Minor changes (but in lot of files): add #if/#endif for options where they could miss. #if LWIP_xxx if always put after #include "lwip/opt.h" (note this one indirectly include cc.h). Move others includes inside #if/#endif block.

This commit is contained in:
fbernon 2007-09-07 23:01:59 +00:00
parent 027a70a415
commit e3cd1ac1f9
62 changed files with 241 additions and 214 deletions

View File

@ -39,14 +39,16 @@
/* This is the part of the API that is linked with /* This is the part of the API that is linked with
the application */ the application */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
#include "lwip/api.h" #include "lwip/api.h"
#include "lwip/api_msg.h" #include "lwip/api_msg.h"
#include "lwip/tcpip.h" #include "lwip/tcpip.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#if !NO_SYS #include <string.h>
/** /**
* Create a new netconn (of a specific type) that has a callback function. * Create a new netconn (of a specific type) that has a callback function.
@ -185,9 +187,12 @@ netconn_peer(struct netconn *conn, struct ip_addr *addr, u16_t *port)
{ {
LWIP_ERROR("netconn_peer: invalid conn", (conn != NULL), return ERR_ARG;); LWIP_ERROR("netconn_peer: invalid conn", (conn != NULL), return ERR_ARG;);
switch (NETCONNTYPE_GROUP(conn->type)) { switch (NETCONNTYPE_GROUP(conn->type)) {
#if LWIP_RAW
case NETCONN_RAW: case NETCONN_RAW:
/* return an error as connecting is only a helper for upper layers */ /* return an error as connecting is only a helper for upper layers */
return ERR_CONN; return ERR_CONN;
#endif /* LWIP_RAW */
#if LWIP_UDP
case NETCONN_UDP: case NETCONN_UDP:
if (conn->pcb.udp == NULL || if (conn->pcb.udp == NULL ||
((conn->pcb.udp->flags & UDP_FLAGS_CONNECTED) == 0)) ((conn->pcb.udp->flags & UDP_FLAGS_CONNECTED) == 0))
@ -195,12 +200,15 @@ netconn_peer(struct netconn *conn, struct ip_addr *addr, u16_t *port)
*addr = (conn->pcb.udp->remote_ip); *addr = (conn->pcb.udp->remote_ip);
*port = conn->pcb.udp->remote_port; *port = conn->pcb.udp->remote_port;
break; break;
#endif /* LWIP_UDP */
#if LWIP_TCP
case NETCONN_TCP: case NETCONN_TCP:
if (conn->pcb.tcp == NULL) if (conn->pcb.tcp == NULL)
return ERR_CONN; return ERR_CONN;
*addr = (conn->pcb.tcp->remote_ip); *addr = (conn->pcb.tcp->remote_ip);
*port = conn->pcb.tcp->remote_port; *port = conn->pcb.tcp->remote_port;
break; break;
#endif /* LWIP_TCP */
} }
return ERR_OK; return ERR_OK;
} }
@ -221,18 +229,24 @@ netconn_addr(struct netconn *conn, struct ip_addr **addr, u16_t *port)
LWIP_ERROR("netconn_addr: invalid addr", (addr != NULL), return ERR_ARG;); LWIP_ERROR("netconn_addr: invalid addr", (addr != NULL), return ERR_ARG;);
LWIP_ERROR("netconn_addr: invalid port", (port != NULL), return ERR_ARG;); LWIP_ERROR("netconn_addr: invalid port", (port != NULL), return ERR_ARG;);
switch (NETCONNTYPE_GROUP(conn->type)) { switch (NETCONNTYPE_GROUP(conn->type)) {
#if LWIP_RAW
case NETCONN_RAW: case NETCONN_RAW:
*addr = &(conn->pcb.raw->local_ip); *addr = &(conn->pcb.raw->local_ip);
*port = conn->pcb.raw->protocol; *port = conn->pcb.raw->protocol;
break; break;
#endif /* LWIP_RAW */
#if LWIP_UDP
case NETCONN_UDP: case NETCONN_UDP:
*addr = &(conn->pcb.udp->local_ip); *addr = &(conn->pcb.udp->local_ip);
*port = conn->pcb.udp->local_port; *port = conn->pcb.udp->local_port;
break; break;
#endif /* LWIP_UDP */
#if LWIP_TCP
case NETCONN_TCP: case NETCONN_TCP:
*addr = &(conn->pcb.tcp->local_ip); *addr = &(conn->pcb.tcp->local_ip);
*port = conn->pcb.tcp->local_port; *port = conn->pcb.tcp->local_port;
break; break;
#endif /* LWIP_TCP */
} }
return ERR_OK; return ERR_OK;
} }
@ -607,4 +621,4 @@ netconn_join_leave_group(struct netconn *conn,
} }
#endif /* LWIP_IGMP */ #endif /* LWIP_IGMP */
#endif /* !NO_SYS */ #endif /* LWIP_NETCONN */

View File

@ -37,15 +37,15 @@
*/ */
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/arch.h"
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
#include "lwip/api_msg.h" #include "lwip/api_msg.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/tcpip.h" #include "lwip/tcpip.h"
#include "lwip/igmp.h" #include "lwip/igmp.h"
#if !NO_SYS
/* forward declarations */ /* forward declarations */
#if LWIP_TCP #if LWIP_TCP
static err_t do_writemore(struct netconn *conn); static err_t do_writemore(struct netconn *conn);
@ -931,4 +931,4 @@ do_join_leave_group(struct api_msg_msg *msg)
} }
#endif /* LWIP_IGMP */ #endif /* LWIP_IGMP */
#endif /* !NO_SYS */ #endif /* LWIP_NETCONN */

