From 934919ff6ad143eb585943799f6685a34bd403b0 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Wed, 12 Oct 2011 15:30:26 +0200 Subject: pingu_adm: implement host-status and gateway-status --- pingu_host.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'pingu_host.c') diff --git a/pingu_host.c b/pingu_host.c index c153e3d..81719a6 100644 --- a/pingu_host.c +++ b/pingu_host.c @@ -109,11 +109,13 @@ struct pingu_host *pingu_host_new(char *hoststr, float burst_interval, return host; } -void pingu_host_dump_status(int fd) +void pingu_host_dump_status(int fd, char *filter) { struct pingu_host *host; char buf[512]; list_for_each_entry(host, &host_list, host_list_entry) { + if (filter != NULL && strcmp(filter, host->label) != 0) + continue; snprintf(buf, sizeof(buf), "%s: %i\n", host->label, host->status); write(fd, buf, strlen(buf)); } -- cgit v1.2.3