You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

icmpv6.h 1.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. #ifndef _IPXE_ICMP6_H
  2. #define _IPXE_ICMP6_H
  3. /** @file
  4. *
  5. * ICMPv6 protocol
  6. *
  7. */
  8. FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
  9. #include <stdint.h>
  10. #include <ipxe/tables.h>
  11. #include <ipxe/iobuf.h>
  12. #include <ipxe/netdevice.h>
  13. #include <ipxe/icmp.h>
  14. /** An ICMPv6 handler */
  15. struct icmpv6_handler {
  16. /** Type */
  17. unsigned int type;
  18. /** Process received packet
  19. *
  20. * @v iobuf I/O buffer
  21. * @v netdev Network device
  22. * @v sin6_src Source socket address
  23. * @v sin6_dest Destination socket address
  24. * @ret rc Return status code
  25. *
  26. * This function takes ownership of the I/O buffer.
  27. */
  28. int ( * rx ) ( struct io_buffer *iobuf, struct net_device *netdev,
  29. struct sockaddr_in6 *sin6_src,
  30. struct sockaddr_in6 *sin6_dest );
  31. };
  32. /** ICMPv6 handler table */
  33. #define ICMPV6_HANDLERS __table ( struct icmpv6_handler, "icmpv6_handlers" )
  34. /** Declare an ICMPv6 handler */
  35. #define __icmpv6_handler __table_entry ( ICMPV6_HANDLERS, 01 )
  36. /** ICMPv6 destination unreachable */
  37. #define ICMPV6_DESTINATION_UNREACHABLE 1
  38. /** ICMPv6 packet too big */
  39. #define ICMPV6_PACKET_TOO_BIG 2
  40. /** ICMPv6 time exceeded */
  41. #define ICMPV6_TIME_EXCEEDED 3
  42. /** ICMPv6 parameter problem */
  43. #define ICMPV6_PARAMETER_PROBLEM 4
  44. /** ICMPv6 echo request */
  45. #define ICMPV6_ECHO_REQUEST 128
  46. /** ICMPv6 echo reply */
  47. #define ICMPV6_ECHO_REPLY 129
  48. /** ICMPv6 router solicitation */
  49. #define ICMPV6_ROUTER_SOLICITATION 133
  50. /** ICMPv6 router advertisement */
  51. #define ICMPV6_ROUTER_ADVERTISEMENT 134
  52. /** ICMPv6 neighbour solicitation */
  53. #define ICMPV6_NEIGHBOUR_SOLICITATION 135
  54. /** ICMPv6 neighbour advertisement */
  55. #define ICMPV6_NEIGHBOUR_ADVERTISEMENT 136
  56. extern struct tcpip_protocol icmpv6_protocol __tcpip_protocol;
  57. #endif /* _IPXE_ICMP6_H */