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 178 of file icmpv6.c.
190 if (
len <
sizeof ( *icmp ) ) {
191 DBGC (
netdev,
"ICMPv6 packet too short at %zd bytes (min %zd " 192 "bytes)\n",
len,
sizeof ( *icmp ) );
200 DBGC (
netdev,
"ICMPv6 checksum incorrect (is %04x, should be " 210 switch ( icmp->
type ) {
224 DBGC (
netdev,
"ICMPv6 unrecognised type %d code %d\n",
234 sin6_dest ) ) != 0 ) {
235 DBGC (
netdev,
"ICMPv6 could not handle type %d: %s\n",
#define ETIMEDOUT_CODE(code)
#define EINVAL
Invalid argument.
struct arbelprm_rc_send_wqe rc
int(* rx)(struct io_buffer *iobuf, struct net_device *netdev, struct sockaddr_in6 *sin6_src, struct sockaddr_in6 *sin6_dest)
Process received packet.
#define ICMPV6_PACKET_TOO_BIG
ICMPv6 packet too big.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define ICMPV6_DESTINATION_UNREACHABLE
ICMPv6 destination unreachable.
#define EHOSTUNREACH_CODE(code)
#define EPROTO_CODE(code)
#define ENOTSUP
Operation not supported.
#define iob_disown(iobuf)
Disown an I/O buffer.
static struct net_device * netdev
#define ICMPV6_PARAMETER_PROBLEM
ICMPv6 parameter problem.
#define ERANGE
Result too large.
char * strerror(int errno)
Retrieve string representation of error number.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
static struct icmpv6_handler * icmpv6_handler(unsigned int type)
Identify ICMPv6 handler.
void * data
Start of data.
#define ICMPV6_TIME_EXCEEDED
ICMPv6 time exceeded.
struct bofm_section_header done
uint16_t tcpip_continue_chksum(uint16_t partial, const void *data, size_t len)
Calculate continued TCP/IP checkum.
References icmp_header::code, io_buffer::data, DBGC, DBGC_HDA, done, EHOSTUNREACH_CODE, EINVAL, ENOTSUP, EPROTO_CODE, ERANGE, ETIMEDOUT_CODE, free_iob(), ICMPV6_DESTINATION_UNREACHABLE, icmpv6_handler(), ICMPV6_PACKET_TOO_BIG, ICMPV6_PARAMETER_PROBLEM, ICMPV6_TIME_EXCEEDED, iob_disown, iob_len(), len, netdev, rc, icmpv6_handler::rx, strerror(), tcpip_continue_chksum(), and icmp_header::type.