From 2dc4a06dda004862b5718a6d5ad0c0373558dc1a Mon Sep 17 00:00:00 2001 From: chris <> Date: Thu, 6 Feb 2003 10:51:24 +0000 Subject: [PATCH] "" --- addr_hash.h | 2 +- iftop.c | 4 +++- iftop.h | 2 +- ns_hash.h | 2 +- resolver.h | 2 +- serv_hash.h | 2 +- ui.h | 6 +++--- 7 files changed, 11 insertions(+), 9 deletions(-) diff --git a/addr_hash.h b/addr_hash.h index 4094d55..cd7a9cf 100644 --- a/addr_hash.h +++ b/addr_hash.h @@ -21,6 +21,6 @@ typedef struct { typedef addr_pair key_type; /* index into hash table */ -hash_type* addr_hash_create(); +hash_type* addr_hash_create(void); #endif /* __ADDR_HASH_H_ */ diff --git a/iftop.c b/iftop.c index 6c4129a..522d308 100644 --- a/iftop.c +++ b/iftop.c @@ -417,7 +417,7 @@ void packet_init() { } strncpy(ifr.ifr_name, options.interface, IFNAMSIZ); ifr.ifr_hwaddr.sa_family = AF_UNSPEC; - if (ioctl(s, SIOCGIFHWADDR, &ifr) == -1) { + if (ioctl(s, SIOCGIFADDR, &ifr) == -1) { fprintf(stderr, "Error getting hardware address for interface: %s\n", options.interface); perror("ioctl(SIOCGIFHWADDR)"); exit(1); @@ -428,6 +428,8 @@ void packet_init() { for (s = 0; s < 6; ++s) fprintf(stderr, "%c%02x", s ? ':' : ' ', (unsigned int)if_hw_addr[s]); fprintf(stderr, "\n"); + + fprintf(stderr, "IP address is: %s", inet_ntoa(((struct sockaddr_in*)&ifr.ifr_addr)->sin_addr)); resolver_initialise(); diff --git a/iftop.h b/iftop.h index d645108..4997583 100644 --- a/iftop.h +++ b/iftop.h @@ -20,7 +20,7 @@ typedef struct { int last_write; } history_type; -void tick(); +void tick(void); void *xmalloc(size_t n); void *xcalloc(size_t n, size_t m); diff --git a/ns_hash.h b/ns_hash.h index 78814be..8135d8f 100644 --- a/ns_hash.h +++ b/ns_hash.h @@ -14,6 +14,6 @@ #include #include "hash.h" -hash_type* ns_hash_create(); +hash_type* ns_hash_create(void); #endif /* __NS_HASH_H_ */ diff --git a/resolver.h b/resolver.h index 836fe25..02df1bf 100644 --- a/resolver.h +++ b/resolver.h @@ -12,7 +12,7 @@ #include -void resolver_initialise(); +void resolver_initialise(void); void resolve(struct in_addr* addr, char* result, int buflen); diff --git a/serv_hash.h b/serv_hash.h index 2d9ecde..de964a1 100644 --- a/serv_hash.h +++ b/serv_hash.h @@ -17,7 +17,7 @@ typedef struct { int protocol; } ip_service; -hash_type* serv_hash_create(); +hash_type* serv_hash_create(void); void serv_hash_initialise(hash_type* sh); #endif /* __SERV_HASH_H_ */ diff --git a/ui.h b/ui.h index 6309151..d67c8c5 100644 --- a/ui.h +++ b/ui.h @@ -7,9 +7,9 @@ #ifndef __UI_H_ /* include guard */ #define __UI_H_ -void ui_print(); -void ui_loop(); -void ui_finish(); +void ui_print(void); +void ui_loop(void); +void ui_finish(void); void ui_tick(int); #endif /* __UI_H_ */