Home
last modified time | relevance | path

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

/lib/liblwip/src/core/ipv6/
Dip6.c96 ip_forward(struct pbuf *p, struct ip_hdr *iphdr) in ip_forward() argument
102 if ((netif = ip_route((struct ip_addr *)&(iphdr->dest))) == NULL) { in ip_forward()
106 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *)&(iphdr->dest))); in ip_forward()
113 if (--iphdr->hoplim == 0) { in ip_forward()
116 if (iphdr->nexthdr != IP_PROTO_ICMP) { in ip_forward()
134 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *)&(iphdr->dest))); in ip_forward()
143 netif->output(netif, p, (struct ip_addr *)&(iphdr->dest)); in ip_forward()
158 struct ip_hdr *iphdr; in ip_input() local
172 iphdr = p->payload; in ip_input()
175 if (iphdr->v != 6) { in ip_input()
[all …]
Dicmp6.c51 struct ip_hdr *iphdr; in icmp_input() local
72 iphdr = (struct ip_hdr *)((u8_t *)p->payload - IP_HLEN); in icmp_input()
74 …led for received ICMP echo (%"X16_F")\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_… 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()
89 …led for received ICMP echo (%"X16_F")\n", inet_chksum_pseudo(p, &(iphdr->src), &(iphdr->dest), IP_… 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
[all …]
/lib/liblwip/src/core/ipv4/
Dip.c202 ip_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp) in ip_forward() argument
239 IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1); in ip_forward()
241 if (IPH_TTL(iphdr) == 0) { in ip_forward()
245 if (IPH_PROTO(iphdr) != IP_PROTO_ICMP) { in ip_forward()
253 if (IPH_CHKSUM(iphdr) >= PP_HTONS(0xffffU - 0x100)) { 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()
270 if ((IPH_OFFSET(iphdr) & PP_NTOHS(IP_DF)) == 0) { in ip_forward()
307 struct ip_hdr *iphdr; local
319 iphdr = (struct ip_hdr *)p->payload;
[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()
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
[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.c391 struct ip_hdr * iphdr; in igmp_input() local
399 iphdr = (struct ip_hdr *)p->payload; in igmp_input()
400 if (pbuf_header(p, -(s16_t)(IPH_HL(iphdr) * 4)) || (p->len < IGMP_MINLEN)) { in igmp_input()
408 ip_addr_debug_print(IGMP_DEBUG, &(iphdr->src)); in igmp_input()
410 ip_addr_debug_print(IGMP_DEBUG, &(iphdr->dest)); in igmp_input()
/lib/liblwip/test/unit/tcp/
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()
240 struct ip_hdr *iphdr = (struct ip_hdr*)p->payload; in test_tcp_input() local
241 ip_addr_copy(current_iphdr_dest, iphdr->dest); in test_tcp_input()
[all …]
/lib/liblwip/src/core/
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) {
378 pbuf_header(p, (s16_t)((IPH_HL(iphdr) * 4) + UDP_HLEN));
386 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()
Dtcp_in.c64 static struct ip_hdr *iphdr; variable
108 iphdr = (struct ip_hdr *)p->payload; in tcp_input()
109 tcphdr = (struct tcp_hdr *)((u8_t *)p->payload + IPH_HL(iphdr) * 4); in tcp_input()
116 if (pbuf_header(p, -((s16_t)(IPH_HL(iphdr) * 4))) || (p->tot_len < sizeof(struct tcp_hdr))) { in tcp_input()
/lib/liblwip/src/include/ipv4/lwip/
Dip_frag.h57 struct ip_hdr iphdr; member
/lib/liblwip/src/include/ipv6/lwip/
Dip.h99 #define IPH_PROTO(hdr) (iphdr->nexthdr)
/lib/liblwip/src/netif/
Detharp.c642 struct ip_hdr *iphdr; local
649 iphdr = (struct ip_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR);
652 iphdr = (struct ip_hdr *)((u8_t*)ethhdr + SIZEOF_ETH_HDR + SIZEOF_VLAN_HDR);
656 ip_addr_copy(iphdr_src, iphdr->src);
924 struct ip_hdr *iphdr = (struct ip_hdr*)((u8_t*)q->payload + local
930 if (!ip_addr_islinklocal(&iphdr->src))
/lib/liblwip/src/api/
Dapi_msg.c182 const struct ip_hdr* iphdr = ip_current_header(); local
184 const struct udp_hdr* udphdr = (void*)(((char*)iphdr) + IPH_LEN(iphdr));
/lib/liblwip/
DCHANGELOG2080 * igmp.h, igmp.c: Fix bug #22613 "IGMP iphdr problem" (could have
2246 are considered like IP packets (payload pointing to iphdr).