Skip to contentSkip to conversation

uapi: updates to lwtunnel and rpl iptunnel

RFC New Alexander Aring 1 participant 2 messages Feb 17, 2020

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

RFC 1/2 uapi: updates to lwtunnel and rpl iptunnel

Update uapi headers.

---
 include/uapi/linux/lwtunnel.h     |  1 +
 include/uapi/linux/rpl.h          | 48 +++++++++++++++++++++++++++++++
 include/uapi/linux/rpl_iptunnel.h | 27 +++++++++++++++++
 3 files changed, 76 insertions(+)
 create mode 100644 include/uapi/linux/rpl.h
 create mode 100644 include/uapi/linux/rpl_iptunnel.h
include/uapi/linux/lwtunnel.h +1 -0
index 532c9370..b7c0191f 100644
@@ -13,6 +13,7 @@ enum lwtunnel_encap_types {
 	LWTUNNEL_ENCAP_SEG6,
 	LWTUNNEL_ENCAP_BPF,
 	LWTUNNEL_ENCAP_SEG6_LOCAL,
+	LWTUNNEL_ENCAP_RPL,
 	__LWTUNNEL_ENCAP_MAX,
 };
 
include/uapi/linux/rpl.h new file +48 -0

48 lines not on this page · raw message

include/uapi/linux/rpl_iptunnel.h new file +27 -0
new file mode 100644
index 00000000..f2839b68
@@ -0,0 +1,27 @@
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+/*
+ *  IPv6 RPL-SR implementation
+ *
+ *  Author:
+ *  Alexander Aring <[email protected]>
+ *
+ *
+ *  This program is free software; you can redistribute it and/or
+ *      modify it under the terms of the GNU General Public License
+ *      as published by the Free Software Foundation; either version
+ *      2 of the License, or (at your option) any later version.
+ */
+
+#ifndef _LINUX_RPL_IPTUNNEL_H
+#define _LINUX_RPL_IPTUNNEL_H
+
+enum {
+	RPL_IPTUNNEL_UNSPEC,
+	RPL_IPTUNNEL_SRH,
+	__RPL_IPTUNNEL_MAX,
+};
+#define RPL_IPTUNNEL_MAX (__RPL_IPTUNNEL_MAX - 1)
+
+#define RPL_IPTUNNEL_SRH_SIZE(srh) (((srh)->hdrlen + 1) << 3)
+
+#endif
Signature · 1 line
2.20.1
#1 lore raw

RFC 2/2 lwtunnel: add support for rpl segment routing

This patch adds support for rpl segment routing settings. Example:

ip -n ns0 -6 route add 2001::3 encap rpl segs \
fe80::c8fe:beef:cafe:cafe,fe80::c8fe:beef:cafe:beef dev lowpan0

---
 ip/iproute.c          |   2 +-
 ip/iproute_lwtunnel.c | 111 ++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 112 insertions(+), 1 deletion(-)
ip/iproute.c +1 -1
index 93b805c9..f636eb26 100644
@@ -101,7 +101,7 @@ static void usage(void)
 		"TIME := NUMBER[s|ms]\n"
 		"BOOL := [1|0]\n"
 		"FEATURES := ecn\n"
-		"ENCAPTYPE := [ mpls | ip | ip6 | seg6 | seg6local ]\n"
+		"ENCAPTYPE := [ mpls | ip | ip6 | seg6 | seg6local | rpl ]\n"
 		"ENCAPHDR := [ MPLSLABEL | SEG6HDR ]\n"
 		"SEG6HDR := [ mode SEGMODE ] segs ADDR1,ADDRi,ADDRn [hmac HMACKEYID] [cleanup]\n"
 		"SEGMODE := [ encap | inline ]\n"
ip/iproute_lwtunnel.c +111 -0

153 lines not on this page · raw message

Signature · 1 line
2.20.1