1 /****************************************************************************
2  ****************************************************************************
3  ***
4  ***   This header was automatically generated from a Linux kernel header
5  ***   of the same name, to make information necessary for userspace to
6  ***   call into the kernel available to libc.  It contains only constants,
7  ***   structures, and macros generated from the original header, and thus,
8  ***   contains no copyrightable information.
9  ***
10  ***   To edit the content of this header, modify the corresponding
11  ***   source file (e.g. under external/kernel-headers/original/) then
12  ***   run bionic/libc/kernel/tools/update_all.py
13  ***
14  ***   Any manual change here will be lost the next time this script will
15  ***   be run. You've been warned!
16  ***
17  ****************************************************************************
18  ****************************************************************************/
19 #ifndef _UAPI_IPV6_H
20 #define _UAPI_IPV6_H
21 #include <linux/libc-compat.h>
22 #include <linux/types.h>
23 #include <linux/in6.h>
24 #include <asm/byteorder.h>
25 #define IPV6_MIN_MTU 1280
26 #if __UAPI_DEF_IN6_PKTINFO
27 struct in6_pktinfo {
28   struct in6_addr ipi6_addr;
29   int ipi6_ifindex;
30 };
31 #endif
32 #if __UAPI_DEF_IP6_MTUINFO
33 struct ip6_mtuinfo {
34   struct sockaddr_in6 ip6m_addr;
35   __u32 ip6m_mtu;
36 };
37 #endif
38 struct in6_ifreq {
39   struct in6_addr ifr6_addr;
40   __u32 ifr6_prefixlen;
41   int ifr6_ifindex;
42 };
43 #define IPV6_SRCRT_STRICT 0x01
44 #define IPV6_SRCRT_TYPE_0 0
45 #define IPV6_SRCRT_TYPE_2 2
46 #define IPV6_SRCRT_TYPE_3 3
47 #define IPV6_SRCRT_TYPE_4 4
48 struct ipv6_rt_hdr {
49   __u8 nexthdr;
50   __u8 hdrlen;
51   __u8 type;
52   __u8 segments_left;
53 };
54 struct ipv6_opt_hdr {
55   __u8 nexthdr;
56   __u8 hdrlen;
57 } __attribute__((packed));
58 #define ipv6_destopt_hdr ipv6_opt_hdr
59 #define ipv6_hopopt_hdr ipv6_opt_hdr
60 #define IPV6_OPT_ROUTERALERT_MLD 0x0000
61 struct rt0_hdr {
62   struct ipv6_rt_hdr rt_hdr;
63   __u32 reserved;
64   struct in6_addr addr[0];
65 #define rt0_type rt_hdr.type
66 };
67 struct rt2_hdr {
68   struct ipv6_rt_hdr rt_hdr;
69   __u32 reserved;
70   struct in6_addr addr;
71 #define rt2_type rt_hdr.type
72 };
73 struct ipv6_destopt_hao {
74   __u8 type;
75   __u8 length;
76   struct in6_addr addr;
77 } __attribute__((packed));
78 struct ipv6hdr {
79 #ifdef __LITTLE_ENDIAN_BITFIELD
80   __u8 priority : 4, version : 4;
81 #elif defined(__BIG_ENDIAN_BITFIELD)
82   __u8 version : 4, priority : 4;
83 #else
84 #error "Please fix <asm/byteorder.h>"
85 #endif
86   __u8 flow_lbl[3];
87   __be16 payload_len;
88   __u8 nexthdr;
89   __u8 hop_limit;
90   struct in6_addr saddr;
91   struct in6_addr daddr;
92 };
93 enum {
94   DEVCONF_FORWARDING = 0,
95   DEVCONF_HOPLIMIT,
96   DEVCONF_MTU6,
97   DEVCONF_ACCEPT_RA,
98   DEVCONF_ACCEPT_REDIRECTS,
99   DEVCONF_AUTOCONF,
100   DEVCONF_DAD_TRANSMITS,
101   DEVCONF_RTR_SOLICITS,
102   DEVCONF_RTR_SOLICIT_INTERVAL,
103   DEVCONF_RTR_SOLICIT_DELAY,
104   DEVCONF_USE_TEMPADDR,
105   DEVCONF_TEMP_VALID_LFT,
106   DEVCONF_TEMP_PREFERED_LFT,
107   DEVCONF_REGEN_MAX_RETRY,
108   DEVCONF_MAX_DESYNC_FACTOR,
109   DEVCONF_MAX_ADDRESSES,
110   DEVCONF_FORCE_MLD_VERSION,
111   DEVCONF_ACCEPT_RA_DEFRTR,
112   DEVCONF_ACCEPT_RA_PINFO,
113   DEVCONF_ACCEPT_RA_RTR_PREF,
114   DEVCONF_RTR_PROBE_INTERVAL,
115   DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
116   DEVCONF_PROXY_NDP,
117   DEVCONF_OPTIMISTIC_DAD,
118   DEVCONF_ACCEPT_SOURCE_ROUTE,
119   DEVCONF_MC_FORWARDING,
120   DEVCONF_DISABLE_IPV6,
121   DEVCONF_ACCEPT_DAD,
122   DEVCONF_FORCE_TLLAO,
123   DEVCONF_NDISC_NOTIFY,
124   DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
125   DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
126   DEVCONF_SUPPRESS_FRAG_NDISC,
127   DEVCONF_ACCEPT_RA_FROM_LOCAL,
128   DEVCONF_USE_OPTIMISTIC,
129   DEVCONF_ACCEPT_RA_MTU,
130   DEVCONF_STABLE_SECRET,
131   DEVCONF_USE_OIF_ADDRS_ONLY,
132   DEVCONF_ACCEPT_RA_MIN_HOP_LIMIT,
133   DEVCONF_IGNORE_ROUTES_WITH_LINKDOWN,
134   DEVCONF_DROP_UNICAST_IN_L2_MULTICAST,
135   DEVCONF_DROP_UNSOLICITED_NA,
136   DEVCONF_KEEP_ADDR_ON_DOWN,
137   DEVCONF_RTR_SOLICIT_MAX_INTERVAL,
138   DEVCONF_SEG6_ENABLED,
139   DEVCONF_SEG6_REQUIRE_HMAC,
140   DEVCONF_ENHANCED_DAD,
141   DEVCONF_ADDR_GEN_MODE,
142   DEVCONF_DISABLE_POLICY,
143   DEVCONF_ACCEPT_RA_RT_INFO_MIN_PLEN,
144   DEVCONF_NDISC_TCLASS,
145   DEVCONF_RPL_SEG_ENABLED,
146   DEVCONF_MAX
147 };
148 #endif
149