View File

@ -36,11 +36,15 @@
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
#include "lwip/netbuf.h" #include "lwip/netbuf.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include <string.h>
/** /**
* Create (allocate) and initialize a new netbuf. * Create (allocate) and initialize a new netbuf.
* The netbuf doesn't yet contain a packet buffer! * The netbuf doesn't yet contain a packet buffer!
@ -227,3 +231,5 @@ netbuf_first(struct netbuf *buf)
LWIP_ERROR("netbuf_free: invalid buf", (buf != NULL), return;); LWIP_ERROR("netbuf_free: invalid buf", (buf != NULL), return;);
buf->ptr = buf->p; buf->ptr = buf->p;
} }
#endif /* LWIP_NETCONN */

View File

@ -32,12 +32,12 @@
*/ */
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/arch.h"
#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
#include "lwip/netifapi.h" #include "lwip/netifapi.h"
#include "lwip/tcpip.h" #include "lwip/tcpip.h"
#if LWIP_NETIF_API
/** /**
* Call netif_add() in a thread-safe way by running that function inside the * Call netif_add() in a thread-safe way by running that function inside the
* tcpip_thread context. * tcpip_thread context.

View File

@ -38,20 +38,19 @@
* *
*/ */
#include "lwip/sockets.h"
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
#include "lwip/sockets.h"
#include "lwip/api.h" #include "lwip/api.h"
#include "lwip/arch.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/igmp.h" #include "lwip/igmp.h"
#include "lwip/inet.h" #include "lwip/inet.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
#include "lwip/tcpip.h" #include "lwip/tcpip.h"
#if !NO_SYS #include <string.h>
#define NUM_SOCKETS MEMP_NUM_NETCONN #define NUM_SOCKETS MEMP_NUM_NETCONN
@ -1081,11 +1080,13 @@ int lwip_getsockopt(int s, int level, int optname, void *optval, socklen_t *optl
if (*optlen < sizeof(int)) { if (*optlen < sizeof(int)) {
err = EINVAL; err = EINVAL;
} }
#if LWIP_UDP
if ((sock->conn->type != NETCONN_UDP) || if ((sock->conn->type != NETCONN_UDP) ||
((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0)) { ((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0)) {
/* this flag is only available for UDP, not for UDP lite */ /* this flag is only available for UDP, not for UDP lite */
err = EAFNOSUPPORT; err = EAFNOSUPPORT;
} }
#endif /* LWIP_UDP */
break; break;
default: default:
@ -1278,9 +1279,11 @@ static void lwip_getsockopt_internal(void *arg)
*(int *)optval = sock->conn->recv_timeout; *(int *)optval = sock->conn->recv_timeout;
break; break;
#endif /* LWIP_SO_RCVTIMEO */ #endif /* LWIP_SO_RCVTIMEO */
#if LWIP_UDP
case SO_NO_CHECK: case SO_NO_CHECK:
*(int*)optval = (udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_NOCHKSUM) ? 1 : 0; *(int*)optval = (udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_NOCHKSUM) ? 1 : 0;
break; break;
#endif /* LWIP_UDP*/
} /* switch (optname) */ } /* switch (optname) */
break; break;
@ -1405,11 +1408,13 @@ int lwip_setsockopt(int s, int level, int optname, const void *optval, socklen_t
if (optlen < sizeof(int)) { if (optlen < sizeof(int)) {
err = EINVAL; err = EINVAL;
} }
#if LWIP_UDP
if ((sock->conn->type != NETCONN_UDP) || if ((sock->conn->type != NETCONN_UDP) ||
((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0)) { ((udp_flags(sock->conn->pcb.udp) & UDP_FLAGS_UDPLITE) != 0)) {
/* this flag is only available for UDP, not for UDP lite */ /* this flag is only available for UDP, not for UDP lite */
err = EAFNOSUPPORT; err = EAFNOSUPPORT;
} }
#endif /* LWIP_UDP */
break; break;
default: default:
LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, SOL_SOCKET, UNIMPL: optname=0x%x, ..)\n", LWIP_DEBUGF(SOCKETS_DEBUG, ("lwip_setsockopt(%d, SOL_SOCKET, UNIMPL: optname=0x%x, ..)\n",
@ -1590,6 +1595,7 @@ static void lwip_setsockopt_internal(void *arg)
sock->conn->recv_timeout = ( *(int*)optval ); sock->conn->recv_timeout = ( *(int*)optval );
break; break;
#endif /* LWIP_SO_RCVTIMEO */ #endif /* LWIP_SO_RCVTIMEO */
#if LWIP_UDP
case SO_NO_CHECK: case SO_NO_CHECK:
if (*(int*)optval) { if (*(int*)optval) {
udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) | UDP_FLAGS_NOCHKSUM); udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) | UDP_FLAGS_NOCHKSUM);
@ -1597,6 +1603,7 @@ static void lwip_setsockopt_internal(void *arg)
udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) & ~UDP_FLAGS_NOCHKSUM); udp_setflags(sock->conn->pcb.udp, udp_flags(sock->conn->pcb.udp) & ~UDP_FLAGS_NOCHKSUM);
} }
break; break;
#endif /* LWIP_UDP */
} /* switch (optname) */ } /* switch (optname) */
break; break;
@ -1755,4 +1762,4 @@ int lwip_ioctl(int s, long cmd, void *argp)
} /* switch (cmd) */ } /* switch (cmd) */
} }
#endif /* !NO_SYS */ #endif /* LWIP_SOCKET */

