diff --git a/src/netif/ppp/ccp.c b/src/netif/ppp/ccp.c index 6c6ce7a2..3cc8d8f3 100644 --- a/src/netif/ppp/ccp.c +++ b/src/netif/ppp/ccp.c @@ -199,8 +199,10 @@ struct protent ccp_protent = { ccp_option_list, NULL, #endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT NULL, NULL +#endif /* DEMAND_SUPPORT */ }; fsm ccp_fsm[NUM_PPP]; diff --git a/src/netif/ppp/chap-new.c b/src/netif/ppp/chap-new.c index 34a45898..a517b23d 100644 --- a/src/netif/ppp/chap-new.c +++ b/src/netif/ppp/chap-new.c @@ -669,8 +669,10 @@ struct protent chap_protent = { chap_option_list, NULL, /* check_options */ #endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT NULL, NULL +#endif /* DEMAND_SUPPORT */ }; #endif /* PPP_SUPPORT && CHAP_SUPPORT */ diff --git a/src/netif/ppp/demand.c b/src/netif/ppp/demand.c index 570846d3..4e922cde 100644 --- a/src/netif/ppp/demand.c +++ b/src/netif/ppp/demand.c @@ -29,8 +29,7 @@ */ #include "lwip/opt.h" - -#define RCSID "$Id: demand.c,v 1.20 2005/08/25 12:14:18 paulus Exp $" +#if PPP_SUPPORT && DEMAND_SUPPORT /* don't build if not configured for use in lwipopts.h */ #include #include @@ -466,3 +465,5 @@ active_packet(p, len) } return 0; /* not a supported protocol !!?? */ } + +#endif /* PPP_SUPPORT && DEMAND_SUPPORT */ diff --git a/src/netif/ppp/eap.c b/src/netif/ppp/eap.c index bac849d0..b08f6c68 100644 --- a/src/netif/ppp/eap.c +++ b/src/netif/ppp/eap.c @@ -122,8 +122,10 @@ struct protent eap_protent = { eap_option_list, /* list of command-line options */ NULL, /* check requested options; assign defaults */ #endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT NULL, /* configure interface for demand-dial */ NULL /* say whether to bring up link for this pkt */ +#endif /* DEMAND_SUPPORT */ }; #ifdef USE_SRP diff --git a/src/netif/ppp/ecp.c b/src/netif/ppp/ecp.c index 3c02e091..ef20e791 100644 --- a/src/netif/ppp/ecp.c +++ b/src/netif/ppp/ecp.c @@ -118,8 +118,10 @@ struct protent ecp_protent = { ecp_option_list, NULL, #endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT NULL, NULL +#endif /* DEMAND_SUPPORT */ }; fsm ecp_fsm[NUM_PPP]; diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index 4c353730..646f52ac 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -259,8 +259,10 @@ static void ipcp_protrej __P((int)); static int ipcp_printpkt __P((u_char *, int, void (*) __P((void *, char *, ...)), void *)); static void ip_check_options __P((void)); +#if DEMAND_SUPPORT static int ip_demand_conf __P((int)); static int ip_active_pkt __P((u_char *, int)); +#endif /* DEMAND_SUPPORT */ static void create_resolv __P((u_int32_t, u_int32_t)); struct protent ipcp_protent = { @@ -281,8 +283,10 @@ struct protent ipcp_protent = { ipcp_option_list, ip_check_options, #endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT ip_demand_conf, ip_active_pkt +#endif /* DEMAND_SUPPORT */ }; static void ipcp_clear_addrs __P((int, u_int32_t, u_int32_t, bool)); @@ -1724,6 +1728,7 @@ ip_check_options() } #endif /* UNUSED */ +#if DEMAND_SUPPORT /* * ip_demand_conf - configure the interface as though * IPCP were up, for use with dial-on-demand. @@ -1765,7 +1770,7 @@ ip_demand_conf(u) return 1; } - +#endif /* DEMAND_SUPPORT */ /* * ipcp_up - IPCP has come UP. @@ -1837,6 +1842,7 @@ ipcp_up(f) /* set tcp compression */ sifvjcomp(f->unit, ho->neg_vj, ho->cflag, ho->maxslotindex); +#if DEMAND_SUPPORT /* * If we are doing dial-on-demand, the interface is already * configured, so we put out any saved-up packets, then set the @@ -1883,7 +1889,9 @@ ipcp_up(f) demand_rexmit(PPP_IP,go->ouraddr); sifnpmode(f->unit, PPP_IP, NPMODE_PASS); - } else { + } else +#endif /* DEMAND_SUPPORT */ + { /* * Set IP addresses and (if specified) netmask. */ @@ -1978,13 +1986,16 @@ ipcp_down(f) * because print_link_stats() sets link_stats_valid * to 0 (zero) */ +#if DEMAND_SUPPORT /* * If we are doing dial-on-demand, set the interface * to queue up outgoing packets (for now). */ if (demand) { sifnpmode(f->unit, PPP_IP, NPMODE_QUEUE); - } else { + } else +#endif /* DEMAND_SUPPORT */ + { sifnpmode(f->unit, PPP_IP, NPMODE_DROP); sifdown(f->unit); ipcp_clear_addrs(f->unit, ipcp_gotoptions[f->unit].ouraddr, @@ -2188,6 +2199,7 @@ ipcp_printpkt(p, plen, printer, arg) #define TCP_HDRLEN 20 #define TH_FIN 0x01 +#if DEMAND_SUPPORT /* * We use these macros because the IP header may be at an odd address, * and some compilers might use word loads to get th_off or ip_hl. @@ -2224,3 +2236,4 @@ ip_active_pkt(pkt, len) return 0; return 1; } +#endif /* DEMAND_SUPPORT */ diff --git a/src/netif/ppp/lcp.c b/src/netif/ppp/lcp.c index a1a054e4..cc83f528 100644 --- a/src/netif/ppp/lcp.c +++ b/src/netif/ppp/lcp.c @@ -285,8 +285,10 @@ struct protent lcp_protent = { lcp_option_list, NULL, #endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT NULL, NULL +#endif /* DEMAND_SUPPORT */ }; int lcp_loopbackfail = DEFLOOPBACKFAIL; diff --git a/src/netif/ppp/options.c b/src/netif/ppp/options.c index 6aebbf3d..62ba3b63 100644 --- a/src/netif/ppp/options.c +++ b/src/netif/ppp/options.c @@ -102,7 +102,9 @@ int maxconnect = 0; /* Maximum connect time */ //char passwd[MAXSECRETLEN]; /* Password for PAP */ bool persist = 0; /* Reopen link after it goes down */ char our_name[MAXNAMELEN]; /* Our name for authentication purposes */ +#if DEMAND_SUPPORT bool demand = 0; /* do dial-on-demand */ +#endif /* DEMAND_SUPPORT */ char *ipparam = NULL; /* Extra parameter for ip up/down scripts */ int idle_time_limit = 0; /* Disconnect if idle for this many seconds */ int holdoff = 30; /* # seconds to pause before reconnecting */ diff --git a/src/netif/ppp/pppd.h b/src/netif/ppp/pppd.h index cdf4403c..3f30d29c 100644 --- a/src/netif/ppp/pppd.h +++ b/src/netif/ppp/pppd.h @@ -436,10 +436,12 @@ struct protent { /* Check requested options, assign defaults */ void (*check_options) __P((void)); #endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT /* Configure interface for demand-dial */ int (*demand_conf) __P((int unit)); /* Say whether to bring up link for this pkt */ int (*active_pkt) __P((u_char *pkt, int len)); +#endif /* DEMAND_SUPPORT */ }; /* Table of pointers to supported protocols */ diff --git a/src/netif/ppp/upap.c b/src/netif/ppp/upap.c index fb268b60..e989a430 100644 --- a/src/netif/ppp/upap.c +++ b/src/netif/ppp/upap.c @@ -105,8 +105,10 @@ struct protent pap_protent = { pap_option_list, NULL, #endif /* PPP_OPTIONS */ +#if DEMAND_SUPPORT NULL, NULL +#endif /* DEMAND_SUPPORT */ }; upap_state upap[NUM_PPP]; /* UPAP state; one for each unit */