From 05ed02cf3a124e228480da65e09b88751c0859e6 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 21 Sep 2011 15:26:36 +0200 Subject: pingu_adm: implement initial admin socket only supported command so far is "status" --- pingu_host.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'pingu_host.c') diff --git a/pingu_host.c b/pingu_host.c index 5fa5aaf..5146f51 100644 --- a/pingu_host.c +++ b/pingu_host.c @@ -111,6 +111,17 @@ struct pingu_host *pingu_host_find_by_iface(struct pingu_iface *iface) return NULL; } +void pingu_host_dump_status(int fd) +{ + struct pingu_host *host; + char buf[512]; + list_for_each_entry(host, &host_list, host_list_entry) { + snprintf(buf, sizeof(buf), "%s: %i\n", host->label, host->status); + write(fd, buf, strlen(buf)); + } + write(fd, "", 1); +} + int pingu_host_init(struct ev_loop *loop) { struct pingu_host *host; -- cgit v1.2.3