2
0
mirror of https://github.com/xcat2/xNBA.git synced 2026-06-18 09:30:53 +00:00
Files
xNBA/src/include/ipxe/icmpv6.h
T
Michael Brown 5c2ffc26cc [icmp] Add support for sending ICMP echo requests
Merge common functionality between IPv4 and IPv6 ICMP echo handling,
and add support for transmitting ICMP echo requests and delivering
ICMP echo replies to a (not yet implemented) ping_rx() function.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
2013-10-21 15:08:12 +01:00

58 lines
1.3 KiB
C

#ifndef _IPXE_ICMP6_H
#define _IPXE_ICMP6_H
/** @file
*
* ICMPv6 protocol
*
*/
FILE_LICENCE ( GPL2_OR_LATER );
#include <stdint.h>
#include <ipxe/tables.h>
#include <ipxe/iobuf.h>
#include <ipxe/netdevice.h>
#include <ipxe/icmp.h>
/** An ICMPv6 handler */
struct icmpv6_handler {
/** Type */
unsigned int type;
/** Process received packet
*
* @v iobuf I/O buffer
* @v netdev Network device
* @v sin6_src Source socket address
* @v sin6_dest Destination socket address
* @ret rc Return status code
*
* This function takes ownership of the I/O buffer.
*/
int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev,
struct sockaddr_in6 *sin6_src,
struct sockaddr_in6 *sin6_dest );
};
/** ICMPv6 handler table */
#define ICMPV6_HANDLERS __table ( struct icmpv6_handler, "icmpv6_handlers" )
/** Declare an ICMPv6 handler */
#define __icmpv6_handler __table_entry ( ICMPV6_HANDLERS, 01 )
/** ICMPv6 echo request */
#define ICMPV6_ECHO_REQUEST 128
/** ICMPv6 echo reply */
#define ICMPV6_ECHO_REPLY 129
/** ICMPv6 neighbour solicitation */
#define ICMPV6_NDP_NEIGHBOUR_SOLICITATION 135
/** ICMPv6 neighbour advertisement */
#define ICMPV6_NDP_NEIGHBOUR_ADVERTISEMENT 136
extern struct tcpip_protocol icmpv6_protocol __tcpip_protocol;
#endif /* _IPXE_ICMP6_H */