1 |
1254 |
phoenix |
//==========================================================================
|
2 |
|
|
//
|
3 |
|
|
// include/netinet6_icmpv6.h
|
4 |
|
|
//
|
5 |
|
|
//
|
6 |
|
|
//
|
7 |
|
|
//==========================================================================
|
8 |
|
|
//####BSDCOPYRIGHTBEGIN####
|
9 |
|
|
//
|
10 |
|
|
// -------------------------------------------
|
11 |
|
|
//
|
12 |
|
|
// Portions of this software may have been derived from OpenBSD or other sources,
|
13 |
|
|
// and are covered by the appropriate copyright disclaimers included herein.
|
14 |
|
|
//
|
15 |
|
|
// -------------------------------------------
|
16 |
|
|
//
|
17 |
|
|
//####BSDCOPYRIGHTEND####
|
18 |
|
|
//==========================================================================
|
19 |
|
|
//#####DESCRIPTIONBEGIN####
|
20 |
|
|
//
|
21 |
|
|
// Author(s): gthomas
|
22 |
|
|
// Contributors: gthomas
|
23 |
|
|
// Date: 2000-01-10
|
24 |
|
|
// Purpose:
|
25 |
|
|
// Description:
|
26 |
|
|
//
|
27 |
|
|
//
|
28 |
|
|
//####DESCRIPTIONEND####
|
29 |
|
|
//
|
30 |
|
|
//==========================================================================
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
/*
|
34 |
|
|
%%% portions-copyright-nrl-97
|
35 |
|
|
Portions of this software are Copyright 1997-1998 by Randall Atkinson,
|
36 |
|
|
Ronald Lee, Daniel McDonald, Bao Phan, and Chris Winters. All Rights
|
37 |
|
|
Reserved. All rights under this copyright have been assigned to the US
|
38 |
|
|
Naval Research Laboratory (NRL). The NRL Copyright Notice and License
|
39 |
|
|
Agreement Version 1.1 (January 17, 1995) applies to these portions of the
|
40 |
|
|
software.
|
41 |
|
|
You should have received a copy of the license with this software. If you
|
42 |
|
|
didn't get a copy, you may request one from <license@ipv6.nrl.navy.mil>.
|
43 |
|
|
|
44 |
|
|
*/
|
45 |
|
|
|
46 |
|
|
#ifndef _NETINET6_ICMPV6_H
|
47 |
|
|
#define _NETINET6_ICMPV6_H 1
|
48 |
|
|
|
49 |
|
|
#include <netinet6/ipv6.h>
|
50 |
|
|
|
51 |
|
|
struct icmpv6hdr {
|
52 |
|
|
uint8_t icmpv6_type; /* type field */
|
53 |
|
|
uint8_t icmpv6_code; /* code field */
|
54 |
|
|
uint16_t icmpv6_cksum; /* checksum field */
|
55 |
|
|
union {
|
56 |
|
|
uint32_t un_data32[1]; /* type-specific field */
|
57 |
|
|
uint16_t un_data16[2]; /* type-specific field */
|
58 |
|
|
uint8_t un_data8[4]; /* type-specific field */
|
59 |
|
|
} icmpv6_dataun;
|
60 |
|
|
};
|
61 |
|
|
|
62 |
|
|
#define icmpv6_data32 icmpv6_dataun.un_data32
|
63 |
|
|
#define icmpv6_data16 icmpv6_dataun.un_data16
|
64 |
|
|
#define icmpv6_data8 icmpv6_dataun.un_data8
|
65 |
|
|
#define icmpv6_pptr icmpv6_data32[0] /* parameter prob */
|
66 |
|
|
#define icmpv6_mtu icmpv6_data32[0] /* packet too big */
|
67 |
|
|
#define icmpv6_id icmpv6_data16[0] /* echo request/reply */
|
68 |
|
|
#define icmpv6_seq icmpv6_data16[1] /* echo request/reply */
|
69 |
|
|
#define icmpv6_maxdelay icmpv6_data16[0] /* mcast group membership */
|
70 |
|
|
|
71 |
|
|
#define ICMPV6_DST_UNREACH 1
|
72 |
|
|
#define ICMPV6_PACKET_TOOBIG 2
|
73 |
|
|
#define ICMPV6_TIME_EXCEEDED 3
|
74 |
|
|
#define ICMPV6_PARAMETER_PROBLEM 4
|
75 |
|
|
|
76 |
|
|
#define ICMPV6_INFOMSG_MASK 128 /* all informational messages */
|
77 |
|
|
#define ICMPV6_ECHO_REQUEST 128
|
78 |
|
|
#define ICMPV6_ECHO_REPLY 129
|
79 |
|
|
#define ICMPV6_MEMBERSHIP_QUERY 130
|
80 |
|
|
#define ICMPV6_MEMBERSHIP_REPORT 131
|
81 |
|
|
#define ICMPV6_MEMBERSHIP_REDUCTION 132
|
82 |
|
|
|
83 |
|
|
#define ICMPV6_UNREACH_NOROUTE 0
|
84 |
|
|
#define ICMPV6_UNREACH_ADMIN 1 /* administratively prohibited */
|
85 |
|
|
#define ICMPV6_UNREACH_NOTNEIGHBOR 2 /* not a neighbor (and must be) */
|
86 |
|
|
#define ICMPV6_UNREACH_ADDRESS 3
|
87 |
|
|
#define ICMPV6_UNREACH_PORT 4
|
88 |
|
|
|
89 |
|
|
#define ICMPV6_EXCEEDED_HOPS 0 /* Hop Limit == 0 in transit */
|
90 |
|
|
#define ICMPV6_EXCEEDED_REASSEMBLY 1 /* Reassembly time out */
|
91 |
|
|
|
92 |
|
|
#define ICMPV6_PARAMPROB_HDR 0 /* erroneous header field */
|
93 |
|
|
#define ICMPV6_PARAMPROB_NEXTHDR 1 /* unrecognized Next Header */
|
94 |
|
|
#define ICMPV6_PARAMPROB_OPTION 2 /* unrecognized option */
|
95 |
|
|
|
96 |
|
|
struct icmpv6_filter {
|
97 |
|
|
uint32_t data[8]; /* 8*32 = 256 bits */
|
98 |
|
|
};
|
99 |
|
|
|
100 |
|
|
#define ICMPV6_FILTER_WILLPASS(type, filterp) \
|
101 |
|
|
((((filterp)->data[(type) >> 5]) & (1 << ((type) & 31))) == 0)
|
102 |
|
|
#define ICMPV6_FILTER_WILLBLOCK(type, filterp) \
|
103 |
|
|
((((filterp)->data[(type) >> 5]) & (1 << ((type) & 31))) != 0)
|
104 |
|
|
#define ICMPV6_FILTER_SETPASS(type, filterp) \
|
105 |
|
|
((((filterp)->data[(type) >> 5]) &= ~(1 << ((type) & 31))))
|
106 |
|
|
#define ICMPV6_FILTER_SETBLOCK(type, filterp) \
|
107 |
|
|
((((filterp)->data[(type) >> 5]) |= (1 << ((type) & 31))))
|
108 |
|
|
#define ICMPV6_FILTER_SETPASSALL(filterp) \
|
109 |
|
|
memset((filterp), 0, sizeof(struct icmpv6_filter))
|
110 |
|
|
#define ICMPV6_FILTER_SETBLOCKALL(filterp) \
|
111 |
|
|
memset((filterp), 0xff, sizeof(struct icmpv6_filter))
|
112 |
|
|
|
113 |
|
|
#endif /* _NETINET6_ICMPV6_H */
|