/* ****************************************************************************** * HEADER FILE * * Document no: @(#) $Name: VXWORKS_ITER40_2019102207 $ $RCSfile: icmp6.h,v $ $Revision: 1.3 $ * $Source: /home/interpeak/CVSRoot/ipxinc/include/netinet/icmp6.h,v $ * $Author: lob $ $Date: 2006-04-10 11:03:29 $ * $State: Exp $ $Locker: $ * * INTERPEAK_COPYRIGHT_STRING * Design and implementation by Lennart Bang ****************************************************************************** */ #ifndef IP_NETINET_ICMP6_H #define IP_NETINET_ICMP6_H /* **************************************************************************** * 1 DESCRIPTION **************************************************************************** */ /* **************************************************************************** * 2 CONFIGURATION **************************************************************************** */ #include "ipcom_config.h" /* **************************************************************************** * 3 INCLUDE FILES **************************************************************************** */ #include "string.h" #include "sys/types.h" #include "netinet/in.h" #ifdef __cplusplus extern "C" { #endif /* **************************************************************************** * 4 DEFINES **************************************************************************** */ #define ICMP6_DST_UNREACH 1 #define ICMP6_PACKET_TOO_BIG 2 #define ICMP6_TIME_EXCEEDED 3 #define ICMP6_PARAM_PROB 4 #define ICMP6_ECHO_REQUEST 128 #define ICMP6_ECHO_REPLY 129 #define ICMP6_MEMBERSHIP_QUERY 130 #define ICMP6_MEMBERSHIP_REPORT 131 #define ICMP6_MEMBERSHIP_REDUCTION 132 #define ND_ROUTER_SOLICIT 133 #define ND_ROUTER_ADVERT 134 #define ND_NEIGHBOR_SOLICIT 135 #define ND_NEIGHBOR_ADVERT 136 #define ND_REDIRECT 137 #define ND_OPT_SOURCE_LINKADDR 1 #define ND_OPT_TARGET_LINKADDR 2 #define ND_OPT_PREFIX_INFORMATION 3 #define ND_OPT_REDIRECTED_HEADER 4 #define ND_OPT_MTU 5 #define ND_RA_FLAG_MANAGED 0x80 #define ND_RA_FLAG_OTHER 0x40 /* **************************************************************************** * 5 TYPES **************************************************************************** */ struct icmp6_hdr { Ip_u8 icmp6_type; /* type field */ Ip_u8 icmp6_code; /* code field */ Ip_u16 icmp6_cksum; /* checksum field */ union { Ip_u32 icmp6_un_data32[1]; /* type-specific field */ Ip_u16 icmp6_un_data16[2]; /* type-specific field */ Ip_u8 icmp6_un_data8[4]; /* type-specific field */ } icmp6_dataun; }; #define icmp6_data32 icmp6_dataun.icmp6_un_data32 #define icmp6_data16 icmp6_dataun.icmp6_un_data16 #define icmp6_data8 icmp6_dataun.icmp6_un_data8 #define icmp6_pptr icmp6_data32[0] #define icmp6_mtu icmp6_data32[0] #define icmp6_id icmp6_data16[0] #define icmp6_seq icmp6_data16[1] #define icmp6_maxdelay icmp6_data16[0] struct nd_redirect { struct icmp6_hdr nd_rd_hdr; struct in6_addr nd_rd_target; struct in6_addr nd_rd_dst; /* options */ }; struct nd_router_advert { struct icmp6_hdr nd_ra_hdr; Ip_u32 nd_ra_reachable; Ip_u32 nd_ra_retransmit; /* options */ }; #define nd_ra_type nd_ra_hdr.icmp6_type #define nd_ra_code nd_ra_hdr.icmp6_code #define nd_ra_cksum nd_ra_hdr.icmp6_cksum #define nd_ra_curhoplimit nd_ra_hdr.icmp6_data8[0] #define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] #define nd_ra_flags_reserved nd_ra_hdr.icmp6_data8[1] #define ND_RA_FLAG_MANAGED 0x80 #define ND_RA_FLAG_OTHER 0x40 #define ND_RA_FLAG_HOME_AGENT 0x20 #define nd_ra_router_lifetime nd_ra_hdr.icmp6_data16[1] struct nd_neighbor_advert { struct icmp6_hdr nd_na_hdr; struct in6_addr nd_na_target; /* options */ }; struct nd_opt_hdr { Ip_u8 nd_opt_type; Ip_u8 nd_opt_len; Ip_u8 nd_opt_data[1]; }; /* Prefix Extension Header Options */ struct nd_opt_prefix_info { Ip_u8 nd_opt_pi_type; Ip_u8 nd_opt_pi_len; Ip_u8 nd_opt_pi_prefix_len; Ip_u8 nd_opt_pi_flags_reserved; Ip_u32 nd_opt_pi_valid_time; Ip_u32 nd_opt_pi_preferred_time; Ip_u32 nd_opt_pi_reserved2; struct Ip_in6_addr nd_opt_pi_prefix; }; #define ND_OPT_PI_FLAG_ONLINK 0x80 #define ND_OPT_PI_FLAG_AUTO 0x40 #define ND_OPT_PI_FLAG_RADDR 0x20 struct icmp6_filter { Ip_u32 icmp6_filt[8]; /* 8*32 = 256 bits */ }; #define ICMP6_FILTER_SETBLOCKALL IP_ICMP6_FILTER_SETBLOCKALL #define ICMP6_FILTER_SETPASS IP_ICMP6_FILTER_SETPASS #define ICMP6_FILTER_SETPASS IP_ICMP6_FILTER_SETPASS /* **************************************************************************** * 6 FUNCTIONS **************************************************************************** */ #ifdef __cplusplus } #endif #endif /* **************************************************************************** * END OF FILE **************************************************************************** */