Lines Matching defs:icmp6

29 /*	$FreeBSD: src/sys/netinet6/icmp6.c,v 1.6.2.6 2001/07/10 09:44:16 ume Exp $	*/
30 /* $KAME: icmp6.c,v 1.211 2001/04/04 05:56:20 itojun Exp $ */
121 #include <netinet/icmp6.h>
279 struct icmp6_hdr *icmp6;
314 * - the Parameter Problem Message that can be allowed an icmp6 error
358 * informational) we must not send icmp6 error.
400 icmp6 = (struct icmp6_hdr *)(nip6 + 1);
401 icmp6->icmp6_type = type;
402 icmp6->icmp6_code = code;
403 icmp6->icmp6_pptr = htonl((u_int32_t)param);
436 struct icmp6_hdr *icmp6, *nicmp6;
452 * Locate icmp6 structure in mbuf, and check
492 icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off);
494 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6));
495 if (icmp6 == NULL) {
500 code = icmp6->icmp6_code;
505 icmp6->icmp6_type, sum, ip6_sprintf(&ip6->ip6_src)));
518 switch (icmp6->icmp6_type) {
527 icmp6stat.icp6s_inhist[icmp6->icmp6_type]++;
529 if (icmp6->icmp6_type < ICMP6_INFOMSG_MASK)
532 switch (icmp6->icmp6_type) {
607 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
653 bcopy(icmp6, nicmp6, sizeof(struct icmp6_hdr));
696 if (icmp6->icmp6_type == MLD_LISTENER_QUERY) /* XXX: ugly... */
701 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
745 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
774 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
797 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
820 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
843 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
866 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
891 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
898 icmp6->icmp6_type, ip6_sprintf(&ip6->ip6_src),
901 if (icmp6->icmp6_type < ICMP6_ECHO_REQUEST) {
911 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
931 if (icmp6_ratelimit(&ip6->ip6_dst, icmp6->icmp6_type, code)) {
952 struct icmp6_hdr *icmp6;
965 icmp6 = (struct icmp6_hdr *)(mtod(m, caddr_t) + off);
967 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off,
968 sizeof(*icmp6) + sizeof(struct ip6_hdr));
969 if (icmp6 == NULL) {
974 eip6 = (struct ip6_hdr *)(icmp6 + 1);
984 int icmp6type = icmp6->icmp6_type;
1115 icmp6 = (struct icmp6_hdr *)(mtod(m, caddr_t) + off);
1117 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off,
1118 sizeof(*icmp6) + sizeof(struct ip6_hdr));
1119 if (icmp6 == NULL) {
1133 eip6 = (struct ip6_hdr *)(icmp6 + 1);
1156 ip6cp.ip6c_icmp6 = icmp6;
1157 ip6cp.ip6c_ip6 = (struct ip6_hdr *)(icmp6 + 1);
1164 notifymtu = ntohl(icmp6->icmp6_mtu);
1189 struct icmp6_hdr *icmp6 = ip6cp->ip6c_icmp6;
1191 u_int mtu = ntohl(icmp6->icmp6_mtu);
2062 struct icmp6_hdr *icmp6;
2068 icmp6 = (struct icmp6_hdr *)((caddr_t)ip6 + off);
2070 IP6_EXTHDR_GET(icmp6, struct icmp6_hdr *, m, off, sizeof(*icmp6));
2071 if (icmp6 == NULL) {
2102 && ICMP6_FILTER_WILLBLOCK(icmp6->icmp6_type,
2164 * OFF points to the icmp6 header, counted from the top of the mbuf.
2172 struct icmp6_hdr *icmp6;
2230 icmp6 = (struct icmp6_hdr *)(ip6 + 1);
2231 type = icmp6->icmp6_type; /* keep type for statistics */
2232 code = icmp6->icmp6_code; /* ditto. */
2327 if (icmp6->icmp6_type == ICMP6_ECHO_REPLY && icmp6->icmp6_code == 0) {
2350 icmp6->icmp6_cksum = 0;
2351 icmp6->icmp6_cksum = in6_cksum(m, IPPROTO_ICMPV6,
2424 * don't update route by icmp6 redirect.
2464 /* ip6->ip6_src must be equal to gw for icmp6->icmp6_reddst */
2555 "(if %d, icmp6 packet %d): %s\n",
2646 * router on this interface, don't send icmp6 redirect.
2823 * compute the maximum size for icmp6 redirect header option.
3080 struct icmp6_hdr *icmp6;
3117 icmp6 = mtod(m, struct icmp6_hdr *);
3123 if ((icmp6->icmp6_type == ICMP6_ECHO_REQUEST && icmp6->icmp6_code == 0) ||
3124 (icmp6->icmp6_type == ICMP6_NI_QUERY &&
3125 (icmp6->icmp6_code == ICMP6_NI_SUBJ_IPV6 ||
3126 icmp6->icmp6_code == ICMP6_NI_SUBJ_FQDN))) {
3253 * Returns 0 if it is okay to send the icmp6 packet.
3254 * Returns 1 if the router SHOULD NOT send this icmp6 packet due to rate