1 /* 2 * This header was generated from the Linux kernel headers by update_headers.py, 3 * to provide necessary information from kernel to userspace, such as constants, 4 * structures, and macros, and thus, contains no copyrightable information. 5 */ 6 #ifndef __NET_DROPMON_H 7 #define __NET_DROPMON_H 8 #include <linux/types.h> 9 #include <linux/netlink.h> 10 struct net_dm_drop_point { 11 __u8 pc[8]; 12 __u32 count; 13 }; 14 #define is_drop_point_hw(x) do {\ 15 int ____i, ____j;\ 16 for (____i = 0; ____i < 8; i ____i++)\ 17 ____j |= x[____i];\ 18 ____j;\ 19 } while (0) 20 #define NET_DM_CFG_VERSION 0 21 #define NET_DM_CFG_ALERT_COUNT 1 22 #define NET_DM_CFG_ALERT_DELAY 2 23 #define NET_DM_CFG_MAX 3 24 struct net_dm_config_entry { 25 __u32 type; 26 __u64 data __attribute__((aligned(8))); 27 }; 28 struct net_dm_config_msg { 29 __u32 entries; 30 struct net_dm_config_entry options[0]; 31 }; 32 struct net_dm_alert_msg { 33 __u32 entries; 34 struct net_dm_drop_point points[0]; 35 }; 36 struct net_dm_user_msg { 37 union { 38 struct net_dm_config_msg user; 39 struct net_dm_alert_msg alert; 40 } u; 41 }; 42 enum { 43 NET_DM_CMD_UNSPEC = 0, 44 NET_DM_CMD_ALERT, 45 NET_DM_CMD_CONFIG, 46 NET_DM_CMD_START, 47 NET_DM_CMD_STOP, 48 _NET_DM_CMD_MAX, 49 }; 50 #define NET_DM_CMD_MAX (_NET_DM_CMD_MAX - 1) 51 #define NET_DM_GRP_ALERT 1 52 #endif 53