mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-30 03:32:50 +00:00
Move some build time checkings inside init.c for task #7142 "Sanity check user-configurable values".
This commit is contained in:
parent
5865a78c1e
commit
c1f89c5640
@ -19,6 +19,10 @@ HISTORY
|
||||
|
||||
++ New features:
|
||||
|
||||
2007-09-05 Frédéric Bernon
|
||||
* inet.c, autoip.c, msg_in.c, msg_out.c, init.c: Move some build time checkings
|
||||
inside init.c for task #7142 "Sanity check user-configurable values".
|
||||
|
||||
2007-09-04 Frédéric Bernon, Bill Florac
|
||||
* igmp.h, igmp.c, memp_std.h, memp.c, init.c, opt.h: Replace mem_malloc call by
|
||||
memp_malloc, and use a new MEMP_NUM_IGMP_GROUP option (see opt.h to define the
|
||||
|
@ -534,9 +534,6 @@ inet_ntoa(struct in_addr addr)
|
||||
* Note ntohs() and ntohl() are merely references to the htonx counterparts.
|
||||
*/
|
||||
|
||||
#ifndef BYTE_ORDER
|
||||
#error BYTE_ORDER is not defined
|
||||
#endif
|
||||
#if (LWIP_PLATFORM_BYTESWAP == 0) && (BYTE_ORDER == LITTLE_ENDIAN)
|
||||
|
||||
/**
|
||||
|
@ -57,6 +57,9 @@
|
||||
/* Compile-time sanity checks for configuration errors.
|
||||
* These can be done independently of LWIP_DEBUG, without penalty.
|
||||
*/
|
||||
#ifndef BYTE_ORDER
|
||||
#error "BYTE_ORDER is not defined, you have to define it in your cc.h"
|
||||
#endif
|
||||
#if (!LWIP_ARP && ARP_QUEUEING)
|
||||
#error "If you want to use ARP Queueing, you have to define LWIP_ARP=1 in your lwipopts.h"
|
||||
#endif
|
||||
@ -102,6 +105,15 @@
|
||||
#if (((!LWIP_DHCP) || (!LWIP_ARP)) && DHCP_DOES_ARP_CHECK)
|
||||
#error "If you want to use DHCP ARP checking, you have to define LWIP_DHCP=1 and LWIP_ARP=1 in your lwipopts.h"
|
||||
#endif
|
||||
#if (!LWIP_ARP && LWIP_AUTOIP)
|
||||
#error "If you want to use AUTOIP, you have to define LWIP_ARP=1 in your lwipopts.h"
|
||||
#endif
|
||||
#if (LWIP_SNMP && (SNMP_CONCURRENT_REQUESTS<=0))
|
||||
#error "If you want to use SNMP, you have to define SNMP_CONCURRENT_REQUESTS>=1 in your lwipopts.h"
|
||||
#endif
|
||||
#if (LWIP_SNMP && (SNMP_TRAP_DESTINATIONS<=0))
|
||||
#error "If you want to use SNMP, you have to define SNMP_TRAP_DESTINATIONS>=1 in your lwipopts.h"
|
||||
#endif
|
||||
#if (LWIP_TCP && ((LWIP_EVENT_API && LWIP_CALLBACK_API) || (!LWIP_EVENT_API && !LWIP_CALLBACK_API)))
|
||||
#error "One and exactly one of LWIP_EVENT_API and LWIP_CALLBACK_API has to be enabled in lwipopts.h"
|
||||
#endif
|
||||
|
@ -73,11 +73,6 @@
|
||||
|
||||
#if LWIP_AUTOIP /* don't build if not configured for use in lwipopts.h */
|
||||
|
||||
/* LWIP_ARP option should be configured in lwipopts.h */
|
||||
#if !LWIP_ARP
|
||||
#error LWIP_ARP is need for LWIP_AUTOIP. Set it from your lwipopts.h.
|
||||
#endif /* !LWIP_ARP */
|
||||
|
||||
/* 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
|
||||
#define LWIP_AUTOIP_RAND(netif) ( (((u32_t)((netif->hwaddr[5]) & 0xff) << 24) | ((u32_t)((netif->hwaddr[3]) & 0xff) << 16) | ((u32_t)((netif->hwaddr[2]) & 0xff) << 8) | ((u32_t)((netif->hwaddr[4]) & 0xff))) + (netif->autoip?netif->autoip->tried_llipaddr:0))
|
||||
|
@ -55,9 +55,6 @@ const s32_t snmp_version = 0;
|
||||
const char snmp_publiccommunity[7] = "public";
|
||||
|
||||
/* statically allocated buffers for SNMP_CONCURRENT_REQUESTS */
|
||||
#if (SNMP_CONCURRENT_REQUESTS == 0)
|
||||
#error "need at least one snmp_msg_pstat"
|
||||
#endif
|
||||
struct snmp_msg_pstat msg_input_list[SNMP_CONCURRENT_REQUESTS];
|
||||
/* UDP Protocol Control Block */
|
||||
struct udp_pcb *snmp1_pcb = NULL;
|
||||
|
@ -60,9 +60,6 @@ struct snmp_trap_dst
|
||||
/* set to 0 when disabled, >0 when enabled */
|
||||
u8_t enable;
|
||||
};
|
||||
#if (SNMP_TRAP_DESTINATIONS == 0)
|
||||
#error "need at least one trap destination"
|
||||
#endif
|
||||
struct snmp_trap_dst trap_dst[SNMP_TRAP_DESTINATIONS];
|
||||
|
||||
/** TRAP message structure */
|
||||
|
Loading…
x
Reference in New Issue
Block a user