diff options
author | Kozlov Dmitry <xeb@mail.ru> | 2012-04-21 22:01:56 +0400 |
---|---|---|
committer | Kozlov Dmitry <xeb@mail.ru> | 2012-04-21 22:04:11 +0400 |
commit | 88b01cc61f8cbd41162041da7bf206eca7e04b2f (patch) | |
tree | 5cb9d64fb9ec05c2f3956bbccbee9e1660c616af /accel-pppd/ctrl | |
parent | 3b3aa52ec2b316f8c5ee1593ca11ce1f437828e6 (diff) | |
download | accel-ppp-88b01cc61f8cbd41162041da7bf206eca7e04b2f.tar.gz accel-ppp-88b01cc61f8cbd41162041da7bf206eca7e04b2f.zip |
implemented per CTRL mppe config
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r-- | accel-pppd/ctrl/l2tp/l2tp.c | 15 | ||||
-rw-r--r-- | accel-pppd/ctrl/pppoe/pppoe.c | 15 | ||||
-rw-r--r-- | accel-pppd/ctrl/pptp/pptp.c | 16 |
3 files changed, 46 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c index a9ecd588..65cf456c 100644 --- a/accel-pppd/ctrl/l2tp/l2tp.c +++ b/accel-pppd/ctrl/l2tp/l2tp.c @@ -52,6 +52,7 @@ static int conf_retransmit = 5; static int conf_hello_interval = 60; static int conf_dir300_quirk = 0; static const char *conf_host_name = "accel-ppp"; +static int conf_mppe = MPPE_UNSET; static unsigned int stat_active; static unsigned int stat_starting; @@ -310,6 +311,7 @@ static int l2tp_tunnel_alloc(struct l2tp_serv_t *serv, struct l2tp_packet_t *pac conn->ctrl.started = l2tp_ppp_started; conn->ctrl.finished = l2tp_ppp_finished; conn->ctrl.max_mtu = 1420; + conn->ctrl.mppe = conf_mppe; conn->ctrl.calling_station_id = _malloc(17); conn->ctrl.called_station_id = _malloc(17); @@ -1146,6 +1148,19 @@ static void load_config(void) opt = conf_get_opt("l2tp", "dir300_quirk"); if (opt) conf_dir300_quirk = atoi(opt); + + conf_mppe = MPPE_UNSET; + opt = conf_get_opt("l2tp", "mppe"); + if (opt) { + if (strcmp(opt, "deny") == 0) + conf_mppe = MPPE_DENY; + else if (strcmp(opt, "allow") == 0) + conf_mppe = MPPE_ALLOW; + else if (strcmp(opt, "prefer") == 0) + conf_mppe = MPPE_PREFER; + else if (strcmp(opt, "require") == 0) + conf_mppe = MPPE_REQUIRE; + } } static void l2tp_init(void) diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c index e1bc4021..43dc6437 100644 --- a/accel-pppd/ctrl/pppoe/pppoe.c +++ b/accel-pppd/ctrl/pppoe/pppoe.c @@ -80,6 +80,7 @@ int conf_ifname_in_sid; char *conf_pado_delay; int conf_tr101 = 1; int conf_padi_limit = 0; +int conf_mppe = MPPE_UNSET; static mempool_t conn_pool; static mempool_t pado_pool; @@ -263,6 +264,7 @@ static struct pppoe_conn_t *allocate_channel(struct pppoe_serv_t *serv, const ui conn->ctrl.max_mtu = MAX_PPPOE_MTU; conn->ctrl.type = CTRL_TYPE_PPPOE; conn->ctrl.name = "pppoe"; + conn->ctrl.mppe = conf_mppe; conn->ctrl.calling_station_id = _malloc(IFNAMSIZ + 19); conn->ctrl.called_station_id = _malloc(IFNAMSIZ + 19); @@ -1407,6 +1409,19 @@ static void load_config(void) opt = conf_get_opt("pppoe", "padi-limit"); if (opt) conf_padi_limit = atoi(opt); + + conf_mppe = MPPE_UNSET; + opt = conf_get_opt("l2tp", "mppe"); + if (opt) { + if (strcmp(opt, "deny") == 0) + conf_mppe = MPPE_DENY; + else if (strcmp(opt, "allow") == 0) + conf_mppe = MPPE_ALLOW; + else if (strcmp(opt, "prefer") == 0) + conf_mppe = MPPE_PREFER; + else if (strcmp(opt, "require") == 0) + conf_mppe = MPPE_REQUIRE; + } } static void pppoe_init(void) diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c index e0875d6f..456b85a4 100644 --- a/accel-pppd/ctrl/pptp/pptp.c +++ b/accel-pppd/ctrl/pptp/pptp.c @@ -58,6 +58,8 @@ static int conf_timeout = 5; static int conf_echo_interval = 0; static int conf_echo_failure = 3; static int conf_verbose = 0; +static int conf_mppe = MPPE_UNSET; + static mempool_t conn_pool; static unsigned int stat_starting; @@ -668,6 +670,7 @@ static int pptp_connect(struct triton_md_handler_t *h) conn->ctrl.max_mtu = PPTP_MAX_MTU; conn->ctrl.type = CTRL_TYPE_PPTP; conn->ctrl.name = "pptp"; + conn->ctrl.mppe = conf_mppe; conn->ctrl.calling_station_id = _malloc(17); conn->ctrl.called_station_id = _malloc(17); @@ -739,6 +742,19 @@ static void load_config(void) opt = conf_get_opt("pptp", "verbose"); if (opt && atoi(opt) > 0) conf_verbose = 1; + + conf_mppe = MPPE_UNSET; + opt = conf_get_opt("pptp", "mppe"); + if (opt) { + if (strcmp(opt, "deny") == 0) + conf_mppe = MPPE_DENY; + else if (strcmp(opt, "allow") == 0) + conf_mppe = MPPE_ALLOW; + else if (strcmp(opt, "prefer") == 0) + conf_mppe = MPPE_PREFER; + else if (strcmp(opt, "require") == 0) + conf_mppe = MPPE_REQUIRE; + } } static void pptp_init(void) |