if_shaper.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. /* Copyright (C) 1998 Free Software Foundation, Inc.
  2. This file is part of the GNU C Library.
  3. The GNU C Library is free software; you can redistribute it and/or
  4. modify it under the terms of the GNU Lesser General Public
  5. License as published by the Free Software Foundation; either
  6. version 2.1 of the License, or (at your option) any later version.
  7. The GNU C Library is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  10. Lesser General Public License for more details.
  11. You should have received a copy of the GNU Lesser General Public
  12. License along with the GNU C Library; if not, write to the Free
  13. Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
  14. 02111-1307 USA. */
  15. #ifndef _NET_IF_SHAPER_H
  16. #define _NET_IF_SHAPER_H 1
  17. #include <features.h>
  18. #include <sys/types.h>
  19. #include <net/if.h>
  20. #include <sys/ioctl.h>
  21. __BEGIN_DECLS
  22. #define SHAPER_QLEN 10
  23. /*
  24. * This is a bit speed dependant (read it shouldnt be a constant!)
  25. *
  26. * 5 is about right for 28.8 upwards. Below that double for every
  27. * halving of speed or so. - ie about 20 for 9600 baud.
  28. */
  29. #define SHAPER_LATENCY (5 * HZ)
  30. #define SHAPER_MAXSLIP 2
  31. #define SHAPER_BURST (HZ / 50) /* Good for >128K then */
  32. #define SHAPER_SET_DEV 0x0001
  33. #define SHAPER_SET_SPEED 0x0002
  34. #define SHAPER_GET_DEV 0x0003
  35. #define SHAPER_GET_SPEED 0x0004
  36. struct shaperconf
  37. {
  38. u_int16_t ss_cmd;
  39. union
  40. {
  41. char ssu_name[14];
  42. u_int32_t ssu_speed;
  43. } ss_u;
  44. #define ss_speed ss_u.ssu_speed
  45. #define ss_name ss_u.ssu_name
  46. };
  47. __END_DECLS
  48. #endif /* net/if_shaper.h */