0.9pre4.
Merged in FreeBSD fixes.
This commit is contained in:
5
Makefile
5
Makefile
@@ -17,6 +17,7 @@ CFLAGS += -I/usr/include/pcap
|
|||||||
# directories:
|
# directories:
|
||||||
#LDFLAGS += -L/usr/local/lib
|
#LDFLAGS += -L/usr/local/lib
|
||||||
# LDFLAGS += -pg -a
|
# LDFLAGS += -pg -a
|
||||||
|
LDFLAGS += -pthread
|
||||||
|
|
||||||
# PREFIX specifies the base directory for the installation.
|
# PREFIX specifies the base directory for the installation.
|
||||||
PREFIX = /usr/local
|
PREFIX = /usr/local
|
||||||
@@ -30,10 +31,10 @@ MANDIR = man
|
|||||||
#MANDIR = share/man # FHS-ish
|
#MANDIR = share/man # FHS-ish
|
||||||
|
|
||||||
# You shouldn't need to change anything below this point.
|
# You shouldn't need to change anything below this point.
|
||||||
VERSION = 0.9pre3
|
VERSION = 0.9pre4
|
||||||
CFLAGS += -g -Wall "-DIFTOP_VERSION=\"$(VERSION)\""
|
CFLAGS += -g -Wall "-DIFTOP_VERSION=\"$(VERSION)\""
|
||||||
LDFLAGS += -g
|
LDFLAGS += -g
|
||||||
LDLIBS += -lpcap -lpthread -lcurses -lm
|
LDLIBS += -lpcap -lcurses -lm
|
||||||
|
|
||||||
SRCS = iftop.c addr_hash.c hash.c ns_hash.c resolver.c ui.c util.c sorted_list.c\
|
SRCS = iftop.c addr_hash.c hash.c ns_hash.c resolver.c ui.c util.c sorted_list.c\
|
||||||
options.c serv_hash.c threadprof.c
|
options.c serv_hash.c threadprof.c
|
||||||
|
|||||||
2
iftop.c
2
iftop.c
@@ -134,7 +134,7 @@ void assign_addr_pair(addr_pair* ap, struct ip* iptr, int flip) {
|
|||||||
unsigned short int dst_port = 0;
|
unsigned short int dst_port = 0;
|
||||||
|
|
||||||
/* Does this protocol use ports? */
|
/* Does this protocol use ports? */
|
||||||
if(iptr->ip_p == IPPROTO_TCP || IP_HL(iptr) == IPPROTO_UDP) {
|
if(iptr->ip_p == IPPROTO_TCP || iptr->ip_p == IPPROTO_UDP) {
|
||||||
/* We take a slight liberty here by treating UDP the same as TCP */
|
/* We take a slight liberty here by treating UDP the same as TCP */
|
||||||
|
|
||||||
/* Find the TCP/UDP header */
|
/* Find the TCP/UDP header */
|
||||||
|
|||||||
2
iftop.h
2
iftop.h
@@ -35,7 +35,7 @@ void options_read(int argc, char **argv);
|
|||||||
|
|
||||||
|
|
||||||
/* Make use of SIOCGIFHWADDR work on FreeBSD */
|
/* Make use of SIOCGIFHWADDR work on FreeBSD */
|
||||||
#ifdef __BSD__
|
#ifndef SIOCGIFHWADDR
|
||||||
#define SIOCGIFHWADDR SIOCGIFADDR
|
#define SIOCGIFHWADDR SIOCGIFADDR
|
||||||
#define ifr_hwaddr ifr_addr
|
#define ifr_hwaddr ifr_addr
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -2,7 +2,9 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in_systm.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include "ns_hash.h"
|
#include "ns_hash.h"
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#ifndef __NS_HASH_H_ /* include guard */
|
#ifndef __NS_HASH_H_ /* include guard */
|
||||||
#define __NS_HASH_H_
|
#define __NS_HASH_H_
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|||||||
@@ -3,8 +3,9 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -6,8 +6,12 @@
|
|||||||
#ifndef __RESOLVER_H_ /* include guard */
|
#ifndef __RESOLVER_H_ /* include guard */
|
||||||
#define __RESOLVER_H_
|
#define __RESOLVER_H_
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in_systm.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
|
||||||
void resolver_initialise();
|
void resolver_initialise();
|
||||||
|
|
||||||
void resolve(struct in_addr* addr, char* result, int buflen);
|
void resolve(struct in_addr* addr, char* result, int buflen);
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
#ifndef __SERV_HASH_H_ /* include guard */
|
#ifndef __SERV_HASH_H_ /* include guard */
|
||||||
#define __SERV_HASH_H_
|
#define __SERV_HASH_H_
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|||||||
Reference in New Issue
Block a user