View File

@ -38,21 +38,17 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/sys.h" #if !NO_SYS /* don't build if not configured for use in lwipopts.h */
#include "lwip/sys.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "netif/etharp.h"
#include "netif/ppp_oe.h"
#include "lwip/ip_frag.h" #include "lwip/ip_frag.h"
#include "lwip/igmp.h" #include "lwip/igmp.h"
#include "lwip/tcpip.h" #include "lwip/tcpip.h"
#include "lwip/init.h" #include "lwip/init.h"
#include "netif/etharp.h"
#if !NO_SYS #include "netif/ppp_oe.h"
/* global variables */ /* global variables */
static void (* tcpip_init_done)(void *arg) = NULL; static void (* tcpip_init_done)(void *arg) = NULL;

View File

@ -68,7 +68,9 @@
* *
*/ */
#include <string.h> #include "lwip/opt.h"
#if LWIP_DHCP /* don't build if not configured for use in lwipopts.h */
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/mem.h" #include "lwip/mem.h"
@ -76,14 +78,12 @@
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/inet.h" #include "lwip/inet.h"
#include "netif/etharp.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/opt.h"
#include "lwip/dhcp.h" #include "lwip/dhcp.h"
#include "lwip/autoip.h" #include "lwip/autoip.h"
#include "netif/etharp.h"
#if LWIP_DHCP /* don't build if not configured for use in lwipopts.h */ #include <string.h>
/** global transaction identifier, must be /** global transaction identifier, must be
* unique for each DHCP request. We simply increment, starting * unique for each DHCP request. We simply increment, starting

View File

@ -39,11 +39,8 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/arch.h"
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/inet.h" #include "lwip/inet.h"
#include "lwip/sys.h" #include "lwip/sys.h"
/* These are some reference implementations of the checksum algorithm, with the /* These are some reference implementations of the checksum algorithm, with the

View File

@ -37,6 +37,7 @@
*/ */
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/init.h" #include "lwip/init.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/sys.h" #include "lwip/sys.h"
@ -45,14 +46,13 @@
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/sockets.h" #include "lwip/sockets.h"
#include "netif/etharp.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/raw.h" #include "lwip/raw.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
#include "lwip/autoip.h" #include "lwip/autoip.h"
#include "lwip/igmp.h" #include "lwip/igmp.h"
#include "netif/etharp.h"
/* Compile-time sanity checks for configuration errors. /* Compile-time sanity checks for configuration errors.
* These can be done independently of LWIP_DEBUG, without penalty. * These can be done independently of LWIP_DEBUG, without penalty.

View File

@ -62,8 +62,10 @@
* *
*/ */
#include <stdlib.h> #include "lwip/opt.h"
#include <string.h>
#if LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */
#include "lwip/mem.h" #include "lwip/mem.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
@ -71,7 +73,8 @@
#include "lwip/autoip.h" #include "lwip/autoip.h"
#include "netif/etharp.h" #include "netif/etharp.h"
#if LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */ #include <stdlib.h>
#include <string.h>
/* pseudo random macro based on netif informations. You could use "rand()" from the C Library if you define LWIP_AUTOIP_RAND in lwipopts.h */ /* pseudo random macro based on netif informations. You could use "rand()" from the C Library if you define LWIP_AUTOIP_RAND in lwipopts.h */
#ifndef LWIP_AUTOIP_RAND #ifndef LWIP_AUTOIP_RAND

View File

@ -39,9 +39,10 @@
/* Some ICMP messages should be passed to the transport protocols. This /* Some ICMP messages should be passed to the transport protocols. This
is not implemented. */ is not implemented. */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/icmp.h" #include "lwip/icmp.h"
#include "lwip/inet.h" #include "lwip/inet.h"
#include "lwip/ip.h" #include "lwip/ip.h"
@ -49,7 +50,7 @@
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ #include <string.h>
/** /**
* Processes ICMP input packets, called from ip_input(). * Processes ICMP input packets, called from ip_input().

View File

@ -77,6 +77,10 @@ Steve Reynolds
* Includes * Includes
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/
#include "lwip/opt.h"
#if LWIP_IGMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/debug.h" #include "lwip/debug.h"
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/mem.h" #include "lwip/mem.h"
@ -89,12 +93,8 @@ Steve Reynolds
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/igmp.h" #include "lwip/igmp.h"
#include "arch/perf.h"
#include "string.h" #include "string.h"
#if LWIP_IGMP /* don't build if not configured for use in lwipopts.h */
/*----------------------------------------------------------------------------- /*-----------------------------------------------------------------------------
* Globales * Globales
*----------------------------------------------------------------------------*/ *----------------------------------------------------------------------------*/

View File

