Lines Matching defs:icp

195 	struct icmp *icp;
327 icp = mtod(m, struct icmp *);
329 icp->icmp_type = type;
331 icp->icmp_gwaddr.s_addr = dest;
333 icp->icmp_void = 0;
339 icp->icmp_pptr = code;
343 icp->icmp_nextmtu = htons(mtu);
346 icp->icmp_code = code;
352 m_copydata(n, 0, icmplen, (caddr_t)&icp->icmp_ip);
353 nip = &icp->icmp_ip;
392 struct icmp *icp;
431 icp = mtod(m, struct icmp *);
441 printf("icmp_input, type %d code %d\n", icp->icmp_type,
442 icp->icmp_code);
448 if (icp->icmp_type > ICMP_MAXTYPE)
462 ICMPSTAT_INC(icps_inhist[icp->icmp_type]);
463 code = icp->icmp_code;
464 switch (icp->icmp_type) {
521 if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
522 icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) {
527 if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
531 printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
533 icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
538 i = sizeof(struct ip) + min(icmplen, ICMP_ADVLENPREF(icp));
546 icp = (struct icmp *)(ip + 1);
555 ctlfunc = inetsw[ip_protox[icp->icmp_ip.ip_p]].pr_ctlinput;
558 (void *)&icp->icmp_ip);
573 icp->icmp_type = ICMP_ECHOREPLY;
590 icp->icmp_type = ICMP_TSTAMPREPLY;
591 icp->icmp_rtime = iptime();
592 icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */
622 icp->icmp_type = ICMP_MASKREPLY;
624 icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr;
626 icp->icmp_mask = V_icmpmaskfake;
636 ICMPSTAT_INC(icps_outhist[icp->icmp_type]);
645 dst = ntohl(icp->icmp_ip.ip_dst.s_addr);
646 gw = ntohl(icp->icmp_gwaddr.s_addr);
664 if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
665 icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) {
677 icmpdst.sin_addr = icp->icmp_gwaddr;
684 inet_ntoa_r(icp->icmp_ip.ip_dst, dstbuf),
685 inet_ntoa_r(icp->icmp_gwaddr, gwbuf));
688 icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
920 struct icmp *icp;
925 icp = mtod(m, struct icmp *);
926 icp->icmp_cksum = 0;
927 icp->icmp_cksum = in_cksum(m, ntohs(ip->ip_len) - hlen);