icmp6.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. struct icmp6hdr {
  2. u_int8_t icmp6_type; /* Type field */
  3. u_int8_t icmp6_code; /* Code field */
  4. u_int16_t icmp6_cksum; /* Checksum field */
  5. union {
  6. u_int32_t un_data32[1]; /* Type-specific field */
  7. u_int16_t un_data16[2]; /* Type-specific field */
  8. u_int8_t un_data8[4]; /* Type-specific field */
  9. } icmp6_dataun;
  10. };
  11. #define icmp6_data32 icmp6_dataun.un_data32
  12. #define icmp6_data16 icmp6_dataun.un_data16
  13. #define icmp6_data8 icmp6_dataun.un_data8
  14. #define icmp6_pptr icmp6_data32[0] /* PARAMPROB */
  15. #define icmp6_mtu icmp6_data32[0] /* PKT_TOOBIG */
  16. #define icmp6_id icmp6_data16[0] /* ECHO */
  17. #define icmp6_seq icmp6_data16[1] /* ECHO */
  18. #define icmp6_maxdelay icmp6_data16[0] /* MGM_xxx */
  19. #define ICMPV6_DEST_UNREACH 1
  20. #define ICMPV6_PKT_TOOBIG 2
  21. #define ICMPV6_TIME_EXCEED 3
  22. #define ICMPV6_PARAMPROB 4
  23. #define ICMPV6_INFOMSG_MASK 0x80 /* all informational messages */
  24. #define ICMPV6_ECHORQST 128
  25. #define ICMPV6_ECHORPLY 129
  26. #define ICMPV6_MGM_QUERY 130
  27. #define ICMPV6_MGM_REPORT 131
  28. #define ICMPV6_MGM_REDUCTION 132
  29. #define ICMPV6_DEST_UNREACH_NOROUTE 0 /* no route to destination */
  30. #define ICMPV6_DEST_UNREACH_ADMIN 1 /* communication with destination */
  31. /* administratively prohibited */
  32. #define ICMPV6_DEST_UNREACH_NOTNEIGHBOR 2 /* not a neighbor */
  33. #define ICMPV6_DEST_UNREACH_ADDR 3 /* address unreachable */
  34. #define ICMPV6_DEST_UNREACH_NOPORT 4 /* bad port */
  35. #define ICMPV6_TIME_EXCEED_HOPS 0 /* Hop Limit == 0 in transit */
  36. #define ICMPV6_TIME_EXCEED_REASSEMBLY 1 /* Reassembly time out */
  37. #define ICMPV6_PARAMPROB_HDR 0 /* erroneous header field */
  38. #define ICMPV6_PARAMPROB_NXT_HDR 1 /* unrecognized Next Header */
  39. #define ICMPV6_PARAMPROB_OPTS 2 /* unrecognized IPv6 option */