diff options
author | Natanael Copa <ncopa@alpinelinux.org> | 2011-10-12 15:30:26 +0200 |
---|---|---|
committer | Natanael Copa <ncopa@alpinelinux.org> | 2011-10-12 15:30:26 +0200 |
commit | 934919ff6ad143eb585943799f6685a34bd403b0 (patch) | |
tree | c920d13567cb64fd5ae209ca4e5ee08d8513b0fd /pingu_host.c | |
parent | c2af879f64bac393df12e593b1bf16cd56517095 (diff) | |
download | pingu-934919ff6ad143eb585943799f6685a34bd403b0.tar.bz2 pingu-934919ff6ad143eb585943799f6685a34bd403b0.tar.xz |
pingu_adm: implement host-status and gateway-status
Diffstat (limited to 'pingu_host.c')
-rw-r--r-- | pingu_host.c | 4 |
1 files changed, 3 insertions, 1 deletions
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)); } |