From 7174578ac3b180c854b7de12d35f1d64372e407d Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Tue, 17 Mar 2015 23:22:56 +0100 Subject: [PATCH] PPP, CCP, moved CCP global variables to ppp_pcb (ppp.h) --- src/include/netif/ppp/ccp.h | 6 ------ src/include/netif/ppp/ppp.h | 10 ++++++++++ src/netif/ppp/ccp.c | 9 --------- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/src/include/netif/ppp/ccp.h b/src/include/netif/ppp/ccp.h index 3d165359..a7271dbf 100644 --- a/src/include/netif/ppp/ccp.h +++ b/src/include/netif/ppp/ccp.h @@ -48,12 +48,6 @@ typedef struct ccp_options { short method; /* code for chosen compression method */ } ccp_options; -extern fsm ccp_fsm[]; -extern ccp_options ccp_wantoptions[]; -extern ccp_options ccp_gotoptions[]; -extern ccp_options ccp_allowoptions[]; -extern ccp_options ccp_hisoptions[]; - extern const struct protent ccp_protent; #endif /* PPP_SUPPORT && CCP_SUPPORT */ diff --git a/src/include/netif/ppp/ppp.h b/src/include/netif/ppp/ppp.h index 7d9ef2bd..05cfed97 100644 --- a/src/include/netif/ppp/ppp.h +++ b/src/include/netif/ppp/ppp.h @@ -380,6 +380,16 @@ struct ppp_pcb_s { u8_t lcp_echo_number; /* ID number of next echo frame */ u16_t peer_mru; /* currently negotiated peer MRU */ +#if CCP_SUPPORT + fsm ccp_fsm; /* CCP fsm structure */ + ccp_options ccp_wantoptions; /* what to request the peer to use */ + ccp_options ccp_gotoptions; /* what the peer agreed to do */ + ccp_options ccp_allowoptions; /* what we'll agree to do */ + ccp_options ccp_hisoptions; /* what we agreed to do */ + int ccp_localstate; /* Local state (mainly for handling reset-reqs and reset-acks). */ + int all_rejected; /* we rejected all peer's options */ +#endif /* CCP_SUPPORT */ + #if PPP_IPV4_SUPPORT fsm ipcp_fsm; /* IPCP fsm structure */ ipcp_options ipcp_wantoptions; /* Options that we want to request */ diff --git a/src/netif/ppp/ccp.c b/src/netif/ppp/ccp.c index 446548be..559f4174 100644 --- a/src/netif/ppp/ccp.c +++ b/src/netif/ppp/ccp.c @@ -211,12 +211,6 @@ const struct protent ccp_protent = { #endif /* DEMAND_SUPPORT */ }; -fsm ccp_fsm[NUM_PPP]; -ccp_options ccp_wantoptions[NUM_PPP]; /* what to request the peer to use */ -ccp_options ccp_gotoptions[NUM_PPP]; /* what the peer agreed to do */ -ccp_options ccp_allowoptions[NUM_PPP]; /* what we'll agree to do */ -ccp_options ccp_hisoptions[NUM_PPP]; /* what we agreed to do */ - /* * Callbacks for fsm code. */ @@ -261,14 +255,11 @@ static const fsm_callbacks ccp_callbacks = { /* * Local state (mainly for handling reset-reqs and reset-acks). */ -static int ccp_localstate[NUM_PPP]; #define RACK_PENDING 1 /* waiting for reset-ack */ #define RREQ_REPEAT 2 /* send another reset-req if no reset-ack */ #define RACKTIMEOUT 1 /* second */ -static int all_rejected[NUM_PPP]; /* we rejected all peer's options */ - #if PPP_OPTIONS /* * Option parsing