summaryrefslogtreecommitdiff
path: root/proto/pipe/pipe.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>1999-12-01 12:01:41 +0000
committerMartin Mares <mj@ucw.cz>1999-12-01 12:01:41 +0000
commit3daf783f95790682025ef03ac5b2f486943e6214 (patch)
tree80d6317b40ce644583d1fa12238de8e790594065 /proto/pipe/pipe.c
parent9685deb910c9e7400915209c1924e100b1feb5d5 (diff)
Implemented get_status for the pipe protocol (reports name of the other
side of the pipe). Please do so for your protocols as well.
Diffstat (limited to 'proto/pipe/pipe.c')
-rw-r--r--proto/pipe/pipe.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c
index 2be2ea0c..0612f5f4 100644
--- a/proto/pipe/pipe.c
+++ b/proto/pipe/pipe.c
@@ -14,6 +14,7 @@
#include "nest/route.h"
#include "conf/conf.h"
#include "filter/filter.h"
+#include "lib/string.h"
#include "pipe.h"
@@ -133,9 +134,18 @@ pipe_postconfig(struct proto_config *C)
cf_error("Primary table and peer table must be different");
}
+static void
+pipe_get_status(struct proto *P, byte *buf)
+{
+ struct pipe_proto *p = (struct pipe_proto *) P;
+
+ bsprintf(buf, "-> %s", p->peer->name);
+}
+
struct protocol proto_pipe = {
name: "Pipe",
postconfig: pipe_postconfig,
init: pipe_init,
start: pipe_start,
+ get_status: pipe_get_status,
};