aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/uapi/linux')
-rw-r--r--include/uapi/linux/tc_ematch/Kbuild4
-rw-r--r--include/uapi/linux/tc_ematch/tc_em_cmp.h25
-rw-r--r--include/uapi/linux/tc_ematch/tc_em_meta.h92
-rw-r--r--include/uapi/linux/tc_ematch/tc_em_nbyte.h13
-rw-r--r--include/uapi/linux/tc_ematch/tc_em_text.h19
5 files changed, 153 insertions, 0 deletions
diff --git a/include/uapi/linux/tc_ematch/Kbuild b/include/uapi/linux/tc_ematch/Kbuild
index aafaa5aa54d4..53fca3925535 100644
--- a/include/uapi/linux/tc_ematch/Kbuild
+++ b/include/uapi/linux/tc_ematch/Kbuild
@@ -1 +1,5 @@
1# UAPI Header export list 1# UAPI Header export list
2header-y += tc_em_cmp.h
3header-y += tc_em_meta.h
4header-y += tc_em_nbyte.h
5header-y += tc_em_text.h
diff --git a/include/uapi/linux/tc_ematch/tc_em_cmp.h b/include/uapi/linux/tc_ematch/tc_em_cmp.h
new file mode 100644
index 000000000000..f34bb1bae083
--- /dev/null
+++ b/include/uapi/linux/tc_ematch/tc_em_cmp.h
@@ -0,0 +1,25 @@
1#ifndef __LINUX_TC_EM_CMP_H
2#define __LINUX_TC_EM_CMP_H
3
4#include <linux/types.h>
5#include <linux/pkt_cls.h>
6
7struct tcf_em_cmp {
8 __u32 val;
9 __u32 mask;
10 __u16 off;
11 __u8 align:4;
12 __u8 flags:4;
13 __u8 layer:4;
14 __u8 opnd:4;
15};
16
17enum {
18 TCF_EM_ALIGN_U8 = 1,
19 TCF_EM_ALIGN_U16 = 2,
20 TCF_EM_ALIGN_U32 = 4
21};
22
23#define TCF_EM_CMP_TRANS 1
24
25#endif
diff --git a/include/uapi/linux/tc_ematch/tc_em_meta.h b/include/uapi/linux/tc_ematch/tc_em_meta.h
new file mode 100644
index 000000000000..b11f8ce2d3c0
--- /dev/null
+++ b/include/uapi/linux/tc_ematch/tc_em_meta.h
@@ -0,0 +1,92 @@
1#ifndef __LINUX_TC_EM_META_H
2#define __LINUX_TC_EM_META_H
3
4#include <linux/types.h>
5#include <linux/pkt_cls.h>
6
7enum {
8 TCA_EM_META_UNSPEC,
9 TCA_EM_META_HDR,
10 TCA_EM_META_LVALUE,
11 TCA_EM_META_RVALUE,
12 __TCA_EM_META_MAX
13};
14#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1)
15
16struct tcf_meta_val {
17 __u16 kind;
18 __u8 shift;
19 __u8 op;
20};
21
22#define TCF_META_TYPE_MASK (0xf << 12)
23#define TCF_META_TYPE(kind) (((kind) & TCF_META_TYPE_MASK) >> 12)
24#define TCF_META_ID_MASK 0x7ff
25#define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK)
26
27enum {
28 TCF_META_TYPE_VAR,
29 TCF_META_TYPE_INT,
30 __TCF_META_TYPE_MAX
31};
32#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1)
33
34enum {
35 TCF_META_ID_VALUE,
36 TCF_META_ID_RANDOM,
37 TCF_META_ID_LOADAVG_0,
38 TCF_META_ID_LOADAVG_1,
39 TCF_META_ID_LOADAVG_2,
40 TCF_META_ID_DEV,
41 TCF_META_ID_PRIORITY,
42 TCF_META_ID_PROTOCOL,
43 TCF_META_ID_PKTTYPE,
44 TCF_META_ID_PKTLEN,
45 TCF_META_ID_DATALEN,
46 TCF_META_ID_MACLEN,
47 TCF_META_ID_NFMARK,
48 TCF_META_ID_TCINDEX,
49 TCF_META_ID_RTCLASSID,
50 TCF_META_ID_RTIIF,
51 TCF_META_ID_SK_FAMILY,
52 TCF_META_ID_SK_STATE,
53 TCF_META_ID_SK_REUSE,
54 TCF_META_ID_SK_BOUND_IF,
55 TCF_META_ID_SK_REFCNT,
56 TCF_META_ID_SK_SHUTDOWN,
57 TCF_META_ID_SK_PROTO,
58 TCF_META_ID_SK_TYPE,
59 TCF_META_ID_SK_RCVBUF,
60 TCF_META_ID_SK_RMEM_ALLOC,
61 TCF_META_ID_SK_WMEM_ALLOC,
62 TCF_META_ID_SK_OMEM_ALLOC,
63 TCF_META_ID_SK_WMEM_QUEUED,
64 TCF_META_ID_SK_RCV_QLEN,
65 TCF_META_ID_SK_SND_QLEN,
66 TCF_META_ID_SK_ERR_QLEN,
67 TCF_META_ID_SK_FORWARD_ALLOCS,
68 TCF_META_ID_SK_SNDBUF,
69 TCF_META_ID_SK_ALLOCS,
70 __TCF_META_ID_SK_ROUTE_CAPS, /* unimplemented but in ABI already */
71 TCF_META_ID_SK_HASH,
72 TCF_META_ID_SK_LINGERTIME,
73 TCF_META_ID_SK_ACK_BACKLOG,
74 TCF_META_ID_SK_MAX_ACK_BACKLOG,
75 TCF_META_ID_SK_PRIO,
76 TCF_META_ID_SK_RCVLOWAT,
77 TCF_META_ID_SK_RCVTIMEO,
78 TCF_META_ID_SK_SNDTIMEO,
79 TCF_META_ID_SK_SENDMSG_OFF,
80 TCF_META_ID_SK_WRITE_PENDING,
81 TCF_META_ID_VLAN_TAG,
82 TCF_META_ID_RXHASH,
83 __TCF_META_ID_MAX
84};
85#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)
86
87struct tcf_meta_hdr {
88 struct tcf_meta_val left;
89 struct tcf_meta_val right;
90};
91
92#endif
diff --git a/include/uapi/linux/tc_ematch/tc_em_nbyte.h b/include/uapi/linux/tc_ematch/tc_em_nbyte.h
new file mode 100644
index 000000000000..7172cfb999c1
--- /dev/null
+++ b/include/uapi/linux/tc_ematch/tc_em_nbyte.h
@@ -0,0 +1,13 @@
1#ifndef __LINUX_TC_EM_NBYTE_H
2#define __LINUX_TC_EM_NBYTE_H
3
4#include <linux/types.h>
5#include <linux/pkt_cls.h>
6
7struct tcf_em_nbyte {
8 __u16 off;
9 __u16 len:12;
10 __u8 layer:4;
11};
12
13#endif
diff --git a/include/uapi/linux/tc_ematch/tc_em_text.h b/include/uapi/linux/tc_ematch/tc_em_text.h
new file mode 100644
index 000000000000..5aac4045ba88
--- /dev/null
+++ b/include/uapi/linux/tc_ematch/tc_em_text.h
@@ -0,0 +1,19 @@
1#ifndef __LINUX_TC_EM_TEXT_H
2#define __LINUX_TC_EM_TEXT_H
3
4#include <linux/types.h>
5#include <linux/pkt_cls.h>
6
7#define TC_EM_TEXT_ALGOSIZ 16
8
9struct tcf_em_text {
10 char algo[TC_EM_TEXT_ALGOSIZ];
11 __u16 from_offset;
12 __u16 to_offset;
13 __u16 pattern_len;
14 __u8 from_layer:4;
15 __u8 to_layer:4;
16 __u8 pad;
17};
18
19#endif