67 return crc32_le ( 0, st_peer,
sizeof ( *st_peer ) );
85 echo->icmp.chksum = 0;
92 &
echo->icmp.chksum :
NULL ) ) ) != 0 )
113 if ( ! echo_protocol ) {
114 DBGC (
icmpcol ( st_dest ),
"ICMP TX echo request unknown " 115 "address family %d\n", st_dest->
st_family );
124 DBGC (
icmpcol ( st_dest ),
"ICMP TX echo request id %04x seq %04x\n",
126 if ( (
rc =
icmp_tx_echo ( iobuf, st_dest, echo_protocol ) ) != 0 )
149 DBGC (
icmpcol ( st_dest ),
"ICMP TX echo reply id %04x seq %04x\n",
151 if ( (
rc =
icmp_tx_echo ( iobuf, st_dest, echo_protocol ) ) != 0 )
173 DBGC (
icmpcol ( st_src ),
"ICMP RX echo request too short at " 174 "%zd bytes (min %zd bytes)\n",
179 DBGC (
icmpcol ( st_src ),
"ICMP RX echo request id %04x seq %04x\n",
203 DBGC (
icmpcol ( st_src ),
"ICMP RX echo reply too short at " 204 "%zd bytes (min %zd bytes)\n",
209 DBGC (
icmpcol ( st_src ),
"ICMP RX echo reply id %04x seq %04x\n",
213 if ( (
rc =
ping_rx ( iobuf, st_src ) ) != 0 )
#define EINVAL
Invalid argument.
int net_checksum
Include network-layer checksum within packet.
struct arbelprm_rc_send_wqe rc
int icmp_tx_echo_request(struct io_buffer *iobuf, struct sockaddr_tcpip *st_dest)
Transmit ICMP echo request.
#define ICMP_ECHO_PROTOCOLS
ICMP echo protocol table.
An ICMP echo request/reply.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
sa_family_t st_family
Socket address family (part of struct sockaddr)
#define ENOTSUP
Operation not supported.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
u32 crc32_le(u32 seed, const void *data, size_t len)
Calculate 32-bit little-endian CRC checksum.
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.
static struct icmp_echo_protocol * icmp_echo_protocol(sa_family_t family)
Identify ICMP echo protocol.
#define __unused
Declare a variable or data structure as unused.
uint16_t sa_family_t
A socket address family.
Transport-network layer interface.
struct tcpip_protocol * tcpip_protocol
TCP/IP protocol.
uint8_t request
Request type.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
static int icmp_tx_echo(struct io_buffer *iobuf, struct sockaddr_tcpip *st_dest, struct icmp_echo_protocol *echo_protocol)
Transmit ICMP echo packet.
static uint32_t icmpcol(struct sockaddr_tcpip *st_peer)
Determine debugging colour for ICMP debug messages.
void * data
Start of data.
__weak int ping_rx(struct io_buffer *iobuf, struct sockaddr_tcpip *st_src __unused)
Receive ping reply (when no ping protocol is present)
#define __weak
Declare a function as weak (use before the definition)
sa_family_t family
Address family.
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.
int tcpip_tx(struct io_buffer *iobuf, struct tcpip_protocol *tcpip_protocol, struct sockaddr_tcpip *st_src, struct sockaddr_tcpip *st_dest, struct net_device *netdev, uint16_t *trans_csum)
Transmit a TCP/IP packet.
uint16_t tcpip_chksum(const void *data, size_t len)
Calculate TCP/IP checkum.
#define NULL
NULL pointer (VOID *)