make PAP and CHAP optional

This commit is contained in:
jani 2003-09-16 14:33:52 +00:00
parent 53969f830f
commit 48ec31d02c
3 changed files with 29 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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