1 /*!\file netinet/ipv6.h
2 * Linux IPv6 definitions.
6 * Linux INET6 implementation
9 * Pedro Roque <roque@di.fc.ul.pt>
11 * $Id: ipv6.h,v 1.6 1997/04/01 02:22:58 davem Exp $
13 * This program is free software; you can redistribute it and/or
14 * modify it under the terms of the GNU General Public License
15 * as published by the Free Software Foundation; either version
16 * 2 of the License, or (at your option) any later version.
18 * NB! Don't ue this file. Use <netinet/in.h> instread.
24 #ifndef __NETINET_IN_H
25 #include <netinet/in.h> /* in6_addr */
30 * source interface/address selection, source routing, etc...
31 * *under construction*
34 #include <sys/packon.h>
40 unsigned char ipv6_priority:4;
41 unsigned char ipv6_version:4;
42 unsigned char ipv6_flow_lbl[3];
43 unsigned short ipv6_len;
44 unsigned char ipv6_nextheader;
45 unsigned char ipv6_hoplimit;
46 struct in6_addr ipv6_src;
47 struct in6_addr ipv6_dst;
53 * The length of this struct cannot be greater than the length of
54 * the proto_priv field in a sk_buff which is currently
55 * defined to be 16 bytes.
56 * Pointers take upto 8 bytes (sizeof(void *) is 8 on the alpha).
59 /* length of extension headers */
60 unsigned short opt_flen; /* after fragment hdr */
61 unsigned short opt_nflen; /* before fragment hdr */
64 * usualy carried in IPv6 extension headers
66 struct ipv6_rt_hdr *srcrt; /* Routing Header */
70 struct in6_addr ipi6_addr;
76 struct in6_addr ifr6_addr;
77 unsigned long ifr6_prefixlen;
78 unsigned long ifr6_ifindex;
81 #define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */
82 #define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */
88 unsigned char nexthdr;
91 unsigned char segments_left;
94 * variable length field
99 * routing header type 0 (used in cmsghdr struct)
101 struct ipv6_rt0_hdr {
102 struct ipv6_rt_hdr rt_hdr;
103 unsigned long bitmap; /* strict/loose bit map */
105 struct in6_addr addr[0];
107 #define rt0_type rt_hdr.type;
111 * NextHeader field of IPv6 header
114 #define NEXTHDR_HOP 0 /* Hop-by-hop option header. */
115 #define NEXTHDR_TCP 6 /* TCP segment. */
116 #define NEXTHDR_UDP 17 /* UDP message. */
117 #define NEXTHDR_IPV6 41 /* IPv6 in IPv6 */
118 #define NEXTHDR_ROUTING 43 /* Routing header. */
119 #define NEXTHDR_FRAGMENT 44 /* Fragmentation/reassembly header. */
120 #define NEXTHDR_ESP 50 /* Encapsulating security payload. */
121 #define NEXTHDR_AUTH 51 /* Authentication header. */
122 #define NEXTHDR_ICMP 58 /* ICMP for IPv6. */
123 #define NEXTHDR_NONE 59 /* No next header */
124 #define NEXTHDR_DEST 60 /* Destination options header. */
126 #define NEXTHDR_MAX 255
129 #define IPV6_DEFAULT_HOPLIMIT 64
130 #define IPV6_DEFAULT_MCASTHOPS 1
135 * type - unicast | multicast | anycast
136 * scope - local | site | global
143 #define IPV6_ADDR_ANY 0x0000U
145 #define IPV6_ADDR_UNICAST 0x0001U
146 #define IPV6_ADDR_MULTICAST 0x0002U
147 #define IPV6_ADDR_ANYCAST 0x0004U
149 #define IPV6_ADDR_LOOPBACK 0x0010U
150 #define IPV6_ADDR_LINKLOCAL 0x0020U
151 #define IPV6_ADDR_SITELOCAL 0x0040U
153 #define IPV6_ADDR_COMPATv4 0x0080U
155 #define IPV6_ADDR_SCOPE_MASK 0x00f0U
157 #define IPV6_ADDR_MAPPED 0x1000U
158 #define IPV6_ADDR_RESERVED 0x2000U /* reserved address space */
161 * fragmentation header
164 struct ipv6_fraghdr {
165 unsigned char nexthdr;
166 unsigned char reserved;
167 unsigned short frag_off;
168 unsigned long identification;
170 #define fraghdr ipv6_fraghdr
172 #include <sys/packoff.h>