brintos

brintos / linux-shallow public Read only

0
0
Text · 864 B · 7c8970e Raw
49 lines · c
1/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */2/*3 *  IPv6 RPL-SR implementation4 *5 *  Author:6 *  (C) 2020 Alexander Aring <alex.aring@gmail.com>7 */8 9#ifndef _UAPI_LINUX_RPL_H10#define _UAPI_LINUX_RPL_H11 12#include <asm/byteorder.h>13#include <linux/types.h>14#include <linux/in6.h>15 16/*17 * RPL SR Header18 */19struct ipv6_rpl_sr_hdr {20	__u8	nexthdr;21	__u8	hdrlen;22	__u8	type;23	__u8	segments_left;24#if defined(__LITTLE_ENDIAN_BITFIELD)25	__u32	cmpre:4,26		cmpri:4,27		reserved:4,28		pad:4,29		reserved1:16;30#elif defined(__BIG_ENDIAN_BITFIELD)31	__u32	cmpri:4,32		cmpre:4,33		pad:4,34		reserved:20;35#else36#error  "Please fix <asm/byteorder.h>"37#endif38 39	union {40		__DECLARE_FLEX_ARRAY(struct in6_addr, addr);41		__DECLARE_FLEX_ARRAY(__u8, data);42	} segments;43} __attribute__((packed));44 45#define rpl_segaddr	segments.addr46#define rpl_segdata	segments.data47 48#endif49