summaryrefslogtreecommitdiff
path: root/accel-pppd/ctrl
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2011-08-19 14:04:55 +0400
committerKozlov Dmitry <dima@server>2011-08-19 14:04:55 +0400
commit5ef49162ea9763ca9878c22e3736766d8f1db014 (patch)
treef58da9adfc87ece6c608265fc694e66bd5db162c /accel-pppd/ctrl
parentfd52e4578dcc7de2301480fece9395563d643045 (diff)
downloadaccel-ppp-5ef49162ea9763ca9878c22e3736766d8f1db014.tar.gz
accel-ppp-5ef49162ea9763ca9878c22e3736766d8f1db014.zip
snmp support
Diffstat (limited to 'accel-pppd/ctrl')
-rw-r--r--accel-pppd/ctrl/l2tp/l2tp.c7
-rw-r--r--accel-pppd/ctrl/pppoe/pppoe.c8
-rw-r--r--accel-pppd/ctrl/pptp/pptp.c7
3 files changed, 22 insertions, 0 deletions
diff --git a/accel-pppd/ctrl/l2tp/l2tp.c b/accel-pppd/ctrl/l2tp/l2tp.c
index 0f36a98a..c9ed08e6 100644
--- a/accel-pppd/ctrl/l2tp/l2tp.c
+++ b/accel-pppd/ctrl/l2tp/l2tp.c
@@ -301,6 +301,7 @@ static int l2tp_tunnel_alloc(struct l2tp_serv_t *serv, struct l2tp_packet_t *pac
conn->hello_timer.expire = l2tp_send_HELLO;
conn->hello_timer.period = conf_hello_interval * 1000;
conn->ctrl.ctx = &conn->ctx;
+ conn->ctrl.type = CTRL_TYPE_L2TP;
conn->ctrl.name = "l2tp";
conn->ctrl.started = l2tp_ppp_started;
conn->ctrl.finished = l2tp_ppp_finished;
@@ -1091,6 +1092,12 @@ static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt,
return CLI_CMD_OK;
}
+void __export l2tp_get_stat(unsigned int **starting, unsigned int **active)
+{
+ *starting = &stat_starting;
+ *active = &stat_active;
+}
+
static void load_config(void)
{
char *opt;
diff --git a/accel-pppd/ctrl/pppoe/pppoe.c b/accel-pppd/ctrl/pppoe/pppoe.c
index fb288657..031766b0 100644
--- a/accel-pppd/ctrl/pppoe/pppoe.c
+++ b/accel-pppd/ctrl/pppoe/pppoe.c
@@ -74,6 +74,7 @@ int conf_tr101 = 1;
static mempool_t conn_pool;
static mempool_t pado_pool;
+unsigned int stat_starting;
unsigned int stat_active;
unsigned int stat_delayed_pado;
unsigned long stat_PADI_recv;
@@ -247,6 +248,7 @@ static struct pppoe_conn_t *allocate_channel(struct pppoe_serv_t *serv, const ui
conn->ctrl.started = ppp_started;
conn->ctrl.finished = ppp_finished;
conn->ctrl.max_mtu = MAX_PPPOE_MTU;
+ conn->ctrl.type = CTRL_TYPE_PPPOE;
conn->ctrl.name = "pppoe";
conn->ctrl.calling_station_id = _malloc(IFNAMSIZ + 19);
@@ -1217,6 +1219,12 @@ void pppoe_server_stop(const char *ifname)
pthread_rwlock_unlock(&serv_lock);
}
+void __export pppoe_get_stat(unsigned int **starting, unsigned int **active)
+{
+ *starting = &stat_starting;
+ *active = &stat_active;
+}
+
static int init_secret(struct pppoe_serv_t *serv)
{
int fd;
diff --git a/accel-pppd/ctrl/pptp/pptp.c b/accel-pppd/ctrl/pptp/pptp.c
index cad7b23f..715a77b0 100644
--- a/accel-pppd/ctrl/pptp/pptp.c
+++ b/accel-pppd/ctrl/pptp/pptp.c
@@ -656,6 +656,7 @@ static int pptp_connect(struct triton_md_handler_t *h)
conn->ctrl.started = ppp_started;
conn->ctrl.finished = ppp_finished;
conn->ctrl.max_mtu = PPTP_MAX_MTU;
+ conn->ctrl.type = CTRL_TYPE_PPTP;
conn->ctrl.name = "pptp";
conn->ctrl.calling_station_id = _malloc(17);
@@ -703,6 +704,12 @@ static int show_stat_exec(const char *cmd, char * const *fields, int fields_cnt,
return CLI_CMD_OK;
}
+void __export pptp_get_stat(unsigned int **starting, unsigned int **active)
+{
+ *starting = &stat_starting;
+ *active = &stat_active;
+}
+
static void load_config(void)
{
char *opt;