icmp.c
Go to the documentation of this file.
1 /**
2  * @file icmp.c
3  * @brief ICMP (Internet Control Message Protocol)
4  *
5  * @section License
6  *
7  * SPDX-License-Identifier: GPL-2.0-or-later
8  *
9  * Copyright (C) 2010-2026 Oryx Embedded SARL. All rights reserved.
10  *
11  * This file is part of CycloneTCP Open.
12  *
13  * This program is free software; you can redistribute it and/or
14  * modify it under the terms of the GNU General Public License
15  * as published by the Free Software Foundation; either version 2
16  * of the License, or (at your option) any later version.
17  *
18  * This program is distributed in the hope that it will be useful,
19  * but WITHOUT ANY WARRANTY; without even the implied warranty of
20  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21  * GNU General Public License for more details.
22  *
23  * You should have received a copy of the GNU General Public License
24  * along with this program; if not, write to the Free Software Foundation,
25  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
26  *
27  * @author Oryx Embedded SARL (www.oryx-embedded.com)
28  * @version 2.6.0
29  **/
30 
31 //Switch to the appropriate trace level
32 #define TRACE_LEVEL ICMP_TRACE_LEVEL
33 
34 //Dependencies
35 #include "core/net.h"
36 #include "core/ip.h"
37 #include "ipv4/ipv4.h"
38 #include "ipv4/ipv4_misc.h"
39 #include "ipv4/icmp.h"
40 #include "debug.h"
41 
42 //Check TCP/IP stack configuration
43 #if (IPV4_SUPPORT == ENABLED)
44 
45 
46 /**
47  * @brief Enable support for ICMP Echo Request messages
48  * @param[in] interface Underlying network interface
49  * @param[in] enable This flag specifies whether the host will respond to
50  * ICMP Echo Requests. When the flag is set to FALSE, incoming ICMP Echo
51  * Request messages will be dropped
52  * @return Error code
53  **/
54 
56 {
57  //Check parameters
58  if(interface == NULL)
60 
61  //Get exclusive access
62  netLock(interface->netContext);
63  //Enable or disable support for Echo Request messages
64  interface->ipv4Context.enableEchoReq = enable;
65  //Release exclusive access
66  netUnlock(interface->netContext);
67 
68  //Successful processing
69  return NO_ERROR;
70 }
71 
72 
73 /**
74  * @brief Enable support for broadcast ICMP Echo Request messages
75  * @param[in] interface Underlying network interface
76  * @param[in] enable This flag specifies whether the host will respond to
77  * broadcast ICMP Echo Requests. When the flag is set to FALSE, incoming ICMP
78  * Echo Request messages destined to a broadcast address will be dropped
79  * @return Error code
80  **/
81 
83  bool_t enable)
84 {
85  //Check parameters
86  if(interface == NULL)
88 
89  //Get exclusive access
90  netLock(interface->netContext);
91  //Enable or disable support for broadcast Echo Request messages
92  interface->ipv4Context.enableBroadcastEchoReq = enable;
93  //Release exclusive access
94  netUnlock(interface->netContext);
95 
96  //Successful processing
97  return NO_ERROR;
98 }
99 
100 
101 /**
102  * @brief Incoming ICMP message processing
103  * @param[in] interface Underlying network interface
104  * @param[in] requestPseudoHeader IPv4 pseudo header
105  * @param[in] buffer Multi-part buffer containing the incoming ICMP message
106  * @param[in] offset Offset to the first byte of the ICMP message
107  **/
108 
110  const Ipv4PseudoHeader *requestPseudoHeader, const NetBuffer *buffer,
111  size_t offset)
112 {
113  size_t length;
114  IcmpHeader *header;
115 
116  //Total number of ICMP messages which the entity received
117  ICMP_STATS_INC_COUNTER32(inMsgs, 1);
118 
119  //Retrieve the length of the ICMP message
120  length = netBufferGetLength(buffer) - offset;
121 
122  //Ensure the message length is correct
123  if(length < sizeof(IcmpHeader))
124  {
125  //Number of ICMP messages which the entity received but determined as
126  //having ICMP-specific errors
127  ICMP_STATS_INC_COUNTER32(inErrors, 1);
128 
129  //Silently discard incoming message
130  return;
131  }
132 
133  //Point to the ICMP message header
134  header = netBufferAt(buffer, offset, 0);
135  //Sanity check
136  if(header == NULL)
137  return;
138 
139  //Debug message
140  TRACE_INFO("ICMP message received (%" PRIuSIZE " bytes)...\r\n", length);
141  //Dump message contents for debugging purpose
142  icmpDumpMessage(header);
143 
144  //Verify checksum value
145  if(ipCalcChecksumEx(buffer, offset, length) != 0x0000)
146  {
147  //Debug message
148  TRACE_WARNING("Wrong ICMP header checksum!\r\n");
149 
150  //Number of ICMP messages which the entity received but determined as
151  //having ICMP-specific errors
152  ICMP_STATS_INC_COUNTER32(inErrors, 1);
153 
154  //Drop incoming message
155  return;
156  }
157 
158  //Increment per-message type ICMP counter
159  ICMP_STATS_INC_COUNTER32(inPkts[header->type], 1);
160 
161  //Check the type of message
162  switch(header->type)
163  {
164  //Echo Request?
166  //Process Echo Request message
167  icmpProcessEchoRequest(interface, requestPseudoHeader, buffer, offset);
168  break;
169 
170  //Unknown type?
171  default:
172  //Debug message
173  TRACE_WARNING("Unknown ICMP message type!\r\n");
174  //Discard incoming ICMP message
175  break;
176  }
177 }
178 
179 
180 /**
181  * @brief Echo Request message processing
182  * @param[in] interface Underlying network interface
183  * @param[in] requestPseudoHeader IPv4 pseudo header
184  * @param[in] request Multi-part buffer containing the incoming Echo Request message
185  * @param[in] requestOffset Offset to the first byte of the Echo Request message
186  **/
187 
189  const Ipv4PseudoHeader *requestPseudoHeader, const NetBuffer *request,
190  size_t requestOffset)
191 {
192  error_t error;
193  size_t requestLength;
194  size_t replyOffset;
195  size_t replyLength;
196  NetBuffer *reply;
197  IcmpEchoMessage *requestHeader;
198  IcmpEchoMessage *replyHeader;
199  Ipv4PseudoHeader replyPseudoHeader;
200 
201  //Retrieve the length of the Echo Request message
202  requestLength = netBufferGetLength(request) - requestOffset;
203 
204  //Ensure the packet length is correct
205  if(requestLength < sizeof(IcmpEchoMessage))
206  return;
207 
208  //Point to the Echo Request header
209  requestHeader = netBufferAt(request, requestOffset, 0);
210  //Sanity check
211  if(requestHeader == NULL)
212  return;
213 
214  //Debug message
215  TRACE_INFO("ICMP Echo Request message received (%" PRIuSIZE " bytes)...\r\n", requestLength);
216  //Dump message contents for debugging purpose
217  icmpDumpEchoMessage(requestHeader);
218 
219  //If support for Echo Request messages has been explicitly disabled, then
220  //the host shall not respond to the incoming request
221  if(!interface->ipv4Context.enableEchoReq)
222  return;
223 
224  //Check whether the destination address of the Echo Request message is
225  //a broadcast or a multicast address
226  if(ipv4IsBroadcastAddr(interface, requestPseudoHeader->destAddr) ||
227  ipv4IsMulticastAddr(requestPseudoHeader->destAddr))
228  {
230 
231  //If support for broadcast Echo Request messages has been explicitly
232  //disabled, then the host shall not respond to the incoming request
233  if(!interface->ipv4Context.enableBroadcastEchoReq)
234  return;
235 
236  //The source address of the reply must be a unicast address belonging to
237  //the interface on which the broadcast Echo Request message was received
238  error = ipv4SelectSourceAddr(interface->netContext, &interface,
239  requestPseudoHeader->srcAddr, &ipAddr);
240  //Any error to report?
241  if(error)
242  return;
243 
244  //Copy the resulting source IP address
245  replyPseudoHeader.srcAddr = ipAddr;
246  }
247  else
248  {
249  //The destination address of the Echo Request message is a unicast address
250  replyPseudoHeader.srcAddr = requestPseudoHeader->destAddr;
251  }
252 
253  //Allocate memory to hold the Echo Reply message
254  reply = ipAllocBuffer(sizeof(IcmpEchoMessage), &replyOffset);
255  //Failed to allocate memory?
256  if(reply == NULL)
257  return;
258 
259  //Point to the Echo Reply header
260  replyHeader = netBufferAt(reply, replyOffset, 0);
261 
262  //Format Echo Reply header
263  replyHeader->type = ICMP_TYPE_ECHO_REPLY;
264  replyHeader->code = 0;
265  replyHeader->checksum = 0;
266  replyHeader->identifier = requestHeader->identifier;
267  replyHeader->sequenceNumber = requestHeader->sequenceNumber;
268 
269  //Point to the first data byte
270  requestOffset += sizeof(IcmpEchoMessage);
271  requestLength -= sizeof(IcmpEchoMessage);
272 
273  //Check the length of the payload
274  if(requestLength > 0)
275  {
276  //Copy payload data
277  error = netBufferConcat(reply, request, requestOffset, requestLength);
278  }
279  else
280  {
281  //The Echo Request message is empty
282  error = NO_ERROR;
283  }
284 
285  //Check status code
286  if(!error)
287  {
288  NetTxAncillary ancillary;
289 
290  //Get the length of the resulting message
291  replyLength = netBufferGetLength(reply) - replyOffset;
292  //Calculate ICMP header checksum
293  replyHeader->checksum = ipCalcChecksumEx(reply, replyOffset, replyLength);
294 
295  //Format IPv4 pseudo header
296  replyPseudoHeader.destAddr = requestPseudoHeader->srcAddr;
297  replyPseudoHeader.reserved = 0;
298  replyPseudoHeader.protocol = IPV4_PROTOCOL_ICMP;
299  replyPseudoHeader.length = htons(replyLength);
300 
301  //Total number of ICMP messages which this entity attempted to send
302  ICMP_STATS_INC_COUNTER32(outMsgs, 1);
303  //Increment per-message type ICMP counter
305 
306  //Debug message
307  TRACE_INFO("Sending ICMP Echo Reply message (%" PRIuSIZE " bytes)...\r\n", replyLength);
308  //Dump message contents for debugging purpose
309  icmpDumpEchoMessage(replyHeader);
310 
311  //Additional options can be passed to the stack along with the packet
312  ancillary = NET_DEFAULT_TX_ANCILLARY;
313 
314  //Send Echo Reply message
315  ipv4SendDatagram(interface, &replyPseudoHeader, reply, replyOffset,
316  &ancillary);
317  }
318 
319  //Free previously allocated memory block
320  netBufferFree(reply);
321 }
322 
323 
324 /**
325  * @brief Send an ICMP Error message
326  * @param[in] interface Underlying network interface
327  * @param[in] type Message type
328  * @param[in] code Specific message code
329  * @param[in] parameter Specific message parameter
330  * @param[in] ipPacket Multi-part buffer that holds the invoking IPv4 packet
331  * @param[in] ipPacketOffset Offset to the first byte of the IPv4 packet
332  * @return Error code
333  **/
334 
336  uint8_t code, uint8_t parameter, const NetBuffer *ipPacket,
337  size_t ipPacketOffset)
338 {
339  error_t error;
340  size_t offset;
341  size_t length;
343  Ipv4Header *ipHeader;
344  NetBuffer *icmpMessage;
345  IcmpErrorMessage *icmpHeader;
346  Ipv4PseudoHeader pseudoHeader;
347 
348  //Retrieve the length of the invoking IPv4 packet
349  length = netBufferGetLength(ipPacket) - ipPacketOffset;
350 
351  //Check the length of the IPv4 packet
352  if(length < sizeof(Ipv4Header))
353  return ERROR_INVALID_LENGTH;
354 
355  //Point to the header of the invoking packet
356  ipHeader = netBufferAt(ipPacket, ipPacketOffset, sizeof(Ipv4Header));
357  //Sanity check
358  if(ipHeader == NULL)
359  return ERROR_FAILURE;
360 
361  //Check the type of the invoking packet
362  if(ipHeader->protocol == IPV4_PROTOCOL_ICMP)
363  {
364  //Make sure the ICMP message is valid
365  if(length >= (ipHeader->headerLength * 4 + sizeof(IcmpHeader)))
366  {
367  //Point to the ICMP header
368  icmpHeader = netBufferAt(ipPacket, ipPacketOffset +
369  ipHeader->headerLength * 4, sizeof(IcmpHeader));
370 
371  //Sanity check
372  if(icmpHeader != NULL)
373  {
374  //An ICMP error message must not be originated as a result of
375  //receiving an ICMP error or redirect message
376  if(icmpHeader->type == ICMP_TYPE_DEST_UNREACHABLE ||
377  icmpHeader->type == ICMP_TYPE_TIME_EXCEEDED ||
378  icmpHeader->type == ICMP_TYPE_PARAM_PROBLEM ||
379  icmpHeader->type == ICMP_TYPE_REDIRECT)
380  {
381  //Do not send any ICMP error message
382  return ERROR_INVALID_TYPE;
383  }
384  }
385  }
386  }
387 
388  //Never respond to a packet destined to a broadcast or a multicast address
389  if(ipv4IsBroadcastAddr(interface, ipHeader->destAddr) ||
390  ipv4IsMulticastAddr(ipHeader->destAddr))
391  {
392  //Report an error
393  return ERROR_INVALID_ADDRESS;
394  }
395 
396  //Length of the data that will be returned along with the ICMP header
397  length = MIN(length, (size_t) ipHeader->headerLength * 4 + 8);
398 
399  //Allocate a memory buffer to hold the ICMP message
400  icmpMessage = ipAllocBuffer(sizeof(IcmpErrorMessage), &offset);
401  //Failed to allocate memory?
402  if(icmpMessage == NULL)
403  return ERROR_OUT_OF_MEMORY;
404 
405  //Point to the ICMP header
406  icmpHeader = netBufferAt(icmpMessage, offset, 0);
407 
408  //Format ICMP message
409  icmpHeader->type = type;
410  icmpHeader->code = code;
411  icmpHeader->checksum = 0;
412  icmpHeader->parameter = parameter;
413  icmpHeader->unused[0] = 0;
414  icmpHeader->unused[1] = 0;
415  icmpHeader->unused[2] = 0;
416 
417  //Copy the IP header and the first 8 bytes of the original datagram data
418  error = netBufferConcat(icmpMessage, ipPacket, ipPacketOffset, length);
419 
420  //Check status code
421  if(!error)
422  {
423  //Get the length of the resulting message
424  length = netBufferGetLength(icmpMessage) - offset;
425  //Message checksum calculation
426  icmpHeader->checksum = ipCalcChecksumEx(icmpMessage, offset, length);
427 
428  //Check whether the destination address of the invoking packet matches a
429  //valid unicast address assigned to the interface
430  error = ipv4CheckDestAddr(interface, ipHeader->destAddr);
431 
432  //The source address must be the address of the gateway or host that
433  //composes the ICMP message (refer to RFC 792)
434  if(!error)
435  {
436  srcIpAddr = ipHeader->destAddr;
437  }
438  else
439  {
440  error = ipv4SelectSourceAddr(interface->netContext, &interface,
441  ipHeader->srcAddr, &srcIpAddr);
442  }
443 
444  //Check status code
445  if(!error)
446  {
447  NetTxAncillary ancillary;
448 
449  //Format IPv4 pseudo header
450  pseudoHeader.srcAddr = srcIpAddr;
451  pseudoHeader.destAddr = ipHeader->srcAddr;
452  pseudoHeader.reserved = 0;
453  pseudoHeader.protocol = IPV4_PROTOCOL_ICMP;
454  pseudoHeader.length = htons(length);
455 
456  //Total number of ICMP messages which this entity attempted to send
457  ICMP_STATS_INC_COUNTER32(outMsgs, 1);
458  //Increment per-message type ICMP counter
459  ICMP_STATS_INC_COUNTER32(outPkts[type], 1);
460 
461  //Debug message
462  TRACE_INFO("Sending ICMP Error message (%" PRIuSIZE " bytes)...\r\n", length);
463  //Dump message contents for debugging purpose
464  icmpDumpErrorMessage(icmpHeader);
465 
466  //Additional options can be passed to the stack along with the packet
467  ancillary = NET_DEFAULT_TX_ANCILLARY;
468 
469  //Send ICMP Error message
470  error = ipv4SendDatagram(interface, &pseudoHeader, icmpMessage, offset,
471  &ancillary);
472  }
473  }
474 
475  //Free previously allocated memory
476  netBufferFree(icmpMessage);
477 
478  //Return status code
479  return error;
480 }
481 
482 
483 /**
484  * @brief Dump ICMP message for debugging purpose
485  * @param[in] message Pointer to the ICMP message
486  **/
487 
489 {
490  //Dump ICMP message
491  TRACE_DEBUG(" Type = %" PRIu8 "\r\n", message->type);
492  TRACE_DEBUG(" Code = %" PRIu8 "\r\n", message->code);
493  TRACE_DEBUG(" Checksum = 0x%04" PRIX16 "\r\n", ntohs(message->checksum));
494 }
495 
496 
497 /**
498  * @brief Dump ICMP Echo Request or Echo Reply message
499  * @param[in] message Pointer to the ICMP message
500  **/
501 
503 {
504  //Dump ICMP message
505  TRACE_DEBUG(" Type = %" PRIu8 "\r\n", message->type);
506  TRACE_DEBUG(" Code = %" PRIu8 "\r\n", message->code);
507  TRACE_DEBUG(" Checksum = 0x%04" PRIX16 "\r\n", ntohs(message->checksum));
508  TRACE_DEBUG(" Identifier = 0x%04" PRIX16 "\r\n", ntohs(message->identifier));
509  TRACE_DEBUG(" Sequence Number = 0x%04" PRIX16 "\r\n", ntohs(message->sequenceNumber));
510 }
511 
512 
513 /**
514  * @brief Dump generic ICMP Error message
515  * @param[in] message Pointer to the ICMP message
516  **/
517 
519 {
520  //Dump ICMP message
521  TRACE_DEBUG(" Type = %" PRIu8 "\r\n", message->type);
522  TRACE_DEBUG(" Code = %" PRIu8 "\r\n", message->code);
523  TRACE_DEBUG(" Checksum = 0x%04" PRIX16 "\r\n", ntohs(message->checksum));
524  TRACE_DEBUG(" Parameter = %" PRIu8 "\r\n", message->parameter);
525 }
526 
527 #endif
#define ipv4IsMulticastAddr(ipAddr)
Definition: ipv4.h:186
#define htons(value)
Definition: cpu_endian.h:413
void netUnlock(NetContext *context)
Release exclusive access to the core of the TCP/IP stack.
Definition: net.c:319
NetBuffer * ipAllocBuffer(size_t length, size_t *offset)
Allocate a buffer to hold an IP packet.
Definition: ip.c:716
uint8_t code
Definition: coap_common.h:179
int bool_t
Definition: compiler_port.h:63
#define Ipv4Header
Definition: ipv4.h:36
void icmpDumpEchoMessage(const IcmpEchoMessage *message)
Dump ICMP Echo Request or Echo Reply message.
Definition: icmp.c:502
@ IPV4_PROTOCOL_ICMP
Definition: ipv4.h:275
uint16_t ipCalcChecksumEx(const NetBuffer *buffer, size_t offset, size_t length)
Calculate IP checksum over a multi-part buffer.
Definition: ip.c:591
const NetTxAncillary NET_DEFAULT_TX_ANCILLARY
Definition: net_misc.c:70
Structure describing a buffer that spans multiple chunks.
Definition: net_mem.h:89
uint8_t message[]
Definition: chap.h:154
bool_t ipv4IsBroadcastAddr(NetInterface *interface, Ipv4Addr ipAddr)
Check whether an IPv4 address is a broadcast address.
Definition: ipv4_misc.c:475
error_t icmpEnableBroadcastEchoRequests(NetInterface *interface, bool_t enable)
Enable support for broadcast ICMP Echo Request messages.
Definition: icmp.c:82
uint8_t type
Definition: coap_common.h:176
@ ERROR_OUT_OF_MEMORY
Definition: error.h:63
@ ICMP_TYPE_TIME_EXCEEDED
Definition: icmp.h:93
uint8_t parameter
Definition: icmp.h:191
Ipv4Addr srcIpAddr
Definition: ipcp.h:79
@ ICMP_TYPE_PARAM_PROBLEM
Definition: icmp.h:94
uint32_t Ipv4Addr
IPv4 network address.
Definition: ipv4.h:322
uint8_t ipPacket[]
Definition: ndp.h:431
IcmpHeader
Definition: icmp.h:149
error_t netBufferConcat(NetBuffer *dest, const NetBuffer *src, size_t srcOffset, size_t length)
Concatenate two multi-part buffers.
Definition: net_mem.c:460
void icmpProcessMessage(NetInterface *interface, const Ipv4PseudoHeader *requestPseudoHeader, const NetBuffer *buffer, size_t offset)
Incoming ICMP message processing.
Definition: icmp.c:109
error_t ipv4CheckDestAddr(NetInterface *interface, Ipv4Addr ipAddr)
Destination IPv4 address filtering.
Definition: ipv4_misc.c:114
Helper functions for IPv4.
void icmpDumpErrorMessage(const IcmpErrorMessage *message)
Dump generic ICMP Error message.
Definition: icmp.c:518
@ ERROR_INVALID_PARAMETER
Invalid parameter.
Definition: error.h:47
ICMP (Internet Control Message Protocol)
error_t
Error codes.
Definition: error.h:43
@ ICMP_TYPE_REDIRECT
Definition: icmp.h:88
@ ERROR_INVALID_ADDRESS
Definition: error.h:103
@ ERROR_FAILURE
Generic error code.
Definition: error.h:45
error_t ipv4SelectSourceAddr(NetContext *context, NetInterface **interface, Ipv4Addr destAddr, Ipv4Addr *srcAddr)
IPv4 source address selection.
Definition: ipv4_misc.c:173
#define NetInterface
Definition: net.h:40
void netBufferFree(NetBuffer *buffer)
Dispose a multi-part buffer.
Definition: net_mem.c:282
@ ERROR_INVALID_LENGTH
Definition: error.h:111
#define NetTxAncillary
Definition: net_misc.h:36
IcmpEchoMessage
Definition: icmp.h:179
@ ERROR_INVALID_TYPE
Definition: error.h:115
@ ICMP_TYPE_ECHO_REQUEST
Definition: icmp.h:90
#define Ipv4PseudoHeader
Definition: ipv4.h:39
#define TRACE_INFO(...)
Definition: debug.h:105
uint8_t length
Definition: tcp.h:375
size_t netBufferGetLength(const NetBuffer *buffer)
Get the actual length of a multi-part buffer.
Definition: net_mem.c:297
#define MIN(a, b)
Definition: os_port.h:63
error_t icmpEnableEchoRequests(NetInterface *interface, bool_t enable)
Enable support for ICMP Echo Request messages.
Definition: icmp.c:55
#define ntohs(value)
Definition: cpu_endian.h:421
#define TRACE_WARNING(...)
Definition: debug.h:93
#define TRACE_DEBUG(...)
Definition: debug.h:119
IcmpErrorMessage
Definition: icmp.h:194
@ ICMP_TYPE_DEST_UNREACHABLE
Definition: icmp.h:86
error_t ipv4SendDatagram(NetInterface *interface, const Ipv4PseudoHeader *pseudoHeader, NetBuffer *buffer, size_t offset, NetTxAncillary *ancillary)
Send an IPv4 datagram.
Definition: ipv4.c:1021
IPv4 and IPv6 common routines.
@ ICMP_TYPE_ECHO_REPLY
Definition: icmp.h:85
void icmpDumpMessage(const IcmpHeader *message)
Dump ICMP message for debugging purpose.
Definition: icmp.c:488
void netLock(NetContext *context)
Get exclusive access to the core of the TCP/IP stack.
Definition: net.c:307
void * netBufferAt(const NetBuffer *buffer, size_t offset, size_t length)
Returns a pointer to a data segment.
Definition: net_mem.c:418
Ipv4Addr ipAddr
Definition: ipcp.h:105
void icmpProcessEchoRequest(NetInterface *interface, const Ipv4PseudoHeader *requestPseudoHeader, const NetBuffer *request, size_t requestOffset)
Echo Request message processing.
Definition: icmp.c:188
#define ICMP_STATS_INC_COUNTER32(name, value)
Definition: icmp.h:64
IPv4 (Internet Protocol Version 4)
#define PRIuSIZE
TCP/IP stack core.
error_t icmpSendErrorMessage(NetInterface *interface, uint8_t type, uint8_t code, uint8_t parameter, const NetBuffer *ipPacket, size_t ipPacketOffset)
Send an ICMP Error message.
Definition: icmp.c:335
@ NO_ERROR
Success.
Definition: error.h:44
Debugging facilities.