Lines Matching defs:icp

212 	register struct icmp *icp;
298 icp = mtod(m, struct icmp *);
300 icp->icmp_type = type;
302 icp->icmp_gwaddr.s_addr = dest;
304 icp->icmp_void = 0;
310 icp->icmp_pptr = code;
314 icp->icmp_nextmtu = htons(mtu);
317 icp->icmp_code = code;
323 m_copydata(n, 0, icmplen, (caddr_t)&icp->icmp_ip);
324 nip = &icp->icmp_ip;
359 struct icmp *icp;
393 icp = mtod(m, struct icmp *);
405 switch (icp->icmp_type) {
416 printf("icmp_input, type %d code %d\n", icp->icmp_type,
417 icp->icmp_code);
423 if (icp->icmp_type > ICMP_MAXTYPE)
437 ICMPSTAT_INC(icps_inhist[icp->icmp_type]);
438 code = icp->icmp_code;
439 switch (icp->icmp_type) {
500 if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
501 icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) {
505 icp->icmp_ip.ip_len = ntohs(icp->icmp_ip.ip_len);
507 if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
511 printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
513 icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
518 ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
521 (void *)&icp->icmp_ip);
534 icp->icmp_type = ICMP_ECHOREPLY;
550 icp->icmp_type = ICMP_TSTAMPREPLY;
551 icp->icmp_rtime = iptime();
552 icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */
585 icp->icmp_type = ICMP_MASKREPLY;
587 icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr;
589 icp->icmp_mask = V_icmpmaskfake;
600 ICMPSTAT_INC(icps_outhist[icp->icmp_type]);
609 dst = ntohl(icp->icmp_ip.ip_dst.s_addr);
610 gw = ntohl(icp->icmp_gwaddr.s_addr);
628 if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
629 icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) {
641 icmpdst.sin_addr = icp->icmp_gwaddr;
645 strcpy(buf, inet_ntoa(icp->icmp_ip.ip_dst));
648 buf, inet_ntoa(icp->icmp_gwaddr));
651 icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
897 register struct icmp *icp;
902 icp = mtod(m, struct icmp *);
903 icp->icmp_cksum = 0;
904 icp->icmp_cksum = in_cksum(m, ip->ip_len - hlen);