mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-24 23:25:58 +00:00
FSM global variables moved to ppp_pcb
This commit is contained in:
parent
93559a54e9
commit
708147625f
@ -70,9 +70,6 @@ static void fsm_sconfreq(fsm *f, int retransmit);
|
||||
|
||||
#define PROTO_NAME(f) ((f)->callbacks->proto_name)
|
||||
|
||||
int peer_mru[NUM_PPP];
|
||||
|
||||
|
||||
/*
|
||||
* fsm_init - Initialize fsm.
|
||||
*
|
||||
@ -714,8 +711,8 @@ static void fsm_sconfreq(fsm *f, int retransmit) {
|
||||
outp = outpacket_buf + PPP_HDRLEN + HEADERLEN;
|
||||
if( f->callbacks->cilen && f->callbacks->addci ){
|
||||
cilen = (*f->callbacks->cilen)(f);
|
||||
if( cilen > peer_mru[pcb->unit] - HEADERLEN )
|
||||
cilen = peer_mru[pcb->unit] - HEADERLEN;
|
||||
if( cilen > pcb->peer_mru - HEADERLEN )
|
||||
cilen = pcb->peer_mru - HEADERLEN;
|
||||
if (f->callbacks->addci)
|
||||
(*f->callbacks->addci)(f, outp, &cilen);
|
||||
} else
|
||||
@ -742,8 +739,8 @@ void fsm_sdata(fsm *f, u_char code, u_char id, u_char *data, int datalen) {
|
||||
|
||||
/* Adjust length to be smaller than MTU */
|
||||
outp = outpacket_buf;
|
||||
if (datalen > peer_mru[pcb->unit] - HEADERLEN)
|
||||
datalen = peer_mru[pcb->unit] - HEADERLEN;
|
||||
if (datalen > pcb->peer_mru - HEADERLEN)
|
||||
datalen = pcb->peer_mru - HEADERLEN;
|
||||
if (datalen && data != outp + PPP_HDRLEN + HEADERLEN)
|
||||
MEMCPY(outp + PPP_HDRLEN + HEADERLEN, data, datalen);
|
||||
outlen = datalen + HEADERLEN;
|
||||
|
@ -168,10 +168,5 @@ void fsm_protreject(fsm *f);
|
||||
void fsm_sdata(fsm *f, u_char code, u_char id, u_char *data, int datalen);
|
||||
|
||||
|
||||
/*
|
||||
* Variables
|
||||
*/
|
||||
extern int peer_mru[]; /* currently negotiated peer MRU (per unit) */
|
||||
|
||||
#endif /* FSM_H */
|
||||
#endif /* PPP_SUPPORT */
|
||||
|
@ -495,7 +495,7 @@ void lcp_lowerup(ppp_pcb *pcb) {
|
||||
|| ppp_recv_config(pcb, PPP_MRU, (lax_recv? 0: 0xffffffff),
|
||||
wo->neg_pcompression, wo->neg_accompression) < 0)
|
||||
return;
|
||||
peer_mru[pcb->unit] = PPP_MRU;
|
||||
pcb->peer_mru = PPP_MRU;
|
||||
|
||||
#if PPPOS_SUPPORT
|
||||
ao->asyncmap = (u_long)xmit_accm[pcb->unit][0]
|
||||
@ -707,7 +707,7 @@ static void lcp_resetci(fsm *f) {
|
||||
#endif /* HAVE_MULTILINK */
|
||||
if (noendpoint)
|
||||
ao->neg_endpoint = 0;
|
||||
peer_mru[pcb->unit] = PPP_MRU;
|
||||
pcb->peer_mru = PPP_MRU;
|
||||
auth_reset(pcb);
|
||||
}
|
||||
|
||||
@ -2242,7 +2242,7 @@ static void lcp_up(fsm *f) {
|
||||
go->neg_pcompression, go->neg_accompression);
|
||||
|
||||
if (ho->neg_mru)
|
||||
peer_mru[pcb->unit] = ho->mru;
|
||||
pcb->peer_mru = ho->mru;
|
||||
|
||||
lcp_echo_lowerup(f->pcb); /* Enable echo messages */
|
||||
|
||||
@ -2267,7 +2267,7 @@ static void lcp_down(fsm *f) {
|
||||
ppp_recv_config(pcb, PPP_MRU,
|
||||
(go->neg_asyncmap? go->asyncmap: 0xffffffff),
|
||||
go->neg_pcompression, go->neg_accompression);
|
||||
peer_mru[pcb->unit] = PPP_MRU;
|
||||
pcb->peer_mru = PPP_MRU;
|
||||
}
|
||||
|
||||
|
||||
|
@ -443,6 +443,8 @@ typedef struct ppp_pcb_s {
|
||||
eap_state eap;
|
||||
#endif /* EAP_SUPPORT */
|
||||
|
||||
int peer_mru; /* currently negotiated peer MRU (per unit) */
|
||||
|
||||
fsm lcp_fsm; /* LCP fsm structure */
|
||||
lcp_options lcp_wantoptions; /* Options that we want to request */
|
||||
lcp_options lcp_gotoptions; /* Options that peer ack'd */
|
||||
|
Loading…
Reference in New Issue
Block a user