- Add startup-config(5) manpage [FIXME].
[l2tpns.git] / setrxspeed.c
1 #include <string.h>
2 #include "l2tpns.h"
3 #include "plugin.h"
4
5 /* fudge up session rx speed if not set */
6
7 char const *cvs_id = "$Id: setrxspeed.c,v 1.3 2004-11-17 08:23:35 bodea Exp $";
8
9 int plugin_api_version = PLUGIN_API_VERSION;
10 static struct pluginfuncs *p = 0;
11
12 int plugin_post_auth(struct param_post_auth *data)
13 {
14 if (!data->auth_allowed) return PLUGIN_RET_OK;
15
16 if (!data->s->rx_connect_speed)
17 {
18 switch (data->s->tx_connect_speed)
19 {
20 case 256 :
21 data->s->rx_connect_speed = 64;
22 break;
23 case 512 :
24 data->s->rx_connect_speed = 128;
25 break;
26 case 1500 :
27 data->s->rx_connect_speed = 256;
28 break;
29 }
30 }
31 return PLUGIN_RET_OK;
32 }
33
34 int plugin_init(struct pluginfuncs *funcs)
35 {
36 return ((p = funcs)) ? 1 : 0;
37 }