net_dropmon.h 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #ifndef __NET_DROPMON_H
  2. #define __NET_DROPMON_H
  3. #include <linux/types.h>
  4. #include <linux/netlink.h>
  5. struct net_dm_drop_point {
  6. __u8 pc[8];
  7. __u32 count;
  8. };
  9. #define NET_DM_CFG_VERSION 0
  10. #define NET_DM_CFG_ALERT_COUNT 1
  11. #define NET_DM_CFG_ALERT_DELAY 2
  12. #define NET_DM_CFG_MAX 3
  13. struct net_dm_config_entry {
  14. __u32 type;
  15. __u64 data __attribute__((aligned(8)));
  16. };
  17. struct net_dm_config_msg {
  18. __u32 entries;
  19. struct net_dm_config_entry options[0];
  20. };
  21. struct net_dm_alert_msg {
  22. __u32 entries;
  23. struct net_dm_drop_point points[0];
  24. };
  25. struct net_dm_user_msg {
  26. union {
  27. struct net_dm_config_msg user;
  28. struct net_dm_alert_msg alert;
  29. } u;
  30. };
  31. /* These are the netlink message types for this protocol */
  32. enum {
  33. NET_DM_CMD_UNSPEC = 0,
  34. NET_DM_CMD_ALERT,
  35. NET_DM_CMD_CONFIG,
  36. NET_DM_CMD_START,
  37. NET_DM_CMD_STOP,
  38. _NET_DM_CMD_MAX,
  39. };
  40. #define NET_DM_CMD_MAX (_NET_DM_CMD_MAX - 1)
  41. /*
  42. * Our group identifiers
  43. */
  44. #define NET_DM_GRP_ALERT 1
  45. #endif