STM32F769IDiscovery  1.00
uDANTE Audio Networking with STM32F7 DISCO board
icmp6.h
Go to the documentation of this file.
1 
7 /*
8  * Copyright (c) 2010 Inico Technologies Ltd.
9  * All rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without modification,
12  * are permitted provided that the following conditions are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  * 2. Redistributions in binary form must reproduce the above copyright notice,
17  * this list of conditions and the following disclaimer in the documentation
18  * and/or other materials provided with the distribution.
19  * 3. The name of the author may not be used to endorse or promote products
20  * derived from this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
23  * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
25  * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
26  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
27  * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
29  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
30  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
31  * OF SUCH DAMAGE.
32  *
33  * This file is part of the lwIP TCP/IP stack.
34  *
35  * Author: Ivan Delamer <delamer@inicotech.com>
36  *
37  *
38  * Please coordinate changes and requests with Ivan Delamer
39  * <delamer@inicotech.com>
40  */
41 #ifndef LWIP_HDR_ICMP6_H
42 #define LWIP_HDR_ICMP6_H
43 
44 #include "lwip/opt.h"
45 #include "lwip/pbuf.h"
46 #include "lwip/ip6_addr.h"
47 #include "lwip/netif.h"
48 
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 enum icmp6_type {
55  ICMP6_TYPE_DUR = 1, /* Destination unreachable */
56  ICMP6_TYPE_PTB = 2, /* Packet too big */
57  ICMP6_TYPE_TE = 3, /* Time exceeded */
58  ICMP6_TYPE_PP = 4, /* Parameter problem */
59  ICMP6_TYPE_PE1 = 100, /* Private experimentation */
60  ICMP6_TYPE_PE2 = 101, /* Private experimentation */
61  ICMP6_TYPE_RSV_ERR = 127, /* Reserved for expansion of error messages */
62 
63  ICMP6_TYPE_EREQ = 128, /* Echo request */
64  ICMP6_TYPE_EREP = 129, /* Echo reply */
65  ICMP6_TYPE_MLQ = 130, /* Multicast listener query */
66  ICMP6_TYPE_MLR = 131, /* Multicast listener report */
67  ICMP6_TYPE_MLD = 132, /* Multicast listener done */
68  ICMP6_TYPE_RS = 133, /* Router solicitation */
69  ICMP6_TYPE_RA = 134, /* Router advertisement */
70  ICMP6_TYPE_NS = 135, /* Neighbor solicitation */
71  ICMP6_TYPE_NA = 136, /* Neighbor advertisement */
72  ICMP6_TYPE_RD = 137, /* Redirect */
73  ICMP6_TYPE_MRA = 151, /* Multicast router advertisement */
74  ICMP6_TYPE_MRS = 152, /* Multicast router solicitation */
75  ICMP6_TYPE_MRT = 153, /* Multicast router termination */
76  ICMP6_TYPE_PE3 = 200, /* Private experimentation */
77  ICMP6_TYPE_PE4 = 201, /* Private experimentation */
78  ICMP6_TYPE_RSV_INF = 255 /* Reserved for expansion of informational messages */
79 };
80 
82  ICMP6_DUR_NO_ROUTE = 0, /* No route to destination */
83  ICMP6_DUR_PROHIBITED = 1, /* Communication with destination administratively prohibited */
84  ICMP6_DUR_SCOPE = 2, /* Beyond scope of source address */
85  ICMP6_DUR_ADDRESS = 3, /* Address unreachable */
86  ICMP6_DUR_PORT = 4, /* Port unreachable */
87  ICMP6_DUR_POLICY = 5, /* Source address failed ingress/egress policy */
88  ICMP6_DUR_REJECT_ROUTE = 6 /* Reject route to destination */
89 };
90 
92  ICMP6_TE_HL = 0, /* Hop limit exceeded in transit */
93  ICMP6_TE_FRAG = 1 /* Fragment reassembly time exceeded */
94 };
95 
97  ICMP6_PP_FIELD = 0, /* Erroneous header field encountered */
98  ICMP6_PP_HEADER = 1, /* Unrecognized next header type encountered */
99  ICMP6_PP_OPTION = 2 /* Unrecognized IPv6 option encountered */
100 };
101 
103 #ifdef PACK_STRUCT_USE_INCLUDES
104 # include "arch/bpstruct.h"
105 #endif
107 struct icmp6_hdr {
108  PACK_STRUCT_FLD_8(u8_t type);
109  PACK_STRUCT_FLD_8(u8_t code);
110  PACK_STRUCT_FIELD(u16_t chksum);
111  PACK_STRUCT_FIELD(u32_t data);
114 #ifdef PACK_STRUCT_USE_INCLUDES
115 # include "arch/epstruct.h"
116 #endif
117 
119 #ifdef PACK_STRUCT_USE_INCLUDES
120 # include "arch/bpstruct.h"
121 #endif
124  PACK_STRUCT_FLD_8(u8_t type);
125  PACK_STRUCT_FLD_8(u8_t code);
126  PACK_STRUCT_FIELD(u16_t chksum);
128  PACK_STRUCT_FIELD(u16_t seqno);
131 #ifdef PACK_STRUCT_USE_INCLUDES
132 # include "arch/epstruct.h"
133 #endif
134 
135 
136 #if LWIP_ICMP6 && LWIP_IPV6 /* don't build if not configured for use in lwipopts.h */
137 
138 void icmp6_input(struct pbuf *p, struct netif *inp);
139 void icmp6_dest_unreach(struct pbuf *p, enum icmp6_dur_code c);
140 void icmp6_packet_too_big(struct pbuf *p, u32_t mtu);
141 void icmp6_time_exceeded(struct pbuf *p, enum icmp6_te_code c);
142 void icmp6_param_problem(struct pbuf *p, enum icmp6_pp_code c, u32_t pointer);
143 
144 #endif /* LWIP_ICMP6 && LWIP_IPV6 */
145 
146 
147 #ifdef __cplusplus
148 }
149 #endif
150 
151 
152 #endif /* LWIP_HDR_ICMP6_H */
153 
icmp6_dur_code
Definition: icmp6.h:81
PACK_STRUCT_FLD_8(u8_t type)
icmp6_te_code
Definition: icmp6.h:91
icmp6_type
Definition: icmp6.h:54
unsigned long u32_t
Definition: cc.h:42
Definition: pbuf.h:108
Definition: netif.h:182
#define PACK_STRUCT_BEGIN
Definition: arch.h:60
PACK_STRUCT_FIELD(u16_t chksum)
unsigned char u8_t
Definition: cc.h:38
#define PACK_STRUCT_END
Definition: arch.h:64
PACK_STRUCT_BEGIN struct icmp6_hdr PACK_STRUCT_STRUCT
unsigned short u16_t
Definition: cc.h:40
icmp6_pp_code
Definition: icmp6.h:96