This is merely a historical archive of years 2008-2021, before the migration to mailman3.
A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.
laforge gerrit-no-reply at lists.osmocom.orglaforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/21803 ) Change subject: Move e1d_find_intf + e1_intf_find_line to intf_line.c ...................................................................... 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 --- M src/ctl.c M src/e1d.h M src/intf_line.c 3 files changed, 31 insertions(+), 24 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/03/21803/1 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 16d0fad..a12b5de 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -122,6 +122,13 @@ 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 @@ // --------------------------------------------------------------------------- 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; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/21803 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: Ibbda172aa425ca1e4702bacc7e595cd73a52929d Gerrit-Change-Number: 21803 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge at osmocom.org> Gerrit-MessageType: newchange -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20201219/3c5d6c2c/attachment.htm>