Home
last modified time | relevance | path

Searched refs:iphdr (Results 1 – 25 of 56) sorted by relevance

123

/external/syslinux/core/lwip/src/core/ipv4/
Dip.c160 ip_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp) in ip_forward() argument
190 IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1); in ip_forward()
192 if (IPH_TTL(iphdr) == 0) { in ip_forward()
196 if (IPH_PROTO(iphdr) != IP_PROTO_ICMP) { in ip_forward()
204 if (IPH_CHKSUM(iphdr) >= PP_HTONS(0xffffU - 0x100)) { in ip_forward()
205 IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100) + 1); in ip_forward()
207 IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100)); in ip_forward()
244 struct ip_hdr *iphdr; local
256 iphdr = (struct ip_hdr *)p->payload;
257 if (IPH_V(iphdr) != 4) {
[all …]
Dicmp.c84 struct ip_hdr *iphdr; in icmp_input() local
91 iphdr = (struct ip_hdr *)p->payload; in icmp_input()
92 hlen = IPH_HL(iphdr) * 4; in icmp_input()
168 iphdr = (struct ip_hdr *)r->payload; in icmp_input()
190 ip_addr_copy(iphdr->src, *ip_current_dest_addr()); in icmp_input()
191 ip_addr_copy(iphdr->dest, *ip_current_src_addr()); in icmp_input()
201 IPH_TTL_SET(iphdr, ICMP_TTL); in icmp_input()
202 IPH_CHKSUM_SET(iphdr, 0); in icmp_input()
204 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN)); in icmp_input()
290 struct ip_hdr *iphdr; in icmp_send_response() local
[all …]
Dip_frag.c179 SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN); in ip_reass_free_complete_datagram()
238 if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) { in ip_reass_remove_oldest_datagram()
295 SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN); in ip_reass_enqueue_new_datagram()
524 if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) { in ip_reass()
542 ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) { in ip_reass()
547 SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN); in ip_reass()
577 SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN); in ip_reass()
678 struct ip_hdr *iphdr; in ip_frag() local
706 iphdr = (struct ip_hdr *)rambuf->payload; in ip_frag()
707 SMEMCPY(iphdr, p->payload, IP_HLEN); in ip_frag()
[all …]
Digmp.c392 struct ip_hdr * iphdr; in igmp_input() local
400 iphdr = (struct ip_hdr *)p->payload; in igmp_input()
401 if (pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4)) || (p->len < IGMP_MINLEN)) { in igmp_input()
409 ip_addr_debug_print(IGMP_DEBUG, &(iphdr->src)); in igmp_input()
411 ip_addr_debug_print(IGMP_DEBUG, &(iphdr->dest)); in igmp_input()
/external/syslinux/gpxe/src/net/
Dipv4.c166 struct iphdr *iphdr = iobuf->data; in ipv4_reassemble() local
173 if ( fragbuf->ident == iphdr->ident && in ipv4_reassemble()
174 fragbuf->src.s_addr == iphdr->src.s_addr ) { in ipv4_reassemble()
183 ( iphdr->frags & IP_MASK_OFFSET ) ) { in ipv4_reassemble()
188 iob_pull ( iobuf, sizeof ( *iphdr ) ); in ipv4_reassemble()
195 if ( ! ( iphdr->frags & IP_MASK_MOREFRAGS ) ) { in ipv4_reassemble()
211 if ( iphdr->frags & IP_MASK_MOREFRAGS && in ipv4_reassemble()
212 ( ( iphdr->frags & IP_MASK_OFFSET ) == 0 ) ) { in ipv4_reassemble()
216 fragbuf->ident = iphdr->ident; in ipv4_reassemble()
217 fragbuf->src = iphdr->src; in ipv4_reassemble()
[all …]
/external/syslinux/gpxe/src/core/
Dgdbudp.c62 struct iphdr *iphdr; in gdbudp_recv() local
111 if ( iob_len ( iob ) < sizeof ( *iphdr ) ) { in gdbudp_recv()
114 iphdr = iob->data; in gdbudp_recv()
115 iob_pull ( iob, sizeof ( *iphdr ) ); in gdbudp_recv()
116 if ( iphdr->protocol != IP_UDP || iphdr->dest.s_addr != source_addr.sin_addr.s_addr ) { in gdbudp_recv()
131 dest_addr.sin_addr.s_addr = iphdr->src.s_addr; in gdbudp_recv()
159 struct iphdr *iphdr; in gdbudp_send() local
169 iob = alloc_iob ( sizeof ( *ethhdr ) + sizeof ( *iphdr ) + sizeof ( *udphdr ) + len ); in gdbudp_send()
175 iob_reserve ( iob, sizeof ( *ethhdr ) + sizeof ( *iphdr ) + sizeof ( *udphdr ) ); in gdbudp_send()
186 iphdr = iob_push ( iob, sizeof ( *iphdr ) ); in gdbudp_send()
[all …]
/external/android-clat/
Dtranslate.h46 void fill_ip_header(struct iphdr *ip_targ, uint16_t payload_len, uint8_t protocol,
49 const struct iphdr *old_header);
60 const struct iphdr *old_header);
61 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ);
65 const struct iphdr *old_header);
66 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ);
Ddump.h21 void dump_ip(struct iphdr *header);
23 void dump_udp(const struct udphdr *udp, const struct iphdr *ip,
25 void dump_tcp(const struct tcphdr *tcp, const struct iphdr *ip,
Dclatd_test.cpp179 int is_ipv4_fragment(struct iphdr *ip) { in is_ipv4_fragment()
193 int ipv4_fragment_offset(struct iphdr *ip) { in ipv4_fragment_offset()
209 struct iphdr *ip = (struct iphdr *) packet; in check_packet()
288 struct iphdr *ip = NULL; in reassemble_packet()
304 struct iphdr *ip_orig = (struct iphdr *) packet; in reassemble_packet()
314 ip = (struct iphdr *) reassembled; in reassemble_packet()
402 struct iphdr *ip = (struct iphdr *) packet; in fix_udp_checksum()
519 struct iphdr *ip; in get_transport_checksum()
527 ip = (struct iphdr *) packet; in get_transport_checksum()
745 ASSERT_EQ(sizeof(struct iphdr), sizeof(v4_header)) << "Test IPv4 header: incorrect length\n"; in TEST_F()
[all …]
Dtranslate.c123 void fill_ip_header(struct iphdr *ip, uint16_t payload_len, uint8_t protocol, in fill_ip_header()
126 memset(ip, 0, sizeof(struct iphdr)); in fill_ip_header()
131 ip->tot_len = htons(sizeof(struct iphdr) + payload_len); in fill_ip_header()
158 const struct iphdr *old_header) { in fill_ip6_header()
179 const struct iphdr *old_header) { in maybe_fill_frag_header()
207 uint8_t parse_frag_header(const struct ip6_frag *frag_hdr, struct iphdr *ip_targ) { in parse_frag_header()
500 char iphdr[sizeof(struct ip6_hdr)]; in translate_packet() local
510 { iphdr, 0 }, // IP header. in translate_packet()
Dipv6.c80 struct iphdr *ip_targ = (struct iphdr *) out[pos].iov_base; in ipv6_packet()
123 out[pos].iov_len = sizeof(struct iphdr); in ipv6_packet()
177 ip_targ->check = ip_checksum(ip_targ, sizeof(struct iphdr)); in ipv6_packet()
Dipv4.c58 const struct iphdr *header = (struct iphdr *) packet; in ipv4_packet()
68 if(len < sizeof(struct iphdr)) { in ipv4_packet()
Ddump.c40 void dump_ip(struct iphdr *header) { in dump_ip()
149 void dump_udp(const struct udphdr *udp, const struct iphdr *ip, in dump_udp()
206 void dump_tcp(const struct tcphdr *tcp, const struct iphdr *ip, in dump_tcp()
Dchecksum.h30 uint32_t ipv4_pseudo_header_checksum(const struct iphdr *ip, uint16_t len);
/external/syslinux/core/lwip/src/netif/
Dundiif.c293 struct ip_hdr *iphdr; in snprintf_ip_hdr() local
295 iphdr = (struct ip_hdr *)((void *)ethhdr + 14); in snprintf_ip_hdr()
300 ip4_addr1(&iphdr->src), ip4_addr2(&iphdr->src), in snprintf_ip_hdr()
301 ip4_addr3(&iphdr->src), ip4_addr4(&iphdr->src), in snprintf_ip_hdr()
302 ip4_addr1(&iphdr->dest), ip4_addr2(&iphdr->dest), in snprintf_ip_hdr()
303 ip4_addr3(&iphdr->dest), ip4_addr4(&iphdr->dest), in snprintf_ip_hdr()
304 ntohs(IPH_LEN(iphdr)), ntohs(IPH_ID(iphdr)), in snprintf_ip_hdr()
305 IPH_PROTO(iphdr), ntohs(IPH_CHKSUM(iphdr)), in snprintf_ip_hdr()
306 (IPH_HL(iphdr) << 2), in snprintf_ip_hdr()
317 struct ip_hdr *iphdr; in snprintf_icmp_hdr() local
[all …]
/external/syslinux/core/lwip/src/core/
Dudp.c89 struct ip_hdr *iphdr; local
98 iphdr = (struct ip_hdr *)p->payload;
102 if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
130 ip4_addr1_16(&iphdr->dest), ip4_addr2_16(&iphdr->dest),
131 ip4_addr3_16(&iphdr->dest), ip4_addr4_16(&iphdr->dest), ntohs(udphdr->dest),
132 ip4_addr1_16(&iphdr->src), ip4_addr2_16(&iphdr->src),
133 ip4_addr3_16(&iphdr->src), ip4_addr4_16(&iphdr->src), ntohs(udphdr->src)));
221 if (IPH_PROTO(iphdr) == IP_PROTO_UDPLITE) {
305 pbuf_header(p, (s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
313 pbuf_header(q, -(s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
[all …]
Draw.c79 struct ip_hdr *iphdr; in raw_input() local
85 iphdr = (struct ip_hdr *)p->payload; in raw_input()
86 proto = IPH_PROTO(iphdr); in raw_input()
/external/iputils/
Dping.c100 static void pr_iph(struct iphdr *ip);
788 struct iphdr *ip; in parse_reply()
797 ip = (struct iphdr *)buf; in parse_reply()
807 opts = buf + sizeof(struct iphdr); in parse_reply()
808 optlen = hlen - sizeof(struct iphdr); in parse_reply()
856 struct iphdr * iph = (struct iphdr *)(&icp[1]); in parse_reply()
859 if (cc < 8+sizeof(struct iphdr)+8 || in parse_reply()
929 pr_options(opts, optlen + sizeof(struct iphdr)); in parse_reply()
1049 pr_iph((struct iphdr*)(icp + 1)); in pr_icmph()
1054 pr_iph((struct iphdr*)(icp + 1)); in pr_icmph()
[all …]
/external/iproute2/examples/bpf/
Dbpf_prog.c254 return !!(load_half(skb, nh_off + offsetof(struct iphdr, frag_off)) & in flow_is_frag()
266 *ip_proto = load_byte(skb, nh_off + offsetof(struct iphdr, in flow_parse_ipv4()
269 flow->src = load_word(skb, nh_off + offsetof(struct iphdr, saddr)); in flow_parse_ipv4()
270 flow->dst = load_word(skb, nh_off + offsetof(struct iphdr, daddr)); in flow_parse_ipv4()
/external/iptables/iptables/
Dnft-ipv4.c48 add_proto(r, offsetof(struct iphdr, protocol), 1, in nft_ipv4_add()
54 add_addr(r, offsetof(struct iphdr, saddr), in nft_ipv4_add()
60 add_addr(r, offsetof(struct iphdr, daddr), in nft_ipv4_add()
65 add_payload(r, offsetof(struct iphdr, frag_off), 2, in nft_ipv4_add()
190 case offsetof(struct iphdr, saddr): in nft_ipv4_parse_payload()
203 case offsetof(struct iphdr, daddr): in nft_ipv4_parse_payload()
216 case offsetof(struct iphdr, protocol): in nft_ipv4_parse_payload()
222 case offsetof(struct iphdr, frag_off): in nft_ipv4_parse_payload()
/external/iptables/extensions/
Dlibxt_TCPMSS.c32 __TCPMSS_help(sizeof(struct iphdr)); in TCPMSS_help()
42 .min = 0, .max = UINT16_MAX - sizeof(struct iphdr),
/external/ltp/testcases/network/stress/ns-tools/
Dns-icmpv4_sender.c359 pkt_size = sizeof(struct iphdr) /* IP header */ in create_clean_packet()
367 pkt.hdr.ihl = sizeof(struct iphdr) / 4; in create_clean_packet()
390 sizeof(struct iphdr)); in create_clean_packet()
523 calc_checksum((u_int16_t *) & (pkt->hdr), sizeof(struct iphdr)); in thrust_fakes()
/external/wpa_supplicant_8/src/ap/
Dfils_hlp.c161 struct iphdr *iph; in fils_dhcp_handler()
477 const struct iphdr *iph; in fils_process_hlp_udp()
483 iph = (const struct iphdr *) pos; in fils_process_hlp_udp()
508 const struct iphdr *iph; in fils_process_hlp_ip()
513 iph = (const struct iphdr *) pos; in fils_process_hlp_ip()
/external/syslinux/core/lwip/src/include/ipv4/lwip/
Dip_frag.h57 struct ip_hdr iphdr; member
/external/syslinux/gpxe/src/include/
Dold_tcp.h8 #define TCP_MAX_HEADER ((int)sizeof(struct iphdr)+64)

123