@ -39,7 +39,6 @@
*/ */
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/mem.h" #include "lwip/mem.h"
#include "lwip/ip.h" #include "lwip/ip.h"
@ -47,22 +46,14 @@
#include "lwip/inet.h" #include "lwip/inet.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/icmp.h" #include "lwip/icmp.h"
#include "lwip/igmp.h"
#include "lwip/raw.h" #include "lwip/raw.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
#include "lwip/stats.h"
#include "arch/perf.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#if LWIP_DHCP
#include "lwip/dhcp.h" #include "lwip/dhcp.h"
#endif /* LWIP_DHCP */ #include "lwip/stats.h"
#include "arch/perf.h"
#if LWIP_IGMP
# include "lwip/igmp.h"
#endif /* LWIP_IGMP */
/** /**
* Initializes the IP layer. * Initializes the IP layer.

View File

@ -36,6 +36,7 @@
* *
*/ */
#include "lwip/opt.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/inet.h" #include "lwip/inet.h"
#include "lwip/netif.h" #include "lwip/netif.h"

View File

@ -37,8 +37,6 @@
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/ip_frag.h" #include "lwip/ip_frag.h"
@ -46,6 +44,8 @@
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include <string.h>
#if IP_REASSEMBLY #if IP_REASSEMBLY
static u8_t ip_reassbuf[IP_HLEN + IP_REASS_BUFSIZE]; static u8_t ip_reassbuf[IP_HLEN + IP_REASS_BUFSIZE];
static u8_t ip_reassbitmap[IP_REASS_BUFSIZE / (8 * 8) + 1]; static u8_t ip_reassbitmap[IP_REASS_BUFSIZE / (8 * 8) + 1];

View File

@ -35,15 +35,14 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/icmp.h" #include "lwip/icmp.h"
#include "lwip/inet.h" #include "lwip/inet.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */
void void
icmp_input(struct pbuf *p, struct netif *inp) icmp_input(struct pbuf *p, struct netif *inp)
{ {

View File

@ -34,7 +34,6 @@
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/inet.h" #include "lwip/inet.h"
u8_t u8_t
ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2, ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2,
struct ip_addr *mask) struct ip_addr *mask)

View File

@ -37,18 +37,17 @@
* *
*/ */
#include <string.h>
#include "lwip/arch.h"
#include "lwip/opt.h" #include "lwip/opt.h"
#if !MEM_LIBC_MALLOC /* don't build if not configured for use in lwipopts.h */
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/mem.h" #include "lwip/mem.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#if !MEM_LIBC_MALLOC #include <string.h>
#if MEM_USE_POOLS #if MEM_USE_POOLS
/* lwIP head implemented with different sized pools */ /* lwIP head implemented with different sized pools */
@ -511,4 +510,5 @@ void *mem_calloc(size_t count, size_t size)
} }
return p; return p;
} }
#endif /* !MEM_LIBC_MALLOC */ #endif /* !MEM_LIBC_MALLOC */

View File

@ -36,9 +36,8 @@
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/udp.h" #include "lwip/udp.h"
@ -50,10 +49,9 @@
#include "lwip/tcpip.h" #include "lwip/tcpip.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#if ARP_QUEUEING
#include "netif/etharp.h" #include "netif/etharp.h"
#endif
#include <string.h>
struct memp { struct memp {
struct memp *next; struct memp *next;

View File

@ -44,10 +44,7 @@
#include "lwip/tcp.h" #include "lwip/tcp.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "lwip/igmp.h" #include "lwip/igmp.h"
#if LWIP_ARP
#include "netif/etharp.h" #include "netif/etharp.h"
#endif /* LWIP_ARP */
#if LWIP_NETIF_STATUS_CALLBACK #if LWIP_NETIF_STATUS_CALLBACK
#define NETIF_STATUS_CALLBACK(n) { if (n->status_callback) (n->status_callback)(n); } #define NETIF_STATUS_CALLBACK(n) { if (n->status_callback) (n->status_callback)(n); }

View File

@ -61,9 +61,8 @@
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/mem.h" #include "lwip/mem.h"
@ -72,6 +71,8 @@
#include "lwip/sys.h" #include "lwip/sys.h"
#include "arch/perf.h" #include "arch/perf.h"
#include <string.h>
#define SIZEOF_STRUCT_PBUF LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf)) #define SIZEOF_STRUCT_PBUF LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf))
/* Since the pool is created in memp, PBUF_POOL_BUFSIZE will be automatically /* Since the pool is created in memp, PBUF_POOL_BUFSIZE will be automatically
aligned there. Therefore, PBUF_POOL_BUFSIZE_ALIGNED can be used here. */ aligned there. Therefore, PBUF_POOL_BUFSIZE_ALIGNED can be used here. */

View File

@ -38,23 +38,21 @@
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/inet.h" #include "lwip/inet.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/raw.h" #include "lwip/raw.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include "arch/perf.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "arch/perf.h"
#if LWIP_RAW #include <string.h>
/** The list of RAW PCBs */ /** The list of RAW PCBs */
static struct raw_pcb *raw_pcbs = NULL; static struct raw_pcb *raw_pcbs = NULL;

View File

@ -36,7 +36,8 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SNMP #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/snmp_asn1.h" #include "lwip/snmp_asn1.h"
/** /**
@ -654,4 +655,3 @@ snmp_asn1_dec_raw(struct pbuf *p, u16_t ofs, u16_t len, u16_t raw_len, u8_t *raw
} }
#endif /* LWIP_SNMP */ #endif /* LWIP_SNMP */

View File

@ -36,7 +36,8 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SNMP #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/snmp_asn1.h" #include "lwip/snmp_asn1.h"
/** /**

View File

@ -37,17 +37,17 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SNMP #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "netif/etharp.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/ip_frag.h" #include "lwip/ip_frag.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/snmp_asn1.h" #include "lwip/snmp_asn1.h"
#include "lwip/snmp_structs.h" #include "lwip/snmp_structs.h"
#include "netif/etharp.h"
/** /**
* IANA assigned enterprise ID for lwIP is 26381 * IANA assigned enterprise ID for lwIP is 26381

View File

@ -34,12 +34,11 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SNMP #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/snmp_structs.h" #include "lwip/snmp_structs.h"
#include "lwip/mem.h" #include "lwip/mem.h"
/** .iso.org.dod.internet address prefix, @see snmp_iso_*() */ /** .iso.org.dod.internet address prefix, @see snmp_iso_*() */
const s32_t prefix[4] = {1, 3, 6, 1}; const s32_t prefix[4] = {1, 3, 6, 1};
@ -1182,4 +1181,3 @@ snmp_iso_prefix_expand(u8_t ident_len, s32_t *ident, struct snmp_obj_id *oidret)
} }
#endif /* LWIP_SNMP */ #endif /* LWIP_SNMP */

