File tree Expand file tree Collapse file tree 8 files changed +434
-0
lines changed Expand file tree Collapse file tree 8 files changed +434
-0
lines changed Original file line number Diff line number Diff line change 11
11
12
12
#include <linux/rpl.h>
13
13
14
+ #if IS_ENABLED (CONFIG_IPV6_RPL_LWTUNNEL )
15
+ extern int rpl_init (void );
16
+ extern void rpl_exit (void );
17
+ #else
18
+ static inline int rpl_init (void )
19
+ {
20
+ return 0 ;
21
+ }
22
+
23
+ static inline void rpl_exit (void ) {}
24
+ #endif
25
+
14
26
/* Worst decompression memory usage ipv6 address (16) + pad 7 */
15
27
#define IPV6_RPL_SRH_WORST_SWAP_SIZE (sizeof(struct in6_addr) + 7)
16
28
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ enum lwtunnel_encap_types {
13
13
LWTUNNEL_ENCAP_SEG6 ,
14
14
LWTUNNEL_ENCAP_BPF ,
15
15
LWTUNNEL_ENCAP_SEG6_LOCAL ,
16
+ LWTUNNEL_ENCAP_RPL ,
16
17
__LWTUNNEL_ENCAP_MAX ,
17
18
};
18
19
Original file line number Diff line number Diff line change
1
+ /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
2
+ /*
3
+ * IPv6 RPL-SR implementation
4
+ *
5
+ * Author:
6
+ * (C) 2020 Alexander Aring <[email protected] >
7
+ */
8
+
9
+ #ifndef _UAPI_LINUX_RPL_IPTUNNEL_H
10
+ #define _UAPI_LINUX_RPL_IPTUNNEL_H
11
+
12
+ enum {
13
+ RPL_IPTUNNEL_UNSPEC ,
14
+ RPL_IPTUNNEL_SRH ,
15
+ __RPL_IPTUNNEL_MAX ,
16
+ };
17
+ #define RPL_IPTUNNEL_MAX (__RPL_IPTUNNEL_MAX - 1)
18
+
19
+ #define RPL_IPTUNNEL_SRH_SIZE (srh ) (((srh)->hdrlen + 1) << 3)
20
+
21
+ #endif
Original file line number Diff line number Diff line change @@ -41,6 +41,8 @@ static const char *lwtunnel_encap_str(enum lwtunnel_encap_types encap_type)
41
41
return "BPF" ;
42
42
case LWTUNNEL_ENCAP_SEG6_LOCAL :
43
43
return "SEG6LOCAL" ;
44
+ case LWTUNNEL_ENCAP_RPL :
45
+ return "RPL" ;
44
46
case LWTUNNEL_ENCAP_IP6 :
45
47
case LWTUNNEL_ENCAP_IP :
46
48
case LWTUNNEL_ENCAP_NONE :
Original file line number Diff line number Diff line change @@ -303,4 +303,14 @@ config IPV6_SEG6_BPF
303
303
depends on IPV6_SEG6_LWTUNNEL
304
304
depends on IPV6 = y
305
305
306
+ config IPV6_RPL_LWTUNNEL
307
+ bool "IPv6: RPL Source Routing Header support"
308
+ depends on IPV6
309
+ select LWTUNNEL
310
+ ---help---
311
+ Support for RFC6554 RPL Source Routing Header using the lightweight
312
+ tunnels mechanism.
313
+
314
+ If unsure, say N.
315
+
306
316
endif # IPV6
Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ ipv6-$(CONFIG_SYN_COOKIES) += syncookies.o
26
26
ipv6-$(CONFIG_NETLABEL) += calipso.o
27
27
ipv6-$(CONFIG_IPV6_SEG6_LWTUNNEL) += seg6_iptunnel.o seg6_local.o
28
28
ipv6-$(CONFIG_IPV6_SEG6_HMAC) += seg6_hmac.o
29
+ ipv6-$(CONFIG_IPV6_RPL_LWTUNNEL) += rpl_iptunnel.o
29
30
30
31
ipv6-objs += $(ipv6-y )
31
32
Original file line number Diff line number Diff line change 59
59
#endif
60
60
#include <net/calipso.h>
61
61
#include <net/seg6.h>
62
+ #include <net/rpl.h>
62
63
63
64
#include <linux/uaccess.h>
64
65
#include <linux/mroute6.h>
@@ -1114,6 +1115,10 @@ static int __init inet6_init(void)
1114
1115
if (err )
1115
1116
goto seg6_fail ;
1116
1117
1118
+ err = rpl_init ();
1119
+ if (err )
1120
+ goto rpl_fail ;
1121
+
1117
1122
err = igmp6_late_init ();
1118
1123
if (err )
1119
1124
goto igmp6_late_err ;
@@ -1136,6 +1141,8 @@ static int __init inet6_init(void)
1136
1141
igmp6_late_cleanup ();
1137
1142
#endif
1138
1143
igmp6_late_err :
1144
+ rpl_exit ();
1145
+ rpl_fail :
1139
1146
seg6_exit ();
1140
1147
seg6_fail :
1141
1148
calipso_exit ();
You can’t perform that action at this time.
0 commit comments