44 #if LWIP_ICMP6 && LWIP_IPV6 59 #ifndef LWIP_ICMP6_DATASIZE 60 #define LWIP_ICMP6_DATASIZE 8 62 #if LWIP_ICMP6_DATASIZE == 0 63 #define LWIP_ICMP6_DATASIZE 8 67 static void icmp6_send_response(
struct pbuf *p,
u8_t code,
u32_t data,
u8_t type);
80 icmp6_input(
struct pbuf *p,
struct netif *inp)
84 const ip6_addr_t * reply_src;
101 if (ip6_chksum_pseudo(p, IP6_NEXTH_ICMP6, p->
tot_len, ip6_current_src_addr(),
102 ip6_current_dest_addr()) != 0) {
112 switch (icmp6hdr->type) {
122 #if LWIP_IPV6_FORWARD 135 #if !LWIP_MULTICAST_PING 137 if (ip6_addr_ismulticast(ip6_current_dest_addr())) {
164 #if LWIP_MULTICAST_PING 165 if (ip6_addr_ismulticast(ip6_current_dest_addr())) {
166 reply_src =
ip_2_ip6(ip6_select_source_address(inp, ip6_current_src_addr()));
167 if (reply_src ==
NULL) {
178 reply_src = ip6_current_dest_addr();
184 #if CHECKSUM_GEN_ICMP6 187 IP6_NEXTH_ICMP6, r->
tot_len, reply_src, ip6_current_src_addr());
193 ip6_output_if(r, reply_src, ip6_current_src_addr(),
229 icmp6_packet_too_big(
struct pbuf *p,
u32_t mtu)
275 const ip6_addr_t *reply_src;
276 ip6_addr_t *reply_dest;
277 ip6_addr_t reply_src_local, reply_dest_local;
278 struct ip6_hdr *ip6hdr;
289 LWIP_ASSERT(
"check that first pbuf can hold icmp 6message",
293 icmp6hdr->type = type;
294 icmp6hdr->code = code;
295 icmp6hdr->data = data;
307 ip6hdr = (
struct ip6_hdr *)p->
payload;
309 ip6_addr_copy(reply_dest_local, ip6hdr->src);
310 ip6_addr_copy(reply_src_local, ip6hdr->dest);
311 reply_dest = &reply_dest_local;
312 reply_src = &reply_src_local;
313 netif = ip6_route(reply_src, reply_dest);
323 reply_dest = ip6_current_src_addr();
326 reply_src =
ip_2_ip6(ip6_select_source_address(netif, reply_dest));
327 if (reply_src ==
NULL) {
336 icmp6hdr->chksum = 0;
337 #if CHECKSUM_GEN_ICMP6 339 icmp6hdr->chksum = ip6_chksum_pseudo(q, IP6_NEXTH_ICMP6, q->
tot_len,
340 reply_src, reply_dest);
345 ip6_output_if(q, reply_src, reply_dest,
LWIP_ICMP6_HL, 0, IP6_NEXTH_ICMP6, netif);
#define ip_current_netif()
#define SMEMCPY(dst, src, len)
#define IF__NETIF_CHECKSUM_ENABLED(netif, chksumflag)
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
u8_t pbuf_free(struct pbuf *p)
err_t pbuf_copy(struct pbuf *p_to, struct pbuf *p_from)
#define CHECKSUM_CHECK_ICMP6
#define LWIP_ASSERT(message, assertion)
#define LWIP_ICMP6_DATASIZE
#define ICMP6_STATS_INC(x)
#define LWIP_DEBUGF(debug, message)