blob: 3ceb0cc1bc787382dd00d3ea27292422f161881b [file] [log] [blame]
Neil Horman9a8afc82009-03-11 09:51:26 +00001#ifndef __NET_DROPMON_H
2#define __NET_DROPMON_H
3
Jaswinder Singh Rajputd280cc92009-06-01 06:23:25 +00004#include <linux/types.h>
Neil Horman9a8afc82009-03-11 09:51:26 +00005#include <linux/netlink.h>
Neil Horman4ea7e382009-05-21 07:36:08 +00006#include <linux/types.h>
Neil Horman9a8afc82009-03-11 09:51:26 +00007
8struct net_dm_drop_point {
9 __u8 pc[8];
10 __u32 count;
11};
12
Neil Horman4ea7e382009-05-21 07:36:08 +000013#define is_drop_point_hw(x) do {\
14 int ____i, ____j;\
15 for (____i = 0; ____i < 8; i ____i++)\
16 ____j |= x[____i];\
17 ____j;\
18} while (0)
19
Neil Horman9a8afc82009-03-11 09:51:26 +000020#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
25struct net_dm_config_entry {
26 __u32 type;
27 __u64 data __attribute__((aligned(8)));
28};
29
30struct net_dm_config_msg {
31 __u32 entries;
32 struct net_dm_config_entry options[0];
33};
34
35struct net_dm_alert_msg {
36 __u32 entries;
37 struct net_dm_drop_point points[0];
38};
39
40struct net_dm_user_msg {
41 union {
42 struct net_dm_config_msg user;
43 struct net_dm_alert_msg alert;
44 } u;
45};
46
47
48/* These are the netlink message types for this protocol */
49
50enum {
51 NET_DM_CMD_UNSPEC = 0,
52 NET_DM_CMD_ALERT,
53 NET_DM_CMD_CONFIG,
54 NET_DM_CMD_START,
55 NET_DM_CMD_STOP,
56 _NET_DM_CMD_MAX,
57};
58
59#define NET_DM_CMD_MAX (_NET_DM_CMD_MAX - 1)
60
61/*
62 * Our group identifiers
63 */
64#define NET_DM_GRP_ALERT 1
65#endif