fixed bug #43235, checking for non-existent preprocessor macros is non-standard, added predefinition for all affected macros

This commit is contained in:
Sylvain Rochet 2014-10-12 20:51:58 +02:00
parent da19974e81
commit 60f920df0e
5 changed files with 90 additions and 11 deletions

View File

@ -1780,12 +1780,41 @@
#endif
/**
* LWIP_PPP_API==1: Support PPP API (in pppapi.c)
* PRINTPKT_SUPPORT==1: Enable PPP print packet support
*
* Mandatory for debugging, it displays exchanged packet content in debug trace.
*/
#ifndef PRINTPKT_SUPPORT
#define PRINTPKT_SUPPORT 0
#endif
/**
* PPP_IPV6_SUPPORT==1: Enable PPP IPv6 support
*/
#ifndef PPP_IPV6_SUPPORT
#define PPP_IPV6_SUPPORT 0
#endif
/**
* LWIP_PPP_API==1: Enable PPP API (in pppapi.c)
*/
#ifndef LWIP_PPP_API
#define LWIP_PPP_API 0
#endif
/**
* PPP_NOTIFY_PHASE==1: Support PPP notify phase support
*
* PPP notify phase support allows you to set a callback which is
* called on change of the internal PPP state machine.
*
* This can be used for example to set a LED pattern depending on the
* current phase of the PPP session.
*/
#ifndef PPP_NOTIFY_PHASE
#define PPP_NOTIFY_PHASE 0
#endif
/**
* pbuf_type PPP is using for LCP, PAP, CHAP, EAP, IPCP and IP6CP packets.
*
@ -1832,6 +1861,13 @@
#define CHAP_SUPPORT 1 /* MSCHAP requires CHAP support */
#endif /* MSCHAP_SUPPORT */
/**
* EAP_SUPPORT==1: Support EAP.
*/
#ifndef EAP_SUPPORT
#define EAP_SUPPORT 0
#endif
/**
* CBCP_SUPPORT==1: Support CBCP. CURRENTLY NOT SUPPORTED! DO NOT SET!
*/
@ -1860,6 +1896,13 @@
#define LQR_SUPPORT 0
#endif
/**
* PPP_SERVER==1: Enable PPP server support (waiting for incoming PPP session). CURRENTLY NOT SUPPORTED! DO NOT SET!
*/
#ifndef PPP_SERVER
#define PPP_SERVER 0
#endif
/**
* VJ_SUPPORT==1: Support VJ header compression.
*/

View File

@ -48,6 +48,42 @@
#include "lwip/ip6_addr.h"
#endif /* PPP_IPV6_SUPPORT */
/* Disable non-working or rarely used PPP feature, so rarely that we don't want to bloat opt.h with them */
#ifndef PPP_OPTIONS
#define PPP_OPTIONS 0
#endif
#ifndef PPP_REMOTENAME
#define PPP_REMOTENAME 0
#endif
#ifndef PPP_IDLETIMELIMIT
#define PPP_IDLETIMELIMIT 0
#endif
#ifndef PPP_LCP_ADAPTIVE
#define PPP_LCP_ADAPTIVE 0
#endif
#ifndef PPP_MAXCONNECT
#define PPP_MAXCONNECT 0
#endif
#ifndef DEMAND_SUPPORT
#define DEMAND_SUPPORT 0
#endif
#ifndef PPP_ALLOWED_ADDRS
#define PPP_ALLOWED_ADDRS 0
#endif
#ifndef PPP_PROTOCOLNAME
#define PPP_PROTOCOLNAME 0
#endif
#ifndef PPP_STATS_SUPPORT
#define PPP_STATS_SUPPORT 0
#endif
/*************************

View File

@ -270,9 +270,9 @@ static int ipv6_demand_conf(int u);
static int ipv6cp_printpkt(u_char *p, int plen,
void (*printer)(void *, char *, ...), void *arg);
#endif /* PRINTPKT_SUPPORT */
#if PPP_DEMAND
#if DEMAND_SUPPORT
static int ipv6_active_pkt(u_char *pkt, int len);
#endif /* PPP_DEMAND */
#endif /* DEMAND_SUPPORT */
const struct protent ipv6cp_protent = {
PPP_IPV6CP,
@ -1035,7 +1035,7 @@ endswitch:
return (rc); /* Return final code */
}
#if PPP_OPTION
#if PPP_OPTIONS
/*
* ipv6_check_options - check that any IP-related options are OK,
* and assign appropriate defaults.
@ -1092,7 +1092,7 @@ static void ipv6_check_options() {
exit(1);
}
}
#endif /* PPP_OPTION */
#endif /* PPP_OPTIONS */
#if DEMAND_SUPPORT
/*
@ -1271,7 +1271,7 @@ static void ipv6cp_down(fsm *f) {
sif6comp(f->unit, 0);
#endif
#if PPP_DEMAND
#if DEMAND_SUPPORT
/*
* If we are doing dial-on-demand, set the interface
* to queue up outgoing packets (for now).
@ -1279,7 +1279,7 @@ static void ipv6cp_down(fsm *f) {
if (demand) {
sifnpmode(f->pcb, PPP_IPV6, NPMODE_QUEUE);
} else
#endif /* PPP_DEMAND */
#endif /* DEMAND_SUPPORT */
{
sifnpmode(f->pcb, PPP_IPV6, NPMODE_DROP);
ipv6cp_clear_addrs(f->pcb,
@ -1464,7 +1464,7 @@ static int ipv6cp_printpkt(u_char *p, int plen,
}
#endif /* PRINTPKT_SUPPORT */
#if PPP_DEMAND
#if DEMAND_SUPPORT
/*
* ipv6_active_pkt - see if this IP packet is worth bringing the link up for.
* We don't bring the link up for IP fragments or for TCP FIN packets
@ -1502,6 +1502,6 @@ static int ipv6_active_pkt(u_char *pkt, int len) {
return 0;
return 1;
}
#endif /* PPP_DEMAND */
#endif /* DEMAND_SUPPORT */
#endif /* PPP_SUPPORT && PPP_IPV6_SUPPORT */

View File

@ -29,7 +29,7 @@
*/
#include "lwip/opt.h"
#if PPP_SUPPORT && HAVE_MULTILINK /* don't build if not configured for use in lwipopts.h */
#if PPP_SUPPORT && defined(HAVE_MULTILINK) /* don't build if not configured for use in lwipopts.h */
/* Multilink support
*

View File

@ -602,7 +602,7 @@ static void ppp_clear(ppp_pcb *pcb) {
LWIP_ASSERT("pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_HOLDOFF", pcb->phase == PPP_PHASE_DEAD || pcb->phase == PPP_PHASE_HOLDOFF);
#if PPP_STATS_SUPPORTs
#if PPP_STATS_SUPPORT
link_stats_valid = 0;
#endif /* PPP_STATS_SUPPORT */