View File

@ -34,19 +34,18 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SNMP #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include <string.h>
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/mem.h" #include "lwip/mem.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "lwip/snmp_asn1.h" #include "lwip/snmp_asn1.h"
#include "lwip/snmp_msg.h" #include "lwip/snmp_msg.h"
#include "lwip/snmp_structs.h" #include "lwip/snmp_structs.h"
#include <string.h>
/* public (non-static) constants */ /* public (non-static) constants */
/** SNMP v1 == 0 */ /** SNMP v1 == 0 */

View File

@ -44,11 +44,10 @@
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SNMP #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "lwip/snmp_asn1.h" #include "lwip/snmp_asn1.h"
#include "lwip/snmp_msg.h" #include "lwip/snmp_msg.h"

View File

@ -36,17 +36,16 @@
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/def.h" #if LWIP_STATS /* don't build if not configured for use in lwipopts.h */
#include "lwip/def.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/mem.h" #include "lwip/mem.h"
#include <string.h>
#if LWIP_STATS
struct stats_ lwip_stats; struct stats_ lwip_stats;
void void
@ -141,5 +140,6 @@ stats_display(void)
#endif #endif
} }
#endif /* LWIP_STATS_DISPLAY */ #endif /* LWIP_STATS_DISPLAY */
#endif /* LWIP_STATS */ #endif /* LWIP_STATS */

View File

@ -36,14 +36,15 @@
* *
*/ */
#include "lwip/sys.h"
#include "lwip/opt.h" #include "lwip/opt.h"
#if (NO_SYS == 0) /* don't build if not configured for use in lwipopts.h */
#include "lwip/sys.h"
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/tcpip.h" #include "lwip/tcpip.h"
#if (NO_SYS == 0)
/** /**
* Struct used for sys_sem_wait_timeout() to tell wether the time * Struct used for sys_sem_wait_timeout() to tell wether the time
* has run out or the semaphore has really become available. * has run out or the semaphore has really become available.

View File

@ -40,16 +40,17 @@
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/mem.h" #include "lwip/mem.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
#if LWIP_TCP
#include <string.h>
/* Incremented every coarse grained timer shot (typically every 500 ms). */ /* Incremented every coarse grained timer shot (typically every 500 ms). */
u32_t tcp_ticks; u32_t tcp_ticks;
@ -1322,4 +1323,5 @@ tcp_pcbs_sane(void)
return 1; return 1;
} }
#endif /* TCP_DEBUG */ #endif /* TCP_DEBUG */
#endif /* LWIP_TCP */ #endif /* LWIP_TCP */

View File

@ -41,22 +41,21 @@
* *
*/ */
#include "lwip/def.h"
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */
#include "lwip/def.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/mem.h" #include "lwip/mem.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/inet.h" #include "lwip/inet.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include "arch/perf.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "arch/perf.h"
#if LWIP_TCP
/* These variables are global to all functions involved in the input /* These variables are global to all functions involved in the input
processing of TCP segments. They are set by the tcp_input() processing of TCP segments. They are set by the tcp_input()
function. */ function. */
@ -1279,4 +1278,5 @@ tcp_parseopt(struct tcp_pcb *pcb)
} }
} }
} }
#endif /* LWIP_TCP */ #endif /* LWIP_TCP */

View File

@ -38,10 +38,11 @@
* *
*/ */
#include <string.h> #include "lwip/opt.h"
#if LWIP_TCP /* don't build if not configured for use in lwipopts.h */
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/opt.h"
#include "lwip/mem.h" #include "lwip/mem.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/sys.h" #include "lwip/sys.h"
@ -52,7 +53,7 @@
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#if LWIP_TCP #include <string.h>
/* Forward declarations.*/ /* Forward declarations.*/
static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb); static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb);

View File

