iPXE
|
ICMP protocol. More...
#include <string.h>
#include <byteswap.h>
#include <errno.h>
#include <ipxe/iobuf.h>
#include <ipxe/in.h>
#include <ipxe/tcpip.h>
#include <ipxe/ping.h>
#include <ipxe/crc32.h>
#include <ipxe/icmp.h>
Go to the source code of this file.
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
static struct icmp_echo_protocol * | icmp_echo_protocol (sa_family_t family) |
Identify ICMP echo protocol. More... | |
static uint32_t | icmpcol (struct sockaddr_tcpip *st_peer) |
Determine debugging colour for ICMP debug messages. More... | |
static int | icmp_tx_echo (struct io_buffer *iobuf, struct sockaddr_tcpip *st_dest, struct icmp_echo_protocol *echo_protocol) |
Transmit ICMP echo packet. More... | |
int | icmp_tx_echo_request (struct io_buffer *iobuf, struct sockaddr_tcpip *st_dest) |
Transmit ICMP echo request. More... | |
static int | icmp_tx_echo_reply (struct io_buffer *iobuf, struct sockaddr_tcpip *st_dest, struct icmp_echo_protocol *echo_protocol) |
Transmit ICMP echo reply. More... | |
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. More... | |
int | icmp_rx_echo_reply (struct io_buffer *iobuf, struct sockaddr_tcpip *st_src) |
Process a received ICMP echo request. More... | |
__weak int | ping_rx (struct io_buffer *iobuf, struct sockaddr_tcpip *st_src __unused) |
Receive ping reply (when no ping protocol is present) More... | |
ICMP protocol.
Definition in file icmp.c.
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
|
static |
Identify ICMP echo protocol.
st_family | Address family |
echo_protocol | ICMP echo protocol, or NULL |
Definition at line 48 of file icmp.c.
References icmp_echo_protocol::family, for_each_table_entry, ICMP_ECHO_PROTOCOLS, and NULL.
Referenced by icmp_tx_echo_request().
|
static |
Determine debugging colour for ICMP debug messages.
st_peer | Peer address |
col | Debugging colour (for DBGC()) |
Definition at line 65 of file icmp.c.
References crc32_le().
Referenced by icmp_rx_echo_reply(), icmp_rx_echo_request(), icmp_tx_echo_reply(), and icmp_tx_echo_request().
|
static |
Transmit ICMP echo packet.
iobuf | I/O buffer |
st_dest | Destination socket address |
echo_protocol | ICMP echo protocol |
rc | Return status code |
Definition at line 78 of file icmp.c.
References io_buffer::data, echo(), iob_len(), icmp_echo_protocol::net_checksum, NULL, rc, tcpip_chksum(), icmp_echo_protocol::tcpip_protocol, and tcpip_tx().
Referenced by icmp_tx_echo_reply(), and icmp_tx_echo_request().
int icmp_tx_echo_request | ( | struct io_buffer * | iobuf, |
struct sockaddr_tcpip * | st_dest | ||
) |
Transmit ICMP echo request.
iobuf | I/O buffer |
st_dest | Destination socket address |
rc | Return status code |
Definition at line 105 of file icmp.c.
References io_buffer::data, DBGC, echo(), ENOTSUP, free_iob(), icmp_echo_protocol(), icmp_tx_echo(), icmpcol(), ntohs, rc, icmp_echo_protocol::request, and sockaddr_tcpip::st_family.
Referenced by ping_deliver().
|
static |
Transmit ICMP echo reply.
iobuf | I/O buffer |
st_dest | Destination socket address |
rc | Return status code |
Definition at line 139 of file icmp.c.
References io_buffer::data, DBGC, echo(), icmp_tx_echo(), icmpcol(), ntohs, rc, and icmp_echo_protocol::reply.
Referenced by icmp_rx_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.
iobuf | I/O buffer |
st_src | Source socket address |
echo_protocol | ICMP echo protocol |
rc | Return status code |
Definition at line 165 of file icmp.c.
References io_buffer::data, DBGC, echo(), EINVAL, free_iob(), icmp_tx_echo_reply(), icmpcol(), iob_len(), ntohs, and rc.
Referenced by icmpv4_rx(), and icmpv6_rx_echo_request().
int icmp_rx_echo_reply | ( | struct io_buffer * | iobuf, |
struct sockaddr_tcpip * | st_src | ||
) |
Process a received ICMP echo request.
iobuf | I/O buffer |
st_src | Source socket address |
rc | Return status code |
Definition at line 196 of file icmp.c.
References io_buffer::data, DBGC, echo(), EINVAL, free_iob(), icmpcol(), iob_len(), ntohs, ping_rx(), and rc.
Referenced by icmpv4_rx(), and icmpv6_rx_echo_reply().
__weak int ping_rx | ( | struct io_buffer * | iobuf, |
struct sockaddr_tcpip *st_src | __unused | ||
) |
Receive ping reply (when no ping protocol is present)
iobuf | I/O buffer |
st_src | Source socket address |
rc | Return status code |
Definition at line 226 of file icmp.c.
References free_iob().
Referenced by icmp_rx_echo_reply().