summaryrefslogtreecommitdiff
path: root/proto/pipe
diff options
context:
space:
mode:
Diffstat (limited to 'proto/pipe')
-rw-r--r--proto/pipe/config.Y14
-rw-r--r--proto/pipe/pipe.c4
2 files changed, 14 insertions, 4 deletions
diff --git a/proto/pipe/config.Y b/proto/pipe/config.Y
index 4f96fdcb..b3c332be 100644
--- a/proto/pipe/config.Y
+++ b/proto/pipe/config.Y
@@ -25,13 +25,19 @@ CF_ADDTO(proto, pipe_proto '}' { this_channel = NULL; } )
pipe_proto_start: proto_start PIPE
{
this_proto = proto_config_new(&proto_pipe, $1);
- this_channel = channel_config_new(NULL, NULL, 0, this_proto);
- this_channel->in_filter = FILTER_ACCEPT;
- this_channel->out_filter = FILTER_ACCEPT;
+}
+proto_name
+{
+ this_channel = proto_cf_main_channel(this_proto);
+ if (!this_channel) {
+ this_channel = channel_config_new(NULL, NULL, 0, this_proto);
+ this_channel->in_filter = FILTER_ACCEPT;
+ this_channel->out_filter = FILTER_ACCEPT;
+ }
};
pipe_proto:
- pipe_proto_start proto_name '{'
+ pipe_proto_start '{'
| pipe_proto proto_item ';'
| pipe_proto channel_item ';'
| pipe_proto PEER TABLE rtable ';' { PIPE_CFG->peer = $4; }
diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c
index 310f3c01..49ff52e2 100644
--- a/proto/pipe/pipe.c
+++ b/proto/pipe/pipe.c
@@ -249,6 +249,8 @@ pipe_show_stats(struct pipe_proto *p)
s2->imp_withdraws_ignored, s2->imp_withdraws_accepted);
}
+static const char *pipe_feed_state[] = { [ES_DOWN] = "down", [ES_FEEDING] = "feed", [ES_READY] = "up" };
+
static void
pipe_show_proto_info(struct proto *P)
{
@@ -257,6 +259,8 @@ pipe_show_proto_info(struct proto *P)
cli_msg(-1006, " Channel %s", "main");
cli_msg(-1006, " Table: %s", p->pri->table->name);
cli_msg(-1006, " Peer table: %s", p->sec->table->name);
+ cli_msg(-1006, " Import state: %s", pipe_feed_state[p->sec->export_state]);
+ cli_msg(-1006, " Export state: %s", pipe_feed_state[p->pri->export_state]);
cli_msg(-1006, " Import filter: %s", filter_name(p->sec->out_filter));
cli_msg(-1006, " Export filter: %s", filter_name(p->pri->out_filter));