]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Implemented get_status for the pipe protocol (reports name of the other
authorMartin Mares <mj@ucw.cz>
Wed, 1 Dec 1999 12:01:41 +0000 (12:01 +0000)
committerMartin Mares <mj@ucw.cz>
Wed, 1 Dec 1999 12:01:41 +0000 (12:01 +0000)
side of the pipe).

Please do so for your protocols as well.

proto/pipe/pipe.c

index 2be2ea0c87e1c7cb93c190b1397d8937dcc77e16..0612f5f47b3df24e5c8a5ecd6dd2a42d9a481317 100644 (file)
@@ -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,
 };