@ -43,10 +43,10 @@
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_UDP /* don't build if not configured for use in lwipopts.h */
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/memp.h" #include "lwip/memp.h"
#include "lwip/inet.h" #include "lwip/inet.h"
@ -54,14 +54,13 @@
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/icmp.h" #include "lwip/icmp.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include "arch/perf.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
#include "arch/perf.h"
#include <string.h>
/* The list of UDP PCBs */ /* The list of UDP PCBs */
#if LWIP_UDP
/* exported in udp.h (was static) */ /* exported in udp.h (was static) */
struct udp_pcb *udp_pcbs = NULL; struct udp_pcb *udp_pcbs = NULL;

View File

@ -45,6 +45,9 @@
#define __LWIP_AUTOIP_H__ #define __LWIP_AUTOIP_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "netif/etharp.h" #include "netif/etharp.h"
@ -97,4 +100,6 @@ void autoip_arp_reply(struct netif *netif, struct etharp_hdr *hdr);
/** Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds */ /** Has to be called in loop every AUTOIP_TMR_INTERVAL milliseconds */
void autoip_tmr(void); void autoip_tmr(void);
#endif /* LWIP_AUTOIP */
#endif /* __LWIP_AUTOIP_H__ */ #endif /* __LWIP_AUTOIP_H__ */

View File

@ -32,16 +32,14 @@
#ifndef __LWIP_ICMP_H__ #ifndef __LWIP_ICMP_H__
#define __LWIP_ICMP_H__ #define __LWIP_ICMP_H__
#include "lwip/arch.h"
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ #if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/pbuf.h"
#include "lwip/ip_addr.h"
#include "lwip/netif.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -32,9 +32,8 @@
#ifndef __LWIP_INET_H__ #ifndef __LWIP_INET_H__
#define __LWIP_INET_H__ #define __LWIP_INET_H__
#include "lwip/arch.h"
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"

View File

@ -32,15 +32,13 @@
#ifndef __LWIP_IP_H__ #ifndef __LWIP_IP_H__
#define __LWIP_IP_H__ #define __LWIP_IP_H__
#include "lwip/arch.h" #include "lwip/opt.h"
#include "lwip/def.h" #include "lwip/def.h"
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/err.h" #include "lwip/err.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -32,7 +32,7 @@
#ifndef __LWIP_IP_ADDR_H__ #ifndef __LWIP_IP_ADDR_H__
#define __LWIP_IP_ADDR_H__ #define __LWIP_IP_ADDR_H__
#include "lwip/arch.h" #include "lwip/opt.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -32,15 +32,13 @@
#ifndef __LWIP_ICMP_H__ #ifndef __LWIP_ICMP_H__
#define __LWIP_ICMP_H__ #define __LWIP_ICMP_H__
#include "lwip/arch.h"
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/pbuf.h"
#include "lwip/netif.h"
#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */ #if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/pbuf.h"
#include "lwip/netif.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -32,8 +32,6 @@
#ifndef __LWIP_INET_H__ #ifndef __LWIP_INET_H__
#define __LWIP_INET_H__ #define __LWIP_INET_H__
#include "lwip/arch.h"
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"

View File

@ -32,7 +32,7 @@
#ifndef __LWIP_IP_ADDR_H__ #ifndef __LWIP_IP_ADDR_H__
#define __LWIP_IP_ADDR_H__ #define __LWIP_IP_ADDR_H__
#include "lwip/arch.h" #include "lwip/opt.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -33,16 +33,16 @@
#define __LWIP_API_H__ #define __LWIP_API_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/netbuf.h" #include "lwip/netbuf.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/raw.h" #include "lwip/raw.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
#include "lwip/err.h" #include "lwip/err.h"
#ifdef __cplusplus #ifdef __cplusplus
@ -122,7 +122,7 @@ struct netconn {
this temporarily stores whether to wake up the original application task this temporarily stores whether to wake up the original application task
if data couldn't be sent in the first try. */ if data couldn't be sent in the first try. */
u8_t write_delayed; u8_t write_delayed;
#endif #endif /* LWIP_TCPIP_CORE_LOCKING */
void (* callback)(struct netconn *, enum netconn_evt, u16_t len); void (* callback)(struct netconn *, enum netconn_evt, u16_t len);
}; };
@ -174,4 +174,6 @@ err_t netconn_join_leave_group (struct netconn *conn,
} }
#endif #endif
#endif /* LWIP_NETCONN */
#endif /* __LWIP_API_H__ */ #endif /* __LWIP_API_H__ */

View File

@ -33,14 +33,14 @@
#define __LWIP_API_MSG_H__ #define __LWIP_API_MSG_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_NETCONN /* don't build if not configured for use in lwipopts.h */
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/udp.h" #include "lwip/udp.h"
#include "lwip/tcp.h" #include "lwip/tcp.h"
#include "lwip/api.h" #include "lwip/api.h"
#ifdef __cplusplus #ifdef __cplusplus
@ -102,4 +102,6 @@ void do_join_leave_group( struct api_msg_msg *msg);
} }
#endif #endif
#endif /* LWIP_NETCONN */
#endif /* __LWIP_API_MSG_H__ */ #endif /* __LWIP_API_MSG_H__ */

View File

@ -5,6 +5,9 @@
#define __LWIP_DHCP_H__ #define __LWIP_DHCP_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_DHCP /* don't build if not configured for use in lwipopts.h */
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/udp.h" #include "lwip/udp.h"
@ -236,4 +239,6 @@ void dhcp_fine_tmr(void);
} }
#endif #endif
#endif /* LWIP_DHCP */
#endif /*__LWIP_DHCP_H__*/ #endif /*__LWIP_DHCP_H__*/

