Seen on a RedHat-7.3 and a Debian-Woody system:
When running iftop-0.16, you can press "o" (letter o) to freeze the
order. From that moment, the "total" column is counting much more than
it should. Also the displayed bandwidth in the other columns is
incorrect.
I hope you can reproduce it, if not I can give you access to one of the
machines.
Richard.
/root/.iftoprc:
interface: eth0
dns-resolution: no
port-resolution: no
filter-code: not udp port 53
show-bars: yes
promiscuous: yes
port-display: on
hide-source: no
hide-destination: no
use-bytes: no
#sort: 2s
#sort: 10s
sort: 40s
#sort: source
#sort: destination
line-display: one-line-both
#line-display: two-line
#line-display: one-line-sent
#line-display: one-line-received
show-totals: yes
log-scale: no
max-bandwidth: 2048k
#net-filter: net/mask
#screen-filter: regexp
--
___________________________________________________________________
Recursion: see recursion
+------------------------------------------------------------------+
| Richard Lucassen, Utrecht |
| Public key and email address: |
| http://www.lucassen.org/mail-pubkey.html |
+------------------------------------------------------------------+
Had to make these changes to compile under HP-UX 11.00
1. in edline.c
KEY_END is undefined anywhere
comment out this case
2. in options.c
u_int32_t is uint32_t in HP-UX (sys/types.h)
struct if_nameindex is struct ifnet in HP-UX
(net/if.h)
3. in resolver.c
wait() requires an argument of type int *
changed wait() to wait( (int *) (pid_t) -1)
4. in ui.c
before #include <curses.h>
add #define _XOPEN_SOURCE_EXTENDED
5. in addrs_dlpi.c
add #include <netdb.h>
Got through the compile phase with these changes, but
at load time, 'ld' choked when trying to find
if_freenameindex() and if_nameindex()
Can anyone suggest where I might find these functions?
Or is the port hopeless because different data
structures are being used for kernel if structures?
=====
John Caywood
biliary two thousand at yahoo dot calm
__________________________________
Do you Yahoo!?
Win a $20,000 Career Makeover at Yahoo! HotJobs
http://hotjobs.sweepstakes.yahoo.com/careermakeover
hi,
I'm tring to use libpcap to measure bandwith..
the reason I need this is to launch this small program that will measure
the bandwith usage (tcpdump filter based).. it will not be ncurses based,,
My problem is how to set this program to capture the traffic for 10 seconds
for example ... and most importanly how u calculate that 1 second is passed,
so that u calc "kbps"...
Could u explain...(i'm not a C programmer but have idea what is all about)
Second question I've used pcap sniffer.c example from tcpdump.org, and
modified so that i calculate the packet sizes in two different ways i.e :
total_len2 += ntohs(ip->ip_len);
total_len += header->len;
into got_packet() callback function... I see that iftop uses the first one, is it more
correct...
tia..
PS. One second question is what if I put several filters in text files and loop over them
i.e. read the first filter, setfilter(), mesure for 10 sec, then read the second filter...etc.etc..
will there be some calculation error 'cause I'm switching filters i.e. will I have to wait some
time before start measuting say :
1. setfilter()
2. wait 1 sec
3. measure 10 sec
4. goto 1