#include <netinet/icmp6.h>
netinet/icmp6.h
$KAME: icmp6.h,v 1.46 2001/04/27 15:09:48 itojun Exp $
229 macros · 28 structs
#define ICMPV6_PLD_MAXLEN 1232
size 8, align 1 · packed
| u_int8_t | icmp6_type | type field |
| u_int8_t | icmp6_code | code field |
| u_int16_t | icmp6_cksum | checksum field |
| unnamed union at netinet/icmp6.h:107:2 | icmp6_dataun | |
| | u_int32_t[1] | icmp6_un_data32 | type-specific field | | u_int16_t[2] | icmp6_un_data16 | type-specific field | | u_int8_t[4] | icmp6_un_data8 | type-specific field |
|
#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_maxdelay icmp6_data16[0]
mcast group membership
#define ICMP6_DST_UNREACH 1
dest unreachable, codes:
#define ICMP6_PACKET_TOO_BIG 2
packet too big
#define ICMP6_TIME_EXCEEDED 3
time exceeded, code:
#define ICMP6_PARAM_PROB 4
ip6 header bad
#define ICMP6_ECHO_REQUEST 128
echo service
#define ICMP6_ECHO_REPLY 129
echo reply
#define MLD_LISTENER_QUERY 130
multicast listener query
#define MLD_LISTENER_REPORT 131
multicast listener report
#define MLD_LISTENER_DONE 132
multicast listener done
RFC2292 decls
#define ICMP6_MEMBERSHIP_QUERY 130
group membership query
#define ICMP6_MEMBERSHIP_REPORT 131
group membership report
#define ICMP6_MEMBERSHIP_REDUCTION 132
group membership termination
the followings are for backward compatibility to old KAME apps.
#define MLD6_LISTENER_QUERY MLD_LISTENER_QUERY
#define ND_ROUTER_SOLICIT 133
router solicitation
#define ND_ROUTER_ADVERT 134
router advertisement
#define ND_NEIGHBOR_SOLICIT 135
neighbor solicitation
#define ND_NEIGHBOR_ADVERT 136
neighbor advertisement
#define ND_REDIRECT 137
redirect
#define ICMP6_ROUTER_RENUMBERING 138
router renumbering
#define ICMP6_WRUREQUEST 139
who are you request
#define ICMP6_WRUREPLY 140
who are you reply
#define ICMP6_FQDN_QUERY 139
FQDN query
#define ICMP6_FQDN_REPLY 140
FQDN reply
#define ICMP6_NI_QUERY 139
node information request
#define ICMP6_NI_REPLY 140
node information reply
#define MLDV2_LISTENER_REPORT 143
RFC3810 listener report
The definitions below are experimental. TBA
#define MLD_MTRACE_RESP 200
mtrace resp (to sender)
#define MLD_MTRACE 201
mtrace messages
#define ICMP6_MAXTYPE 201
#define ICMP6_DST_UNREACH_NOROUTE 0
no route to destination
#define ICMP6_DST_UNREACH_ADMIN 1
administratively prohibited
#define ICMP6_DST_UNREACH_NOTNEIGHBOR 2
not a neighbor(obsolete)
#define ICMP6_DST_UNREACH_BEYONDSCOPE 2
beyond scope of source address
#define ICMP6_DST_UNREACH_ADDR 3
address unreachable
#define ICMP6_DST_UNREACH_NOPORT 4
port unreachable
#define ICMP6_TIME_EXCEED_TRANSIT 0
ttl==0 in transit
#define ICMP6_TIME_EXCEED_REASSEMBLY 1
ttl==0 in reass
#define ICMP6_PARAMPROB_OPTION 2
unrecognized option
#define ICMP6_PARAMPROB_FIRSTFRAG_INCOMP_HDR 3
first fragment has incomplete IPv6 Header Chain
#define ICMP6_INFOMSG_MASK 0x80
all informational messages
#define ICMP6_NI_SUBJ_IPV6 0
Query Subject is an IPv6 address
#define ICMP6_NI_SUBJ_FQDN 1
Query Subject is a Domain name
#define ICMP6_NI_SUBJ_IPV4 2
Query Subject is an IPv4 address
#define ICMP6_NI_SUCCESS 0
node information successful reply
#define ICMP6_NI_REFUSED 1
node information request is refused
#define ICMP6_NI_UNKNOWN 2
unknown Qtype
#define ICMP6_ROUTER_RENUMBERING_COMMAND 0
rr command
#define ICMP6_ROUTER_RENUMBERING_RESULT 1
rr result
#define ICMP6_ROUTER_RENUMBERING_SEQNUM_RESET 255
rr seq num reset
Used in kernel only
#define ND_REDIRECT_ONLINK 0
redirect to an on-link node
#define ND_REDIRECT_ROUTER 1
redirect to a better router
Multicast Listener Discovery
size 24, align 1 · packed
definitions to provide backward compatibility to old KAME applications
#define mld6_hdr mld_hdr
#define mld6_addr mld_addr
shortcut macro definitions
#define mld_type mld_icmp6_hdr.icmp6_type
#define mld_code mld_icmp6_hdr.icmp6_code
#define mld_cksum mld_icmp6_hdr.icmp6_cksum
#define nd_rs_type nd_rs_hdr.icmp6_type
#define nd_rs_code nd_rs_hdr.icmp6_code
#define nd_rs_cksum nd_rs_hdr.icmp6_cksum
size 16, align 1 · packed
#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_FLAG_MANAGED 0x80
#define ND_RA_FLAG_OTHER 0x40
#define ND_RA_FLAG_HA 0x20
Router preference values based on RFC 4191
#define ND_RA_FLAG_RTPREF_MASK 0x18
00011000
#define ND_RA_FLAG_RTPREF_HIGH 0x08
00001000
#define ND_RA_FLAG_RTPREF_MEDIUM 0x00
00000000
#define ND_RA_FLAG_RTPREF_LOW 0x18
00011000
#define ND_RA_FLAG_RTPREF_RSV 0x10
00010000
size 24, align 1 · packed
#define nd_ns_type nd_ns_hdr.icmp6_type
#define nd_ns_code nd_ns_hdr.icmp6_code
#define nd_ns_cksum nd_ns_hdr.icmp6_cksum
size 24, align 1 · packed
#define nd_na_type nd_na_hdr.icmp6_type
#define nd_na_code nd_na_hdr.icmp6_code
#define nd_na_cksum nd_na_hdr.icmp6_cksum
#define ND_NA_FLAG_ROUTER 0x80
#define ND_NA_FLAG_SOLICITED 0x40
#define ND_NA_FLAG_OVERRIDE 0x20
size 40, align 1 · packed
#define nd_rd_type nd_rd_hdr.icmp6_type
#define nd_rd_code nd_rd_hdr.icmp6_code
#define nd_rd_cksum nd_rd_hdr.icmp6_cksum
#define ND_OPT_SOURCE_LINKADDR 1
#define ND_OPT_TARGET_LINKADDR 2
#define ND_OPT_NONCE 14
RFC 3971
#define ND_OPT_PVD 21
RFC 8801
#define ND_OPT_ROUTE_INFO 24
RFC 4191
#define ND_OPT_RDNSS 25
RFC 6106
#define ND_OPT_DNSSL 31
RFC 6106
#define ND_OPT_CAPTIVE_PORTAL 37
RFC 7710
#define ND_OPT_PREF64 38
RFC 8781
#define ND_OPT_DNR 144
RFC 9463
size 32, align 1 · packed
#define ND_OPT_PI_FLAG_ONLINK 0x80
#define ND_OPT_PI_FLAG_AUTO 0x40
#define ND_OPT_NONCE_LEN ((1 * 8) - 2)
size 24, align 1 · packed
size 16, align 1 · packed
DNR (Discovery of Network-designated Resolvers) RFC 9463
size 11, align 1 · packed
#define ND_OPT_DNR_MIN_LENGTH offsetof(struct nd_opt_dnr, nd_opt_dnr_continuation)
PREF64 (NAT64 prefix) RFC 8781
size 16, align 1 · packed
#define ND_OPT_PREF64_SCALED_LIFETIME_MASK 0xfff8
#define ND_OPT_PREF64_PLC_MASK 0x0007
#define ND_OPT_PREF64_LIFETIME_MAX 65528
#define ND_OPT_PREF64_PLC_32 5
#define ND_OPT_PREF64_PLC_40 4
#define ND_OPT_PREF64_PLC_48 3
#define ND_OPT_PREF64_PLC_56 2
#define ND_OPT_PREF64_PLC_64 1
#define ND_OPT_PREF64_PLC_96 0
PvD (Provisioning Domain) RFC 8801
size 7, align 1 · packed
#define ND_OPT_PVD_MIN_LENGTH offsetof(struct nd_opt_pvd, nd_opt_pvd_id)
#define ND_OPT_PVD_FLAGS_HTTP 0x80
#define ND_OPT_PVD_FLAGS_LEGACY 0x40
#define ND_OPT_PVD_FLAGS_RA 0x20
#define ND_OPT_PVD_DELAY_MASK 0x0f
size 20, align 1 · packed
icmp6 node information
size 16, align 1 · packed
#define ni_type icmp6_ni_hdr.icmp6_type
#define ni_code icmp6_ni_hdr.icmp6_code
#define ni_cksum icmp6_ni_hdr.icmp6_cksum
#define NI_QTYPE_NOOP 0
NOOP
#define NI_QTYPE_SUPTYPES 1
Supported Qtypes
#define NI_QTYPE_FQDN 2
FQDN (draft 04)
#define NI_QTYPE_DNSNAME 2
DNS Name
#define NI_QTYPE_NODEADDR 3
Node Addresses
#define NI_QTYPE_IPV4ADDR 4
IPv4 Addresses
#define NI_SUPTYPE_FLAG_COMPRESS 0x0100
#define NI_FQDN_FLAG_VALIDTTL 0x0100
#define NI_NODEADDR_FLAG_TRUNCATE 0x0100
#define NI_NODEADDR_FLAG_ALL 0x0200
#define NI_NODEADDR_FLAG_COMPAT 0x0400
#define NI_NODEADDR_FLAG_LINKLOCAL 0x0800
#define NI_NODEADDR_FLAG_SITELOCAL 0x1000
#define NI_NODEADDR_FLAG_GLOBAL 0x2000
#define NI_NODEADDR_FLAG_ANYCAST 0x4000
just experimental. not in spec
Router Renumbering. as router-renum-08.txt
size 16, align 1 · packed
#define ICMP6_RR_FLAGS_TEST 0x80
#define ICMP6_RR_FLAGS_REQRESULT 0x40
#define ICMP6_RR_FLAGS_FORCEAPPLY 0x20
#define ICMP6_RR_FLAGS_SPECSITE 0x10
#define ICMP6_RR_FLAGS_PREVDONE 0x08
#define rr_type rr_hdr.icmp6_type
#define rr_code rr_hdr.icmp6_code
#define rr_cksum rr_hdr.icmp6_cksum
size 24, align 1 · packed
#define RPM_PCO_SETGLOBAL 3
size 32, align 1 · packed
#define ICMP6_RR_PCOUSE_RAFLAGS_ONLINK 0x80
#define ICMP6_RR_PCOUSE_RAFLAGS_AUTO 0x40
#define ICMP6_RR_PCOUSE_FLAGS_DECRVLTIME 0x80
#define ICMP6_RR_PCOUSE_FLAGS_DECRPLTIME 0x40
size 24, align 1 · packed
#define ICMP6_RR_RESULT_FLAGS_OOB 0x0200
#define ICMP6_RR_RESULT_FLAGS_FORBIDDEN 0x0100
#define ICMP6_FILTER_SETPASSALL(filterp) memset(filterp, 0xff, sizeof(struct icmp6_filter))
#define ICMP6_FILTER_SETBLOCKALL(filterp) memset(filterp, 0x00, sizeof(struct icmp6_filter))
#define ICMP6_FILTER_SETPASS(type, filterp) (((filterp)->icmp6_filt[(type) >> 5]) |= (1u << ((type) & 31)))
#define ICMP6_FILTER_SETBLOCK(type, filterp) (((filterp)->icmp6_filt[(type) >> 5]) &= ~(1u << ((type) & 31)))
#define ICMP6_FILTER_WILLPASS(type, filterp) ((((filterp)->icmp6_filt[(type) >> 5]) & (1u << ((type) & 31))) != 0)
#define ICMP6_FILTER_WILLBLOCK(type, filterp) ((((filterp)->icmp6_filt[(type) >> 5]) & (1u << ((type) & 31))) == 0)
Variables related to this implementation
of the internet control message protocol version 6.
size 104, align 8
size 4344, align 8
| u_quad_t | icp6s_error | statistics related to icmp6 packets generated # of calls to icmp6_error |
| u_quad_t | icp6s_canterror | no error 'cuz old was icmp |
| u_quad_t | icp6s_toofreq | no error 'cuz rate limitation |
| u_quad_t[256] | icp6s_outhist | |
| u_quad_t | icp6s_badcode | statistics related to input message processed icmp6_code out of range |
| u_quad_t | icp6s_tooshort | packet < sizeof(struct icmp6_hdr) |
| u_quad_t | icp6s_checksum | bad checksum |
| u_quad_t | icp6s_badlen | calculated bound mismatch |
| u_quad_t | icp6s_reflect | number of responses |
| u_quad_t[256] | icp6s_inhist | |
| u_quad_t | icp6s_nd_toomanyopt | too many ND options |
| struct icmp6errstat | icp6s_outerrhist | |
| u_quad_t | icp6s_pmtuchg | path MTU changes |
| u_quad_t | icp6s_nd_badopt | bad ND options |
| u_quad_t | icp6s_badns | bad neighbor solicitation |
| u_quad_t | icp6s_badna | bad neighbor advertisement |
| u_quad_t | icp6s_badrs | bad router advertisement |
| u_quad_t | icp6s_badra | bad router advertisement |
| u_quad_t | icp6s_badredirect | bad redirect message |
| u_quad_t | icp6s_rfc6980_drop | NDP packet dropped based on RFC 6980 |
| u_quad_t | icp6s_badpkttoobig | bad packet too big |
#define icp6s_odst_unreach_noroute icp6s_outerrhist.icp6errs_dst_unreach_noroute
#define icp6s_odst_unreach_admin icp6s_outerrhist.icp6errs_dst_unreach_admin
#define icp6s_odst_unreach_beyondscope icp6s_outerrhist.icp6errs_dst_unreach_beyondscope
#define icp6s_odst_unreach_addr icp6s_outerrhist.icp6errs_dst_unreach_addr
#define icp6s_odst_unreach_noport icp6s_outerrhist.icp6errs_dst_unreach_noport
#define icp6s_opacket_too_big icp6s_outerrhist.icp6errs_packet_too_big
#define icp6s_otime_exceed_transit icp6s_outerrhist.icp6errs_time_exceed_transit
#define icp6s_otime_exceed_reassembly icp6s_outerrhist.icp6errs_time_exceed_reassembly
#define icp6s_oparamprob_option icp6s_outerrhist.icp6errs_paramprob_option
#define icp6s_oredirect icp6s_outerrhist.icp6errs_redirect
#define icp6s_ounknown icp6s_outerrhist.icp6errs_unknown
Names for ICMP sysctl objects
#define ICMPV6CTL_STATS 1
#define ICMPV6CTL_REDIRACCEPT 2
accept/process redirects
#define ICMPV6CTL_REDIRTIMEOUT 3
redirect cache time
#define ICMPV6CTL_ND6_PRUNE 6
#define ICMPV6CTL_ND6_DELAY 8
#define ICMPV6CTL_ND6_UMAXTRIES 9
#define ICMPV6CTL_ND6_MMAXTRIES 10
#define ICMPV6CTL_ND6_USELOOPBACK 11
#define ICMPV6CTL_ND6_PROXYALL 12 obsoleted, do not reuse here
#define ICMPV6CTL_NODEINFO 13
#define ICMPV6CTL_ERRPPSLIMIT 14
ICMPv6 error pps limitation
#define ICMPV6CTL_ND6_MAXNUDHINT 15
#define ICMPV6CTL_MTUDISC_HIWAT 16
#define ICMPV6CTL_MTUDISC_LOWAT 17
#define ICMPV6CTL_ND6_DEBUG 18
#define ICMPV6CTL_ND6_DRLIST 19
#define ICMPV6CTL_ND6_PRLIST 20
#define ICMPV6CTL_MLD_MAXSRCFILTER 21
#define ICMPV6CTL_MLD_SOMAXSRC 22
#define ICMPV6CTL_MLD_VERSION 23
#define ICMPV6CTL_ND6_MAXQLEN 24
#define ICMPV6CTL_ND6_ACCEPT_6TO4 25
#define ICMPV6CTL_ND6_OPTIMISTIC_DAD 26
RFC 4429
#define ICMPV6CTL_ERRPPSLIMIT_RANDOM_INCR 27
#define ICMPV6CTL_ND6_RTILIST 28
#define ICMPV6CTL_MAXID 29