blob: 0e2e100c44a275f719377d7c0e2ad113743d404d [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>
6
7struct net_dm_drop_point {
8 __u8 pc[8];
9 __u32 count;
10};
11
12#define NET_DM_CFG_VERSION 0
13#define NET_DM_CFG_ALERT_COUNT 1
14#define NET_DM_CFG_ALERT_DELAY 2
15#define NET_DM_CFG_MAX 3
16
17struct net_dm_config_entry {
18 __u32 type;
19 __u64 data __attribute__((aligned(8)));
20};
21
22struct net_dm_config_msg {
23 __u32 entries;
24 struct net_dm_config_entry options[0];
25};
26
27struct net_dm_alert_msg {
28 __u32 entries;
29 struct net_dm_drop_point points[0];
30};
31
32struct net_dm_user_msg {
33 union {
34 struct net_dm_config_msg user;
35 struct net_dm_alert_msg alert;
36 } u;
37};
38
39
40/* These are the netlink message types for this protocol */
41
42enum {
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
51#define NET_DM_CMD_MAX (_NET_DM_CMD_MAX - 1)
52
53/*
54 * Our group identifiers
55 */
56#define NET_DM_GRP_ALERT 1
57#endif