46 #include "lwip/icmp.h"
58 #ifndef LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
59 #define LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN 1
63 #define ICMP_DEST_UNREACH_DATASIZE 8
65 static void icmp_send_response(
struct pbuf *p,
u8_t type,
u8_t code);
77 icmp_input(
struct pbuf *p,
struct netif *inp)
108 #if !LWIP_MULTICAST_PING || !LWIP_BROADCAST_PING
111 #if !LWIP_MULTICAST_PING
117 #if !LWIP_BROADCAST_PING
144 #if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
152 LWIP_ASSERT(
"icmp_input: moving p->payload to ip header failed\n", 0);
161 LWIP_ASSERT(
"check that first pbuf can hold struct the ICMP header",
165 LWIP_ASSERT(
"icmp_input: copying to new pbuf failed\n", 0);
171 LWIP_ASSERT(
"icmp_input: restoring original p->payload failed\n", 0);
181 LWIP_ASSERT(
"icmp_input: restoring original p->payload failed\n", 0);
214 LWIP_ASSERT(
"Can't move over header in packet", 0);
238 #if LWIP_ICMP_ECHO_CHECK_INPUT_PBUF_LEN
262 #if IP_FORWARD || IP_REASSEMBLY
273 icmp_send_response(p,
ICMP_TE, t);
287 icmp_send_response(
struct pbuf *p,
u8_t type,
u8_t code)
302 LWIP_ASSERT(
"check that first pbuf can hold icmp message",
313 icmphdr->type = type;
314 icmphdr->code = code;
320 IP_HLEN + ICMP_DEST_UNREACH_DATASIZE);