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