github.com/cilium/cilium@v1.16.2/bpf/include/linux/in6.h (about)

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