Lines Matching defs:icp

213 	struct icmp *icp;
346 icp = mtod(m, struct icmp *);
348 icp->icmp_type = type;
350 icp->icmp_gwaddr.s_addr = dest;
352 icp->icmp_void = 0;
358 icp->icmp_pptr = code;
362 icp->icmp_nextmtu = htons(mtu);
365 icp->icmp_code = code;
371 m_copydata(n, 0, icmplen, (caddr_t)&icp->icmp_ip);
372 nip = &icp->icmp_ip;
406 icmp_errmap(const struct icmp *icp)
409 switch (icp->icmp_type) {
411 switch (icp->icmp_code) {
435 switch (icp->icmp_code) {
442 switch (icp->icmp_code) {
460 struct icmp *icp;
500 icp = mtod(m, struct icmp *);
510 printf("icmp_input, type %d code %d\n", icp->icmp_type,
511 icp->icmp_code);
517 if (icp->icmp_type > ICMP_MAXTYPE)
531 ICMPSTAT_INC2(icps_inhist, icp->icmp_type);
532 code = icp->icmp_code;
533 switch (icp->icmp_type) {
554 if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
555 icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) {
560 if (IN_MULTICAST(ntohl(icp->icmp_ip.ip_dst.s_addr)))
563 if (icp->icmp_ip.ip_dst.s_addr == INADDR_ANY ||
564 icp->icmp_ip.ip_src.s_addr == INADDR_ANY)
568 printf("deliver to protocol %d\n", icp->icmp_ip.ip_p);
574 i = sizeof(struct ip) + min(icmplen, ICMP_ADVLENPREF(icp));
582 icp = (struct icmp *)(ip + 1);
591 if (ip_ctlprotox[icp->icmp_ip.ip_p] != NULL)
592 ip_ctlprotox[icp->icmp_ip.ip_p](icp);
607 icp->icmp_type = ICMP_ECHOREPLY;
624 icp->icmp_type = ICMP_TSTAMPREPLY;
625 icp->icmp_rtime = iptime();
626 icp->icmp_ttime = icp->icmp_rtime; /* bogus, do later! */
653 icp->icmp_type = ICMP_MASKREPLY;
655 icp->icmp_mask = ia->ia_sockmask.sin_addr.s_addr;
657 icp->icmp_mask = V_icmpmaskfake;
666 ICMPSTAT_INC2(icps_outhist, icp->icmp_type);
675 dst = ntohl(icp->icmp_ip.ip_dst.s_addr);
676 gw = ntohl(icp->icmp_gwaddr.s_addr);
694 if (icmplen < ICMP_ADVLENMIN || icmplen < ICMP_ADVLEN(icp) ||
695 icp->icmp_ip.ip_hl < (sizeof(struct ip) >> 2)) {
707 icmpdst.sin_addr = icp->icmp_gwaddr;
714 inet_ntoa_r(icp->icmp_ip.ip_dst, dstbuf),
715 inet_ntoa_r(icp->icmp_gwaddr, gwbuf));
718 icmpsrc.sin_addr = icp->icmp_ip.ip_dst;
1011 struct icmp *icp;
1016 icp = mtod(m, struct icmp *);
1017 icp->icmp_cksum = 0;
1018 icp->icmp_cksum = in_cksum(m, ntohs(ip->ip_len) - hlen);