Home
last modified time | relevance | path

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

12

/components/net/lwip/lwip-1.4.1/src/core/ipv6/
A Dip6.c158 struct ip_hdr *iphdr; in ip_input() local
172 iphdr = p->payload; in ip_input()
175 if (iphdr->v != 6) { in ip_input()
264 struct ip_hdr *iphdr; in ip_output_if() local
277 iphdr = p->payload; in ip_output_if()
282 iphdr->hoplim = ttl; in ip_output_if()
287 iphdr->v = 6; in ip_output_if()
361 iphdr->v, in ip_debug_print()
362 iphdr->tclass1, iphdr->tclass2, in ip_debug_print()
363 iphdr->flow1, iphdr->flow2)); in ip_debug_print()
[all …]
A Dicmp6.c51 struct ip_hdr *iphdr; in icmp_input() local
72 iphdr = (struct ip_hdr *)((u8_t *)p->payload - IP_HLEN); in icmp_input()
79 ip_addr_set(&tmpaddr, &(iphdr->src)); in icmp_input()
80 ip_addr_set(&(iphdr->src), &(iphdr->dest)); in icmp_input()
81 ip_addr_set(&(iphdr->dest), &tmpaddr); in icmp_input()
93 ip_output_if (p, &(iphdr->src), IP_HDRINCL, in icmp_input()
94 iphdr->hoplim, IP_PROTO_ICMP, inp); in icmp_input()
109 struct ip_hdr *iphdr; in icmp_dest_unreach() local
123 iphdr = p->payload; in icmp_dest_unreach()
145 struct ip_hdr *iphdr; in icmp_time_exceeded() local
[all …]
/components/net/lwip/lwip-1.4.1/src/core/ipv4/
A Dip.c239 IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1); in ip_forward()
241 if (IPH_TTL(iphdr) == 0) { in ip_forward()
254 IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100) + 1); in ip_forward()
256 IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100)); in ip_forward()
307 struct ip_hdr *iphdr; local
325 if (IPH_V(iphdr) != 4) {
530 …ntohs(IPH_ID(iphdr)), p->tot_len, ntohs(IPH_LEN(iphdr)), !!(IPH_OFFSET(iphdr) & PP_HTONS(IP_MF)), …
574 current_header = iphdr;
687 struct ip_hdr *iphdr; local
768 chk_sum += iphdr->_id;
[all …]
A 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()
205 IPH_TTL_SET(iphdr, ICMP_TTL); in icmp_input()
206 IPH_CHKSUM_SET(iphdr, 0); in icmp_input()
208 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN)); in icmp_input()
294 struct ip_hdr *iphdr; in icmp_send_response() local
309 iphdr = (struct ip_hdr *)p->payload; in icmp_send_response()
311 ip_addr_debug_print(ICMP_DEBUG, &(iphdr->src)); in icmp_send_response()
[all …]
A Dip_frag.c295 SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN); in ip_reass_enqueue_new_datagram()
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()
710 iphdr = original_iphdr; in ip_frag()
714 tmp = ntohs(IPH_OFFSET(iphdr)); in ip_frag()
752 iphdr = rambuf->payload; in ip_frag()
811 IPH_OFFSET_SET(iphdr, htons(tmp)); in ip_frag()
813 IPH_CHKSUM_SET(iphdr, 0); in ip_frag()
[all …]
/components/net/lwip/lwip-2.0.3/src/core/ipv4/
A Dip4.c306 IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1); in ip4_forward()
308 if (IPH_TTL(iphdr) == 0) { in ip4_forward()
321 IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100) + 1); in ip4_forward()
323 IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100)); in ip4_forward()
376 struct ip_hdr *iphdr; local
389 if (IPH_V(iphdr) != 4) {
616 …hs(IPH_ID(iphdr)), p->tot_len, lwip_ntohs(IPH_LEN(iphdr)), (u16_t)!!(IPH_OFFSET(iphdr) & PP_HTONS(…
704 p->payload = iphdr;
813 struct ip_hdr *iphdr; local
892 chk_sum += iphdr->_id;
[all …]
A Dicmp.c205 struct ip_hdr *iphdr = (struct ip_hdr*)p->payload; in icmp_input() local
206 ip4_addr_copy(iphdr->src, *src); in icmp_input()
228 IPH_TTL_SET(iphdr, ICMP_TTL); in icmp_input()
229 IPH_CHKSUM_SET(iphdr, 0); in icmp_input()
232 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, hlen)); in icmp_input()
336 struct ip_hdr *iphdr; in icmp_send_response() local
356 iphdr = (struct ip_hdr *)p->payload; in icmp_send_response()
358 ip4_addr_debug_print_val(ICMP_DEBUG, iphdr->src); in icmp_send_response()
360 ip4_addr_debug_print_val(ICMP_DEBUG, iphdr->dest); in icmp_send_response()
373 ip4_addr_copy(iphdr_src, iphdr->src); in icmp_send_response()
[all …]
A Dip4_frag.c185 SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN); in ip_reass_free_complete_datagram()
308 SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN); in ip_reass_enqueue_new_datagram()
568 SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN); in ip4_reass()
616 SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN); in ip4_reass()
727 struct ip_hdr *iphdr; in ip4_frag() local
736 iphdr = original_iphdr; in ip4_frag()
740 tmp = lwip_ntohs(IPH_OFFSET(iphdr)); in ip4_frag()
765 iphdr = (struct ip_hdr*)rambuf->payload; in ip4_frag()
830 IPH_OFFSET_SET(iphdr, lwip_htons(tmp)); in ip4_frag()
832 IPH_CHKSUM_SET(iphdr, 0); in ip4_frag()
[all …]
/components/net/lwip/lwip-2.1.2/src/core/ipv4/
A Dip4.c319 IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1); in ip4_forward()
321 if (IPH_TTL(iphdr) == 0) { in ip4_forward()
334 IPH_CHKSUM_SET(iphdr, (u16_t)(IPH_CHKSUM(iphdr) + PP_HTONS(0x100) + 1)); in ip4_forward()
336 IPH_CHKSUM_SET(iphdr, (u16_t)(IPH_CHKSUM(iphdr) + PP_HTONS(0x100))); in ip4_forward()
428 const struct ip_hdr *iphdr; local
446 if (IPH_V(iphdr) != 4) {
640 …hs(IPH_ID(iphdr)), p->tot_len, lwip_ntohs(IPH_LEN(iphdr)), (u16_t)!!(IPH_OFFSET(iphdr) & PP_HTONS(…
845 struct ip_hdr *iphdr; local
927 chk_sum += iphdr->_len;
932 chk_sum += iphdr->_id;
[all …]
A Dicmp.c212 struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; in icmp_input() local
213 ip4_addr_copy(iphdr->src, *src); in icmp_input()
235 IPH_TTL_SET(iphdr, ICMP_TTL); in icmp_input()
236 IPH_CHKSUM_SET(iphdr, 0); in icmp_input()
239 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, hlen)); in icmp_input()
343 struct ip_hdr *iphdr; in icmp_send_response() local
363 iphdr = (struct ip_hdr *)p->payload; in icmp_send_response()
365 ip4_addr_debug_print_val(ICMP_DEBUG, iphdr->src); in icmp_send_response()
367 ip4_addr_debug_print_val(ICMP_DEBUG, iphdr->dest); in icmp_send_response()
380 ip4_addr_copy(iphdr_src, iphdr->src); in icmp_send_response()
[all …]
A Dip4_frag.c185 SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN); in ip_reass_free_complete_datagram()
308 SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN); in ip_reass_enqueue_new_datagram()
580 SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN); in ip4_reass()
628 SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN); in ip4_reass()
749 struct ip_hdr *iphdr; in ip4_frag() local
759 iphdr = original_iphdr; in ip4_frag()
760 if (IPH_HL_BYTES(iphdr) != IP_HLEN) { in ip4_frag()
767 tmp = lwip_ntohs(IPH_OFFSET(iphdr)); in ip4_frag()
860 IPH_OFFSET_SET(iphdr, lwip_htons(tmp)); in ip4_frag()
862 IPH_CHKSUM_SET(iphdr, 0); in ip4_frag()
[all …]
/components/net/lwip/lwip-2.1.2/test/unit/ip4/
A Dtest_ip4.c29 struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; in create_ip4_input_fragment() local
30 IPH_VHL_SET(iphdr, 4, sizeof(struct ip_hdr) / 4); in create_ip4_input_fragment()
31 IPH_TOS_SET(iphdr, 0); in create_ip4_input_fragment()
32 IPH_LEN_SET(iphdr, lwip_htons(p->tot_len)); in create_ip4_input_fragment()
33 IPH_ID_SET(iphdr, lwip_htons(ip_id)); in create_ip4_input_fragment()
35 IPH_OFFSET_SET(iphdr, lwip_htons(start / 8)); in create_ip4_input_fragment()
39 IPH_TTL_SET(iphdr, 5); in create_ip4_input_fragment()
40 IPH_PROTO_SET(iphdr, IP_PROTO_UDP); in create_ip4_input_fragment()
41 IPH_CHKSUM_SET(iphdr, 0); in create_ip4_input_fragment()
43 iphdr->src.addr = lwip_htonl(lwip_htonl(iphdr->src.addr) + 1); in create_ip4_input_fragment()
[all …]
/components/net/lwip/lwip-2.0.3/test/unit/ip4/
A Dtest_ip4.c27 struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; in create_ip4_input_fragment() local
28 IPH_VHL_SET(iphdr, 4, sizeof(struct ip_hdr) / 4); in create_ip4_input_fragment()
29 IPH_TOS_SET(iphdr, 0); in create_ip4_input_fragment()
30 IPH_LEN_SET(iphdr, lwip_htons(p->tot_len)); in create_ip4_input_fragment()
31 IPH_ID_SET(iphdr, lwip_htons(ip_id)); in create_ip4_input_fragment()
33 IPH_OFFSET_SET(iphdr, lwip_htons(start / 8)); in create_ip4_input_fragment()
37 IPH_TTL_SET(iphdr, 5); in create_ip4_input_fragment()
38 IPH_PROTO_SET(iphdr, IP_PROTO_UDP); in create_ip4_input_fragment()
39 IPH_CHKSUM_SET(iphdr, 0); in create_ip4_input_fragment()
41 iphdr->src.addr = lwip_htonl(lwip_htonl(iphdr->src.addr) + 1); in create_ip4_input_fragment()
[all …]
/components/net/lwip-nat/
A Dipv4_nat.c177 #define ip_nat_dbg_dump(msg, iphdr) argument
369 ip_nat_shallnat(const struct ip_hdr *iphdr) in ip_nat_shallnat() argument
398 s16_t iphdr_len = IPH_HL(iphdr) * 4; in ip_nat_check_header()
433 switch (IPH_PROTO(iphdr)) { in ip_nat_input()
545 (u8_t *) & (iphdr->dest.addr), 4); in ip_nat_input()
615 struct ip_hdr *iphdr = p->payload; in ip_nat_out() local
628 nat_config = ip_nat_shallnat(iphdr); in ip_nat_out()
633 switch (IPH_PROTO(iphdr)) in ip_nat_out()
744 LWIP_ASSERT("NULL != iphdr", NULL != iphdr); in ip_nat_cmn_init()
992 LWIP_ASSERT("NULL != iphdr", NULL != iphdr); in ip_nat_dbg_dump()
[all …]
/components/net/lwip-dhcpd/
A Ddhcp_server.c127 struct ip_hdr *iphdr; in _low_level_dhcp_send() local
144 iphdr->src.addr = 0x00000000; /* src: 0.0.0.0 */ in _low_level_dhcp_send()
145 iphdr->dest.addr = 0xFFFFFFFF; /* src: 255.255.255.255 */ in _low_level_dhcp_send()
147 IPH_VHL_SET(iphdr, 4, IP_HLEN / 4); in _low_level_dhcp_send()
148 IPH_TOS_SET(iphdr, 0x00); in _low_level_dhcp_send()
150 IPH_ID_SET(iphdr, htons(2)); in _low_level_dhcp_send()
151 IPH_OFFSET_SET(iphdr, 0); in _low_level_dhcp_send()
152 IPH_TTL_SET(iphdr, 255); in _low_level_dhcp_send()
153 IPH_PROTO_SET(iphdr, IP_PROTO_UDP); in _low_level_dhcp_send()
154 IPH_CHKSUM_SET(iphdr, 0); in _low_level_dhcp_send()
[all …]
/components/net/lwip/lwip-1.4.1/test/unit/tcp/
A Dtcp_helper.c46 struct ip_hdr* iphdr; in tcp_create_segment_wnd() local
63 iphdr = p->payload; in tcp_create_segment_wnd()
65 iphdr->dest.addr = dst_ip->addr; in tcp_create_segment_wnd()
66 iphdr->src.addr = src_ip->addr; in tcp_create_segment_wnd()
67 IPH_VHL_SET(iphdr, 4, IP_HLEN / 4); in tcp_create_segment_wnd()
68 IPH_TOS_SET(iphdr, 0); in tcp_create_segment_wnd()
69 IPH_LEN_SET(iphdr, htons(p->tot_len)); in tcp_create_segment_wnd()
70 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN)); in tcp_create_segment_wnd()
241 ip_addr_copy(current_iphdr_dest, iphdr->dest); in test_tcp_input()
242 ip_addr_copy(current_iphdr_src, iphdr->src); in test_tcp_input()
[all …]
/components/net/lwip/lwip-2.1.2/test/unit/tcp/
A Dtcp_helper.c52 struct ip_hdr* iphdr; in tcp_create_segment_wnd() local
70 iphdr = (struct ip_hdr*)p->payload; in tcp_create_segment_wnd()
72 iphdr->dest.addr = ip_2_ip4(dst_ip)->addr; in tcp_create_segment_wnd()
73 iphdr->src.addr = ip_2_ip4(src_ip)->addr; in tcp_create_segment_wnd()
74 IPH_VHL_SET(iphdr, 4, IP_HLEN / 4); in tcp_create_segment_wnd()
75 IPH_TOS_SET(iphdr, 0); in tcp_create_segment_wnd()
76 IPH_LEN_SET(iphdr, htons(p->tot_len)); in tcp_create_segment_wnd()
77 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN)); in tcp_create_segment_wnd()
256 struct ip_hdr *iphdr = (struct ip_hdr*)p->payload; in test_tcp_input() local
259 ip_addr_copy_from_ip4(*ip_current_src_addr(), iphdr->src); in test_tcp_input()
[all …]
/components/net/lwip/lwip-2.0.3/test/unit/tcp/
A Dtcp_helper.c47 struct ip_hdr* iphdr; in tcp_create_segment_wnd() local
65 iphdr = (struct ip_hdr*)p->payload; in tcp_create_segment_wnd()
67 iphdr->dest.addr = ip_2_ip4(dst_ip)->addr; in tcp_create_segment_wnd()
68 iphdr->src.addr = ip_2_ip4(src_ip)->addr; in tcp_create_segment_wnd()
69 IPH_VHL_SET(iphdr, 4, IP_HLEN / 4); in tcp_create_segment_wnd()
70 IPH_TOS_SET(iphdr, 0); in tcp_create_segment_wnd()
71 IPH_LEN_SET(iphdr, htons(p->tot_len)); in tcp_create_segment_wnd()
72 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, IP_HLEN)); in tcp_create_segment_wnd()
251 struct ip_hdr *iphdr = (struct ip_hdr*)p->payload; in test_tcp_input() local
254 ip_addr_copy_from_ip4(*ip_current_src_addr(), iphdr->src); in test_tcp_input()
[all …]
/components/net/lwip/lwip-2.1.2/src/netif/ppp/
A Ddemand.c325 unsigned iphdr; local
342 iphdr = (pkt->data[4] & 15) << 2;
350 pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr));
363 pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr));
393 *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum;
396 *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum;
409 ntohs(*( (short *) (pkt->data+iphdr+4))),
411 ntohs(*( (short *) (pkt->data+iphdr+6))));
/components/net/lwip/lwip-2.0.3/src/netif/ppp/
A Ddemand.c325 unsigned iphdr; local
342 iphdr = (pkt->data[4] & 15) << 2;
350 pkt_checksum = *((unsigned short *) (pkt->data+10+iphdr));
363 pkt_checksum = *((unsigned short *) (pkt->data+20+iphdr));
393 *((unsigned short *) (pkt->data+20+iphdr)) = pkt_checksum;
396 *((unsigned short *) (pkt->data+10+iphdr)) = pkt_checksum;
409 ntohs(*( (short *) (pkt->data+iphdr+4))),
411 ntohs(*( (short *) (pkt->data+iphdr+6))));
/components/net/lwip/lwip-2.1.2/src/include/lwip/
A Dip6_frag.h83 #define IPV6_FRAG_SRC(ipr) ((ipr)->iphdr->src)
84 #define IPV6_FRAG_DEST(ipr) ((ipr)->iphdr->dest)
93 struct ip6_hdr *iphdr; /* pointer to the first (original) IPv6 header */ member
/components/net/lwip/lwip-1.4.1/src/core/
A Dudp.c156 struct ip_hdr *iphdr; local
165 iphdr = (struct ip_hdr *)p->payload;
169 if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN) || pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4))) {
197 ip4_addr1_16(&iphdr->dest), ip4_addr2_16(&iphdr->dest),
198 ip4_addr3_16(&iphdr->dest), ip4_addr4_16(&iphdr->dest), ntohs(udphdr->dest),
199 ip4_addr1_16(&iphdr->src), ip4_addr2_16(&iphdr->src),
200 ip4_addr3_16(&iphdr->src), ip4_addr4_16(&iphdr->src), ntohs(udphdr->src)));
294 if (IPH_PROTO(iphdr) == IP_PROTO_UDPLITE) {
396 pbuf_header(p, -(s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
418 pbuf_header(p, (IPH_HL(iphdr) * 4) + UDP_HLEN);
[all …]
/components/net/lwip/lwip-2.0.3/src/apps/ping/
A Dping.c113 struct ip_hdr *iphdr; in lwip_ping_recv() local
120 iphdr = (struct ip_hdr *) buf; in lwip_ping_recv()
121 iecho = (struct icmp_echo_hdr *) (buf + (IPH_HL(iphdr) * 4)); in lwip_ping_recv()
124 *ttl = iphdr->_ttl; in lwip_ping_recv()
/components/net/lwip/lwip-1.4.1/src/apps/ping/
A Dping.c113 struct ip_hdr *iphdr; in lwip_ping_recv() local
120 iphdr = (struct ip_hdr *) buf; in lwip_ping_recv()
121 iecho = (struct icmp_echo_hdr *) (buf + (IPH_HL(iphdr) * 4)); in lwip_ping_recv()
124 *ttl = iphdr->_ttl; in lwip_ping_recv()
/components/net/lwip/lwip-2.1.2/src/apps/ping/
A Dping.c113 struct ip_hdr *iphdr; in lwip_ping_recv() local
120 iphdr = (struct ip_hdr *) buf; in lwip_ping_recv()
121 iecho = (struct icmp_echo_hdr *) (buf + (IPH_HL(iphdr) * 4)); in lwip_ping_recv()
124 *ttl = iphdr->_ttl; in lwip_ping_recv()

Completed in 43 milliseconds

12