ReactOS 0.4.16-dev-732-g2d1144a
raw.c
Go to the documentation of this file.
1
16/*
17 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
18 * All rights reserved.
19 *
20 * Redistribution and use in source and binary forms, with or without modification,
21 * are permitted provided that the following conditions are met:
22 *
23 * 1. Redistributions of source code must retain the above copyright notice,
24 * this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright notice,
26 * this list of conditions and the following disclaimer in the documentation
27 * and/or other materials provided with the distribution.
28 * 3. The name of the author may not be used to endorse or promote products
29 * derived from this software without specific prior written permission.
30 *
31 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
32 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
33 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
34 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
35 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
36 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
37 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
38 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
39 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
40 * OF SUCH DAMAGE.
41 *
42 * This file is part of the lwIP TCP/IP stack.
43 *
44 * Author: Adam Dunkels <adam@sics.se>
45 *
46 */
47
48#include "lwip/opt.h"
49
50#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */
51
52#include "lwip/def.h"
53#include "lwip/memp.h"
54#include "lwip/ip_addr.h"
55#include "lwip/netif.h"
56#include "lwip/raw.h"
57#include "lwip/priv/raw_priv.h"
58#include "lwip/stats.h"
59#include "lwip/ip6.h"
60#include "lwip/ip6_addr.h"
61#include "lwip/inet_chksum.h"
62
63#include <string.h>
64
66static struct raw_pcb *raw_pcbs;
67
68static u8_t
69raw_input_local_match(struct raw_pcb *pcb, u8_t broadcast)
70{
71 LWIP_UNUSED_ARG(broadcast); /* in IPv6 only case */
72
73 /* check if PCB is bound to specific netif */
74 if ((pcb->netif_idx != NETIF_NO_INDEX) &&
75 (pcb->netif_idx != netif_get_index(ip_data.current_input_netif))) {
76 return 0;
77 }
78
79#if LWIP_IPV4 && LWIP_IPV6
80 /* Dual-stack: PCBs listening to any IP type also listen to any IP address */
81 if (IP_IS_ANY_TYPE_VAL(pcb->local_ip)) {
82#if IP_SOF_BROADCAST_RECV
83 if ((broadcast != 0) && !ip_get_option(pcb, SOF_BROADCAST)) {
84 return 0;
85 }
86#endif /* IP_SOF_BROADCAST_RECV */
87 return 1;
88 }
89#endif /* LWIP_IPV4 && LWIP_IPV6 */
90
91 /* Only need to check PCB if incoming IP version matches PCB IP version */
93#if LWIP_IPV4
94 /* Special case: IPv4 broadcast: receive all broadcasts
95 * Note: broadcast variable can only be 1 if it is an IPv4 broadcast */
96 if (broadcast != 0) {
97#if IP_SOF_BROADCAST_RECV
99#endif /* IP_SOF_BROADCAST_RECV */
100 {
101 if (ip4_addr_isany(ip_2_ip4(&pcb->local_ip))) {
102 return 1;
103 }
104 }
105 } else
106#endif /* LWIP_IPV4 */
107 /* Handle IPv4 and IPv6: catch all or exact match */
108 if (ip_addr_isany(&pcb->local_ip) ||
109 ip_addr_eq(&pcb->local_ip, ip_current_dest_addr())) {
110 return 1;
111 }
112 }
113
114 return 0;
115}
116
134raw_input_state_t
135raw_input(struct pbuf *p, struct netif *inp)
136{
137 struct raw_pcb *pcb, *prev;
138 s16_t proto;
139 raw_input_state_t ret = RAW_INPUT_NONE;
141
142 LWIP_UNUSED_ARG(inp);
143
144#if LWIP_IPV6
145#if LWIP_IPV4
146 if (IP_HDR_GET_VERSION(p->payload) == 6)
147#endif /* LWIP_IPV4 */
148 {
149 struct ip6_hdr *ip6hdr = (struct ip6_hdr *)p->payload;
150 proto = IP6H_NEXTH(ip6hdr);
151 }
152#if LWIP_IPV4
153 else
154#endif /* LWIP_IPV4 */
155#endif /* LWIP_IPV6 */
156#if LWIP_IPV4
157 {
158 proto = IPH_PROTO((struct ip_hdr *)p->payload);
159 }
160#endif /* LWIP_IPV4 */
161
162 prev = NULL;
163 pcb = raw_pcbs;
164 /* loop through all raw pcbs until the packet is eaten by one */
165 /* this allows multiple pcbs to match against the packet by design */
166 while (pcb != NULL) {
167 if ((pcb->protocol == proto) && raw_input_local_match(pcb, broadcast) &&
168 (((pcb->flags & RAW_FLAGS_CONNECTED) == 0) ||
169 ip_addr_eq(&pcb->remote_ip, ip_current_src_addr()))) {
170 /* receive callback function available? */
171 if (pcb->recv != NULL) {
172 u8_t eaten;
173#ifndef LWIP_NOASSERT
174 void *old_payload = p->payload;
175#endif
176 ret = RAW_INPUT_DELIVERED;
177 /* the receive callback function did not eat the packet? */
178 eaten = pcb->recv(pcb->recv_arg, pcb, p, ip_current_src_addr());
179 if (eaten != 0) {
180 /* receive function ate the packet */
181 p = NULL;
182 if (prev != NULL) {
183 /* move the pcb to the front of raw_pcbs so that is
184 found faster next time */
185 prev->next = pcb->next;
186 pcb->next = raw_pcbs;
187 raw_pcbs = pcb;
188 }
189 return RAW_INPUT_EATEN;
190 } else {
191 /* sanity-check that the receive callback did not alter the pbuf */
192 LWIP_ASSERT("raw pcb recv callback altered pbuf payload pointer without eating packet",
193 p->payload == old_payload);
194 }
195 }
196 /* no receive callback function was set for this raw PCB */
197 }
198 /* drop the packet */
199 prev = pcb;
200 pcb = pcb->next;
201 }
202 return ret;
203}
204
220err_t
221raw_bind(struct raw_pcb *pcb, const ip_addr_t *ipaddr)
222{
224 if ((pcb == NULL) || (ipaddr == NULL)) {
225 return ERR_VAL;
226 }
227 ip_addr_set_ipaddr(&pcb->local_ip, ipaddr);
228#if LWIP_IPV6 && LWIP_IPV6_SCOPES
229 /* If the given IP address should have a zone but doesn't, assign one now.
230 * This is legacy support: scope-aware callers should always provide properly
231 * zoned source addresses. */
232 if (IP_IS_V6(&pcb->local_ip) &&
233 ip6_addr_lacks_zone(ip_2_ip6(&pcb->local_ip), IP6_UNKNOWN)) {
234 ip6_addr_select_zone(ip_2_ip6(&pcb->local_ip), ip_2_ip6(&pcb->local_ip));
235 }
236#endif /* LWIP_IPV6 && LWIP_IPV6_SCOPES */
237 return ERR_OK;
238}
239
252void
253raw_bind_netif(struct raw_pcb *pcb, const struct netif *netif)
254{
256 if (netif != NULL) {
257 pcb->netif_idx = netif_get_index(netif);
258 } else {
259 pcb->netif_idx = NETIF_NO_INDEX;
260 }
261}
262
277err_t
278raw_connect(struct raw_pcb *pcb, const ip_addr_t *ipaddr)
279{
281 if ((pcb == NULL) || (ipaddr == NULL)) {
282 return ERR_VAL;
283 }
284 ip_addr_set_ipaddr(&pcb->remote_ip, ipaddr);
285#if LWIP_IPV6 && LWIP_IPV6_SCOPES
286 /* If the given IP address should have a zone but doesn't, assign one now,
287 * using the bound address to make a more informed decision when possible. */
288 if (IP_IS_V6(&pcb->remote_ip) &&
289 ip6_addr_lacks_zone(ip_2_ip6(&pcb->remote_ip), IP6_UNKNOWN)) {
290 ip6_addr_select_zone(ip_2_ip6(&pcb->remote_ip), ip_2_ip6(&pcb->local_ip));
291 }
292#endif /* LWIP_IPV6 && LWIP_IPV6_SCOPES */
293 raw_set_flags(pcb, RAW_FLAGS_CONNECTED);
294 return ERR_OK;
295}
296
303void
304raw_disconnect(struct raw_pcb *pcb)
305{
307 /* reset remote address association */
308#if LWIP_IPV4 && LWIP_IPV6
309 if (IP_IS_ANY_TYPE_VAL(pcb->local_ip)) {
310 ip_addr_copy(pcb->remote_ip, *IP_ANY_TYPE);
311 } else {
312#endif
313 ip_addr_set_any(IP_IS_V6_VAL(pcb->remote_ip), &pcb->remote_ip);
314#if LWIP_IPV4 && LWIP_IPV6
315 }
316#endif
317 pcb->netif_idx = NETIF_NO_INDEX;
318 /* mark PCB as unconnected */
319 raw_clear_flags(pcb, RAW_FLAGS_CONNECTED);
320}
321
333void
334raw_recv(struct raw_pcb *pcb, raw_recv_fn recv, void *recv_arg)
335{
337 /* remember recv() callback and user data */
338 pcb->recv = recv;
339 pcb->recv_arg = recv_arg;
340}
341
353err_t
354raw_sendto(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *ipaddr)
355{
356 struct netif *netif;
357 const ip_addr_t *src_ip;
358
359 if ((pcb == NULL) || (ipaddr == NULL) || !IP_ADDR_PCB_VERSION_MATCH(pcb, ipaddr)) {
360 return ERR_VAL;
361 }
362
363 LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE, ("raw_sendto\n"));
364
365 if (pcb->netif_idx != NETIF_NO_INDEX) {
366 netif = netif_get_by_index(pcb->netif_idx);
367 } else {
368#if LWIP_MULTICAST_TX_OPTIONS
369 netif = NULL;
370 if (ip_addr_ismulticast(ipaddr)) {
371 /* For multicast-destined packets, use the user-provided interface index to
372 * determine the outgoing interface, if an interface index is set and a
373 * matching netif can be found. Otherwise, fall back to regular routing. */
374 netif = netif_get_by_index(pcb->mcast_ifindex);
375 }
376
377 if (netif == NULL)
378#endif /* LWIP_MULTICAST_TX_OPTIONS */
379 {
380 netif = ip_route(&pcb->local_ip, ipaddr);
381 }
382 }
383
384 if (netif == NULL) {
385 LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ("raw_sendto: No route to "));
388 return ERR_RTE;
389 }
390
391 if (ip_addr_isany(&pcb->local_ip) || ip_addr_ismulticast(&pcb->local_ip)) {
392 /* use outgoing network interface IP address as source address */
393 src_ip = ip_netif_get_local_ip(netif, ipaddr);
394#if LWIP_IPV6
395 if (src_ip == NULL) {
396 return ERR_RTE;
397 }
398#endif /* LWIP_IPV6 */
399 } else {
400 /* use RAW PCB local IP address as source address */
401 src_ip = &pcb->local_ip;
402 }
403
404 return raw_sendto_if_src(pcb, p, ipaddr, netif, src_ip);
405}
406
420err_t
421raw_sendto_if_src(struct raw_pcb *pcb, struct pbuf *p, const ip_addr_t *dst_ip,
422 struct netif *netif, const ip_addr_t *src_ip)
423{
424 err_t err;
425 struct pbuf *q; /* q will be sent down the stack */
426 u16_t header_size;
427 u8_t ttl;
428
430
431 if ((pcb == NULL) || (dst_ip == NULL) || (netif == NULL) || (src_ip == NULL) ||
432 !IP_ADDR_PCB_VERSION_MATCH(pcb, src_ip) || !IP_ADDR_PCB_VERSION_MATCH(pcb, dst_ip)) {
433 return ERR_VAL;
434 }
435
436 header_size = (
437#if LWIP_IPV4 && LWIP_IPV6
438 IP_IS_V6(dst_ip) ? IP6_HLEN : IP_HLEN);
439#elif LWIP_IPV4
440 IP_HLEN);
441#else
442 IP6_HLEN);
443#endif
444
445 /* Handle the HDRINCL option as an exception: none of the code below applies
446 * to this case, and sending the packet needs to be done differently too. */
447 if (pcb->flags & RAW_FLAGS_HDRINCL) {
448 /* A full header *must* be present in the first pbuf of the chain, as the
449 * output routines may access its fields directly. */
450 if (p->len < header_size) {
451 return ERR_VAL;
452 }
453 /* @todo multicast loop support, if at all desired for this scenario.. */
454 NETIF_SET_HINTS(netif, &pcb->netif_hints);
455 err = ip_output_if_hdrincl(p, src_ip, dst_ip, netif);
457 return err;
458 }
459
460 /* packet too large to add an IP header without causing an overflow? */
461 if ((u16_t)(p->tot_len + header_size) < p->tot_len) {
462 return ERR_MEM;
463 }
464 /* not enough space to add an IP header to first pbuf in given p chain? */
465 if (pbuf_add_header(p, header_size)) {
466 /* allocate header in new pbuf */
468 /* new header pbuf could not be allocated? */
469 if (q == NULL) {
470 LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE | LWIP_DBG_LEVEL_SERIOUS, ("raw_sendto: could not allocate header\n"));
471 return ERR_MEM;
472 }
473 if (p->tot_len != 0) {
474 /* chain header q in front of given pbuf p */
475 pbuf_chain(q, p);
476 }
477 /* { first pbuf q points to header pbuf } */
478 LWIP_DEBUGF(RAW_DEBUG, ("raw_sendto: added header pbuf %p before given pbuf %p\n", (void *)q, (void *)p));
479 } else {
480 /* first pbuf q equals given pbuf */
481 q = p;
482 if (pbuf_remove_header(q, header_size)) {
483 LWIP_ASSERT("Can't restore header we just removed!", 0);
484 return ERR_MEM;
485 }
486 }
487
488#if IP_SOF_BROADCAST
489 if (IP_IS_V4(dst_ip)) {
490 /* broadcast filter? */
491 if (!ip_get_option(pcb, SOF_BROADCAST) && ip_addr_isbroadcast(dst_ip, netif)) {
492 LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_LEVEL_WARNING, ("raw_sendto: SOF_BROADCAST not enabled on pcb %p\n", (void *)pcb));
493 /* free any temporary header pbuf allocated by pbuf_header() */
494 if (q != p) {
495 pbuf_free(q);
496 }
497 return ERR_VAL;
498 }
499 }
500#endif /* IP_SOF_BROADCAST */
501
502 /* Multicast Loop? */
503#if LWIP_MULTICAST_TX_OPTIONS
504 if (((pcb->flags & RAW_FLAGS_MULTICAST_LOOP) != 0) && ip_addr_ismulticast(dst_ip)) {
505 q->flags |= PBUF_FLAG_MCASTLOOP;
506 }
507#endif /* LWIP_MULTICAST_TX_OPTIONS */
508
509#if LWIP_IPV6
510 /* If requested, based on the IPV6_CHECKSUM socket option per RFC3542,
511 compute the checksum and update the checksum in the payload. */
512 if (IP_IS_V6(dst_ip) && pcb->chksum_reqd) {
513 u16_t chksum = ip6_chksum_pseudo(p, pcb->protocol, p->tot_len, ip_2_ip6(src_ip), ip_2_ip6(dst_ip));
514 LWIP_ASSERT("Checksum must fit into first pbuf", p->len >= (pcb->chksum_offset + 2));
515 SMEMCPY(((u8_t *)p->payload) + pcb->chksum_offset, &chksum, sizeof(u16_t));
516 }
517#endif
518
519 /* Determine TTL to use */
520#if LWIP_MULTICAST_TX_OPTIONS
521 ttl = (ip_addr_ismulticast(dst_ip) ? raw_get_multicast_ttl(pcb) : pcb->ttl);
522#else /* LWIP_MULTICAST_TX_OPTIONS */
523 ttl = pcb->ttl;
524#endif /* LWIP_MULTICAST_TX_OPTIONS */
525
526 NETIF_SET_HINTS(netif, &pcb->netif_hints);
527 err = ip_output_if(q, src_ip, dst_ip, ttl, pcb->tos, pcb->protocol, netif);
529
530 /* did we chain a header earlier? */
531 if (q != p) {
532 /* free the header */
533 pbuf_free(q);
534 }
535 return err;
536}
537
546err_t
547raw_send(struct raw_pcb *pcb, struct pbuf *p)
548{
549 return raw_sendto(pcb, p, &pcb->remote_ip);
550}
551
561void
562raw_remove(struct raw_pcb *pcb)
563{
564 struct raw_pcb *pcb2;
566 /* pcb to be removed is first in list? */
567 if (raw_pcbs == pcb) {
568 /* make list start at 2nd pcb */
569 raw_pcbs = raw_pcbs->next;
570 /* pcb not 1st in list */
571 } else {
572 for (pcb2 = raw_pcbs; pcb2 != NULL; pcb2 = pcb2->next) {
573 /* find pcb in raw_pcbs list */
574 if (pcb2->next != NULL && pcb2->next == pcb) {
575 /* remove pcb from list */
576 pcb2->next = pcb->next;
577 break;
578 }
579 }
580 }
581 memp_free(MEMP_RAW_PCB, pcb);
582}
583
595struct raw_pcb *
596raw_new(u8_t proto)
597{
598 struct raw_pcb *pcb;
599
600 LWIP_DEBUGF(RAW_DEBUG | LWIP_DBG_TRACE, ("raw_new\n"));
602
603 pcb = (struct raw_pcb *)memp_malloc(MEMP_RAW_PCB);
604 /* could allocate RAW PCB? */
605 if (pcb != NULL) {
606 /* initialize PCB to all zeroes */
607 memset(pcb, 0, sizeof(struct raw_pcb));
608 pcb->protocol = proto;
609 pcb->ttl = RAW_TTL;
610#if LWIP_MULTICAST_TX_OPTIONS
611 raw_set_multicast_ttl(pcb, RAW_TTL);
612#endif /* LWIP_MULTICAST_TX_OPTIONS */
613 pcb_tci_init(pcb);
614 pcb->next = raw_pcbs;
615 raw_pcbs = pcb;
616 }
617 return pcb;
618}
619
635struct raw_pcb *
636raw_new_ip_type(u8_t type, u8_t proto)
637{
638 struct raw_pcb *pcb;
640 pcb = raw_new(proto);
641#if LWIP_IPV4 && LWIP_IPV6
642 if (pcb != NULL) {
643 IP_SET_TYPE_VAL(pcb->local_ip, type);
644 IP_SET_TYPE_VAL(pcb->remote_ip, type);
645 }
646#else /* LWIP_IPV4 && LWIP_IPV6 */
648#endif /* LWIP_IPV4 && LWIP_IPV6 */
649 return pcb;
650}
651
657void raw_netif_ip_addr_changed(const ip_addr_t *old_addr, const ip_addr_t *new_addr)
658{
659 struct raw_pcb *rpcb;
660
661 if (!ip_addr_isany(old_addr) && !ip_addr_isany(new_addr)) {
662 for (rpcb = raw_pcbs; rpcb != NULL; rpcb = rpcb->next) {
663 /* PCB bound to current local interface address? */
664 if (ip_addr_eq(&rpcb->local_ip, old_addr)) {
665 /* The PCB is bound to the old ipaddr and
666 * is set to bound to the new one instead */
667 ip_addr_copy(rpcb->local_ip, *new_addr);
668 }
669 }
670 }
671}
672
673#endif /* LWIP_RAW */
#define NULL
Definition: types.h:112
INT WSAAPI recv(IN SOCKET s, OUT CHAR FAR *buf, IN INT len, IN INT flags)
Definition: recv.c:23
#define LWIP_DEBUGF(debug, message)
Definition: debug.h:158
#define LWIP_ASSERT(message, assertion)
Definition: debug.h:116
#define ip_get_option(pcb, opt)
Definition: ip.h:228
#define ip_current_src_addr()
Definition: ip.h:223
#define ip_current_dest_addr()
Definition: ip.h:225
#define ip_current_netif()
Definition: ip.h:146
#define SOF_BROADCAST
Definition: ip.h:112
struct ip_globals ip_data
#define pcb_tci_init(pcb)
Definition: ip.h:104
#define IP_HDR_GET_VERSION(ptr)
Definition: ip.h:53
#define ERR_MEM
Definition: fontsub.h:52
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
GLdouble GLdouble GLdouble GLdouble q
Definition: gl.h:2063
GLfloat GLfloat p
Definition: glext.h:8902
uint8_t u8_t
Definition: arch.h:125
#define LWIP_UNUSED_ARG(x)
Definition: arch.h:373
uint16_t u16_t
Definition: arch.h:127
int16_t s16_t
Definition: arch.h:128
#define LWIP_DBG_LEVEL_SERIOUS
Definition: debug.h:57
#define LWIP_DBG_LEVEL_WARNING
Definition: debug.h:55
#define LWIP_DBG_TRACE
Definition: debug.h:83
s8_t err_t
Definition: err.h:96
@ ERR_RTE
Definition: err.h:63
@ ERR_OK
Definition: err.h:55
@ ERR_VAL
Definition: err.h:67
#define IP_ANY_TYPE
Definition: ip_addr.h:461
#define RAW_DEBUG
Definition: opt.h:3406
#define LWIP_ASSERT_CORE_LOCKED()
Definition: opt.h:227
#define SMEMCPY(dst, src, len)
Definition: opt.h:145
#define RAW_TTL
Definition: opt.h:905
struct netif * netif_get_by_index(u8_t idx)
Definition: netif.c:1730
void pbuf_chain(struct pbuf *h, struct pbuf *t)
Definition: pbuf.c:897
struct pbuf * pbuf_alloc(pbuf_layer layer, u16_t length, pbuf_type type)
Definition: pbuf.c:224
u8_t pbuf_free(struct pbuf *p)
Definition: pbuf.c:727
@ PBUF_RAM
Definition: pbuf.h:152
@ PBUF_IP
Definition: pbuf.h:97
#define ip_2_ip6(ipaddr)
Definition: ip_addr.h:356
#define ip_addr_isbroadcast(addr, netif)
Definition: ip_addr.h:381
#define IP_IS_V6_VAL(ipaddr)
Definition: ip_addr.h:348
#define ip_addr_ismulticast(ipaddr)
Definition: ip_addr.h:382
#define IP_ADDR_PCB_VERSION_MATCH(addr, pcb)
Definition: ip_addr.h:286
#define ip_addr_isany(ipaddr)
Definition: ip_addr.h:377
#define ip_addr_eq(addr1, addr2)
Definition: ip_addr.h:374
#define ip_addr_copy(dest, src)
Definition: ip_addr.h:360
#define IP_ADDR_PCB_VERSION_MATCH_EXACT(pcb, ipaddr)
Definition: ip_addr.h:287
#define IP_IS_ANY_TYPE_VAL(ipaddr)
Definition: ip_addr.h:351
#define ip_addr_set_any(is_ipv6, ipaddr)
Definition: ip_addr.h:367
ip6_addr_t ip_addr_t
Definition: ip_addr.h:344
#define IP_IS_V6(ipaddr)
Definition: ip_addr.h:350
#define IP_SET_TYPE_VAL(ipaddr, iptype)
Definition: ip_addr.h:352
#define IP_IS_V4(ipaddr)
Definition: ip_addr.h:349
#define ip_addr_set_ipaddr(dest, src)
Definition: ip_addr.h:364
#define ip_addr_debug_print(debug, ipaddr)
Definition: ip_addr.h:383
void * memp_malloc(memp_t type)
Definition: memp.c:337
void memp_free(memp_t type, void *mem)
Definition: memp.c:420
#define NETIF_RESET_HINTS(netif)
Definition: netif.h:570
#define NETIF_NO_INDEX
Definition: netif.h:579
#define netif_get_index(netif)
Definition: netif.h:578
#define NETIF_SET_HINTS(netif, netifhint)
Definition: netif.h:569
u8_t pbuf_add_header(struct pbuf *p, size_t header_size_increment)
Definition: pbuf.c:554
u8_t pbuf_remove_header(struct pbuf *p, size_t header_size_decrement)
Definition: pbuf.c:585
#define PBUF_FLAG_MCASTLOOP
Definition: pbuf.h:177
#define IPH_PROTO(hdr)
Definition: ip4.h:113
#define IP_HLEN
Definition: ip4.h:64
#define IP6H_NEXTH(hdr)
Definition: ip6.h:103
#define IP6_HLEN
Definition: ip6.h:64
#define err(...)
#define memset(x, y, z)
Definition: compat.h:39
struct define * next
Definition: compiler.c:65
Definition: ip6.h:82
Definition: ip4.h:73
Definition: netif.h:269
Definition: pbuf.h:186
static const u8_t broadcast[6]
Definition: test_dhcp.c:23
int ret