blob: 308ef0a05caef487257831a72d40483082db0c4a [file] [log] [blame]
Alexander Aring8610c7c2020-03-27 18:00:20 -04001/* SPDX-License-Identifier: GPL-2.0-or-later */
2/*
3 * RPL implementation
4 *
5 * Author:
6 * (C) 2020 Alexander Aring <alex.aring@gmail.com>
7 */
8
9#ifndef _NET_RPL_H
10#define _NET_RPL_H
11
12#include <linux/rpl.h>
13
Alexander Aringa7a29f92020-03-27 18:00:22 -040014#if IS_ENABLED(CONFIG_IPV6_RPL_LWTUNNEL)
15extern int rpl_init(void);
16extern void rpl_exit(void);
17#else
18static inline int rpl_init(void)
19{
20 return 0;
21}
22
23static inline void rpl_exit(void) {}
24#endif
25
Alexander Aring8610c7c2020-03-27 18:00:20 -040026/* Worst decompression memory usage ipv6 address (16) + pad 7 */
27#define IPV6_RPL_SRH_WORST_SWAP_SIZE (sizeof(struct in6_addr) + 7)
28
Alexander Aring8610c7c2020-03-27 18:00:20 -040029size_t ipv6_rpl_srh_size(unsigned char n, unsigned char cmpri,
30 unsigned char cmpre);
31
32void ipv6_rpl_srh_decompress(struct ipv6_rpl_sr_hdr *outhdr,
33 const struct ipv6_rpl_sr_hdr *inhdr,
34 const struct in6_addr *daddr, unsigned char n);
35
36void ipv6_rpl_srh_compress(struct ipv6_rpl_sr_hdr *outhdr,
37 const struct ipv6_rpl_sr_hdr *inhdr,
38 const struct in6_addr *daddr, unsigned char n);
39
40#endif /* _NET_RPL_H */