mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-06-13 08:23:56 +08:00
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:
@@ -67,23 +67,23 @@
|
||||
* to remove the DHCP client.
|
||||
*
|
||||
*/
|
||||
|
||||
#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/mem.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/inet.h"
|
||||
#include "netif/etharp.h"
|
||||
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/dhcp.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
|
||||
* unique for each DHCP request. We simply increment, starting
|
||||
|
||||
@@ -39,11 +39,8 @@
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/inet.h"
|
||||
|
||||
#include "lwip/sys.h"
|
||||
|
||||
/* These are some reference implementations of the checksum algorithm, with the
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
*/
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/init.h"
|
||||
#include "lwip/stats.h"
|
||||
#include "lwip/sys.h"
|
||||
@@ -45,14 +46,13 @@
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/sockets.h"
|
||||
#include "netif/etharp.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/autoip.h"
|
||||
#include "lwip/igmp.h"
|
||||
|
||||
#include "netif/etharp.h"
|
||||
|
||||
/* Compile-time sanity checks for configuration errors.
|
||||
* These can be done independently of LWIP_DEBUG, without penalty.
|
||||
|
||||
@@ -62,8 +62,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#if LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
@@ -71,7 +73,8 @@
|
||||
#include "lwip/autoip.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 */
|
||||
#ifndef LWIP_AUTOIP_RAND
|
||||
|
||||
@@ -39,9 +39,10 @@
|
||||
/* Some ICMP messages should be passed to the transport protocols. This
|
||||
is not implemented. */
|
||||
|
||||
#include <string.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/inet.h"
|
||||
#include "lwip/ip.h"
|
||||
@@ -49,7 +50,7 @@
|
||||
#include "lwip/stats.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().
|
||||
|
||||
@@ -77,6 +77,10 @@ Steve Reynolds
|
||||
* 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/def.h"
|
||||
#include "lwip/mem.h"
|
||||
@@ -89,12 +93,8 @@ Steve Reynolds
|
||||
#include "lwip/stats.h"
|
||||
#include "lwip/igmp.h"
|
||||
|
||||
#include "arch/perf.h"
|
||||
|
||||
#include "string.h"
|
||||
|
||||
#if LWIP_IGMP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Globales
|
||||
*----------------------------------------------------------------------------*/
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
*/
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/ip.h"
|
||||
@@ -47,22 +46,14 @@
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/icmp.h"
|
||||
#include "lwip/igmp.h"
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#include "arch/perf.h"
|
||||
|
||||
#include "lwip/snmp.h"
|
||||
#if LWIP_DHCP
|
||||
# include "lwip/dhcp.h"
|
||||
#endif /* LWIP_DHCP */
|
||||
|
||||
#if LWIP_IGMP
|
||||
# include "lwip/igmp.h"
|
||||
#endif /* LWIP_IGMP */
|
||||
#include "lwip/dhcp.h"
|
||||
#include "lwip/stats.h"
|
||||
#include "arch/perf.h"
|
||||
|
||||
/**
|
||||
* Initializes the IP layer.
|
||||
|
||||
@@ -36,6 +36,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/netif.h"
|
||||
|
||||
@@ -37,8 +37,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/ip_frag.h"
|
||||
@@ -46,6 +44,8 @@
|
||||
#include "lwip/snmp.h"
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if IP_REASSEMBLY
|
||||
static u8_t ip_reassbuf[IP_HLEN + IP_REASS_BUFSIZE];
|
||||
static u8_t ip_reassbitmap[IP_REASS_BUFSIZE / (8 * 8) + 1];
|
||||
|
||||
@@ -35,15 +35,14 @@
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
#include "lwip/icmp.h"
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/def.h"
|
||||
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#if LWIP_ICMP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
void
|
||||
icmp_input(struct pbuf *p, struct netif *inp)
|
||||
{
|
||||
|
||||
@@ -34,7 +34,6 @@
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/inet.h"
|
||||
|
||||
|
||||
u8_t
|
||||
ip_addr_netcmp(struct ip_addr *addr1, struct ip_addr *addr2,
|
||||
struct ip_addr *mask)
|
||||
|
||||
@@ -37,18 +37,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "lwip/arch.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/mem.h"
|
||||
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#if !MEM_LIBC_MALLOC
|
||||
#include <string.h>
|
||||
|
||||
#if MEM_USE_POOLS
|
||||
/* lwIP head implemented with different sized pools */
|
||||
|
||||
@@ -511,4 +510,5 @@ void *mem_calloc(size_t count, size_t size)
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
#endif /* !MEM_LIBC_MALLOC */
|
||||
|
||||
@@ -36,9 +36,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/udp.h"
|
||||
@@ -50,10 +49,9 @@
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#if ARP_QUEUEING
|
||||
#include "netif/etharp.h"
|
||||
#endif
|
||||
|
||||
#include <string.h>
|
||||
|
||||
struct memp {
|
||||
struct memp *next;
|
||||
|
||||
@@ -44,10 +44,7 @@
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/snmp.h"
|
||||
#include "lwip/igmp.h"
|
||||
|
||||
#if LWIP_ARP
|
||||
#include "netif/etharp.h"
|
||||
#endif /* LWIP_ARP */
|
||||
|
||||
#if LWIP_NETIF_STATUS_CALLBACK
|
||||
#define NETIF_STATUS_CALLBACK(n) { if (n->status_callback) (n->status_callback)(n); }
|
||||
|
||||
@@ -61,9 +61,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/stats.h"
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/mem.h"
|
||||
@@ -72,6 +71,8 @@
|
||||
#include "lwip/sys.h"
|
||||
#include "arch/perf.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#define SIZEOF_STRUCT_PBUF LWIP_MEM_ALIGN_SIZE(sizeof(struct pbuf))
|
||||
/* Since the pool is created in memp, PBUF_POOL_BUFSIZE will be automatically
|
||||
aligned there. Therefore, PBUF_POOL_BUFSIZE_ALIGNED can be used here. */
|
||||
|
||||
@@ -38,23 +38,21 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.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/memp.h"
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/raw.h"
|
||||
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#include "arch/perf.h"
|
||||
#include "lwip/snmp.h"
|
||||
#include "arch/perf.h"
|
||||
|
||||
#if LWIP_RAW
|
||||
#include <string.h>
|
||||
|
||||
/** The list of RAW PCBs */
|
||||
static struct raw_pcb *raw_pcbs = NULL;
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
|
||||
#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"
|
||||
|
||||
/**
|
||||
@@ -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 */
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@
|
||||
|
||||
#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"
|
||||
|
||||
/**
|
||||
|
||||
@@ -37,17 +37,17 @@
|
||||
|
||||
#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/netif.h"
|
||||
#include "netif/etharp.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/ip_frag.h"
|
||||
#include "lwip/tcp.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/snmp_asn1.h"
|
||||
#include "lwip/snmp_structs.h"
|
||||
#include "netif/etharp.h"
|
||||
|
||||
/**
|
||||
* IANA assigned enterprise ID for lwIP is 26381
|
||||
|
||||
@@ -34,12 +34,11 @@
|
||||
|
||||
#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/mem.h"
|
||||
|
||||
|
||||
|
||||
/** .iso.org.dod.internet address prefix, @see snmp_iso_*() */
|
||||
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 */
|
||||
|
||||
|
||||
@@ -34,19 +34,18 @@
|
||||
|
||||
#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/mem.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#include "lwip/snmp.h"
|
||||
#include "lwip/snmp_asn1.h"
|
||||
#include "lwip/snmp_msg.h"
|
||||
#include "lwip/snmp_structs.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* public (non-static) constants */
|
||||
/** SNMP v1 == 0 */
|
||||
|
||||
@@ -44,11 +44,10 @@
|
||||
|
||||
#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/netif.h"
|
||||
|
||||
#include "lwip/snmp.h"
|
||||
#include "lwip/snmp_asn1.h"
|
||||
#include "lwip/snmp_msg.h"
|
||||
|
||||
@@ -36,17 +36,16 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.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/mem.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#if LWIP_STATS
|
||||
struct stats_ lwip_stats;
|
||||
|
||||
void
|
||||
@@ -141,5 +140,6 @@ stats_display(void)
|
||||
#endif
|
||||
}
|
||||
#endif /* LWIP_STATS_DISPLAY */
|
||||
|
||||
#endif /* LWIP_STATS */
|
||||
|
||||
|
||||
@@ -36,14 +36,15 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lwip/sys.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/memp.h"
|
||||
#include "lwip/tcpip.h"
|
||||
|
||||
#if (NO_SYS == 0)
|
||||
|
||||
/**
|
||||
* Struct used for sys_sem_wait_timeout() to tell wether the time
|
||||
* has run out or the semaphore has really become available.
|
||||
|
||||
@@ -40,16 +40,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#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/mem.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/snmp.h"
|
||||
|
||||
#include "lwip/tcp.h"
|
||||
#if LWIP_TCP
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* Incremented every coarse grained timer shot (typically every 500 ms). */
|
||||
u32_t tcp_ticks;
|
||||
@@ -1322,4 +1323,5 @@ tcp_pcbs_sane(void)
|
||||
return 1;
|
||||
}
|
||||
#endif /* TCP_DEBUG */
|
||||
|
||||
#endif /* LWIP_TCP */
|
||||
|
||||
@@ -41,22 +41,21 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "lwip/def.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/netif.h"
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/memp.h"
|
||||
|
||||
#include "lwip/inet.h"
|
||||
#include "lwip/tcp.h"
|
||||
|
||||
#include "lwip/stats.h"
|
||||
#include "arch/perf.h"
|
||||
#include "lwip/snmp.h"
|
||||
#include "arch/perf.h"
|
||||
|
||||
#if LWIP_TCP
|
||||
/* These variables are global to all functions involved in the input
|
||||
processing of TCP segments. They are set by the tcp_input()
|
||||
function. */
|
||||
@@ -1279,4 +1278,5 @@ tcp_parseopt(struct tcp_pcb *pcb)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* LWIP_TCP */
|
||||
|
||||
@@ -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/opt.h"
|
||||
#include "lwip/mem.h"
|
||||
#include "lwip/memp.h"
|
||||
#include "lwip/sys.h"
|
||||
@@ -52,7 +53,7 @@
|
||||
#include "lwip/stats.h"
|
||||
#include "lwip/snmp.h"
|
||||
|
||||
#if LWIP_TCP
|
||||
#include <string.h>
|
||||
|
||||
/* Forward declarations.*/
|
||||
static void tcp_output_segment(struct tcp_seg *seg, struct tcp_pcb *pcb);
|
||||
|
||||
@@ -43,10 +43,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include <string.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/memp.h"
|
||||
#include "lwip/inet.h"
|
||||
@@ -54,14 +54,13 @@
|
||||
#include "lwip/netif.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/icmp.h"
|
||||
|
||||
#include "lwip/stats.h"
|
||||
|
||||
#include "arch/perf.h"
|
||||
#include "lwip/snmp.h"
|
||||
#include "arch/perf.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/* The list of UDP PCBs */
|
||||
#if LWIP_UDP
|
||||
/* exported in udp.h (was static) */
|
||||
struct udp_pcb *udp_pcbs = NULL;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user