ICMPv4 protocol.
Definition in file icmpv4.c.
Process a received packet.
- Parameters
-
| iobuf | I/O buffer |
| netdev | Network device |
| st_src | Partially-filled source address |
| st_dest | Partially-filled destination address |
| pshdr_csum | Pseudo-header checksum |
- Return values
-
Definition at line 52 of file icmpv4.c.
64 if (
len <
sizeof ( *icmp ) ) {
65 DBG (
"ICMP packet too short at %zd bytes (min %zd bytes)\n",
66 len,
sizeof ( *icmp ) );
74 DBG (
"ICMP checksum incorrect (is %04x, should be 0000)\n",
86 &icmpv4_echo_protocol );
90 DBG (
"ICMP ignoring type %d\n",
type );
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
uint32_t type
Operating system type.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define ICMP_ECHO_REQUEST
void * data
Start of data.
int icmp_rx_echo_reply(struct io_buffer *iobuf, struct sockaddr_tcpip *st_src)
Process a received ICMP echo request.
int icmp_rx_echo_request(struct io_buffer *iobuf, struct sockaddr_tcpip *st_src, struct icmp_echo_protocol *echo_protocol)
Process a received ICMP echo request.
#define DBG(...)
Print a debugging message.
uint16_t tcpip_chksum(const void *data, size_t len)
Calculate TCP/IP checkum.
References io_buffer::data, DBG, DBG_HD, EINVAL, free_iob(), ICMP_ECHO_REPLY, ICMP_ECHO_REQUEST, icmp_rx_echo_reply(), icmp_rx_echo_request(), iob_len(), len, rc, tcpip_chksum(), type, and icmp_header::type.