X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/4da95975031c20cb0caf210a3bd78ca8f9963dd6..66ded1b9e5e9eaf47ba84784c7212af292ab0f91:/setrxspeed.c diff --git a/setrxspeed.c b/setrxspeed.c new file mode 100644 index 0000000..b8c6171 --- /dev/null +++ b/setrxspeed.c @@ -0,0 +1,37 @@ +#include +#include "l2tpns.h" +#include "plugin.h" + +/* fudge up session rx speed if not set */ + +char const *cvs_id = "$Id: setrxspeed.c,v 1.1 2004-11-05 02:38:59 bodea Exp $"; + +int __plugin_api_version = 1; +static struct pluginfuncs *p = 0; + +int plugin_post_auth(struct param_post_auth *data) +{ + if (!data->auth_allowed) return PLUGIN_RET_OK; + + if (!data->s->rx_connect_speed) + { + switch (data->s->tx_connect_speed) + { + case 256 : + data->s->rx_connect_speed = 64; + break; + case 512 : + data->s->rx_connect_speed = 128; + break; + case 1500 : + data->s->rx_connect_speed = 256; + break; + } + } + return PLUGIN_RET_OK; +} + +int plugin_init(struct pluginfuncs *funcs) +{ + return ((p = funcs)) ? 1 : 0; +}