18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-or-later */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci *  RPL implementation
48c2ecf20Sopenharmony_ci *
58c2ecf20Sopenharmony_ci *  Author:
68c2ecf20Sopenharmony_ci *  (C) 2020 Alexander Aring <alex.aring@gmail.com>
78c2ecf20Sopenharmony_ci */
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifndef _NET_RPL_H
108c2ecf20Sopenharmony_ci#define _NET_RPL_H
118c2ecf20Sopenharmony_ci
128c2ecf20Sopenharmony_ci#include <linux/rpl.h>
138c2ecf20Sopenharmony_ci
148c2ecf20Sopenharmony_ci#if IS_ENABLED(CONFIG_IPV6_RPL_LWTUNNEL)
158c2ecf20Sopenharmony_ciextern int rpl_init(void);
168c2ecf20Sopenharmony_ciextern void rpl_exit(void);
178c2ecf20Sopenharmony_ci#else
188c2ecf20Sopenharmony_cistatic inline int rpl_init(void)
198c2ecf20Sopenharmony_ci{
208c2ecf20Sopenharmony_ci	return 0;
218c2ecf20Sopenharmony_ci}
228c2ecf20Sopenharmony_ci
238c2ecf20Sopenharmony_cistatic inline void rpl_exit(void) {}
248c2ecf20Sopenharmony_ci#endif
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_cisize_t ipv6_rpl_srh_size(unsigned char n, unsigned char cmpri,
278c2ecf20Sopenharmony_ci			 unsigned char cmpre);
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_civoid ipv6_rpl_srh_decompress(struct ipv6_rpl_sr_hdr *outhdr,
308c2ecf20Sopenharmony_ci			     const struct ipv6_rpl_sr_hdr *inhdr,
318c2ecf20Sopenharmony_ci			     const struct in6_addr *daddr, unsigned char n);
328c2ecf20Sopenharmony_ci
338c2ecf20Sopenharmony_civoid ipv6_rpl_srh_compress(struct ipv6_rpl_sr_hdr *outhdr,
348c2ecf20Sopenharmony_ci			   const struct ipv6_rpl_sr_hdr *inhdr,
358c2ecf20Sopenharmony_ci			   const struct in6_addr *daddr, unsigned char n);
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci#endif /* _NET_RPL_H */
38