if_shaper.h 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* Copyright (C) 1998-2020 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, see
  13. <https://www.gnu.org/licenses/>. */
  14. #ifndef _NET_IF_SHAPER_H
  15. #define _NET_IF_SHAPER_H 1
  16. #include <sys/types.h>
  17. #include <stdint.h>
  18. #include <net/if.h>
  19. #include <sys/ioctl.h>
  20. __BEGIN_DECLS
  21. #define SHAPER_QLEN 10
  22. /*
  23. * This is a bit speed dependant (read it shouldnt be a constant!)
  24. *
  25. * 5 is about right for 28.8 upwards. Below that double for every
  26. * halving of speed or so. - ie about 20 for 9600 baud.
  27. */
  28. #define SHAPER_LATENCY (5 * HZ)
  29. #define SHAPER_MAXSLIP 2
  30. #define SHAPER_BURST (HZ / 50) /* Good for >128K then */
  31. #define SHAPER_SET_DEV 0x0001
  32. #define SHAPER_SET_SPEED 0x0002
  33. #define SHAPER_GET_DEV 0x0003
  34. #define SHAPER_GET_SPEED 0x0004
  35. struct shaperconf
  36. {
  37. uint16_t ss_cmd;
  38. union
  39. {
  40. char ssu_name[14];
  41. uint32_t ssu_speed;
  42. } ss_u;
  43. #define ss_speed ss_u.ssu_speed
  44. #define ss_name ss_u.ssu_name
  45. };
  46. __END_DECLS
  47. #endif /* net/if_shaper.h */