""
This commit is contained in:
@@ -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_ */
|
||||
|
||||
4
iftop.c
4
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();
|
||||
|
||||
|
||||
2
iftop.h
2
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);
|
||||
|
||||
@@ -14,6 +14,6 @@
|
||||
#include <arpa/inet.h>
|
||||
#include "hash.h"
|
||||
|
||||
hash_type* ns_hash_create();
|
||||
hash_type* ns_hash_create(void);
|
||||
|
||||
#endif /* __NS_HASH_H_ */
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
#include <netinet/in.h>
|
||||
|
||||
|
||||
void resolver_initialise();
|
||||
void resolver_initialise(void);
|
||||
|
||||
void resolve(struct in_addr* addr, char* result, int buflen);
|
||||
|
||||
|
||||
@@ -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_ */
|
||||
|
||||
Reference in New Issue
Block a user