PPP, CORE, disable VJ is PPP IPV4 is compiled out

VJ compression is only supported for PPP IPv4, compile out VJ support
if PPP IPv4 is not compiled.
This commit is contained in:
Sylvain Rochet 2015-02-22 02:34:45 +01:00
parent 00e8988b52
commit a1c5415f8f
5 changed files with 14 additions and 6 deletions

View File

@ -2061,7 +2061,7 @@
#ifndef VJ_SUPPORT #ifndef VJ_SUPPORT
#define VJ_SUPPORT 1 #define VJ_SUPPORT 1
#endif #endif
#if !PPPOS_SUPPORT #if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT
#undef VJ_SUPPORT #undef VJ_SUPPORT
#define VJ_SUPPORT 0 /* VJ compression is only supported for PPPoS. */ #define VJ_SUPPORT 0 /* VJ compression is only supported for PPPoS. */
#endif /* !PPPOS_SUPPORT */ #endif /* !PPPOS_SUPPORT */

View File

@ -330,7 +330,12 @@ struct ppp_pcb_s {
unsigned int ipcp_is_up :1; /* have called ipcp_up() */ unsigned int ipcp_is_up :1; /* have called ipcp_up() */
unsigned int if4_up :1; /* True when the IPv4 interface is up. */ unsigned int if4_up :1; /* True when the IPv4 interface is up. */
unsigned int proxy_arp_set :1; /* Have created proxy arp entry */ unsigned int proxy_arp_set :1; /* Have created proxy arp entry */
#if VJ_SUPPORT
unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */
#else #else
unsigned int :1; /* 1 bit of padding */
#endif /* VJ_SUPPORT */
#else /* PPP_IPV4_SUPPORT */
unsigned int :4; /* 4 bit of padding */ unsigned int :4; /* 4 bit of padding */
#endif /* PPP_IPV4_SUPPORT */ #endif /* PPP_IPV4_SUPPORT */
#if PPP_IPV6_SUPPORT #if PPP_IPV6_SUPPORT
@ -341,11 +346,6 @@ struct ppp_pcb_s {
#endif /* PPP_IPV6_SUPPORT */ #endif /* PPP_IPV6_SUPPORT */
unsigned int ask_for_local :1; /* request our address from peer */ unsigned int ask_for_local :1; /* request our address from peer */
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 */
#if VJ_SUPPORT
unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */
#else
unsigned int :1; /* 1 bit of padding */
#endif /* VJ_SUPPORT */
unsigned int :5; /* 5 bits of padding to round out to 16 bits */ unsigned int :5; /* 5 bits of padding to round out to 16 bits */
u32_t last_xmit; /* Time of last transmission. */ u32_t last_xmit; /* Time of last transmission. */

View File

@ -431,7 +431,9 @@ int sifproxyarp(ppp_pcb *pcb, u32_t his_adr);
int cifproxyarp(ppp_pcb *pcb, u32_t his_adr); int cifproxyarp(ppp_pcb *pcb, u32_t his_adr);
int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2); int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2);
int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2); int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2);
#if VJ_SUPPORT
int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid); int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid);
#endif /* VJ_SUPPORT */
int sifup(ppp_pcb *pcb); int sifup(ppp_pcb *pcb);
int sifdown (ppp_pcb *pcb); int sifdown (ppp_pcb *pcb);
#endif /* PPP_IPV4_SUPPORT */ #endif /* PPP_IPV4_SUPPORT */

View File

@ -1852,8 +1852,10 @@ static void ipcp_up(fsm *f) {
} }
#endif /* Unused */ #endif /* Unused */
#if VJ_SUPPORT
/* set tcp compression */ /* set tcp compression */
sifvjcomp(pcb, ho->neg_vj, ho->cflag, ho->maxslotindex); sifvjcomp(pcb, ho->neg_vj, ho->cflag, ho->maxslotindex);
#endif /* VJ_SUPPORT */
#if DEMAND_SUPPORT #if DEMAND_SUPPORT
/* /*
@ -2012,7 +2014,9 @@ static void ipcp_down(fsm *f) {
pcb->ipcp_is_up = 0; pcb->ipcp_is_up = 0;
np_down(pcb, PPP_IP); np_down(pcb, PPP_IP);
} }
#if VJ_SUPPORT
sifvjcomp(pcb, 0, 0, 0); sifvjcomp(pcb, 0, 0, 0);
#endif /* VJ_SUPPORT */
#if PPP_STATS_SUPPORT #if PPP_STATS_SUPPORT
print_link_stats(); /* _after_ running the notifiers and ip_down_hook(), print_link_stats(); /* _after_ running the notifiers and ip_down_hook(),

View File

@ -957,6 +957,7 @@ int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2) {
return 1; return 1;
} }
#if VJ_SUPPORT
/******************************************************************** /********************************************************************
* *
* sifvjcomp - config tcp header compression * sifvjcomp - config tcp header compression
@ -967,6 +968,7 @@ int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid) {
} }
return 0; return 0;
} }
#endif /* VJ_SUPPORT */
/* /*
* sifup - Config the interface up and enable IP packets to pass. * sifup - Config the interface up and enable IP packets to pass.