mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-27 00:22:59 +00:00
PPP, ppp->last_xmit is only used in PPPoS, moved to PPPoS
Only PPPoS need to keep track of last transmitted packet for HDLC flag, removed from PPPoE and PPPoL2TP and moved to PPPoS.
This commit is contained in:
parent
6a04357547
commit
50336aaedd
@ -347,8 +347,6 @@ struct ppp_pcb_s {
|
|||||||
unsigned int lcp_echo_timer_running :1; /* set if a timer is running */
|
unsigned int lcp_echo_timer_running :1; /* set if a timer is running */
|
||||||
unsigned int :2; /* 2 bits of padding to round out to 8 bits */
|
unsigned int :2; /* 2 bits of padding to round out to 8 bits */
|
||||||
|
|
||||||
u32_t last_xmit; /* Time of last transmission. */
|
|
||||||
|
|
||||||
/* auth data */
|
/* auth data */
|
||||||
#if PPP_SERVER
|
#if PPP_SERVER
|
||||||
char peer_authname[MAXNAMELEN + 1]; /* The name by which the peer authenticated itself to us. */
|
char peer_authname[MAXNAMELEN + 1]; /* The name by which the peer authenticated itself to us. */
|
||||||
|
@ -71,9 +71,10 @@ struct pppos_pcb_s {
|
|||||||
|
|
||||||
/* -- below are data that will be cleared between two sessions
|
/* -- below are data that will be cleared between two sessions
|
||||||
*
|
*
|
||||||
* out_accm must be the first member of cleared members, because it is
|
* last_xmit must be the first member of cleared members, because it is
|
||||||
* used to know which part must not be cleared.
|
* used to know which part must not be cleared.
|
||||||
*/
|
*/
|
||||||
|
u32_t last_xmit; /* Time of last transmission. */
|
||||||
ext_accm out_accm; /* Async-Ctl-Char-Map for output. */
|
ext_accm out_accm; /* Async-Ctl-Char-Map for output. */
|
||||||
|
|
||||||
/* flags */
|
/* flags */
|
||||||
|
@ -232,8 +232,6 @@ static err_t pppoe_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) {
|
|||||||
tot_len = ph->tot_len;
|
tot_len = ph->tot_len;
|
||||||
#endif /* LWIP_SNMP */
|
#endif /* LWIP_SNMP */
|
||||||
|
|
||||||
ppp->last_xmit = sys_jiffies();
|
|
||||||
|
|
||||||
ret = pppoe_xmit(sc, ph);
|
ret = pppoe_xmit(sc, ph);
|
||||||
if (ret != ERR_OK) {
|
if (ret != ERR_OK) {
|
||||||
LINK_STATS_INC(link.err);
|
LINK_STATS_INC(link.err);
|
||||||
@ -268,8 +266,6 @@ static err_t pppoe_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *p, u_short
|
|||||||
|
|
||||||
pbuf_header(pb, -(s16_t)PPPOE_HEADERLEN);
|
pbuf_header(pb, -(s16_t)PPPOE_HEADERLEN);
|
||||||
|
|
||||||
ppp->last_xmit = sys_jiffies();
|
|
||||||
|
|
||||||
pl = (u8_t*)pb->payload;
|
pl = (u8_t*)pb->payload;
|
||||||
PUTSHORT(protocol, pl);
|
PUTSHORT(protocol, pl);
|
||||||
|
|
||||||
|
@ -234,8 +234,6 @@ static err_t pppol2tp_write(ppp_pcb *ppp, void *ctx, struct pbuf *p) {
|
|||||||
tot_len = ph->tot_len;
|
tot_len = ph->tot_len;
|
||||||
#endif /* LWIP_SNMP */
|
#endif /* LWIP_SNMP */
|
||||||
|
|
||||||
ppp->last_xmit = sys_jiffies();
|
|
||||||
|
|
||||||
ret = pppol2tp_xmit(l2tp, ph);
|
ret = pppol2tp_xmit(l2tp, ph);
|
||||||
if (ret != ERR_OK) {
|
if (ret != ERR_OK) {
|
||||||
LINK_STATS_INC(link.err);
|
LINK_STATS_INC(link.err);
|
||||||
@ -270,8 +268,6 @@ static err_t pppol2tp_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *p, u_sh
|
|||||||
|
|
||||||
pbuf_header(pb, -(s16_t)PPPOL2TP_OUTPUT_DATA_HEADER_LEN);
|
pbuf_header(pb, -(s16_t)PPPOL2TP_OUTPUT_DATA_HEADER_LEN);
|
||||||
|
|
||||||
ppp->last_xmit = sys_jiffies();
|
|
||||||
|
|
||||||
pl = (u8_t*)pb->payload;
|
pl = (u8_t*)pb->payload;
|
||||||
PUTSHORT(protocol, pl);
|
PUTSHORT(protocol, pl);
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ pppos_write(ppp_pcb *ppp, void *ctx, struct pbuf *p)
|
|||||||
/* If the link has been idle, we'll send a fresh flag character to
|
/* If the link has been idle, we'll send a fresh flag character to
|
||||||
* flush any noise. */
|
* flush any noise. */
|
||||||
err = ERR_OK;
|
err = ERR_OK;
|
||||||
if ((sys_jiffies() - ppp->last_xmit) >= PPP_MAXIDLEFLAG) {
|
if ((sys_jiffies() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) {
|
||||||
err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0);
|
err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -321,7 +321,7 @@ pppos_netif_output(ppp_pcb *ppp, void *ctx, struct pbuf *pb, u_short protocol)
|
|||||||
/* If the link has been idle, we'll send a fresh flag character to
|
/* If the link has been idle, we'll send a fresh flag character to
|
||||||
* flush any noise. */
|
* flush any noise. */
|
||||||
err = ERR_OK;
|
err = ERR_OK;
|
||||||
if ((sys_jiffies() - ppp->last_xmit) >= PPP_MAXIDLEFLAG) {
|
if ((sys_jiffies() - pppos->last_xmit) >= PPP_MAXIDLEFLAG) {
|
||||||
err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0);
|
err = pppos_output_append(pppos, err, nb, PPP_FLAG, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,7 +384,7 @@ pppos_connect(ppp_pcb *ppp, void *ctx)
|
|||||||
|
|
||||||
ppp_clear(ppp);
|
ppp_clear(ppp);
|
||||||
/* reset PPPoS control block to its initial state */
|
/* reset PPPoS control block to its initial state */
|
||||||
memset(&pppos->out_accm, 0, sizeof(pppos_pcb) - ( (char*)&((pppos_pcb*)0)->out_accm - (char*)0 ) );
|
memset(&pppos->last_xmit, 0, sizeof(pppos_pcb) - ( (char*)&((pppos_pcb*)0)->last_xmit - (char*)0 ) );
|
||||||
|
|
||||||
#if PPP_IPV4_SUPPORT && VJ_SUPPORT
|
#if PPP_IPV4_SUPPORT && VJ_SUPPORT
|
||||||
vj_compress_init(&pppos->vj_comp);
|
vj_compress_init(&pppos->vj_comp);
|
||||||
@ -974,7 +974,7 @@ pppos_output_last(pppos_pcb *pppos, err_t err, struct pbuf *nb)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ppp->last_xmit = sys_jiffies();
|
pppos->last_xmit = sys_jiffies();
|
||||||
snmp_add_ifoutoctets(ppp->netif, nb->tot_len);
|
snmp_add_ifoutoctets(ppp->netif, nb->tot_len);
|
||||||
snmp_inc_ifoutucastpkts(ppp->netif);
|
snmp_inc_ifoutucastpkts(ppp->netif);
|
||||||
LINK_STATS_INC(link.xmit);
|
LINK_STATS_INC(link.xmit);
|
||||||
@ -982,7 +982,7 @@ pppos_output_last(pppos_pcb *pppos, err_t err, struct pbuf *nb)
|
|||||||
return ERR_OK;
|
return ERR_OK;
|
||||||
|
|
||||||
failed:
|
failed:
|
||||||
ppp->last_xmit = 0; /* prepend PPP_FLAG to next packet */
|
pppos->last_xmit = 0; /* prepend PPP_FLAG to next packet */
|
||||||
LINK_STATS_INC(link.err);
|
LINK_STATS_INC(link.err);
|
||||||
LINK_STATS_INC(link.drop);
|
LINK_STATS_INC(link.drop);
|
||||||
snmp_inc_ifoutdiscards(ppp->netif);
|
snmp_inc_ifoutdiscards(ppp->netif);
|
||||||
|
Loading…
Reference in New Issue
Block a user