Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


ipv6.h
001: #ifndef _IPV6_H
002: #define _IPV6_H
003: 
004: #include <linux/types.h>
005: #include <linux/in6.h>
006: #include <asm/byteorder.h>
007: 
008: /* The latest drafts declared increase in minimal mtu up to 1280. */
009: 
010: #define IPV6_MIN_MTU    1280
011: 
012: /*
013:  *      Advanced API
014:  *      source interface/address selection, source routing, etc...
015:  *      *under construction*
016:  */
017: 
018: 
019: struct in6_pktinfo {
020:         struct in6_addr ipi6_addr;
021:         int             ipi6_ifindex;
022: };
023: 
024: struct ip6_mtuinfo {
025:         struct sockaddr_in6     ip6m_addr;
026:         __u32                   ip6m_mtu;
027: };
028: 
029: struct in6_ifreq {
030:         struct in6_addr ifr6_addr;
031:         __u32           ifr6_prefixlen;
032:         int             ifr6_ifindex; 
033: };
034: 
035: #define IPV6_SRCRT_STRICT       0x01    /* Deprecated; will be removed */
036: #define IPV6_SRCRT_TYPE_0       0       /* Deprecated; will be removed */
037: #define IPV6_SRCRT_TYPE_2       2       /* IPv6 type 2 Routing Header   */
038: 
039: /*
040:  *      routing header
041:  */
042: struct ipv6_rt_hdr {
043:         __u8            nexthdr;
044:         __u8            hdrlen;
045:         __u8            type;
046:         __u8            segments_left;
047: 
048:         /*
049:          *      type specific data
050:          *      variable length field
051:          */
052: };
053: 
054: 
055: struct ipv6_opt_hdr {
056:         __u8            nexthdr;
057:         __u8            hdrlen;
058:         /* 
059:          * TLV encoded option data follows.
060:          */
061: } __attribute__((packed));      /* required for some archs */
062: 
063: #define ipv6_destopt_hdr ipv6_opt_hdr
064: #define ipv6_hopopt_hdr  ipv6_opt_hdr
065: 
066: 
067: /*
068:  *      routing header type 0 (used in cmsghdr struct)
069:  */
070: 
071: struct rt0_hdr {
072:         struct ipv6_rt_hdr      rt_hdr;
073:         __u32                   reserved;
074:         struct in6_addr         addr[0];
075: 
076: #define rt0_type                rt_hdr.type
077: };
078: 
079: /*
080:  *      routing header type 2
081:  */
082: 
083: struct rt2_hdr {
084:         struct ipv6_rt_hdr      rt_hdr;
085:         __u32                   reserved;
086:         struct in6_addr         addr;
087: 
088: #define rt2_type                rt_hdr.type
089: };
090: 
091: /*
092:  *      home address option in destination options header
093:  */
094: 
095: struct ipv6_destopt_hao {
096:         __u8                    type;
097:         __u8                    length;
098:         struct in6_addr         addr;
099: } __attribute__((packed));
100: 
101: /*
102:  *      IPv6 fixed header
103:  *
104:  *      BEWARE, it is incorrect. The first 4 bits of flow_lbl
105:  *      are glued to priority now, forming "class".
106:  */
107: 
108: struct ipv6hdr {
109: #if defined(__LITTLE_ENDIAN_BITFIELD)
110:         __u8                    priority:4,
111:                                 version:4;
112: #elif defined(__BIG_ENDIAN_BITFIELD)
113:         __u8                    version:4,
114:                                 priority:4;
115: #else
116: #error  "Please fix <asm/byteorder.h>"
117: #endif
118:         __u8                    flow_lbl[3];
119: 
120:         __be16                  payload_len;
121:         __u8                    nexthdr;
122:         __u8                    hop_limit;
123: 
124:         struct  in6_addr        saddr;
125:         struct  in6_addr        daddr;
126: };
127: 
128: 
129: /* index values for the variables in ipv6_devconf */
130: enum {
131:         DEVCONF_FORWARDING = 0,
132:         DEVCONF_HOPLIMIT,
133:         DEVCONF_MTU6,
134:         DEVCONF_ACCEPT_RA,
135:         DEVCONF_ACCEPT_REDIRECTS,
136:         DEVCONF_AUTOCONF,
137:         DEVCONF_DAD_TRANSMITS,
138:         DEVCONF_RTR_SOLICITS,
139:         DEVCONF_RTR_SOLICIT_INTERVAL,
140:         DEVCONF_RTR_SOLICIT_DELAY,
141:         DEVCONF_USE_TEMPADDR,
142:         DEVCONF_TEMP_VALID_LFT,
143:         DEVCONF_TEMP_PREFERED_LFT,
144:         DEVCONF_REGEN_MAX_RETRY,
145:         DEVCONF_MAX_DESYNC_FACTOR,
146:         DEVCONF_MAX_ADDRESSES,
147:         DEVCONF_FORCE_MLD_VERSION,
148:         DEVCONF_ACCEPT_RA_DEFRTR,
149:         DEVCONF_ACCEPT_RA_PINFO,
150:         DEVCONF_ACCEPT_RA_RTR_PREF,
151:         DEVCONF_RTR_PROBE_INTERVAL,
152:         DEVCONF_ACCEPT_RA_RT_INFO_MAX_PLEN,
153:         DEVCONF_PROXY_NDP,
154:         DEVCONF_OPTIMISTIC_DAD,
155:         DEVCONF_ACCEPT_SOURCE_ROUTE,
156:         DEVCONF_MC_FORWARDING,
157:         DEVCONF_DISABLE_IPV6,
158:         DEVCONF_ACCEPT_DAD,
159:         DEVCONF_FORCE_TLLAO,
160:         DEVCONF_MAX
161: };
162: 
163: 
164: #endif /* _IPV6_H */
165: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/