if_shaper.h 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef __LINUX_SHAPER_H
  2. #define __LINUX_SHAPER_H
  3. #ifdef __KERNEL__
  4. #define SHAPER_QLEN 10
  5. /*
  6. * This is a bit speed dependent (read it shouldn't be a constant!)
  7. *
  8. * 5 is about right for 28.8 upwards. Below that double for every
  9. * halving of speed or so. - ie about 20 for 9600 baud.
  10. */
  11. #define SHAPER_LATENCY (5*HZ)
  12. #define SHAPER_MAXSLIP 2
  13. #define SHAPER_BURST (HZ/50) /* Good for >128K then */
  14. struct shaper
  15. {
  16. struct sk_buff_head sendq;
  17. __u32 bytespertick;
  18. __u32 bitspersec;
  19. __u32 shapelatency;
  20. __u32 shapeclock;
  21. unsigned long recovery; /* Time we can next clock a packet out on
  22. an empty queue */
  23. spinlock_t lock;
  24. struct net_device *dev;
  25. struct net_device_stats* (*get_stats)(struct net_device *dev);
  26. struct timer_list timer;
  27. };
  28. #endif
  29. #define SHAPER_SET_DEV 0x0001
  30. #define SHAPER_SET_SPEED 0x0002
  31. #define SHAPER_GET_DEV 0x0003
  32. #define SHAPER_GET_SPEED 0x0004
  33. struct shaperconf
  34. {
  35. __u16 ss_cmd;
  36. union
  37. {
  38. char ssu_name[14];
  39. __u32 ssu_speed;
  40. } ss_u;
  41. #define ss_speed ss_u.ssu_speed
  42. #define ss_name ss_u.ssu_name
  43. };
  44. #endif