mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-29 00:32:51 +00:00
PPP, MPPE, moved struct ppp_mppe_state from mppe.c to mppe.h
In order to be able to use struct ppp_mppe_state statically allocated, export struct ppp_mppe_state.
This commit is contained in:
parent
3618432107
commit
6235e1ae57
@ -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,
|
||||
|
@ -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) */
|
||||
|
Loading…
x
Reference in New Issue
Block a user