Commit 9e3d1e08 authored by chris's avatar chris
Browse files

""

parent e7c96c16
......@@ -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_ */
......@@ -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"
......
......@@ -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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment