diff --git a/src/include/netif/ppp/mppe.h b/src/include/netif/ppp/mppe.h index 31c95af6..b239b33d 100644 --- a/src/include/netif/ppp/mppe.h +++ b/src/include/netif/ppp/mppe.h @@ -39,6 +39,12 @@ #ifndef MPPE_H #define MPPE_H +#if LWIP_INCLUDED_POLARSSL_ARC4 +#include "netif/ppp/polarssl/arc4.h" +#else +#include "polarssl/arc4.h" +#endif + #define MPPE_PAD 4 /* MPPE growth per frame */ #define MPPE_MAX_KEY_LEN 16 /* largest key length (128-bit) */ @@ -126,6 +132,26 @@ opts |= MPPE_OPT_UNKNOWN; \ } while (/* CONSTCOND */ 0) +/* + * State for an MPPE (de)compressor. + */ +struct ppp_mppe_state { + arc4_context arc4; + unsigned char master_key[MPPE_MAX_KEY_LEN]; + unsigned char session_key[MPPE_MAX_KEY_LEN]; + unsigned keylen; /* key length in bytes */ + /* NB: 128-bit == 16, 40-bit == 8! */ + /* If we want to support 56-bit, */ + /* the unit has to change to bits */ + unsigned char bits; /* MPPE control bits */ + unsigned ccount; /* 12-bit coherency count (seqno) */ + unsigned stateful; /* stateful mode flag */ + int discard; /* stateful mode packet loss flag */ + int sanity_errors; /* take down LCP if too many */ + int unit; + int debug; +}; + void *mppe_alloc(unsigned char *options, int optlen); void mppe_free(void *arg); int mppe_comp_init(void *arg, unsigned char *options, int optlen, int unit, diff --git a/src/netif/ppp/mppe.c b/src/netif/ppp/mppe.c index 22efe01e..635ec039 100644 --- a/src/netif/ppp/mppe.c +++ b/src/netif/ppp/mppe.c @@ -50,26 +50,6 @@ #define SHA1_SIGNATURE_SIZE 20 #define SHA1_PAD_SIZE 40 -/* - * State for an MPPE (de)compressor. - */ -struct ppp_mppe_state { - arc4_context arc4; - unsigned char master_key[MPPE_MAX_KEY_LEN]; - unsigned char session_key[MPPE_MAX_KEY_LEN]; - unsigned keylen; /* key length in bytes */ - /* NB: 128-bit == 16, 40-bit == 8! */ - /* If we want to support 56-bit, */ - /* the unit has to change to bits */ - unsigned char bits; /* MPPE control bits */ - unsigned ccount; /* 12-bit coherency count (seqno) */ - unsigned stateful; /* stateful mode flag */ - int discard; /* stateful mode packet loss flag */ - int sanity_errors; /* take down LCP if too many */ - int unit; - int debug; -}; - /* struct ppp_mppe_state.bits definitions */ #define MPPE_BIT_A 0x80 /* Encryption table were (re)inititalized */ #define MPPE_BIT_B 0x40 /* MPPC only (not implemented) */