forked from thesofproject/linux
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
net: ipv6: add support for rpl sr exthdr
This patch adds rpl source routing receive handling. Everything works only if sysconf "rpl_seg_enabled" and source routing is enabled. Mostly the same behaviour as IPv6 segmentation routing. To handle compression and uncompression a rpl.c file is created which contains the necessary functionality. The receive handling will also care about IPv6 encapsulated so far it's specified as possible nexthdr in RFC 6554. Signed-off-by: Alexander Aring <[email protected]> Signed-off-by: David S. Miller <[email protected]>
- Loading branch information
Showing
7 changed files
with
370 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-or-later */ | ||
/* | ||
* RPL implementation | ||
* | ||
* Author: | ||
* (C) 2020 Alexander Aring <[email protected]> | ||
*/ | ||
|
||
#ifndef _NET_RPL_H | ||
#define _NET_RPL_H | ||
|
||
#include <linux/rpl.h> | ||
|
||
/* Worst decompression memory usage ipv6 address (16) + pad 7 */ | ||
#define IPV6_RPL_SRH_WORST_SWAP_SIZE (sizeof(struct in6_addr) + 7) | ||
|
||
static inline size_t ipv6_rpl_srh_alloc_size(unsigned char n) | ||
{ | ||
return sizeof(struct ipv6_rpl_sr_hdr) + | ||
((n + 1) * sizeof(struct in6_addr)); | ||
} | ||
|
||
size_t ipv6_rpl_srh_size(unsigned char n, unsigned char cmpri, | ||
unsigned char cmpre); | ||
|
||
void ipv6_rpl_srh_decompress(struct ipv6_rpl_sr_hdr *outhdr, | ||
const struct ipv6_rpl_sr_hdr *inhdr, | ||
const struct in6_addr *daddr, unsigned char n); | ||
|
||
void ipv6_rpl_srh_compress(struct ipv6_rpl_sr_hdr *outhdr, | ||
const struct ipv6_rpl_sr_hdr *inhdr, | ||
const struct in6_addr *daddr, unsigned char n); | ||
|
||
#endif /* _NET_RPL_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.