aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-12-18 17:24:40 +0100
committerHarald Welte <laforge@osmocom.org>2020-12-20 11:46:19 +0100
commite07bbb5037721bca1e5e4659c27a1393e6e9bdd4 (patch)
tree3260a8a3b4506a81efbcb5beaf384969c4e6c40c
parent1923b4d8327d96563bd739019a943953e3d2f2b1 (diff)
Move e1d_find_intf + e1_intf_find_line to intf_line.c
Those are generic helper functions not really related to the ctl interface. Change-Id: Ibbda172aa425ca1e4702bacc7e595cd73a52929d
-rw-r--r--src/ctl.c24
-rw-r--r--src/e1d.h7
-rw-r--r--src/intf_line.c24
3 files changed, 31 insertions, 24 deletions
diff --git a/src/ctl.c b/src/ctl.c
index 8a0e339..1775423 100644
--- a/src/ctl.c
+++ b/src/ctl.c
@@ -42,30 +42,6 @@
#include "log.h"
-struct e1_intf *
-e1d_find_intf(struct e1_daemon *e1d, uint8_t id)
-{
- struct e1_intf *intf;
-
- llist_for_each_entry(intf, &e1d->interfaces, list)
- if (intf->id == id)
- return intf;
-
- return NULL;
-}
-
-struct e1_line *
-e1_intf_find_line(struct e1_intf *intf, uint8_t id)
-{
- struct e1_line *line;
-
- llist_for_each_entry(line, &intf->lines, list)
- if (line->id == id)
- return line;
-
- return NULL;
-}
-
static struct e1_ts *
_e1d_get_ts(struct e1_line *line, uint8_t ts)
{
diff --git a/src/e1d.h b/src/e1d.h
index e5b541b..f02f397 100644
--- a/src/e1d.h
+++ b/src/e1d.h
@@ -124,6 +124,13 @@ struct e1_daemon {
struct llist_head interfaces;
};
+
+struct e1_line *
+e1_intf_find_line(struct e1_intf *intf, uint8_t id);
+
+struct e1_line *
+e1_intf_find_line(struct e1_intf *intf, uint8_t id);
+
struct e1_intf *
e1_intf_new(struct e1_daemon *e1d, void *drv_data);
diff --git a/src/intf_line.c b/src/intf_line.c
index 3aebf9c..ccd7645 100644
--- a/src/intf_line.c
+++ b/src/intf_line.c
@@ -67,6 +67,30 @@ static const struct rate_ctr_group_desc line_ctrg_desc = {
// ---------------------------------------------------------------------------
struct e1_intf *
+e1d_find_intf(struct e1_daemon *e1d, uint8_t id)
+{
+ struct e1_intf *intf;
+
+ llist_for_each_entry(intf, &e1d->interfaces, list)
+ if (intf->id == id)
+ return intf;
+
+ return NULL;
+}
+
+struct e1_line *
+e1_intf_find_line(struct e1_intf *intf, uint8_t id)
+{
+ struct e1_line *line;
+
+ llist_for_each_entry(line, &intf->lines, list)
+ if (line->id == id)
+ return line;
+
+ return NULL;
+}
+
+struct e1_intf *
e1_intf_new(struct e1_daemon *e1d, void *drv_data)
{
struct e1_intf *intf;