View File

@ -33,7 +33,6 @@
#define __LWIP_INIT_H__ #define __LWIP_INIT_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/arch.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -33,7 +33,6 @@
#define __LWIP_MEM_H__ #define __LWIP_MEM_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#include "lwip/arch.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {

View File

@ -29,13 +29,14 @@
#define __LWIP_NETIFAPI_H__ #define __LWIP_NETIFAPI_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_NETIF_API /* don't build if not configured for use in lwipopts.h */
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/netif.h" #include "lwip/netif.h"
#include "lwip/dhcp.h" #include "lwip/dhcp.h"
#include "lwip/autoip.h" #include "lwip/autoip.h"
#if LWIP_NETIF_API
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif

View File

@ -33,7 +33,7 @@
#ifndef __LWIP_PBUF_H__ #ifndef __LWIP_PBUF_H__
#define __LWIP_PBUF_H__ #define __LWIP_PBUF_H__
#include "lwip/arch.h" #include "lwip/opt.h"
#include "lwip/err.h" #include "lwip/err.h"
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -32,7 +32,9 @@
#ifndef __LWIP_RAW_H__ #ifndef __LWIP_RAW_H__
#define __LWIP_RAW_H__ #define __LWIP_RAW_H__
#include "lwip/arch.h" #include "lwip/opt.h"
#if LWIP_RAW /* don't build if not configured for use in lwipopts.h */
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/inet.h" #include "lwip/inet.h"
@ -89,4 +91,6 @@ void raw_init (void);
} }
#endif #endif
#endif /* LWIP_RAW */
#endif /* __LWIP_RAW_H__ */ #endif /* __LWIP_RAW_H__ */

View File

@ -79,8 +79,7 @@ enum snmp_ifType {
snmp_ifType_frame_relay snmp_ifType_frame_relay
}; };
/* SNMP support available? */ #if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#if defined(LWIP_SNMP) && (LWIP_SNMP > 0)
/** fixed maximum length for object identifier type */ /** fixed maximum length for object identifier type */
#define LWIP_SNMP_OBJ_ID_LEN 32 #define LWIP_SNMP_OBJ_ID_LEN 32
@ -350,7 +349,7 @@ void snmp_get_snmpenableauthentraps(u8_t *value);
#define snmp_set_snmpenableauthentraps(value) #define snmp_set_snmpenableauthentraps(value)
#define snmp_get_snmpenableauthentraps(value) #define snmp_get_snmpenableauthentraps(value)
#endif #endif /* LWIP_SNMP */
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -94,4 +94,4 @@ err_t snmp_asn1_enc_raw(struct pbuf *p, u16_t ofs, u8_t raw_len, u8_t *raw);
} }
#endif #endif
#endif #endif /* __LWIP_SNMP_ASN1_H__ */

View File

@ -304,4 +304,4 @@ void snmp_authfail_trap(void);
} }
#endif #endif
#endif #endif /* __LWIP_SNMP_MSG_H__ */

View File

@ -38,7 +38,8 @@
#define __LWIP_SNMP_STRUCTS_H__ #define __LWIP_SNMP_STRUCTS_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SNMP
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
#include "lwip/snmp.h" #include "lwip/snmp.h"
@ -257,4 +258,5 @@ u8_t snmp_iso_prefix_expand(u8_t ident_len, s32_t *ident, struct snmp_obj_id *oi
#endif #endif
#endif /* LWIP_SNMP */ #endif /* LWIP_SNMP */
#endif
#endif /* __LWIP_SNMP_STRUCTS_H__ */

View File

@ -35,6 +35,9 @@
#define __LWIP_SOCKETS_H__ #define __LWIP_SOCKETS_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_SOCKET /* don't build if not configured for use in lwipopts.h */
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/inet.h" #include "lwip/inet.h"
@ -327,4 +330,6 @@ int lwip_ioctl(int s, long cmd, void *argp);
} }
#endif #endif
#endif /* LWIP_SOCKET */
#endif /* __LWIP_SOCKETS_H__ */ #endif /* __LWIP_SOCKETS_H__ */

View File

@ -32,14 +32,15 @@
#ifndef __LWIP_TCP_H__ #ifndef __LWIP_TCP_H__
#define __LWIP_TCP_H__ #define __LWIP_TCP_H__
#include "lwip/opt.h"
/*#if LWIP_TCP*/ /* don't build if not configured for use in lwipopts.h */
#include "lwip/sys.h" #include "lwip/sys.h"
#include "lwip/mem.h" #include "lwip/mem.h"
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/opt.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/icmp.h" #include "lwip/icmp.h"
#include "lwip/err.h" #include "lwip/err.h"
#ifdef __cplusplus #ifdef __cplusplus
@ -591,4 +592,6 @@ extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */
} }
#endif #endif
/*#endif*/ /* LWIP_TCP */
#endif /* __LWIP_TCP_H__ */ #endif /* __LWIP_TCP_H__ */

View File

