Hello,
I have downloaded jnettop and am trying to get it running
on my FreeBSD
system but I'm not having much luck. After I
run ./configure I run make and
get the following errors:
zephyr:~/jnettop-0.7$ gmake
gmake all-am
gmake[1]: Entering directory `/usr/home/mpc/jnettop-0.7'
source='jnettop.c' object='jnettop.o' libtool=no \
depfile='.deps/jnettop.Po' tmpdepfile='.deps/jnettop.TPo' \
depmode=gcc3 /usr/local/bin/bash ./depcomp \
gcc -DHAVE_CONFIG_H -I. -I. -I. -I./include -
D_REENTRANT -D_THREAD_SAFE -I/u
sr/local/include/glib-2.0 -I/usr/local/lib/glib-
2.0/include -g -O2 -Wal
l -c `test -f 'jnettop.c' || echo './'`jnettop.c
jnettop.c: In function `checkDevices':
jnettop.c:219: structure has no member named
`ifr_hwaddr'
jnettop.c:220: `SIOCGIFHWADDR' undeclared (first use
in this function)
jnettop.c:220: (Each undeclared identifier is reported
only once
jnettop.c:220: for each function it appears in.)
jnettop.c:223: structure has no member named
`ifr_hwaddr'
jnettop.c: In function `drawHeader':
jnettop.c:499: warning: passing arg 1 of `localtime_r'
from incompatible
pointer type
jnettop.c: In function `resolverThreadFunc':
jnettop.c:548: warning: implicit declaration of function
`gethostbyaddr_r'
jnettop.c:548: warning: assignment makes pointer from
integer without a cast
gmake[1]: *** [jnettop.o] Error 1
gmake[1]: Leaving directory `/usr/home/mpc/jnettop-0.7'
gmake: *** [all] Error 2
So what I did next was just comment out lines 219
through 224, which allows
it to compile, but when I try to run it with "jnettop -i eth0"
as root I get
the following error:
Not sniffing. Error while initializing eth0: BIOCSETIF:
eth0: Device not
configured
If I start it without the -i it segfaults.
This might be helpful - it is from /usr/include/net/if.h
/*
* Interface request structure used for socket
* ioctl's. All interface ioctl's must have parameter
* definitions which begin with ifr_name. The
* remainder may be interface specific.
*/
struct ifreq {
char ifr_name[IFNAMSIZ]; /* if name,
e.g. "en0" */
union {
struct sockaddr ifru_addr;
struct sockaddr ifru_dstaddr;
struct sockaddr ifru_broadaddr;
short ifru_flags[2];
short ifru_index;
int ifru_metric;
int ifru_mtu;
int ifru_phys;
int ifru_media;
caddr_t ifru_data;
int ifru_cap[2];
} ifr_ifru;
#define ifr_addr ifr_ifru.ifru_addr /* address */
#define ifr_dstaddr ifr_ifru.ifru_dstaddr /* other end of
p-to-p link
*/
#define ifr_broadaddr ifr_ifru.ifru_broadaddr /* broadcast
address */
#define ifr_flags ifr_ifru.ifru_flags[0] /* flags (low 16
bits) */
#define ifr_flagshigh ifr_ifru.ifru_flags[1] /* flags (high
16 bits) */
#define ifr_metric ifr_ifru.ifru_metric /* metric */
#define ifr_mtu ifr_ifru.ifru_mtu /* mtu */
#define ifr_phys ifr_ifru.ifru_phys /* physical wire
*/
#define ifr_media ifr_ifru.ifru_media /* physical
media */
#define ifr_data ifr_ifru.ifru_data /* for use by
interface */
#define ifr_reqcap ifr_ifru.ifru_cap[0] /* requested
capabilities */
#define ifr_curcap ifr_ifru.ifru_cap[1] /* current
capabilities */
#define ifr_index ifr_ifru.ifru_index /* interface
index */
};
I'm guessing ifr_hwaddr the program is looking for is the
MAC address... I
took a look at the 'arp' command source code and I
think "ether_ntoa" will
give the address on FreeBSD. I notice the Linux man
pages don't have
ether_ntoa, so maybe this is the source of the problem.
See
http://www.freebsd.org/cgi/man.cgi?
query=ether_ntoa&apropos=0&sektion=0&manp
ath=FreeBSD+5.0-current&format=html
I'm not sure if this is helpful or not, like I said I'm just
guessing. I
haven't done any C programming since college. :-)
-Matt
Logged In: NO
Matthew P. Cashdollar <mattcash78@hotmail.com>