mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-24 15:16:02 +00:00
PPP, MPPE, removed "compression" stats
We don't need "compression" stats on a encryption protocols, as commented "Since every frame grows by MPPE_OVHD + 2 bytes, this is always going to look bad ... and the longer the link is up the worse it will get."
This commit is contained in:
parent
a6c101aeb8
commit
c759639603
|
@ -86,7 +86,6 @@ struct ppp_mppe_state {
|
||||||
int sanity_errors; /* take down LCP if too many */
|
int sanity_errors; /* take down LCP if too many */
|
||||||
int unit;
|
int unit;
|
||||||
int debug;
|
int debug;
|
||||||
struct compstat stats;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/* struct ppp_mppe_state.bits definitions */
|
/* struct ppp_mppe_state.bits definitions */
|
||||||
|
@ -346,26 +345,9 @@ mppe_compress(void *arg, unsigned char *ibuf, unsigned char *obuf,
|
||||||
/* Encrypt packet */
|
/* Encrypt packet */
|
||||||
MEMCPY(obuf, ibuf, isize);
|
MEMCPY(obuf, ibuf, isize);
|
||||||
arc4_crypt(&state->arc4, obuf, isize);
|
arc4_crypt(&state->arc4, obuf, isize);
|
||||||
|
|
||||||
state->stats.unc_bytes += isize;
|
|
||||||
state->stats.unc_packets++;
|
|
||||||
state->stats.comp_bytes += osize;
|
|
||||||
state->stats.comp_packets++;
|
|
||||||
|
|
||||||
return osize;
|
return osize;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Since every frame grows by MPPE_OVHD + 2 bytes, this is always going
|
|
||||||
* to look bad ... and the longer the link is up the worse it will get.
|
|
||||||
*/
|
|
||||||
static void mppe_comp_stats(void *arg, struct compstat *stats)
|
|
||||||
{
|
|
||||||
struct ppp_mppe_state *state = (struct ppp_mppe_state *) arg;
|
|
||||||
|
|
||||||
*stats = state->stats;
|
|
||||||
}
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
mppe_decomp_init(void *arg, unsigned char *options, int optlen, int unit,
|
mppe_decomp_init(void *arg, unsigned char *options, int optlen, int unit,
|
||||||
int hdrlen, int mru, int debug)
|
int hdrlen, int mru, int debug)
|
||||||
|
@ -545,11 +527,6 @@ mppe_decompress(void *arg, unsigned char *ibuf, int isize, unsigned char *obuf,
|
||||||
MEMCPY(obuf+1, ibuf+1, isize-1);
|
MEMCPY(obuf+1, ibuf+1, isize-1);
|
||||||
arc4_crypt(&state->arc4, obuf+1, isize-1);
|
arc4_crypt(&state->arc4, obuf+1, isize-1);
|
||||||
|
|
||||||
state->stats.unc_bytes += osize;
|
|
||||||
state->stats.unc_packets++;
|
|
||||||
state->stats.comp_bytes += isize;
|
|
||||||
state->stats.comp_packets++;
|
|
||||||
|
|
||||||
/* good packet credit */
|
/* good packet credit */
|
||||||
state->sanity_errors >>= 1;
|
state->sanity_errors >>= 1;
|
||||||
|
|
||||||
|
@ -571,11 +548,6 @@ static void mppe_incomp(void *arg, unsigned char *ibuf, int icnt)
|
||||||
PPPDEBUG(LOG_DEBUG,
|
PPPDEBUG(LOG_DEBUG,
|
||||||
("mppe_incomp[%d]: incompressible (unencrypted) data! "
|
("mppe_incomp[%d]: incompressible (unencrypted) data! "
|
||||||
"(proto %04x)\n", state->unit, PPP_PROTOCOL(ibuf)));
|
"(proto %04x)\n", state->unit, PPP_PROTOCOL(ibuf)));
|
||||||
|
|
||||||
state->stats.inc_bytes += icnt;
|
|
||||||
state->stats.inc_packets++;
|
|
||||||
state->stats.unc_bytes += icnt;
|
|
||||||
state->stats.unc_packets++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
|
@ -592,14 +564,12 @@ static struct compressor ppp_mppe = {
|
||||||
.comp_init = mppe_comp_init,
|
.comp_init = mppe_comp_init,
|
||||||
.comp_reset = mppe_comp_reset,
|
.comp_reset = mppe_comp_reset,
|
||||||
.compress = mppe_compress,
|
.compress = mppe_compress,
|
||||||
.comp_stat = mppe_comp_stats,
|
|
||||||
.decomp_alloc = mppe_alloc,
|
.decomp_alloc = mppe_alloc,
|
||||||
.decomp_free = mppe_free,
|
.decomp_free = mppe_free,
|
||||||
.decomp_init = mppe_decomp_init,
|
.decomp_init = mppe_decomp_init,
|
||||||
.decomp_reset = mppe_decomp_reset,
|
.decomp_reset = mppe_decomp_reset,
|
||||||
.decompress = mppe_decompress,
|
.decompress = mppe_decompress,
|
||||||
.incomp = mppe_incomp,
|
.incomp = mppe_incomp,
|
||||||
.decomp_stat = mppe_comp_stats,
|
|
||||||
.owner = THIS_MODULE,
|
.owner = THIS_MODULE,
|
||||||
.comp_extra = MPPE_PAD,
|
.comp_extra = MPPE_PAD,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user