ipv6: fix redefinition of in6_pktinfo and ip6_mtuinfo
[cascardo/linux.git] / include / uapi / linux / ipv6.h
1 #ifndef _UAPI_IPV6_H
2 #define _UAPI_IPV6_H
3
4 #include <linux/types.h>
5 #include <linux/in6.h>
6 #include <asm/byteorder.h>
7
8 /* The latest drafts declared increase in minimal mtu up to 1280. */
9
10 #define IPV6_MIN_MTU    1280
11
12 /*
13  *      Advanced API
14  *      source interface/address selection, source routing, etc...
15  *      *under construction*
16  */
17
18 #if __UAPI_DEF_IN6_PKTINFO
19 struct in6_pktinfo {
20         struct in6_addr ipi6_addr;
21         int             ipi6_ifindex;
22 };
23 #endif
24
25 #if __UAPI_DEF_IP6_MTUINFO
26 struct ip6_mtuinfo {
27         struct sockaddr_in6     ip6m_addr;
28         __u32                   ip6m_mtu;
29 };
30 #endif
31
32 struct in6_ifreq {
33         struct in6_addr ifr6_addr;
34         __u32           ifr6_prefixlen;
35         int             ifr6_ifindex; 
36 };
37
38 #define IPV6_SRCRT_STRICT       0x01    /* Deprecated; will be removed */
39 #define IPV6_SRCRT_TYPE_0       0       /* Deprecated; will be removed */
40 #define IPV6_SRCRT_TYPE_2       2       /* IPv6 type 2 Routing Header   */
41
42 /*
43  *      routing header
44  */
45 struct ipv6_rt_hdr {
46         __u8            nexthdr;
47         __u8            hdrlen;
48         __u8            type;
49         __u8            segments_left;
50
51         /*
52          *      type specific data
53          *      variable length field
54          */
55 };
56
57
58 struct ipv6_opt_hdr {
59         __u8            nexthdr;
60         __u8            hdrlen;
61         /* 
62          * TLV encoded option data follows.
63          */
64 } __attribute__((packed));      /* required for some archs */
65
66 #define ipv6_destopt_hdr ipv6_opt_hdr
67 #define ipv6_hopopt_hdr  ipv6_opt_hdr
68
69 /* Router Alert option values (RFC2711) */
70 #define IPV6_OPT_ROUTERALERT_MLD        0x0000  /* MLD(RFC2710) */
71
72 /*
73  *      routing header type 0 (used in cmsghdr struct)
74  */
75
76 struct rt0_hdr {
77         struct ipv6_rt_hdr      rt_hdr;
78         __u32                   reserved;
79         struct in6_addr         addr[0];
80
81 #define rt0_type                rt_hdr.type
82 };
83
84 /*
85  *      routing header type 2
86  */
87
88 struct rt2_hdr {
89         struct ipv6_rt_hdr      rt_hdr;
90         __u32                   reserved;
91         struct in6_addr         addr;
92
93 #define rt2_type                rt_hdr.type
94 };
95
96 /*
97  *      home address option in destination options header
98  */
99
100 struct ipv6_destopt_hao {
101         __u8                    type;
102         __u8                    length;
103         struct in6_addr         addr;
104 } __attribute__((packed));
105
106 /*
107  *      IPv6 fixed header
108  *
109  *      BEWARE, it is incorrect. The first 4 bits of flow_lbl
110  *      are glued to priority now, forming "class".
111  */
112
113 struct ipv6hdr {
114 #if defined(__LITTLE_ENDIAN_BITFIELD)
115         __u8                    priority:4,
116                                 version:4;
117 #elif defined(__BIG_ENDIAN_BITFIELD)
118         __u8                    version:4,
119                                 priority:4;
120 #else
121 #error  "Please fix <asm/byteorder.h>"
122 #endif
123         __u8                    flow_lbl[3];
124
125         __be16                  payload_len;
126         __u8                    nexthdr;
127         __u8                    hop_limit;
128
129         struct  in6_addr        saddr;
130         struct  in6_addr        daddr;
131 };
132
133
134 /* index values for the variables in ipv6_devconf */
135 enum {
136         DEVCONF_FORWARDING = 0,
137         DEVCONF_HOPLIMIT,
138         DEVCONF_MTU6,
139         DEVCONF_ACCEPT_RA,
140         DEVCONF_ACCEPT_REDIRECTS,
141         DEVCONF_AUTOCONF,
142         DEVCONF_DAD_TRANSMITS,
143         DEVCONF_RTR_SOLICITS,
144         DEVCONF_RTR_SOLICIT_INTERVAL,
145         DEVCONF_RTR_SOLICIT_DELAY,
146         DEVCONF_USE_TEMPADDR,
147         DEVCONF_TEMP_VALID_LFT,
148         DEVCONF_TEMP_PREFERED_LFT,
149         DEVCONF_REGEN_MAX_RETRY,
150         DEVCONF_MAX_DESYNC_FACTOR,
151         DEVCONF_MAX_ADDRESSES,
152         DEVCONF_FORCE_MLD_VERSION,
153         DEVCONF_ACCEPT_RA_DEFRTR,
154         DEVCONF_ACCEPT_RA_PINFO,
155         DEVCONF_ACCEPT_RA_RTR_PREF,
156         DEVCONF_RTR_PROBE_INTERVAL,
157         DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
158         DEVCONF_PROXY_NDP,
159         DEVCONF_OPTIMISTIC_DAD,
160         DEVCONF_ACCEPT_SOURCE_ROUTE,
161         DEVCONF_MC_FORWARDING,
162         DEVCONF_DISABLE_IPV6,
163         DEVCONF_ACCEPT_DAD,
164         DEVCONF_FORCE_TLLAO,
165         DEVCONF_NDISC_NOTIFY,
166         DEVCONF_MLDV1_UNSOLICITED_REPORT_INTERVAL,
167         DEVCONF_MLDV2_UNSOLICITED_REPORT_INTERVAL,
168         DEVCONF_SUPPRESS_FRAG_NDISC,
169         DEVCONF_ACCEPT_RA_FROM_LOCAL,
170         DEVCONF_USE_OPTIMISTIC,
171         DEVCONF_MAX
172 };
173
174
175 #endif /* _UAPI_IPV6_H */