Implemented get_status for the pipe protocol (reports name of the other
side of the pipe). Please do so for your protocols as well.
This commit is contained in:
parent
9685deb910
commit
3daf783f95
1 changed files with 10 additions and 0 deletions
|
@ -14,6 +14,7 @@
|
||||||
#include "nest/route.h"
|
#include "nest/route.h"
|
||||||
#include "conf/conf.h"
|
#include "conf/conf.h"
|
||||||
#include "filter/filter.h"
|
#include "filter/filter.h"
|
||||||
|
#include "lib/string.h"
|
||||||
|
|
||||||
#include "pipe.h"
|
#include "pipe.h"
|
||||||
|
|
||||||
|
@ -133,9 +134,18 @@ pipe_postconfig(struct proto_config *C)
|
||||||
cf_error("Primary table and peer table must be different");
|
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 = {
|
struct protocol proto_pipe = {
|
||||||
name: "Pipe",
|
name: "Pipe",
|
||||||
postconfig: pipe_postconfig,
|
postconfig: pipe_postconfig,
|
||||||
init: pipe_init,
|
init: pipe_init,
|
||||||
start: pipe_start,
|
start: pipe_start,
|
||||||
|
get_status: pipe_get_status,
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue