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


icmpv6.h
001: #ifndef _LINUX_ICMPV6_H
002: #define _LINUX_ICMPV6_H
003: 
004: #include <linux/types.h>
005: #include <asm/byteorder.h>
006: 
007: struct icmp6hdr {
008: 
009:         __u8            icmp6_type;
010:         __u8            icmp6_code;
011:         __sum16         icmp6_cksum;
012: 
013: 
014:         union {
015:                 __be32                  un_data32[1];
016:                 __be16                  un_data16[2];
017:                 __u8                    un_data8[4];
018: 
019:                 struct icmpv6_echo {
020:                         __be16          identifier;
021:                         __be16          sequence;
022:                 } u_echo;
023: 
024:                 struct icmpv6_nd_advt {
025: #if defined(__LITTLE_ENDIAN_BITFIELD)
026:                         __u32           reserved:5,
027:                                         override:1,
028:                                         solicited:1,
029:                                         router:1,
030:                                         reserved2:24;
031: #elif defined(__BIG_ENDIAN_BITFIELD)
032:                         __u32           router:1,
033:                                         solicited:1,
034:                                         override:1,
035:                                         reserved:29;
036: #else
037: #error  "Please fix <asm/byteorder.h>"
038: #endif                                          
039:                 } u_nd_advt;
040: 
041:                 struct icmpv6_nd_ra {
042:                         __u8            hop_limit;
043: #if defined(__LITTLE_ENDIAN_BITFIELD)
044:                         __u8            reserved:3,
045:                                         router_pref:2,
046:                                         home_agent:1,
047:                                         other:1,
048:                                         managed:1;
049: 
050: #elif defined(__BIG_ENDIAN_BITFIELD)
051:                         __u8            managed:1,
052:                                         other:1,
053:                                         home_agent:1,
054:                                         router_pref:2,
055:                                         reserved:3;
056: #else
057: #error  "Please fix <asm/byteorder.h>"
058: #endif
059:                         __be16          rt_lifetime;
060:                 } u_nd_ra;
061: 
062:         } icmp6_dataun;
063: 
064: #define icmp6_identifier        icmp6_dataun.u_echo.identifier
065: #define icmp6_sequence          icmp6_dataun.u_echo.sequence
066: #define icmp6_pointer           icmp6_dataun.un_data32[0]
067: #define icmp6_mtu               icmp6_dataun.un_data32[0]
068: #define icmp6_unused            icmp6_dataun.un_data32[0]
069: #define icmp6_maxdelay          icmp6_dataun.un_data16[0]
070: #define icmp6_router            icmp6_dataun.u_nd_advt.router
071: #define icmp6_solicited         icmp6_dataun.u_nd_advt.solicited
072: #define icmp6_override          icmp6_dataun.u_nd_advt.override
073: #define icmp6_ndiscreserved     icmp6_dataun.u_nd_advt.reserved
074: #define icmp6_hop_limit         icmp6_dataun.u_nd_ra.hop_limit
075: #define icmp6_addrconf_managed  icmp6_dataun.u_nd_ra.managed
076: #define icmp6_addrconf_other    icmp6_dataun.u_nd_ra.other
077: #define icmp6_rt_lifetime       icmp6_dataun.u_nd_ra.rt_lifetime
078: #define icmp6_router_pref       icmp6_dataun.u_nd_ra.router_pref
079: };
080: 
081: 
082: #define ICMPV6_ROUTER_PREF_LOW          0x3
083: #define ICMPV6_ROUTER_PREF_MEDIUM       0x0
084: #define ICMPV6_ROUTER_PREF_HIGH         0x1
085: #define ICMPV6_ROUTER_PREF_INVALID      0x2
086: 
087: #define ICMPV6_DEST_UNREACH             1
088: #define ICMPV6_PKT_TOOBIG               2
089: #define ICMPV6_TIME_EXCEED              3
090: #define ICMPV6_PARAMPROB                4
091: 
092: #define ICMPV6_INFOMSG_MASK             0x80
093: 
094: #define ICMPV6_ECHO_REQUEST             128
095: #define ICMPV6_ECHO_REPLY               129
096: #define ICMPV6_MGM_QUERY                130
097: #define ICMPV6_MGM_REPORT               131
098: #define ICMPV6_MGM_REDUCTION            132
099: 
100: #define ICMPV6_NI_QUERY                 139
101: #define ICMPV6_NI_REPLY                 140
102: 
103: #define ICMPV6_MLD2_REPORT              143
104: 
105: #define ICMPV6_DHAAD_REQUEST            144
106: #define ICMPV6_DHAAD_REPLY              145
107: #define ICMPV6_MOBILE_PREFIX_SOL        146
108: #define ICMPV6_MOBILE_PREFIX_ADV        147
109: 
110: /*
111:  *      Codes for Destination Unreachable
112:  */
113: #define ICMPV6_NOROUTE                  0
114: #define ICMPV6_ADM_PROHIBITED           1
115: #define ICMPV6_NOT_NEIGHBOUR            2
116: #define ICMPV6_ADDR_UNREACH             3
117: #define ICMPV6_PORT_UNREACH             4
118: 
119: /*
120:  *      Codes for Time Exceeded
121:  */
122: #define ICMPV6_EXC_HOPLIMIT             0
123: #define ICMPV6_EXC_FRAGTIME             1
124: 
125: /*
126:  *      Codes for Parameter Problem
127:  */
128: #define ICMPV6_HDR_FIELD                0
129: #define ICMPV6_UNK_NEXTHDR              1
130: #define ICMPV6_UNK_OPTION               2
131: 
132: /*
133:  *      constants for (set|get)sockopt
134:  */
135: 
136: #define ICMPV6_FILTER                   1
137: 
138: /*
139:  *      ICMPV6 filter
140:  */
141: 
142: #define ICMPV6_FILTER_BLOCK             1
143: #define ICMPV6_FILTER_PASS              2
144: #define ICMPV6_FILTER_BLOCKOTHERS       3
145: #define ICMPV6_FILTER_PASSONLY          4
146: 
147: struct icmp6_filter {
148:         __u32           data[8];
149: };
150: 
151: /*
152:  *      Definitions for MLDv2
153:  */
154: #define MLD2_MODE_IS_INCLUDE    1
155: #define MLD2_MODE_IS_EXCLUDE    2
156: #define MLD2_CHANGE_TO_INCLUDE  3
157: #define MLD2_CHANGE_TO_EXCLUDE  4
158: #define MLD2_ALLOW_NEW_SOURCES  5
159: #define MLD2_BLOCK_OLD_SOURCES  6
160: 
161: #define MLD2_ALL_MCR_INIT { { { 0xff,0x02,0,0,0,0,0,0,0,0,0,0,0,0,0,0x16 } } }
162: 
163: 
164: #endif
165: 


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