aboutsummaryrefslogtreecommitdiffstats
path: root/src/sctp_m2ua.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-22 15:52:07 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-22 16:22:18 +0100
commit4c1eb0ee43259bae710b5685ed666210be9712f9 (patch)
tree301658340558a040a479164144d1a74a0f6005d9 /src/sctp_m2ua.c
parentc5d897e8474e99f2b42202b8ec323484225796ec (diff)
stats: Count packets on a per link level
Diffstat (limited to 'src/sctp_m2ua.c')
-rw-r--r--src/sctp_m2ua.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/sctp_m2ua.c b/src/sctp_m2ua.c
index a4743fa..d3a64c9 100644
--- a/src/sctp_m2ua.c
+++ b/src/sctp_m2ua.c
@@ -18,6 +18,7 @@
#include <sctp_m2ua.h>
#include <bsc_data.h>
#include <cellmgr_debug.h>
+#include <counter.h>
#include <mtp_data.h>
#include <mtp_pcap.h>
@@ -31,6 +32,12 @@
extern struct bsc_data bsc;
+static void link_down(struct mtp_link *link)
+{
+ rate_ctr_inc(&link->ctrg->ctr[MTP_LNK_ERROR]);
+ mtp_link_down(link);
+}
+
static void m2ua_conn_destroy(struct sctp_m2ua_conn *conn)
{
close(conn->queue.bfd.fd);
@@ -39,7 +46,7 @@ static void m2ua_conn_destroy(struct sctp_m2ua_conn *conn)
llist_del(&conn->entry);
if (conn->asp_up && conn->asp_active && conn->established)
- mtp_link_down(&conn->trans->base);
+ link_down(&conn->trans->base);
talloc_free(conn);
#warning "Notify any other AS(P) for failover scenario"
@@ -286,7 +293,7 @@ static int m2ua_handle_rel_req(struct sctp_m2ua_conn *conn,
conn->established = 0;
LOGP(DINP, LOGL_NOTICE, "M2UA/Link is released.\n");
- mtp_link_down(&conn->trans->base);
+ link_down(&conn->trans->base);
m2ua_msg_free(conf);
return 0;
}