summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2017-04-26 12:30:22 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2017-04-26 12:30:22 +0200
commit69fddac0525b1b0c940d778a161ed3a0a742ed6f (patch)
tree3fd1d68a1dc84f6d14bd6705fe3505be1483d4ee /nest/proto.c
parent93a3661c15c612e1de807524649482765b2c2702 (diff)
parentb29499996bbc1612a63a7e715bb53a8abf0940e3 (diff)
Merge branch 'int-new' of gitlab.labs.nic.cz:labs/bird into int-new
Diffstat (limited to 'nest/proto.c')
-rw-r--r--nest/proto.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/nest/proto.c b/nest/proto.c
index 0a7a32a6..3d764df0 100644
--- a/nest/proto.c
+++ b/nest/proto.c
@@ -105,6 +105,25 @@ proto_find_channel_by_table(struct proto *p, struct rtable *t)
}
/**
+ * proto_find_channel_by_name - find channel by its name
+ * @p: protocol instance
+ * @n: channel name
+ *
+ * Returns pointer to channel or NULL
+ */
+struct channel *
+proto_find_channel_by_name(struct proto *p, const char *n)
+{
+ struct channel *c;
+
+ WALK_LIST(c, p->channels)
+ if (!strcmp(c->name, n))
+ return c;
+
+ return NULL;
+}
+
+/**
* proto_add_channel - connect protocol to a routing table
* @p: protocol instance
* @cf: channel configuration