Update changelog
[l2tpns.git] / setrxspeed.c
1 #include <string.h>
2 #include <linux/rtnetlink.h>
3 #include <netinet/ip6.h>
4
5 #include "dhcp6.h"
6 #include "l2tpns.h"
7 #include "plugin.h"
8
9 /* fudge up session rx speed if not set */
10
11 int plugin_api_version = PLUGIN_API_VERSION;
12 static struct pluginfuncs *f = 0;
13
14 int plugin_post_auth(struct param_post_auth *data)
15 {
16 if (!data->auth_allowed)
17 return PLUGIN_RET_OK;
18
19 if (data->s->rx_connect_speed)
20 return PLUGIN_RET_OK;
21
22 switch (data->s->tx_connect_speed)
23 {
24 case 256:
25 data->s->rx_connect_speed = 64;
26 break;
27
28 case 512:
29 data->s->rx_connect_speed = 128;
30 break;
31
32 case 1500:
33 data->s->rx_connect_speed = 256;
34 break;
35 }
36
37 return PLUGIN_RET_OK;
38 }
39
40 int plugin_init(struct pluginfuncs *funcs)
41 {
42 return ((f = funcs)) ? 1 : 0;
43 }