github.com/looshlee/beatles@v0.0.0-20220727174639-742810ab631c/bpf/include/linux/in6.h (about) 1 /* 2 * Types and definitions for AF_INET6 3 * Linux INET6 implementation 4 * 5 * Authors: 6 * Pedro Roque <roque@di.fc.ul.pt> 7 * 8 * Sources: 9 * IPv6 Program Interfaces for BSD Systems 10 * <draft-ietf-ipngwg-bsd-api-05.txt> 11 * 12 * Advanced Sockets API for IPv6 13 * <draft-stevens-advanced-api-00.txt> 14 * 15 * This program is free software; you can redistribute it and/or 16 * modify it under the terms of the GNU General Public License 17 * as published by the Free Software Foundation; either version 18 * 2 of the License, or (at your option) any later version. 19 */ 20 21 #ifndef _LINUX_IN6_H 22 #define _LINUX_IN6_H 23 24 #include <linux/type_mapper.h> 25 26 /* 27 * IPv6 address structure 28 */ 29 30 struct in6_addr { 31 union { 32 __u8 u6_addr8[16]; 33 __be16 u6_addr16[8]; 34 __be32 u6_addr32[4]; 35 } in6_u; 36 #define s6_addr in6_u.u6_addr8 37 #define s6_addr16 in6_u.u6_addr16 38 #define s6_addr32 in6_u.u6_addr32 39 }; 40 41 /* 42 * Bitmask constant declarations to help applications select out the 43 * flow label and priority fields. 44 * 45 * Note that this are in host byte order while the flowinfo field of 46 * sockaddr_in6 is in network byte order. 47 */ 48 49 #define IPV6_FLOWINFO_FLOWLABEL 0x000fffff 50 #define IPV6_FLOWINFO_PRIORITY 0x0ff00000 51 52 /* These definitions are obsolete */ 53 #define IPV6_PRIORITY_UNCHARACTERIZED 0x0000 54 #define IPV6_PRIORITY_FILLER 0x0100 55 #define IPV6_PRIORITY_UNATTENDED 0x0200 56 #define IPV6_PRIORITY_RESERVED1 0x0300 57 #define IPV6_PRIORITY_BULK 0x0400 58 #define IPV6_PRIORITY_RESERVED2 0x0500 59 #define IPV6_PRIORITY_INTERACTIVE 0x0600 60 #define IPV6_PRIORITY_CONTROL 0x0700 61 #define IPV6_PRIORITY_8 0x0800 62 #define IPV6_PRIORITY_9 0x0900 63 #define IPV6_PRIORITY_10 0x0a00 64 #define IPV6_PRIORITY_11 0x0b00 65 #define IPV6_PRIORITY_12 0x0c00 66 #define IPV6_PRIORITY_13 0x0d00 67 #define IPV6_PRIORITY_14 0x0e00 68 #define IPV6_PRIORITY_15 0x0f00 69 70 /* 71 * IPV6 extension headers 72 */ 73 #define IPPROTO_HOPOPTS 0 /* IPv6 hop-by-hop options */ 74 #define IPPROTO_ROUTING 43 /* IPv6 routing header */ 75 #define IPPROTO_FRAGMENT 44 /* IPv6 fragmentation header */ 76 #define IPPROTO_ICMPV6 58 /* ICMPv6 */ 77 #define IPPROTO_NONE 59 /* IPv6 no next header */ 78 #define IPPROTO_DSTOPTS 60 /* IPv6 destination options */ 79 #define IPPROTO_MH 135 /* IPv6 mobility header */ 80 81 /* 82 * IPv6 TLV options. 83 */ 84 #define IPV6_TLV_PAD1 0 85 #define IPV6_TLV_PADN 1 86 #define IPV6_TLV_ROUTERALERT 5 87 #define IPV6_TLV_JUMBO 194 88 #define IPV6_TLV_HAO 201 /* home address option */ 89 90 /* 91 * IPV6 socket options 92 */ 93 #define IPV6_ADDRFORM 1 94 #define IPV6_2292PKTINFO 2 95 #define IPV6_2292HOPOPTS 3 96 #define IPV6_2292DSTOPTS 4 97 #define IPV6_2292RTHDR 5 98 #define IPV6_2292PKTOPTIONS 6 99 #define IPV6_CHECKSUM 7 100 #define IPV6_2292HOPLIMIT 8 101 #define IPV6_NEXTHOP 9 102 #define IPV6_AUTHHDR 10 /* obsolete */ 103 #define IPV6_FLOWINFO 11 104 105 #define IPV6_UNICAST_HOPS 16 106 #define IPV6_MULTICAST_IF 17 107 #define IPV6_MULTICAST_HOPS 18 108 #define IPV6_MULTICAST_LOOP 19 109 #define IPV6_ADD_MEMBERSHIP 20 110 #define IPV6_DROP_MEMBERSHIP 21 111 #define IPV6_ROUTER_ALERT 22 112 #define IPV6_MTU_DISCOVER 23 113 #define IPV6_MTU 24 114 #define IPV6_RECVERR 25 115 #define IPV6_V6ONLY 26 116 #define IPV6_JOIN_ANYCAST 27 117 #define IPV6_LEAVE_ANYCAST 28 118 119 /* IPV6_MTU_DISCOVER values */ 120 #define IPV6_PMTUDISC_DONT 0 121 #define IPV6_PMTUDISC_WANT 1 122 #define IPV6_PMTUDISC_DO 2 123 #define IPV6_PMTUDISC_PROBE 3 124 /* same as IPV6_PMTUDISC_PROBE, provided for symetry with IPv4 125 * also see comments on IP_PMTUDISC_INTERFACE 126 */ 127 #define IPV6_PMTUDISC_INTERFACE 4 128 /* weaker version of IPV6_PMTUDISC_INTERFACE, which allows packets to 129 * get fragmented if they exceed the interface mtu 130 */ 131 #define IPV6_PMTUDISC_OMIT 5 132 133 /* Flowlabel */ 134 #define IPV6_FLOWLABEL_MGR 32 135 #define IPV6_FLOWINFO_SEND 33 136 137 #define IPV6_IPSEC_POLICY 34 138 #define IPV6_XFRM_POLICY 35 139 #define IPV6_HDRINCL 36 140 141 /* 142 * Multicast Routing: 143 * see include/uapi/linux/mroute6.h. 144 * 145 * MRT6_BASE 200 146 * ... 147 * MRT6_MAX 148 */ 149 #endif /* _LINUX_IN6_H */