PPP, PPPoS, moved VJ from PPP core to PPPoS

VJ is only available for PPPoS, moved VJ from PPP CORE to PPPoS.
This commit is contained in:
Sylvain Rochet
2015-02-16 00:24:17 +01:00
parent 4aa9244b92
commit e6465a6f44
6 changed files with 161 additions and 67 deletions

View File

@@ -391,11 +391,11 @@ struct ppp_pcb_s {
#endif /* PPP_IPV6_SUPPORT */
unsigned int ask_for_local :1; /* request our address from peer */
unsigned int lcp_echo_timer_running :1; /* set if a timer is running */
#if PPPOS_SUPPORT && VJ_SUPPORT
#if VJ_SUPPORT
unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */
#else
unsigned int :1; /* 1 bit of padding */
#endif /* PPPOS_SUPPORT && VJ_SUPPORT */
#endif /* VJ_SUPPORT */
unsigned int :5; /* 5 bits of padding to round out to 16 bits */
#if PPPOS_SUPPORT
@@ -403,9 +403,6 @@ struct ppp_pcb_s {
ext_accm out_accm; /* Async-Ctl-Char-Map for output. */
ext_accm xmit_accm; /* extended transmit ACCM */
ppp_pcb_rx rx;
#if VJ_SUPPORT
struct vjcompress vj_comp; /* Van Jacobson compression header. */
#endif /* VJ_SUPPORT */
#endif /* PPPOS_SUPPORT */
u32_t last_xmit; /* Time of last transmission. */

View File

@@ -38,6 +38,7 @@
#define PPPOS_H
#include "ppp.h"
#include "vj.h"
/*
* PPPoS interface control block.
@@ -46,6 +47,9 @@ typedef struct pppos_pcb_s pppos_pcb;
struct pppos_pcb_s {
ppp_pcb *ppp; /* PPP PCB */
sio_fd_t fd; /* File device ID of port. */
#if VJ_SUPPORT
struct vjcompress vj_comp; /* Van Jacobson compression header. */
#endif /* VJ_SUPPORT */
};
/* Create a new PPPoS session. */
@@ -55,5 +59,10 @@ ppp_pcb *ppp_over_serial_create(struct netif *pppif, sio_fd_t fd,
/* PPP over Serial: this is the input function to be called for received data. */
void pppos_input(ppp_pcb *pcb, u_char* data, int len);
void pppos_vjc_config(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid);
int pppos_vjc_comp(ppp_pcb *pcb, struct pbuf *pb);
int pppos_vjc_uncomp(ppp_pcb *pcb, struct pbuf *pb);
#endif /* PPPOS_H */
#endif /* PPP_SUPPORT && PPPOL2TP_SUPPORT */