From 9e3d1e08ef36391c4d72874c3518a65af366b499 Mon Sep 17 00:00:00 2001 From: chris <> Date: Mon, 1 Apr 2002 22:44:41 +0000 Subject: [PATCH] "" --- iftop.h | 7 +++++++ options.c | 8 ++++---- resolver.c | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/iftop.h b/iftop.h index 4a67560..60cb53f 100644 --- a/iftop.h +++ b/iftop.h @@ -26,4 +26,11 @@ void *xrealloc(void *w, size_t n); char *xstrdup(const char *s); void xfree(void *v); +/* ui.c */ +void analyse_data(void); +void ui_init(void); + +/* options.c */ +void options_read(int argc, char **argv); + #endif /* __IFTOP_H_ */ diff --git a/options.c b/options.c index 2363b81..1f0ef3f 100644 --- a/options.c +++ b/options.c @@ -17,7 +17,7 @@ char optstr[] = "+i:f:n:dhp"; /* Global options. */ -void set_defaults() { +static void set_defaults() { options.interface = "eth0"; options.filtercode = NULL; options.netfilter = 0; @@ -28,12 +28,12 @@ void set_defaults() { options.showbars = 1; } -void die(char *msg) { +static void die(char *msg) { fprintf(stderr, msg); exit(1); } -void set_net_filter(char* arg) { +static void set_net_filter(char* arg) { char* mask; mask = strchr(arg, '/'); @@ -64,7 +64,7 @@ void set_net_filter(char* arg) { /* usage: * Print usage information. */ -void usage(FILE *fp) { +static void usage(FILE *fp) { fprintf(fp, "iftop: display bandwidth usage on an interface by host\n" "\n" diff --git a/resolver.c b/resolver.c index cef2bcd..4646868 100644 --- a/resolver.c +++ b/resolver.c @@ -58,7 +58,7 @@ void resolver_worker(void* ptr) { /* Allocate buffer, remember to free it to avoid memory leakage. */ tmphstbuf = xmalloc (hstbuflen); - while ((res = gethostbyaddr_r (&addr, sizeof(addr), AF_INET, + while ((res = gethostbyaddr_r ((char*)&addr, sizeof(addr), AF_INET, &hostbuf, tmphstbuf, hstbuflen, &hp, &herr)) == ERANGE) { /* Enlarge the buffer. */