63 if (
len <
sizeof ( *icmp ) ) {
64 DBG (
"ICMP packet too short at %zd bytes (min %zd bytes)\n",
65 len,
sizeof ( *icmp ) );
73 DBG (
"ICMP checksum incorrect (is %04x, should be 0000)\n",
85 &icmpv4_echo_protocol );
89 DBG (
"ICMP ignoring type %d\n",
type );
111 .tcpip_protocol = &icmpv4_protocol,
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
static int icmpv4_rx(struct io_buffer *iobuf, struct net_device *netdev __unused, struct sockaddr_tcpip *st_src, struct sockaddr_tcpip *st_dest __unused, uint16_t pshdr_csum __unused)
Process a received packet.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
uint32_t type
Operating system type.
#define __unused
Declare a variable or data structure as unused.
static struct net_device * netdev
Transport-network layer interface.
const char * name
Protocol name.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
struct icmp_echo_protocol icmpv4_echo_protocol __icmp_echo_protocol
ICMPv4 echo protocol.
#define ICMP_ECHO_REQUEST
A transport-layer protocol of the TCP/IP stack (eg.
void * data
Start of data.
struct tcpip_protocol icmpv4_protocol __tcpip_protocol
ICMPv4 TCP/IP protocol.
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.
#define DBG(...)
Print a debugging message.
uint16_t tcpip_chksum(const void *data, size_t len)
Calculate TCP/IP checkum.
#define AF_INET
IPv4 Internet addresses.