mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-08-08 08:33:39 +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:
@@ -45,6 +45,9 @@
|
||||
#define __LWIP_AUTOIP_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/udp.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 */
|
||||
void autoip_tmr(void);
|
||||
|
||||
#endif /* LWIP_AUTOIP */
|
||||
|
||||
#endif /* __LWIP_AUTOIP_H__ */
|
||||
|
||||
@@ -32,16 +32,14 @@
|
||||
#ifndef __LWIP_ICMP_H__
|
||||
#define __LWIP_ICMP_H__
|
||||
|
||||
#include "lwip/arch.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 */
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
#include "lwip/netif.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -32,9 +32,8 @@
|
||||
#ifndef __LWIP_INET_H__
|
||||
#define __LWIP_INET_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
|
||||
@@ -32,15 +32,13 @@
|
||||
#ifndef __LWIP_IP_H__
|
||||
#define __LWIP_IP_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#include "lwip/def.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#ifndef __LWIP_IP_ADDR_H__
|
||||
#define __LWIP_IP_ADDR_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -32,15 +32,13 @@
|
||||
#ifndef __LWIP_ICMP_H__
|
||||
#define __LWIP_ICMP_H__
|
||||
|
||||
#include "lwip/arch.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 */
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/netif.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
#ifndef __LWIP_INET_H__
|
||||
#define __LWIP_INET_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/ip_addr.h"
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
#ifndef __LWIP_IP_ADDR_H__
|
||||
#define __LWIP_IP_ADDR_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
#include "lwip/opt.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -33,16 +33,16 @@
|
||||
#define __LWIP_API_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/netbuf.h"
|
||||
#include "lwip/sys.h"
|
||||
|
||||
#include "lwip/ip.h"
|
||||
|
||||
#include "lwip/raw.h"
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -122,7 +122,7 @@ struct netconn {
|
||||
this temporarily stores whether to wake up the original application task
|
||||
if data couldn't be sent in the first try. */
|
||||
u8_t write_delayed;
|
||||
#endif
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
|
||||
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 /* LWIP_NETCONN */
|
||||
|
||||
#endif /* __LWIP_API_H__ */
|
||||
|
||||
@@ -33,14 +33,14 @@
|
||||
#define __LWIP_API_MSG_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/sys.h"
|
||||
|
||||
#include "lwip/ip.h"
|
||||
|
||||
#include "lwip/udp.h"
|
||||
#include "lwip/tcp.h"
|
||||
|
||||
#include "lwip/api.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -102,4 +102,6 @@ void do_join_leave_group( struct api_msg_msg *msg);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_NETCONN */
|
||||
|
||||
#endif /* __LWIP_API_MSG_H__ */
|
||||
|
||||
@@ -5,6 +5,9 @@
|
||||
#define __LWIP_DHCP_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/udp.h"
|
||||
|
||||
@@ -236,4 +239,6 @@ void dhcp_fine_tmr(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_DHCP */
|
||||
|
||||
#endif /*__LWIP_DHCP_H__*/
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#define __LWIP_INIT_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -33,7 +33,6 @@
|
||||
#define __LWIP_MEM_H__
|
||||
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/arch.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -91,4 +91,4 @@ void memp_free(memp_t type, void *mem);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __LWIP_MEMP_H__ */
|
||||
#endif /* __LWIP_MEMP_H__ */
|
||||
|
||||
@@ -29,13 +29,14 @@
|
||||
#define __LWIP_NETIFAPI_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/netif.h"
|
||||
#include "lwip/dhcp.h"
|
||||
#include "lwip/autoip.h"
|
||||
|
||||
#if LWIP_NETIF_API
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
@@ -33,7 +33,7 @@
|
||||
#ifndef __LWIP_PBUF_H__
|
||||
#define __LWIP_PBUF_H__
|
||||
|
||||
#include "lwip/arch.h"
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#ifndef __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/inet.h"
|
||||
@@ -89,4 +91,6 @@ void raw_init (void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_RAW */
|
||||
|
||||
#endif /* __LWIP_RAW_H__ */
|
||||
|
||||
@@ -79,8 +79,7 @@ enum snmp_ifType {
|
||||
snmp_ifType_frame_relay
|
||||
};
|
||||
|
||||
/* SNMP support available? */
|
||||
#if defined(LWIP_SNMP) && (LWIP_SNMP > 0)
|
||||
#if LWIP_SNMP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
/** fixed maximum length for object identifier type */
|
||||
#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_get_snmpenableauthentraps(value)
|
||||
|
||||
#endif
|
||||
#endif /* LWIP_SNMP */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
|
||||
@@ -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 /* __LWIP_SNMP_ASN1_H__ */
|
||||
|
||||
@@ -304,4 +304,4 @@ void snmp_authfail_trap(void);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
#endif /* __LWIP_SNMP_MSG_H__ */
|
||||
|
||||
@@ -38,7 +38,8 @@
|
||||
#define __LWIP_SNMP_STRUCTS_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"
|
||||
|
||||
@@ -257,4 +258,5 @@ u8_t snmp_iso_prefix_expand(u8_t ident_len, s32_t *ident, struct snmp_obj_id *oi
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_SNMP */
|
||||
#endif
|
||||
|
||||
#endif /* __LWIP_SNMP_STRUCTS_H__ */
|
||||
|
||||
@@ -35,6 +35,9 @@
|
||||
#define __LWIP_SOCKETS_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/inet.h"
|
||||
|
||||
@@ -327,4 +330,6 @@ int lwip_ioctl(int s, long cmd, void *argp);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_SOCKET */
|
||||
|
||||
#endif /* __LWIP_SOCKETS_H__ */
|
||||
|
||||
@@ -32,14 +32,15 @@
|
||||
#ifndef __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/mem.h"
|
||||
|
||||
#include "lwip/pbuf.h"
|
||||
#include "lwip/opt.h"
|
||||
#include "lwip/ip.h"
|
||||
#include "lwip/icmp.h"
|
||||
|
||||
#include "lwip/err.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -591,4 +592,6 @@ extern struct tcp_pcb *tcp_tmp_pcb; /* Only used for temporary storage. */
|
||||
}
|
||||
#endif
|
||||
|
||||
/*#endif*/ /* LWIP_TCP */
|
||||
|
||||
#endif /* __LWIP_TCP_H__ */
|
||||
|
||||
@@ -64,9 +64,7 @@ err_t tcpip_apimsg(struct api_msg *apimsg);
|
||||
err_t tcpip_apimsg_lock(struct api_msg *apimsg);
|
||||
#endif /* LWIP_TCPIP_CORE_LOCKING */
|
||||
|
||||
#if LWIP_ARP
|
||||
err_t tcpip_input(struct pbuf *p, struct netif *inp);
|
||||
#endif /* LWIP_ARP */
|
||||
|
||||
#if LWIP_NETIF_API
|
||||
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 {
|
||||
TCPIP_MSG_API,
|
||||
#if LWIP_ARP
|
||||
TCPIP_MSG_INPKT,
|
||||
#endif /* LWIP_ARP */
|
||||
#if LWIP_NETIF_API
|
||||
TCPIP_MSG_NETIFAPI,
|
||||
#endif /* LWIP_NETIF_API */
|
||||
@@ -99,12 +95,10 @@ struct tcpip_msg {
|
||||
#if LWIP_NETIF_API
|
||||
struct netifapi_msg *netifapimsg;
|
||||
#endif /* LWIP_NETIF_API */
|
||||
#if LWIP_ARP
|
||||
struct {
|
||||
struct pbuf *p;
|
||||
struct netif *netif;
|
||||
} inp;
|
||||
#endif /* LWIP_ARP */
|
||||
struct {
|
||||
void (*f)(void *ctx);
|
||||
void *ctx;
|
||||
|
||||
@@ -32,7 +32,9 @@
|
||||
#ifndef __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/inet.h"
|
||||
@@ -135,4 +137,6 @@ void udp_debug_print(struct udp_hdr *udphdr);
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_UDP */
|
||||
|
||||
#endif /* __LWIP_UDP_H__ */
|
||||
|
||||
@@ -36,6 +36,9 @@
|
||||
#define __NETIF_ETHARP_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/ip_addr.h"
|
||||
#include "lwip/netif.h"
|
||||
@@ -136,7 +139,7 @@ struct etharp_q_entry {
|
||||
struct etharp_q_entry *next;
|
||||
struct pbuf *p;
|
||||
};
|
||||
#endif
|
||||
#endif /* ARP_QUEUEING */
|
||||
|
||||
void etharp_init(void);
|
||||
void etharp_tmr(void);
|
||||
@@ -165,4 +168,6 @@ extern const struct eth_addr ethbroadcast, ethzero;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* LWIP_ARP */
|
||||
|
||||
#endif /* __NETIF_ARP_H__ */
|
||||
|
||||
Reference in New Issue
Block a user