""
This commit is contained in:
@@ -21,6 +21,6 @@ typedef struct {
|
|||||||
|
|
||||||
typedef addr_pair key_type; /* index into hash table */
|
typedef addr_pair key_type; /* index into hash table */
|
||||||
|
|
||||||
hash_type* addr_hash_create();
|
hash_type* addr_hash_create(void);
|
||||||
|
|
||||||
#endif /* __ADDR_HASH_H_ */
|
#endif /* __ADDR_HASH_H_ */
|
||||||
|
|||||||
4
iftop.c
4
iftop.c
@@ -417,7 +417,7 @@ void packet_init() {
|
|||||||
}
|
}
|
||||||
strncpy(ifr.ifr_name, options.interface, IFNAMSIZ);
|
strncpy(ifr.ifr_name, options.interface, IFNAMSIZ);
|
||||||
ifr.ifr_hwaddr.sa_family = AF_UNSPEC;
|
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);
|
fprintf(stderr, "Error getting hardware address for interface: %s\n", options.interface);
|
||||||
perror("ioctl(SIOCGIFHWADDR)");
|
perror("ioctl(SIOCGIFHWADDR)");
|
||||||
exit(1);
|
exit(1);
|
||||||
@@ -429,6 +429,8 @@ void packet_init() {
|
|||||||
fprintf(stderr, "%c%02x", s ? ':' : ' ', (unsigned int)if_hw_addr[s]);
|
fprintf(stderr, "%c%02x", s ? ':' : ' ', (unsigned int)if_hw_addr[s]);
|
||||||
fprintf(stderr, "\n");
|
fprintf(stderr, "\n");
|
||||||
|
|
||||||
|
fprintf(stderr, "IP address is: %s", inet_ntoa(((struct sockaddr_in*)&ifr.ifr_addr)->sin_addr));
|
||||||
|
|
||||||
resolver_initialise();
|
resolver_initialise();
|
||||||
|
|
||||||
pd = pcap_open_live(options.interface, CAPTURE_LENGTH, options.promiscuous, 1000, errbuf);
|
pd = pcap_open_live(options.interface, CAPTURE_LENGTH, options.promiscuous, 1000, errbuf);
|
||||||
|
|||||||
2
iftop.h
2
iftop.h
@@ -20,7 +20,7 @@ typedef struct {
|
|||||||
int last_write;
|
int last_write;
|
||||||
} history_type;
|
} history_type;
|
||||||
|
|
||||||
void tick();
|
void tick(void);
|
||||||
|
|
||||||
void *xmalloc(size_t n);
|
void *xmalloc(size_t n);
|
||||||
void *xcalloc(size_t n, size_t m);
|
void *xcalloc(size_t n, size_t m);
|
||||||
|
|||||||
@@ -14,6 +14,6 @@
|
|||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include "hash.h"
|
#include "hash.h"
|
||||||
|
|
||||||
hash_type* ns_hash_create();
|
hash_type* ns_hash_create(void);
|
||||||
|
|
||||||
#endif /* __NS_HASH_H_ */
|
#endif /* __NS_HASH_H_ */
|
||||||
|
|||||||
@@ -12,7 +12,7 @@
|
|||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
|
||||||
void resolver_initialise();
|
void resolver_initialise(void);
|
||||||
|
|
||||||
void resolve(struct in_addr* addr, char* result, int buflen);
|
void resolve(struct in_addr* addr, char* result, int buflen);
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ typedef struct {
|
|||||||
int protocol;
|
int protocol;
|
||||||
} ip_service;
|
} ip_service;
|
||||||
|
|
||||||
hash_type* serv_hash_create();
|
hash_type* serv_hash_create(void);
|
||||||
void serv_hash_initialise(hash_type* sh);
|
void serv_hash_initialise(hash_type* sh);
|
||||||
|
|
||||||
#endif /* __SERV_HASH_H_ */
|
#endif /* __SERV_HASH_H_ */
|
||||||
|
|||||||
6
ui.h
6
ui.h
@@ -7,9 +7,9 @@
|
|||||||
#ifndef __UI_H_ /* include guard */
|
#ifndef __UI_H_ /* include guard */
|
||||||
#define __UI_H_
|
#define __UI_H_
|
||||||
|
|
||||||
void ui_print();
|
void ui_print(void);
|
||||||
void ui_loop();
|
void ui_loop(void);
|
||||||
void ui_finish();
|
void ui_finish(void);
|
||||||
void ui_tick(int);
|
void ui_tick(int);
|
||||||
|
|
||||||
#endif /* __UI_H_ */
|
#endif /* __UI_H_ */
|
||||||
|
|||||||
Reference in New Issue
Block a user