summaryrefslogtreecommitdiffstats
path: root/src/e1_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/e1_input.c')
-rw-r--r--src/e1_input.c37
1 files changed, 31 insertions, 6 deletions
diff --git a/src/e1_input.c b/src/e1_input.c
index b8b0130..82ba202 100644
--- a/src/e1_input.c
+++ b/src/e1_input.c
@@ -40,14 +40,12 @@
#define PF_ISDN AF_ISDN
#endif
-#include <osmocom/core/select.h>
-#include <osmocom/core/msgb.h>
+#include <osmocom/core/linuxlist.h>
+#include <osmocom/core/talloc.h>
+#include <osmocom/core/rate_ctr.h>
#include <osmocom/core/logging.h>
#include <osmocom/core/signal.h>
#include <osmocom/abis/e1_input.h>
-#include <osmocom/core/linuxlist.h>
-#include <osmocom/abis/subchan_demux.h>
-#include <osmocom/core/talloc.h>
#define NUM_E1_TS 32
@@ -61,6 +59,31 @@ LLIST_HEAD(e1inp_line_list);
static void *tall_sigl_ctx;
+static const struct rate_ctr_desc e1inp_ctr_d[] = {
+ [E1I_CTR_HDLC_ABORT] = {
+ "hdlc.abort", "ABORT from E1 Layer1"
+ },
+ [E1I_CTR_HDLC_BADFCS] = {
+ "hdlc.bad_fcs", "Bad Frame Check Sequence"
+ },
+ [E1I_CTR_HDLC_OVERR] = {
+ "hdlc.overrun", "HDLC Overrun"
+ },
+ [E1I_CTR_ALARM] = {
+ "alarm", "E1 Alarm (Yellow/Red)"
+ },
+ [E1I_CTR_REMOVED] = {
+ "removed", "E1 Line removed"
+ },
+};
+
+static const struct rate_ctr_group_desc e1inp_ctr_g_d = {
+ .group_name_prefix = "e1inp",
+ .group_description = "E1 Input subsystem",
+ .num_ctr = ARRAY_SIZE(e1inp_ctr_d),
+ .ctr_desc = e1inp_ctr_d,
+};
+
/*
* pcap writing of the misdn load
* pcap format is from http://wiki.wireshark.org/Development/LibpcapFileFormat
@@ -307,8 +330,10 @@ e1inp_line_create(uint8_t e1_nr, const char *driver_name)
return NULL;
line->driver = driver;
-
line->num = e1_nr;
+
+ line->rate_ctr = rate_ctr_group_alloc(line, &e1inp_ctr_g_d, line->num);
+
for (i = 0; i < NUM_E1_TS; i++) {
line->ts[i].num = i+1;
line->ts[i].line = line;