blob: 01b76cb104817ea59febfbbab1914523b8f51fe8 [file] [log] [blame]
Ben Cheng655a7c02013-10-16 16:09:24 -07001/****************************************************************************
2 ****************************************************************************
3 ***
4 *** This header was automatically generated from a Linux kernel header
5 *** of the same name, to make information necessary for userspace to
6 *** call into the kernel available to libc. It contains only constants,
7 *** structures, and macros generated from the original header, and thus,
8 *** contains no copyrightable information.
9 ***
10 *** To edit the content of this header, modify the corresponding
11 *** source file (e.g. under external/kernel-headers/original/) then
12 *** run bionic/libc/kernel/tools/update_all.py
13 ***
14 *** Any manual change here will be lost the next time this script will
15 *** be run. You've been warned!
16 ***
17 ****************************************************************************
18 ****************************************************************************/
19#ifndef __NET_DROPMON_H
20#define __NET_DROPMON_H
21#include <linux/types.h>
22#include <linux/netlink.h>
Ben Cheng655a7c02013-10-16 16:09:24 -070023struct net_dm_drop_point {
Tao Baod7db5942015-01-28 10:07:51 -080024 __u8 pc[8];
25 __u32 count;
Ben Cheng655a7c02013-10-16 16:09:24 -070026};
Tao Baod7db5942015-01-28 10:07:51 -080027#define is_drop_point_hw(x) do { int ____i, ____j; for(____i = 0; ____i < 8; i ____i ++) ____j |= x[____i]; ____j; \
28} while(0)
Ben Cheng655a7c02013-10-16 16:09:24 -070029#define NET_DM_CFG_VERSION 0
30#define NET_DM_CFG_ALERT_COUNT 1
31#define NET_DM_CFG_ALERT_DELAY 2
Ben Cheng655a7c02013-10-16 16:09:24 -070032#define NET_DM_CFG_MAX 3
33struct net_dm_config_entry {
Tao Baod7db5942015-01-28 10:07:51 -080034 __u32 type;
35 __u64 data __attribute__((aligned(8)));
Ben Cheng655a7c02013-10-16 16:09:24 -070036};
37struct net_dm_config_msg {
Tao Baod7db5942015-01-28 10:07:51 -080038 __u32 entries;
39 struct net_dm_config_entry options[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070040};
41struct net_dm_alert_msg {
Tao Baod7db5942015-01-28 10:07:51 -080042 __u32 entries;
43 struct net_dm_drop_point points[0];
Ben Cheng655a7c02013-10-16 16:09:24 -070044};
45struct net_dm_user_msg {
Tao Baod7db5942015-01-28 10:07:51 -080046 union {
47 struct net_dm_config_msg user;
Tao Baod7db5942015-01-28 10:07:51 -080048 struct net_dm_alert_msg alert;
49 } u;
Ben Cheng655a7c02013-10-16 16:09:24 -070050};
51enum {
Tao Baod7db5942015-01-28 10:07:51 -080052 NET_DM_CMD_UNSPEC = 0,
53 NET_DM_CMD_ALERT,
54 NET_DM_CMD_CONFIG,
55 NET_DM_CMD_START,
Tao Baod7db5942015-01-28 10:07:51 -080056 NET_DM_CMD_STOP,
Christopher Ferris9584fa42019-12-09 15:36:13 -080057 NET_DM_CMD_PACKET_ALERT,
58 NET_DM_CMD_CONFIG_GET,
59 NET_DM_CMD_CONFIG_NEW,
60 NET_DM_CMD_STATS_GET,
61 NET_DM_CMD_STATS_NEW,
Tao Baod7db5942015-01-28 10:07:51 -080062 _NET_DM_CMD_MAX,
Ben Cheng655a7c02013-10-16 16:09:24 -070063};
64#define NET_DM_CMD_MAX (_NET_DM_CMD_MAX - 1)
Ben Cheng655a7c02013-10-16 16:09:24 -070065#define NET_DM_GRP_ALERT 1
Christopher Ferris9584fa42019-12-09 15:36:13 -080066enum net_dm_attr {
67 NET_DM_ATTR_UNSPEC,
68 NET_DM_ATTR_ALERT_MODE,
69 NET_DM_ATTR_PC,
70 NET_DM_ATTR_SYMBOL,
71 NET_DM_ATTR_IN_PORT,
72 NET_DM_ATTR_TIMESTAMP,
73 NET_DM_ATTR_PROTO,
74 NET_DM_ATTR_PAYLOAD,
75 NET_DM_ATTR_PAD,
76 NET_DM_ATTR_TRUNC_LEN,
77 NET_DM_ATTR_ORIG_LEN,
78 NET_DM_ATTR_QUEUE_LEN,
79 NET_DM_ATTR_STATS,
80 NET_DM_ATTR_HW_STATS,
81 NET_DM_ATTR_ORIGIN,
82 NET_DM_ATTR_HW_TRAP_GROUP_NAME,
83 NET_DM_ATTR_HW_TRAP_NAME,
84 NET_DM_ATTR_HW_ENTRIES,
85 NET_DM_ATTR_HW_ENTRY,
86 NET_DM_ATTR_HW_TRAP_COUNT,
87 NET_DM_ATTR_SW_DROPS,
88 NET_DM_ATTR_HW_DROPS,
Christopher Ferrisaf09c702020-06-01 20:29:29 -070089 NET_DM_ATTR_FLOW_ACTION_COOKIE,
Christopher Ferris9584fa42019-12-09 15:36:13 -080090 __NET_DM_ATTR_MAX,
91 NET_DM_ATTR_MAX = __NET_DM_ATTR_MAX - 1
92};
93enum net_dm_alert_mode {
94 NET_DM_ALERT_MODE_SUMMARY,
95 NET_DM_ALERT_MODE_PACKET,
96};
97enum {
98 NET_DM_ATTR_PORT_NETDEV_IFINDEX,
99 NET_DM_ATTR_PORT_NETDEV_NAME,
100 __NET_DM_ATTR_PORT_MAX,
101 NET_DM_ATTR_PORT_MAX = __NET_DM_ATTR_PORT_MAX - 1
102};
103enum {
104 NET_DM_ATTR_STATS_DROPPED,
105 __NET_DM_ATTR_STATS_MAX,
106 NET_DM_ATTR_STATS_MAX = __NET_DM_ATTR_STATS_MAX - 1
107};
108enum net_dm_origin {
109 NET_DM_ORIGIN_SW,
110 NET_DM_ORIGIN_HW,
111};
Ben Cheng655a7c02013-10-16 16:09:24 -0700112#endif