@ -64,9 +64,7 @@ err_t tcpip_apimsg(struct api_msg *apimsg);
err_t tcpip_apimsg_lock(struct api_msg *apimsg); err_t tcpip_apimsg_lock(struct api_msg *apimsg);
#endif /* LWIP_TCPIP_CORE_LOCKING */ #endif /* LWIP_TCPIP_CORE_LOCKING */
#if LWIP_ARP
err_t tcpip_input(struct pbuf *p, struct netif *inp); err_t tcpip_input(struct pbuf *p, struct netif *inp);
#endif /* LWIP_ARP */
#if LWIP_NETIF_API #if LWIP_NETIF_API
err_t tcpip_netifapi(struct netifapi_msg *netifapimsg); err_t tcpip_netifapi(struct netifapi_msg *netifapimsg);
@ -81,9 +79,7 @@ err_t tcpip_timeout(u32_t msecs, sys_timeout_handler h, void *arg);
enum tcpip_msg_type { enum tcpip_msg_type {
TCPIP_MSG_API, TCPIP_MSG_API,
#if LWIP_ARP
TCPIP_MSG_INPKT, TCPIP_MSG_INPKT,
#endif /* LWIP_ARP */
#if LWIP_NETIF_API #if LWIP_NETIF_API
TCPIP_MSG_NETIFAPI, TCPIP_MSG_NETIFAPI,
#endif /* LWIP_NETIF_API */ #endif /* LWIP_NETIF_API */
@ -99,12 +95,10 @@ struct tcpip_msg {
#if LWIP_NETIF_API #if LWIP_NETIF_API
struct netifapi_msg *netifapimsg; struct netifapi_msg *netifapimsg;
#endif /* LWIP_NETIF_API */ #endif /* LWIP_NETIF_API */
#if LWIP_ARP
struct { struct {
struct pbuf *p; struct pbuf *p;
struct netif *netif; struct netif *netif;
} inp; } inp;
#endif /* LWIP_ARP */
struct { struct {
void (*f)(void *ctx); void (*f)(void *ctx);
void *ctx; void *ctx;

View File

@ -32,7 +32,9 @@
#ifndef __LWIP_UDP_H__ #ifndef __LWIP_UDP_H__
#define __LWIP_UDP_H__ #define __LWIP_UDP_H__
#include "lwip/arch.h" #include "lwip/opt.h"
#if LWIP_UDP /* don't build if not configured for use in lwipopts.h */
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/inet.h" #include "lwip/inet.h"
@ -135,4 +137,6 @@ void udp_debug_print(struct udp_hdr *udphdr);
} }
#endif #endif
#endif /* LWIP_UDP */
#endif /* __LWIP_UDP_H__ */ #endif /* __LWIP_UDP_H__ */

View File

@ -36,6 +36,9 @@
#define __NETIF_ETHARP_H__ #define __NETIF_ETHARP_H__
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_ARP /* don't build if not configured for use in lwipopts.h */
#include "lwip/pbuf.h" #include "lwip/pbuf.h"
#include "lwip/ip_addr.h" #include "lwip/ip_addr.h"
#include "lwip/netif.h" #include "lwip/netif.h"
@ -136,7 +139,7 @@ struct etharp_q_entry {
struct etharp_q_entry *next; struct etharp_q_entry *next;
struct pbuf *p; struct pbuf *p;
}; };
#endif #endif /* ARP_QUEUEING */
void etharp_init(void); void etharp_init(void);
void etharp_tmr(void); void etharp_tmr(void);
@ -165,4 +168,6 @@ extern const struct eth_addr ethbroadcast, ethzero;
} }
#endif #endif
#endif /* LWIP_ARP */
#endif /* __NETIF_ARP_H__ */ #endif /* __NETIF_ARP_H__ */

View File

@ -43,22 +43,19 @@
* This file is part of the lwIP TCP/IP stack. * This file is part of the lwIP TCP/IP stack.
* *
*/ */
#include <string.h>
#include "lwip/opt.h" #include "lwip/opt.h"
#if LWIP_ARP /* don't build if not configured for use in lwipopts.h */
#include "lwip/inet.h" #include "lwip/inet.h"
#include "netif/etharp.h"
#include "lwip/ip.h" #include "lwip/ip.h"
#include "lwip/stats.h" #include "lwip/stats.h"
#include "lwip/snmp.h" #include "lwip/snmp.h"
/* ARP needs to inform DHCP of any ARP replies? */
#if (LWIP_DHCP && DHCP_DOES_ARP_CHECK)
#include "lwip/dhcp.h" #include "lwip/dhcp.h"
#endif /* LWIP_DHCP && DHCP_DOES_ARP_CHECK */
/* ARP needs to inform AUTOIP of any ARP replies? */
#if (LWIP_AUTOIP)
#include "lwip/autoip.h" #include "lwip/autoip.h"
#endif /* LWIP_AUTOIP */ #include "netif/etharp.h"
#include <string.h>
/** the time an ARP entry stays valid after its last update, /** the time an ARP entry stays valid after its last update,
* for ARP_TMR_INTERVAL = 5000, this is * for ARP_TMR_INTERVAL = 5000, this is
@ -1086,3 +1083,5 @@ etharp_request(struct netif *netif, struct ip_addr *ipaddr)
(struct eth_addr *)netif->hwaddr, &netif->ip_addr, &ethzero, (struct eth_addr *)netif->hwaddr, &netif->ip_addr, &ethzero,
ipaddr, ARP_REQUEST); ipaddr, ARP_REQUEST);
} }
#endif /* LWIP_ARP */