diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-21 15:26:36 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-09-21 15:26:36 +0200 |
commit | 05ed02cf3a124e228480da65e09b88751c0859e6 (patch) | |
tree | 7662efb5c114d23a4eed255afbd40f49e90d037c /pingu_host.c | |
parent | 20cbd15c9eb521c6ca21d446b5cdf060df4eb169 (diff) | |
download | pingu-05ed02cf3a124e228480da65e09b88751c0859e6.tar.bz2 pingu-05ed02cf3a124e228480da65e09b88751c0859e6.tar.xz |
pingu_adm: implement initial admin socket
only supported command so far is "status"
Diffstat (limited to 'pingu_host.c')
-rw-r--r-- | pingu_host.c | 11 |
1 files changed, 11 insertions, 0 deletions
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; |