Lines Matching refs:icp

202 	struct icmp *icp;
257 icp = mtod(m, struct icmp *);
261 icp->icmp_type = type;
263 icp->icmp_gwaddr.s_addr = dest;
265 icp->icmp_void = 0;
271 icp->icmp_pptr = code;
275 icp->icmp_nextmtu = htons(nextmtu);
279 icp->icmp_code = code;
280 m_copydata(n, 0, icmplen, (caddr_t)&icp->icmp_ip);
281 nip = &icp->icmp_ip;
325 struct icmp *icp;
365 icp = mtod(m, struct icmp *);
375 printf("icmp_input, type %d code %d\n", icp->icmp_type,
376 icp->icmp_code);
382 if (icp->icmp_type > ICMP_MAXTYPE)
384 icmpstat.icps_inhist[icp->icmp_type]++;
385 code = icp->icmp_code;
386 switch (icp->icmp_type) {
447 if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
448 IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
454 NTOHS(icp->icmp_ip.ip_len);
458 if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
462 printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
464 icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
470 ctlfunc = ip_protox[icp->icmp_ip.ip_p]->pr_ctlinput;
473 (void *)&icp->icmp_ip);
486 icp->icmp_type = ICMP_ECHOREPLY;
508 icp->icmp_type = ICMP_TSTAMPREPLY;
509 icp->icmp_rtime = iptime();
510 icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */
548 icp->icmp_type = ICMP_MASKREPLY;
549 icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr;
561 icmpstat.icps_outhist[icp->icmp_type]++;
570 dst = ntohl(icp->icmp_ip.ip_dst.s_addr);
571 gw = ntohl(icp->icmp_gwaddr.s_addr);
585 if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
586 IP_VHL_HL(icp->icmp_ip.ip_vhl) < (sizeof(struct ip) >> 2)) {
598 icmpdst.sin_addr = icp->icmp_gwaddr;
604 inet_ntop(AF_INET, &icp->icmp_ip.ip_dst, buf, sizeof(buf)),
605 inet_ntop(AF_INET, &icp->icmp_gwaddr, ipv4str,
609 icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
812 struct icmp *icp;
825 icp = mtod(m, struct icmp *);
826 icp->icmp_cksum = 0;
827 icp->icmp_cksum = in_cksum(m, ip->ip_len - hlen);
1091 struct icmp *icp;
1148 icp = (struct icmp *)(void *)(((char *)m->m_data) + hlen);
1154 icp = mtod(m, struct icmp *);
1159 if (icp->icmp_code != 0)
1161 switch (icp->icmp_type) {