net_dropmon.h 928 B

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