summaryrefslogtreecommitdiff
path: root/nest/proto.c
diff options
context:
space:
mode:
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