Merged in FreeBSD fixes.
This commit is contained in:
pdw
2002-10-21 13:08:23 +00:00
parent 7a997c4ec2
commit 8010c98d26
8 changed files with 15 additions and 5 deletions

View File

@@ -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

View File

@@ -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 */

View File

@@ -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

View File

@@ -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"

View File

@@ -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>

View File

@@ -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>

View File

@@ -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);

View File

@@ -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>