1 /* SPDX-License-Identifier: GPL-2.0+ WITH Linu 1 2 /* 3 * IPv6 IOAM implementation 4 * 5 * Author: 6 * Justin Iurman <justin.iurman@uliege.be> 7 */ 8 9 #ifndef _UAPI_LINUX_IOAM6_H 10 #define _UAPI_LINUX_IOAM6_H 11 12 #include <asm/byteorder.h> 13 #include <linux/types.h> 14 15 #define IOAM6_U16_UNAVAILABLE U16_MAX 16 #define IOAM6_U32_UNAVAILABLE U32_MAX 17 #define IOAM6_U64_UNAVAILABLE U64_MAX 18 19 #define IOAM6_DEFAULT_ID (IOAM6_U32_UNAVAILABL 20 #define IOAM6_DEFAULT_ID_WIDE (IOAM6_U64_UNAVA 21 #define IOAM6_DEFAULT_IF_ID IOAM6_U16_UNAVAILA 22 #define IOAM6_DEFAULT_IF_ID_WIDE IOAM6_U32_UNA 23 24 /* 25 * IPv6 IOAM Option Header 26 */ 27 struct ioam6_hdr { 28 __u8 opt_type; 29 __u8 opt_len; 30 __u8 :8; 31 #define IOAM6_TYPE_PREALLOC 0 32 __u8 type; 33 } __attribute__((packed)); 34 35 /* 36 * IOAM Trace Header 37 */ 38 struct ioam6_trace_hdr { 39 __be16 namespace_id; 40 41 #if defined(__LITTLE_ENDIAN_BITFIELD) 42 43 __u8 :1, 44 :1, 45 overflow:1, 46 nodelen:5; 47 48 __u8 remlen:7, 49 :1; 50 51 union { 52 __be32 type_be32; 53 54 struct { 55 __u32 bit7:1, 56 bit6:1, 57 bit5:1, 58 bit4:1, 59 bit3:1, 60 bit2:1, 61 bit1:1, 62 bit0:1, 63 bit15:1, 64 bit14:1, 65 bit13:1, 66 bit12:1, 67 bit11:1, 68 bit10:1, 69 bit9:1, 70 bit8:1, 71 bit23:1, 72 bit22:1, 73 bit21:1, 74 bit20:1, 75 bit19:1, 76 bit18:1, 77 bit17:1, 78 bit16:1, 79 :8; 80 } type; 81 }; 82 83 #elif defined(__BIG_ENDIAN_BITFIELD) 84 85 __u8 nodelen:5, 86 overflow:1, 87 :1, 88 :1; 89 90 __u8 :1, 91 remlen:7; 92 93 union { 94 __be32 type_be32; 95 96 struct { 97 __u32 bit0:1, 98 bit1:1, 99 bit2:1, 100 bit3:1, 101 bit4:1, 102 bit5:1, 103 bit6:1, 104 bit7:1, 105 bit8:1, 106 bit9:1, 107 bit10:1, 108 bit11:1, 109 bit12:1, 110 bit13:1, 111 bit14:1, 112 bit15:1, 113 bit16:1, 114 bit17:1, 115 bit18:1, 116 bit19:1, 117 bit20:1, 118 bit21:1, 119 bit22:1, 120 bit23:1, 121 :8; 122 } type; 123 }; 124 125 #else 126 #error "Please fix <asm/byteorder.h>" 127 #endif 128 129 #define IOAM6_TRACE_DATA_SIZE_MAX 244 130 __u8 data[]; 131 } __attribute__((packed)); 132 133 #endif /* _UAPI_LINUX_IOAM6_H */ 134
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.