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