Import 2.3.6
[davej-history.git] / include / linux / ipv6.h
blob84564bae7f6dc86f833626d443bc25d8f6af42a3
1 #ifndef _IPV6_H
2 #define _IPV6_H
4 #include <linux/in6.h>
5 #include <asm/byteorder.h>
7 /* The latest drafts declared increase in minimal mtu up to 1280. */
9 #define IPV6_MIN_MTU 1280
12 * Advanced API
13 * source interface/address selection, source routing, etc...
14 * *under construction*
18 struct in6_pktinfo {
19 struct in6_addr ipi6_addr;
20 int ipi6_ifindex;
24 struct in6_ifreq {
25 struct in6_addr ifr6_addr;
26 __u32 ifr6_prefixlen;
27 int ifr6_ifindex;
30 #define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */
31 #define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */
34 * routing header
36 struct ipv6_rt_hdr {
37 __u8 nexthdr;
38 __u8 hdrlen;
39 __u8 type;
40 __u8 segments_left;
43 * type specific data
44 * variable length field
49 struct ipv6_opt_hdr {
50 __u8 nexthdr;
51 __u8 hdrlen;
52 /*
53 * TLV encoded option data follows.
57 #define ipv6_destopt_hdr ipv6_opt_hdr
58 #define ipv6_hopopt_hdr ipv6_opt_hdr
60 #ifdef __KERNEL__
61 #define ipv6_optlen(p) (((p)->hdrlen+1) << 3)
62 #endif
65 * routing header type 0 (used in cmsghdr struct)
68 struct rt0_hdr {
69 struct ipv6_rt_hdr rt_hdr;
70 __u32 bitmap; /* strict/loose bit map */
71 struct in6_addr addr[0];
73 #define rt0_type rt_hdr.type;
77 * IPv6 fixed header
79 * BEWARE, it is incorrect. The first 4 bits of flow_lbl
80 * are glued to priority now, forming "class".
83 struct ipv6hdr {
84 #if defined(__LITTLE_ENDIAN_BITFIELD)
85 __u8 priority:4,
86 version:4;
87 #elif defined(__BIG_ENDIAN_BITFIELD)
88 __u8 version:4,
89 priority:4;
90 #else
91 #error "Please fix <asm/byteorder.h>"
92 #endif
93 __u8 flow_lbl[3];
95 __u16 payload_len;
96 __u8 nexthdr;
97 __u8 hop_limit;
99 struct in6_addr saddr;
100 struct in6_addr daddr;
103 #ifdef __KERNEL__
106 This structure contains results of exthdrs parsing
107 as offsets from skb->nh.
110 struct inet6_skb_parm
112 int iif;
113 __u16 ra;
114 __u16 hop;
115 __u16 auth;
116 __u16 dst0;
117 __u16 srcrt;
118 __u16 dst1;
121 #endif
123 #endif