42 #define EHOSTUNREACH_ROUTE \ 43 __einfo_error ( EINFO_EHOSTUNREACH_ROUTE ) 44 #define EINFO_EHOSTUNREACH_ROUTE \ 45 __einfo_uniqify ( EINFO_EHOSTUNREACH, 0, \ 46 "No route to destination" ) 47 #define EHOSTUNREACH_PROHIBITED \ 48 __einfo_error ( EINFO_EHOSTUNREACH_PROHIBITED ) 49 #define EINFO_EHOSTUNREACH_PROHIBITED \ 50 __einfo_uniqify ( EINFO_EHOSTUNREACH, 1, \ 51 "Communication administratively prohibited" ) 52 #define EHOSTUNREACH_ADDRESS \ 53 __einfo_error ( EINFO_EHOSTUNREACH_ADDRESS ) 54 #define EINFO_EHOSTUNREACH_ADDRESS \ 55 __einfo_uniqify ( EINFO_EHOSTUNREACH, 3, \ 56 "Address unreachable" ) 57 #define EHOSTUNREACH_PORT \ 58 __einfo_error ( EINFO_EHOSTUNREACH_PORT ) 59 #define EINFO_EHOSTUNREACH_PORT \ 60 __einfo_uniqify ( EINFO_EHOSTUNREACH, 4, \ 62 #define EHOSTUNREACH_CODE( code ) \ 63 EUNIQ ( EINFO_EHOSTUNREACH, ( (code) & 0x1f ), \ 64 EHOSTUNREACH_ROUTE, EHOSTUNREACH_PROHIBITED, \ 65 EHOSTUNREACH_ADDRESS, EHOSTUNREACH_PORT ) 67 #define ETIMEDOUT_HOP \ 68 __einfo_error ( EINFO_ETIMEDOUT_HOP ) 69 #define EINFO_ETIMEDOUT_HOP \ 70 __einfo_uniqify ( EINFO_ETIMEDOUT, 0, \ 71 "Hop limit exceeded in transit" ) 72 #define ETIMEDOUT_REASSEMBLY \ 73 __einfo_error ( EINFO_ETIMEDOUT_REASSEMBLY ) 74 #define EINFO_ETIMEDOUT_REASSEMBLY \ 75 __einfo_uniqify ( EINFO_ETIMEDOUT, 1, \ 76 "Fragment reassembly time exceeded" ) 77 #define ETIMEDOUT_CODE( code ) \ 78 EUNIQ ( EINFO_ETIMEDOUT, ( (code) & 0x1f ), \ 79 ETIMEDOUT_HOP, ETIMEDOUT_REASSEMBLY ) 81 #define EPROTO_BAD_HEADER \ 82 __einfo_error ( EINFO_EPROTO_BAD_HEADER ) 83 #define EINFO_EPROTO_BAD_HEADER \ 84 __einfo_uniqify ( EINFO_EPROTO, 0, \ 85 "Erroneous header field" ) 86 #define EPROTO_NEXT_HEADER \ 87 __einfo_error ( EINFO_EPROTO_NEXT_HEADER ) 88 #define EINFO_EPROTO_NEXT_HEADER \ 89 __einfo_uniqify ( EINFO_EPROTO, 1, \ 90 "Unrecognised next header type" ) 91 #define EPROTO_OPTION \ 92 __einfo_error ( EINFO_EPROTO_OPTION ) 93 #define EINFO_EPROTO_OPTION \ 94 __einfo_uniqify ( EINFO_EPROTO, 2, \ 95 "Unrecognised IPv6 option" ) 96 #define EPROTO_CODE( code ) \ 97 EUNIQ ( EINFO_EPROTO, ( (code) & 0x1f ), \ 98 EPROTO_BAD_HEADER, EPROTO_NEXT_HEADER, EPROTO_OPTION ) 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",
257 .tcpip_protocol = &icmpv6_protocol,
#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 AF_INET6
IPv6 Internet addresses.
#define ICMPV6_PACKET_TOO_BIG
ICMPv6 packet too big.
void free_iob(struct io_buffer *iobuf)
Free I/O buffer.
uint32_t type
Operating system type.
#define ICMPV6_DESTINATION_UNREACHABLE
ICMPv6 destination unreachable.
static int icmpv6_rx_echo_reply(struct io_buffer *iobuf, struct net_device *netdev __unused, struct sockaddr_in6 *sin6_src, struct sockaddr_in6 *sin6_dest __unused)
Process received ICMPv6 echo reply packet.
#define EHOSTUNREACH_CODE(code)
#define EPROTO_CODE(code)
#define ENOTSUP
Operation not supported.
#define ICMPV6_ECHO_REPLY
ICMPv6 echo reply.
#define iob_disown(iobuf)
Disown an I/O buffer.
#define __unused
Declare a variable or data structure as unused.
struct tcpip_protocol icmpv6_protocol __tcpip_protocol
ICMPv6 TCP/IP protocol.
static struct net_device * netdev
Transport-network layer interface.
static int icmpv6_rx(struct io_buffer *iobuf, struct net_device *netdev, struct sockaddr_tcpip *st_src, struct sockaddr_tcpip *st_dest, uint16_t pshdr_csum)
Process a received packet.
struct icmp_echo_protocol icmpv6_echo_protocol __icmp_echo_protocol
ICMPv6 echo protocol.
#define ICMPV6_PARAMETER_PROBLEM
ICMPv6 parameter problem.
#define ICMPV6_ECHO_REQUEST
ICMPv6 echo request.
const char * name
Protocol name.
#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.
#define for_each_table_entry(pointer, table)
Iterate through all entries within a linker table.
static struct icmpv6_handler * icmpv6_handler(unsigned int type)
Identify ICMPv6 handler.
A transport-layer protocol of the TCP/IP stack (eg.
struct icmpv6_handler icmpv6_echo_request_handler __icmpv6_handler
ICMPv6 echo request handler.
void * data
Start of data.
FILE_LICENCE(GPL2_OR_LATER_OR_UBDL)
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 ICMPV6_HANDLERS
ICMPv6 handler table.
static int icmpv6_rx_echo_request(struct io_buffer *iobuf, struct net_device *netdev __unused, struct sockaddr_in6 *sin6_src, struct sockaddr_in6 *sin6_dest __unused)
Process received ICMPv6 echo request packet.
#define NULL
NULL pointer (VOID *)
#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.