Lines Matching defs:iph

452     struct ip_hdr *iph;
465 iph = (/* UNCONST */ struct ip_hdr *)ip_current_header();
480 IPH_TTL(iph)));
482 ttl = IPH_TTL(iph);
503 df = (IPH_OFFSET(iph) & PP_HTONS(IP_DF)) != 0;
525 memcpy(&iph_orig, iph, iphlen);
528 ip4_addr_set_u32(&iph->dest, pcb->peer.sin.sin_addr.s_addr);
532 ip4_addr_set_u32(&iph->src, g_proxy_options->src4->sin_addr.s_addr);
536 ip_addr_set_any(&iph->src);
539 IPH_TTL_SET(iph, ttl); /* already decremented */
540 IPH_ID_SET(iph, 0); /* kernel will set one */
543 IPH_OFFSET_SET(iph, ntohs(IPH_OFFSET(iph)));
544 IPH_LEN_SET(iph, ntohs(IPH_LEN(iph)));
547 IPH_CHKSUM_SET(iph, sum);
549 IPH_CHKSUM_SET(iph, 0); /* kernel will recalculate */
591 tos = IPH_TOS(iph);
620 memcpy(iph, &iph_orig, iphlen);
674 struct ip6_hdr *iph;
681 iph = (/* UNCONST */ struct ip6_hdr *)ip6_current_header();
701 IP6H_HOPLIM(iph)));
703 hopl = IP6H_HOPLIM(iph);
1139 struct ip_hdr *iph;
1162 iph = (struct ip_hdr *)pollmgr_udpbuf;
1165 if (IPH_V(iph) != 4) {
1166 DPRINTF2(("%s: unexpected IP version %d\n", __func__, IPH_V(iph)));
1171 ipoff = IPH_OFFSET(iph);
1175 IPH_OFFSET_SET(iph, ipoff);
1184 if (IPH_HL(iph) * 4 != IP_HLEN) {
1186 __func__, IPH_HL(iph) * 4));
1190 if (IPH_PROTO(iph) != IP_PROTO_ICMP) {
1191 DPRINTF2(("%s: unexpected protocol %d\n", __func__, IPH_PROTO(iph)));
1195 iplen = IPH_LEN(iph);
1203 IPH_LEN_SET(iph, htons(iplen));
1240 struct ip_hdr *iph;
1250 iph = (struct ip_hdr *)pollmgr_udpbuf;
1263 ip_addr_copy(target_ip, iph->src);
1268 if (mapped == PXREMAP_ASIS && IPH_TTL(iph) == 1) {
1301 oipsum = IPH_CHKSUM(iph);
1304 ip_addr_copy(iph->dest, guest_ip);
1306 ip_addr_copy(iph->src, target_ip);
1309 IPH_TTL_SET(iph, IPH_TTL(iph) - 1);
1311 IPH_CHKSUM_SET(iph, inet_chksum(iph, ntohs(IPH_LEN(iph))));
1315 sum += chksum_update_32((u32_t *)&iph->dest,
1318 sum += chksum_update_32((u32_t *)&iph->src,
1322 IPH_TTL_SET(iph, IPH_TTL(iph) - 1);
1326 IPH_CHKSUM_SET(iph, ~sum);
1341 struct ip_hdr *iph, *oiph;
1351 iph = (struct ip_hdr *)pollmgr_udpbuf;
1450 ip_addr_copy(error_ip, iph->src); /* node that reports the error */
1455 if (error_mapped == PXREMAP_ASIS && IPH_TTL(iph) == 1) {
1480 sum = (u16_t)~IPH_CHKSUM(iph);
1481 sum += chksum_update_32((u32_t *)&iph->dest, ip4_addr_get_u32(&guest_ip));
1483 sum += chksum_update_32((u32_t *)&iph->src, ip4_addr_get_u32(&error_ip));
1486 IPH_TTL_SET(iph, IPH_TTL(iph) - 1);
1490 IPH_CHKSUM_SET(iph, ~sum);