From 48ec31d02ce7fd86a0f62f9c7511ef8a02eab0c6 Mon Sep 17 00:00:00 2001 From: jani Date: Tue, 16 Sep 2003 14:33:52 +0000 Subject: [PATCH] make PAP and CHAP optional --- .../ecos/net/lwip_tcpip/current/cdl/lwip_net.cdl | 16 ++++++++++++++-- .../net/lwip_tcpip/current/include/lwipopts.h | 13 ++++++++++++- .../ecos/net/lwip_tcpip/current/src/ecos/init.c | 4 +++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ports/ecos/ecos/net/lwip_tcpip/current/cdl/lwip_net.cdl b/ports/ecos/ecos/net/lwip_tcpip/current/cdl/lwip_net.cdl index ac3d383..1718314 100644 --- a/ports/ecos/ecos/net/lwip_tcpip/current/cdl/lwip_net.cdl +++ b/ports/ecos/ecos/net/lwip_tcpip/current/cdl/lwip_net.cdl @@ -481,8 +481,6 @@ cdl_package CYGPKG_NET_LWIP { description "The Point-to-Point Protocol" compile netif/ppp/ppp.c \ netif/ppp/auth.c \ - netif/ppp/pap.c \ - netif/ppp/chap.c \ netif/ppp/chpms.c \ netif/ppp/fsm.c \ netif/ppp/ipcp.c \ @@ -494,6 +492,20 @@ cdl_package CYGPKG_NET_LWIP { ecos/sio.c + cdl_option CYGPKG_LWIP_PPP_PAP_AUTH { + display "Support PAP authentication" + flavor bool + default_value 1 + compile netif/ppp/pap.c + } + + cdl_option CYGPKG_LWIP_PPP_CHAP_AUTH { + display "Support CHAP authentication" + flavor bool + default_value 1 + compile netif/ppp/chap.c + } + cdl_option CYGPKG_LWIP_PPP_DEV { display "Serial device for PPP" flavor data diff --git a/ports/ecos/ecos/net/lwip_tcpip/current/include/lwipopts.h b/ports/ecos/ecos/net/lwip_tcpip/current/include/lwipopts.h index 1e5f07d..ff14a75 100644 --- a/ports/ecos/ecos/net/lwip_tcpip/current/include/lwipopts.h +++ b/ports/ecos/ecos/net/lwip_tcpip/current/include/lwipopts.h @@ -196,7 +196,18 @@ a lot of data that needs to be copied, this should be set high. */ #define PPP_SUPPORT defined(CYGPKG_LWIP_PPP) #define PPP_DEV CYGPKG_LWIP_PPP_DEV #define MD5_SUPPORT 1 -#define PAP_SUPPORT 1 + +#if defined(CYGPKG_LWIP_PPP_PAP_AUTH) + #define PAP_SUPPORT 1 +#else + #define PAP_SUPPORT 0 +#endif + +#if defined(CYGPKG_LWIP_PPP_CHAP_AUTH) + #define CHAP_SUPPORT 1 +#else + #define CHAP_SUPPORT 0 +#endif /* ------- Thread priorities ---------------*/ #define TCPIP_THREAD_PRIO CYGPKG_LWIP_TCPIP_THREAD_PRIORITY diff --git a/ports/ecos/ecos/net/lwip_tcpip/current/src/ecos/init.c b/ports/ecos/ecos/net/lwip_tcpip/current/src/ecos/init.c index f77197e..4dc9fce 100644 --- a/ports/ecos/ecos/net/lwip_tcpip/current/src/ecos/init.c +++ b/ports/ecos/ecos/net/lwip_tcpip/current/src/ecos/init.c @@ -83,6 +83,8 @@ struct netif mynetif, loopif; static void ecosglue_init(void); void lwip_set_addr(struct netif *netif); #if PPP_SUPPORT +#define PPP_USER "pppuser" +#define PPP_PASS "ppppass" void pppMyCallback(void *a , int e) { @@ -140,7 +142,7 @@ int lwip_init(void) #elif PPP_SUPPORT pppInit(); #if PAP_SUPPORT || CHAP_SUPPORT - pppSetAuth(PPPAUTHTYPE_PAP, "ecos", "picula"); + pppSetAuth(PPPAUTHTYPE_PAP, PPP_USER, PPP_PASS); #endif pppOpen(sio_open(2), pppMyCallback, NULL); #else