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 179 of file icmpv6.c.
181 {
187 unsigned int csum;
189
190
191 if (
len <
sizeof ( *icmp ) ) {
192 DBGC (
netdev,
"ICMPv6 packet too short at %zd bytes (min %zd "
193 "bytes)\n",
len,
sizeof ( *icmp ) );
196 }
198
199
201 if ( csum != 0 ) {
202 DBGC (
netdev,
"ICMPv6 checksum incorrect (is %04x, should be "
203 "0000)\n", csum );
207 }
208
209
211 if ( ! handler ) {
212 switch ( icmp->
type ) {
215 break;
218 break;
221 break;
224 break;
225 default:
226 DBGC (
netdev,
"ICMPv6 unrecognised type %d code %d\n",
229 break;
230 };
232 }
233
234
236 sin6_dest ) ) != 0 ) {
237 DBGC (
netdev,
"ICMPv6 could not handle type %d: %s\n",
240 }
241
245}
struct arbelprm_rc_send_wqe rc
struct bofm_section_header done
static struct net_device * netdev
#define EINVAL
Invalid argument.
#define ENOTSUP
Operation not supported.
#define ERANGE
Result too large.
#define EHOSTUNREACH_CODE(code)
static struct icmpv6_handler * icmpv6_handler(unsigned int type)
Identify ICMPv6 handler.
#define ETIMEDOUT_CODE(code)
#define EPROTO_CODE(code)
#define ICMPV6_PACKET_TOO_BIG
ICMPv6 packet too big.
#define ICMPV6_DESTINATION_UNREACHABLE
ICMPv6 destination unreachable.
#define ICMPV6_TIME_EXCEEDED
ICMPv6 time exceeded.
#define ICMPV6_PARAMETER_PROBLEM
ICMPv6 parameter problem.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
#define iob_disown(iobuf)
Disown an I/O buffer.
static size_t iob_len(struct io_buffer *iobuf)
Calculate length of data in an I/O buffer.
char * strerror(int errno)
Retrieve string representation of error number.
int(* rx)(struct io_buffer *iobuf, struct net_device *netdev, struct sockaddr_in6 *sin6_src, struct sockaddr_in6 *sin6_dest)
Process received packet.
void * data
Start of data.
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.