1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linu 1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */ 2 /* 2 /* 3 * IPv6 RPL-SR implementation 3 * IPv6 RPL-SR implementation 4 * 4 * 5 * Author: 5 * Author: 6 * (C) 2020 Alexander Aring <alex.aring@gmail 6 * (C) 2020 Alexander Aring <alex.aring@gmail.com> 7 */ 7 */ 8 8 9 #ifndef _UAPI_LINUX_RPL_H 9 #ifndef _UAPI_LINUX_RPL_H 10 #define _UAPI_LINUX_RPL_H 10 #define _UAPI_LINUX_RPL_H 11 11 12 #include <asm/byteorder.h> 12 #include <asm/byteorder.h> 13 #include <linux/types.h> 13 #include <linux/types.h> 14 #include <linux/in6.h> 14 #include <linux/in6.h> 15 15 16 /* 16 /* 17 * RPL SR Header 17 * RPL SR Header 18 */ 18 */ 19 struct ipv6_rpl_sr_hdr { 19 struct ipv6_rpl_sr_hdr { 20 __u8 nexthdr; 20 __u8 nexthdr; 21 __u8 hdrlen; 21 __u8 hdrlen; 22 __u8 type; 22 __u8 type; 23 __u8 segments_left; 23 __u8 segments_left; 24 #if defined(__LITTLE_ENDIAN_BITFIELD) 24 #if defined(__LITTLE_ENDIAN_BITFIELD) 25 __u32 cmpre:4, 25 __u32 cmpre:4, 26 cmpri:4, 26 cmpri:4, 27 reserved:4, 27 reserved:4, 28 pad:4, 28 pad:4, 29 reserved1:16; 29 reserved1:16; 30 #elif defined(__BIG_ENDIAN_BITFIELD) 30 #elif defined(__BIG_ENDIAN_BITFIELD) 31 __u32 cmpri:4, 31 __u32 cmpri:4, 32 cmpre:4, 32 cmpre:4, 33 pad:4, 33 pad:4, 34 reserved:20; 34 reserved:20; 35 #else 35 #else 36 #error "Please fix <asm/byteorder.h>" 36 #error "Please fix <asm/byteorder.h>" 37 #endif 37 #endif 38 38 39 union { 39 union { 40 __DECLARE_FLEX_ARRAY(struct in 40 __DECLARE_FLEX_ARRAY(struct in6_addr, addr); 41 __DECLARE_FLEX_ARRAY(__u8, dat 41 __DECLARE_FLEX_ARRAY(__u8, data); 42 } segments; 42 } segments; 43 } __attribute__((packed)); 43 } __attribute__((packed)); 44 44 45 #define rpl_segaddr segments.addr 45 #define rpl_segaddr segments.addr 46 #define rpl_segdata segments.data 46 #define rpl_segdata segments.data 47 47 48 #endif 48 #endif 49 49
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.