History

netfilter: add IPv6 segment routing header 'srh' match

It allows matching packets based on Segment Routing Header (SRH) information. The implementation considers revision 7 of the SRH draft. https://tools.ietf.org/html/draft-ietf-6man-segment-routing-header-07 Currently supported match options include: (1) Next Header (2) Hdr Ext Len (3) Segments Left (4) Last Entry (5) Tag value of SRH

Ahmed Abdelsalam committed 8 years ago

Commit 202a8ff1 parent cbef4264 files · +228 −0Browse files

Showing the changes to include/uapi/linux (1 of 4 files). Show all

Unified · Split

include/uapi/linux/netfilter_ipv6/ip6t_srh.h+57−0
@@ -0,0 +1,57 @@
1+/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
2+#ifndef _IP6T_SRH_H
3+#define _IP6T_SRH_H
4+
5+#include <linux/types.h>
6+#include <linux/netfilter.h>
7+
8+/* Values for "mt_flags" field in struct ip6t_srh */
9+#define IP6T_SRH_NEXTHDR 0x0001
10+#define IP6T_SRH_LEN_EQ 0x0002
11+#define IP6T_SRH_LEN_GT 0x0004
12+#define IP6T_SRH_LEN_LT 0x0008
13+#define IP6T_SRH_SEGS_EQ 0x0010
14+#define IP6T_SRH_SEGS_GT 0x0020
15+#define IP6T_SRH_SEGS_LT 0x0040
16+#define IP6T_SRH_LAST_EQ 0x0080
17+#define IP6T_SRH_LAST_GT 0x0100
18+#define IP6T_SRH_LAST_LT 0x0200
19+#define IP6T_SRH_TAG 0x0400
20+#define IP6T_SRH_MASK 0x07FF
21+
22+/* Values for "mt_invflags" field in struct ip6t_srh */
23+#define IP6T_SRH_INV_NEXTHDR 0x0001
24+#define IP6T_SRH_INV_LEN_EQ 0x0002
25+#define IP6T_SRH_INV_LEN_GT 0x0004
26+#define IP6T_SRH_INV_LEN_LT 0x0008
27+#define IP6T_SRH_INV_SEGS_EQ 0x0010
28+#define IP6T_SRH_INV_SEGS_GT 0x0020
29+#define IP6T_SRH_INV_SEGS_LT 0x0040
30+#define IP6T_SRH_INV_LAST_EQ 0x0080
31+#define IP6T_SRH_INV_LAST_GT 0x0100
32+#define IP6T_SRH_INV_LAST_LT 0x0200
33+#define IP6T_SRH_INV_TAG 0x0400
34+#define IP6T_SRH_INV_MASK 0x07FF
35+
36+/**
37+ * struct ip6t_srh - SRH match options
38+ * @ next_hdr: Next header field of SRH
39+ * @ hdr_len: Extension header length field of SRH
40+ * @ segs_left: Segments left field of SRH
41+ * @ last_entry: Last entry field of SRH
42+ * @ tag: Tag field of SRH
43+ * @ mt_flags: match options
44+ * @ mt_invflags: Invert the sense of match options
45+ */
46+
47+struct ip6t_srh {
48+ __u8 next_hdr;
49+ __u8 hdr_len;
50+ __u8 segs_left;
51+ __u8 last_entry;
52+ __u16 tag;
53+ __u16 mt_flags;
54+ __u16 mt_invflags;
55+};
56+
57+#endif /*_IP6T_SRH_H*/