Searched refs:iphdr (Results 1 - 25 of 27) sorted by relevance

12

/barrelfish-master/lib/lwip/src/core/ipv6/
H A Dip6.c93 static void ip_forward(struct pbuf *p, struct ip_hdr *iphdr) argument
99 if ((netif = ip_route((struct ip_addr *) &(iphdr->dest))) == NULL) {
103 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *) &(iphdr->dest)));
110 if (--iphdr->hoplim == 0) {
113 if (iphdr->nexthdr != IP_PROTO_ICMP) {
122 /* if (iphdr->chksum >= htons(0xffff - 0x100)) {
123 iphdr->chksum += htons(0x100) + 1;
125 iphdr->chksum += htons(0x100);
131 ip_addr_debug_print(IP_DEBUG, ((struct ip_addr *) &(iphdr->dest)));
140 netif->output(netif, p, (struct ip_addr *) &(iphdr
155 struct ip_hdr *iphdr; local
262 struct ip_hdr *iphdr; local
361 struct ip_hdr *iphdr = p->payload; local
[all...]
H A Dicmp6.c50 struct ip_hdr *iphdr; local
72 iphdr = (struct ip_hdr *) ((u8_t *) p->payload - IP_HLEN);
76 X16_F ")\n", inet_chksum_pseudo(p, &(iphdr->src),
77 &(iphdr->dest),
86 ip_addr_set(&tmpaddr, &(iphdr->src));
87 ip_addr_set(&(iphdr->src), &(iphdr->dest));
88 ip_addr_set(&(iphdr->dest), &tmpaddr);
98 X16_F ")\n", inet_chksum_pseudo(p, &(iphdr->src),
99 &(iphdr
122 struct ip_hdr *iphdr; local
158 struct ip_hdr *iphdr; local
[all...]
/barrelfish-master/lib/lwip/src/core/ipv4/
H A Dip.c140 * @param iphdr the IP header of the input packet
144 static struct netif *ip_forward(struct pbuf *p, struct ip_hdr *iphdr, argument
151 netif = ip_route((struct ip_addr *) &(iphdr->dest));
155 iphdr->dest.addr));
169 IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1);
171 if (IPH_TTL(iphdr) == 0) {
175 if (IPH_PROTO(iphdr) != IP_PROTO_ICMP) {
183 if (IPH_CHKSUM(iphdr) >= htons(0xffff - 0x100)) {
184 IPH_CHKSUM_SET(iphdr, IPH_CHKSU
219 struct ip_hdr *iphdr; local
[all...]
H A Dicmp.c106 struct ip_hdr *iphdr; local
113 iphdr = p->payload;
114 hlen = IPH_HL(iphdr) * 4;
134 if (ip_addr_ismulticast(&iphdr->dest)) {
140 if (ip_addr_isbroadcast(&iphdr->dest, inp)) {
197 iphdr = r->payload;
222 tmpaddr.addr = iphdr->src.addr;
223 iphdr->src.addr = iphdr->dest.addr;
224 iphdr
334 struct ip_hdr *iphdr; local
[all...]
H A Dip_frag.c179 SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN);
236 if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) {
294 SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN);
529 if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) {
548 ((ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) {
549 /* ipr->iphdr is not the header from the first fragment, but fraghdr is
550 * -> copy fraghdr into ipr->iphdr since we want to have the header
553 SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN);
583 SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
651 struct ip_hdr *iphdr; local
[all...]
H A Digmp.c347 struct ip_hdr *iphdr; local
353 iphdr = p->payload;
354 if (pbuf_header(p, -(s16_t) (IPH_HL(iphdr) * 4)) || (p->len < IGMP_MINLEN)) {
362 ip_addr_debug_print(IGMP_DEBUG, &(iphdr->src));
364 ip_addr_debug_print(IGMP_DEBUG, &(iphdr->dest));
/barrelfish-master/lib/lwip2/src/core/ipv4/
H A Dip4.c264 * @param iphdr the IP header of the input packet
268 ip4_forward(struct pbuf *p, struct ip_hdr *iphdr, struct netif *inp) argument
306 IPH_TTL_SET(iphdr, IPH_TTL(iphdr) - 1);
308 if (IPH_TTL(iphdr) == 0) {
312 if (IPH_PROTO(iphdr) != IP_PROTO_ICMP) {
320 if (IPH_CHKSUM(iphdr) >= PP_HTONS(0xffffU - 0x100)) {
321 IPH_CHKSUM_SET(iphdr, IPH_CHKSUM(iphdr) + PP_HTONS(0x100) + 1);
323 IPH_CHKSUM_SET(iphdr, IPH_CHKSU
376 struct ip_hdr *iphdr; local
813 struct ip_hdr *iphdr; local
1049 struct ip_hdr *iphdr = (struct ip_hdr *)p->payload; local
[all...]
H A Dicmp.c205 struct ip_hdr *iphdr = (struct ip_hdr*)p->payload; local
206 ip4_addr_copy(iphdr->src, *src);
207 ip4_addr_copy(iphdr->dest, *ip4_current_src_addr());
228 IPH_TTL_SET(iphdr, ICMP_TTL);
229 IPH_CHKSUM_SET(iphdr, 0);
232 IPH_CHKSUM_SET(iphdr, inet_chksum(iphdr, hlen));
336 struct ip_hdr *iphdr; local
356 iphdr = (struct ip_hdr *)p->payload;
358 ip4_addr_debug_print_val(ICMP_DEBUG, iphdr
[all...]
H A Dip4_frag.c181 SMEMCPY(p->payload, &ipr->iphdr, IP_HLEN);
241 if (!IP_ADDRESSES_AND_ID_MATCH(&r->iphdr, fraghdr)) {
304 SMEMCPY(&(ipr->iphdr), fraghdr, IP_HLEN);
530 if (IP_ADDRESSES_AND_ID_MATCH(&ipr->iphdr, fraghdr)) {
547 ((lwip_ntohs(IPH_OFFSET(&ipr->iphdr)) & IP_OFFMASK) != 0)) {
548 /* ipr->iphdr is not the header from the first fragment, but fraghdr is
549 * -> copy fraghdr into ipr->iphdr since we want to have the header
552 SMEMCPY(&ipr->iphdr, fraghdr, IP_HLEN);
583 SMEMCPY(fraghdr, &ipr->iphdr, IP_HLEN);
694 struct ip_hdr *iphdr; local
[all...]
/barrelfish-master/include/lwip/lwip/
H A Dip_frag.h57 struct ip_hdr iphdr; member in struct:ip_reassdata
/barrelfish-master/lib/lwip/src/core/
H A Dudp.c91 struct ip_hdr *iphdr; local
100 iphdr = p->payload;
103 if (p->tot_len < (IPH_HL(iphdr) * 4 + UDP_HLEN)
104 || pbuf_header(p, -(s16_t) (IPH_HL(iphdr) * 4))) {
119 broadcast = ip_addr_isbroadcast(&(iphdr->dest), inp);
135 U16_F ")\n", ip4_addr1(&iphdr->dest), ip4_addr2(&iphdr->dest),
136 ip4_addr3(&iphdr->dest), ip4_addr4(&iphdr->dest),
137 ntohs(udphdr->dest), ip4_addr1(&iphdr
[all...]
H A Draw.c80 struct ip_hdr *iphdr; local
86 iphdr = p->payload;
87 proto = IPH_PROTO(iphdr);
98 || !ip_addr_isbroadcast(&(iphdr->dest), inp))
104 if (pcb->recv(pcb->recv_arg, pcb, p, &(iphdr->src)) != 0) {
H A Dtcp_in.c67 static struct ip_hdr *iphdr; variable in typeref:struct:ip_hdr
105 iphdr = p->payload;
106 tcphdr = (struct tcp_hdr *) ((u8_t *) p->payload + IPH_HL(iphdr) * 4);
113 if (pbuf_header(p, -((s16_t) (IPH_HL(iphdr) * 4)))
127 if (ip_addr_isbroadcast(&(iphdr->dest), inp) ||
128 ip_addr_ismulticast(&(iphdr->dest))) {
140 inet_chksum_pseudo(p, (struct ip_addr *) &(iphdr->src),
141 (struct ip_addr *) &(iphdr->dest),
146 (struct ip_addr *) &(iphdr->
148 (struct ip_addr *) &(iphdr
[all...]
/barrelfish-master/lib/lwip2/test/minimal/
H A Dmain.c147 struct ip_hdr *iphdr = p->payload + SIZEOF_ETH_HDR; local
154 iphdr->_len = lwip_htons(1024);
155 iphdr->_v_hl = (4 << 4) | 5;
158 IP4_ADDR(&(iphdr->dest), 192,168,0,2);
159 IP4_ADDR(&(iphdr->src), 192,168,0,1);
161 iphdr->dest.addr = 0xdeadbeef;
162 iphdr->_proto = IP_PROTO_UDP;
163 iphdr->_chksum = inet_chksum(iphdr, 1024);
/barrelfish-master/include/lwip2/lwip/
H A Dip4_frag.h64 struct ip_hdr iphdr; member in struct:ip_reassdata
H A Dip6_frag.h83 struct ip6_hdr IPV6_FRAG_HDRPTR iphdr; member in struct:ip6_reassdata
/barrelfish-master/usr/tests/e10ktest/
H A De10ktest_latencies.c211 struct ip_hdr *iphdr = (struct ip_hdr *)(p->payload + SIZEOF_ETH_HDR); local
213 /* printf("Is an IP packet, type %x\n", IPH_PROTO(iphdr)); */
215 if(IPH_PROTO(iphdr) == IP_PROTO_UDP) {
216 struct udp_hdr *udphdr = (struct udp_hdr *)(p->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4));
217 uint8_t *payload = p->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4) + sizeof(struct udp_hdr);
220 /* iphdr->dest.addr, udphdr->dest); */
222 if(htonl(iphdr->dest.addr) != 0x80d00643 ||
232 struct udp_hdr *myudp = (struct udp_hdr *)(outp->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4));
233 uint8_t *mypayload = outp->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4) + sizeof(struct udp_hdr);
241 memcpy(myip, iphdr, sizeo
[all...]
H A De10ktest.c430 struct ip_hdr *iphdr = (struct ip_hdr *)(p->payload + SIZEOF_ETH_HDR); local
432 printf("%d: Is an IP packet, type %x\n", disp_get_core_id(), IPH_PROTO(iphdr));
435 if(IPH_PROTO(iphdr) != IP_PROTO_UDP && IPH_PROTO(iphdr) != IP_PROTO_TCP) {
440 if(iphdr->dest.addr != arranet_myip) {
444 if(IPH_PROTO(iphdr) == IP_PROTO_UDP) {
445 struct udp_hdr *udphdr = (struct udp_hdr *)(p->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4));
446 uint8_t *payload = p->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4) + sizeof(struct udp_hdr);
449 htonl(iphdr->dest.addr), htons(udphdr->dest));
462 struct udp_hdr *myudp = (struct udp_hdr *)(outp->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) *
[all...]
H A Dsubways.c487 struct ip_hdr *iphdr = (struct ip_hdr *)(p->payload + SIZEOF_ETH_HDR); local
494 if(IPH_PROTO(iphdr) != IP_PROTO_IPENCAP) {
565 if(peers_get_from_ip(iphdr->src.addr) == NULL) {
569 newpeer->ip = iphdr->src.addr;
690 struct ip_hdr *iphdr = (struct ip_hdr *)(p + SIZEOF_ETH_HDR); local
692 uint8_t ttl = IPH_TTL(iphdr);
697 unsigned int outer_len = IPH_HL(iphdr) * 4;
699 memcpy(iphdr, inner_iphdr, len - SIZEOF_ETH_HDR - outer_len);
704 IPH_TTL_SET(iphdr, ttl - 1);
707 uint32_t tmpip = iphdr
[all...]
/barrelfish-master/lib/lwip2/src/netif/ppp/
H 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))));
/barrelfish-master/include/lwip2/netif/ppp/
H 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))));
/barrelfish-master/include/lwip/ipv6/lwip/
H A Dip.h99 #define IPH_PROTO(hdr) (iphdr->nexthdr)
/barrelfish-master/lib/lwip2/src/core/ipv6/
H A Dip6_frag.c163 if (pbuf_header_force(p, (s16_t)((u8_t*)p->payload - (u8_t*)IPV6_FRAG_HDRREF(ipr->iphdr)))) {
298 ip6_addr_cmp(ip6_current_src_addr(), &(IPV6_FRAG_HDRREF(ipr->iphdr)->src)) &&
299 ip6_addr_cmp(ip6_current_dest_addr(), &(IPV6_FRAG_HDRREF(ipr->iphdr)->dest))) {
341 MEMCPY(&ipr->iphdr, ip6_current_header(), IP6_HLEN);
344 ipr->iphdr = ip_data.current_ip6_header;
481 MEMCPY(&ipr->iphdr, ip6_current_header(), IP6_HLEN);
485 ipr->iphdr = ip_data.current_ip6_header;
555 MEMCPY(iphdr_ptr, &ipr->iphdr, IP6_HLEN);
557 iphdr_ptr = ipr->iphdr;
/barrelfish-master/lib/lwip2/src/apps/ping/
H A Dping.c211 struct ip_hdr *iphdr; local
214 iphdr = (struct ip_hdr *)buf;
215 iecho = (struct icmp_echo_hdr *)(buf + (IPH_HL(iphdr) * 4));
/barrelfish-master/lib/arranet/
H A Darranet.c769 struct ip_hdr *iphdr = (struct ip_hdr *)(p->payload + SIZEOF_ETH_HDR); local
771 if(IPH_PROTO(iphdr) == IP_PROTO_UDP) {
772 struct udp_hdr *udphdr = (struct udp_hdr *)(p->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4));
848 struct ip_hdr *iphdr = (struct ip_hdr *)(inpkt->payload + SIZEOF_ETH_HDR); local
850 assert(IPH_PROTO(iphdr) == IP_PROTO_UDP);
852 struct udp_hdr *udphdr = (struct udp_hdr *)(inpkt->payload + SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4));
853 size_t hdr_len = SIZEOF_ETH_HDR + (IPH_HL(iphdr) * 4) + sizeof(struct udp_hdr);
867 addr->sin_addr.s_addr = iphdr->src.addr;
914 struct ip_hdr *iphdr = (struct ip_hdr *)(inpkt->payload + SIZEOF_ETH_HDR); local
916 uint16_t pkt_len = ntohs(IPH_LEN(iphdr));
957 struct ip_hdr *iphdr = (struct ip_hdr *)(inpkt->payload + SIZEOF_ETH_HDR); local
2166 struct ip_hdr *iphdr = (struct ip_hdr *)(p->payload + SIZEOF_ETH_HDR); local
2552 struct ip_hdr *iphdr = (struct ip_hdr *)(inpkt->payload + SIZEOF_ETH_HDR); local
[all...]

Completed in 230 milliseconds

12