diff options
author | Dmitry Kozlov <xeb@mail.ru> | 2011-01-04 00:11:04 +0300 |
---|---|---|
committer | Dmitry Kozlov <xeb@mail.ru> | 2011-01-04 00:11:04 +0300 |
commit | cdd91cd6a6a7bd00dcf9a0ba78ea76e01ce33655 (patch) | |
tree | 9edc12be71dc10f7112aef9fa654faa2b6897b51 /accel-pptpd/ctrl/pppoe/pppoe.c | |
parent | 709dd1595b4877471cb18397be28352730120067 (diff) | |
download | accel-ppp-cdd91cd6a6a7bd00dcf9a0ba78ea76e01ce33655.tar.gz accel-ppp-cdd91cd6a6a7bd00dcf9a0ba78ea76e01ce33655.zip |
pppoe: additional statistics
radius: additional statistics
Diffstat (limited to 'accel-pptpd/ctrl/pppoe/pppoe.c')
-rw-r--r-- | accel-pptpd/ctrl/pppoe/pppoe.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/accel-pptpd/ctrl/pppoe/pppoe.c b/accel-pptpd/ctrl/pppoe/pppoe.c index 3e6b0bf2..95ae3944 100644 --- a/accel-pptpd/ctrl/pppoe/pppoe.c +++ b/accel-pptpd/ctrl/pppoe/pppoe.c @@ -75,6 +75,11 @@ static mempool_t pado_pool; unsigned int stat_active; unsigned int stat_delayed_pado; +unsigned long stat_PADI_recv; +unsigned long stat_PADO_sent; +unsigned long stat_PADR_recv; +unsigned long stat_PADR_dup_recv; +unsigned long stat_PADS_sent; pthread_rwlock_t serv_lock = PTHREAD_RWLOCK_INITIALIZER; LIST_HEAD(serv_list); @@ -581,6 +586,7 @@ static void pppoe_send_PADO(struct pppoe_serv_t *serv, const uint8_t *addr, cons print_packet(pack); } + __sync_add_and_fetch(&stat_PADO_sent, 1); pppoe_send(serv->hnd.fd, pack); } @@ -628,6 +634,7 @@ static void pppoe_send_PADS(struct pppoe_conn_t *conn) print_packet(pack); } + __sync_add_and_fetch(&stat_PADS_sent, 1); pppoe_send(conn->disc_sock, pack); } @@ -693,6 +700,8 @@ static void pppoe_recv_PADI(struct pppoe_serv_t *serv, uint8_t *pack, int size) int n, service_match = 0; struct delayed_pado_t *pado; + __sync_add_and_fetch(&stat_PADI_recv, 1); + if (ppp_shutdown || pado_delay == -1) return; @@ -791,6 +800,8 @@ static void pppoe_recv_PADR(struct pppoe_serv_t *serv, uint8_t *pack, int size) struct pppoe_conn_t *conn; int vendor_id; + __sync_add_and_fetch(&stat_PADR_recv, 1); + if (ppp_shutdown) return; @@ -876,8 +887,10 @@ static void pppoe_recv_PADR(struct pppoe_serv_t *serv, uint8_t *pack, int size) pthread_mutex_lock(&serv->lock); conn = find_channel(serv, (uint8_t *)ac_cookie_tag->tag_data); - if (conn && !conn->ppp.username) + if (conn && !conn->ppp.username) { + __sync_add_and_fetch(&stat_PADR_dup_recv, 1); pppoe_send_PADS(conn); + } pthread_mutex_unlock(&serv->lock); if (conn) |