X-Git-Url: http://git.sameswireless.fr/l2tpns.git/blobdiff_plain/9cb9a8b436315ee795f48181f95c2b9ee132593c..890bffb510b300b8ed55357c6d9e99f1c6de22e9:/setrxspeed.c?ds=sidebyside diff --git a/setrxspeed.c b/setrxspeed.c index 9d20915..7a5acd9 100644 --- a/setrxspeed.c +++ b/setrxspeed.c @@ -4,34 +4,38 @@ /* fudge up session rx speed if not set */ -char const *cvs_id = "$Id: setrxspeed.c,v 1.2 2004-11-09 08:05:03 bodea Exp $"; +char const *cvs_id = "$Id: setrxspeed.c,v 1.4 2005-10-11 09:04:53 bodea Exp $"; -int __plugin_api_version = PLUGIN_API_VERSION; -static struct pluginfuncs *p = 0; +int plugin_api_version = PLUGIN_API_VERSION; +static struct pluginfuncs *f = 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; + if (!data->auth_allowed) + return PLUGIN_RET_OK; + + if (data->s->rx_connect_speed) + return PLUGIN_RET_OK; + + 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; + return ((f = funcs)) ? 1 : 0; }