Ok the make for the patched iftop.c failed :
source='iftop.c' object='iftop.o' libtool=no depfile='.deps/iftop.Po' tmpdepfile='.deps/iftop.TPo' depmode=gcc /bin/sh ./config/depcomp gcc -DHAVE_CONFIG_H -I. -I. -I. -g -O2 -c `test -f 'iftop.c' || echo './'`iftop.c iftop.c: In function `packet_loop': iftop.c:511: `p' undeclared (first use in this function) iftop.c:511: (Each undeclared identifier is reported only once iftop.c:511: for each function it appears in.) *** Error code 1
Stop in /root/iftop-0.13. *** Error code 1
Stop in /root/iftop-0.13 (line 352 of Makefile). *** Error code 1
forgive me I'm not much of a coder any ideas ?
oh and I need to edit the last email, instead of saying "keyboard input is being recognized" I meant IS NOT being recognized. =( sorry
-----Original Message----- From: Michael [mailto:admin@ntworks.org] Sent: Friday, August 29, 2003 11:56 AM To: 'iftop-users@lists.beasts.org' Subject: RE: [Iftop-users] iftop on openbsd
As a matter of fact it seems none of the keyboard input is being recognized by iftop... I reinstalled my server to openbsd 3.3-stable, and installed iftop, and when running it from ssh session or from the console, it never accepts keyboard input, even a kill command ?
I will try the patch
Oh and by the way yes openbsd does run under vmware... in fact the openbsd system I am testing iftop on is running under vmware GSX server on a gentoo linux host.
-----Original Message----- From: Paul Warren [mailto:pdw@sphinx.mythic-beasts.com] On Behalf Of Paul Warren Sent: Friday, August 29, 2003 8:52 AM To: Michael Cc: iftop-users@lists.beasts.org Subject: Re: [Iftop-users] iftop on openbsd
On Thu, Aug 28, 2003 at 01:54:38PM -0700, Michael wrote:
I successfully compiled the latest iftop on openbsd 3.4 (installed
yesterday
from the current /snapshot/i386/ openbsd directory)
It seems to work except once loaded I cant stop it with "q" like I can in linux, and I cant ctrl-C or ctrl-X it or anything it keeps running, I
have
to open a new bash shell and kill -9 its pid
Anyone use iftop on openbsd with no probs?
I'm not ignoring this, I just don't know the answer :-(
After you press "q" does it keep on running to the extent that you can still press keys and have them do stuff?
My guess is that it's a difference in the handling of threads (is that vague enough?), and the stuff that makes is quit is <blame-torch action="pass">stuff that Chris wrote</blame-torch>
Paul
On Fri, Aug 29, 2003 at 12:07:30PM -0700, Michael wrote:
Ok the make for the patched iftop.c failed :
sorry, first patch was broken. try this on the unpatched iftop.c:
diff -u -r1.44 iftop.c --- iftop.c 2003/05/20 21:14:37 1.44 +++ iftop.c 2003/08/29 17:12:25 @@ -528,7 +528,9 @@ /* packet_loop: * Worker function for packet capture thread. */ void packet_loop(void* ptr) { - pcap_loop(pd,-1,(pcap_handler)packet_handler,NULL); + /* Make sure that this thread is cancellable. */ + while (pcap_dispatch(pd, -1, (pcap_handler)packet_handler, NULL) != -1) + pthread_testcancel(); }
Thanks for the quick reply, this patch compiles successfully
However it still wont accept any keystrokes once iftop is started.. I've tried the keys to change the display while in iftop, and q to quit, and ctrl-z, c, and x, and Break and ctrl-just-about-everything =/ but I appreciate the help!
-----Original Message----- From: Chris Lightfoot [mailto:chris@ex-parrot.com] Sent: Friday, August 29, 2003 10:13 AM To: Michael Cc: iftop-users@lists.beasts.org Subject: Re: [Iftop-users] iftop on openbsd
On Fri, Aug 29, 2003 at 12:07:30PM -0700, Michael wrote:
Ok the make for the patched iftop.c failed :
sorry, first patch was broken. try this on the unpatched iftop.c:
diff -u -r1.44 iftop.c --- iftop.c 2003/05/20 21:14:37 1.44 +++ iftop.c 2003/08/29 17:12:25 @@ -528,7 +528,9 @@ /* packet_loop: * Worker function for packet capture thread. */ void packet_loop(void* ptr) { - pcap_loop(pd,-1,(pcap_handler)packet_handler,NULL); + /* Make sure that this thread is cancellable. */ + while (pcap_dispatch(pd, -1, (pcap_handler)packet_handler, NULL) != -1) + pthread_testcancel(); }
On Fri, Aug 29, 2003 at 12:24:09PM -0700, Michael wrote:
Thanks for the quick reply, this patch compiles successfully
However it still wont accept any keystrokes once iftop is started.. I've tried the keys to change the display while in iftop, and q to quit, and ctrl-z, c, and x, and Break and ctrl-just-about-everything =/ but I appreciate the help!
ok. if i get time i'll try installing openbsd on vmware and have a play.
Ok thanks a lot, iftop is a great program and I'm looking at migrating my firewall to BSD and it's a must-have item on my firewall. :)
Oh btw I found 1 keystroke combination that it would accept - CTRL + \ which forces iftop to die and take a core dump in the current directory... which is err... ok I guess lol :)
-----Original Message----- From: Chris Lightfoot [mailto:chris@ex-parrot.com] Sent: Friday, August 29, 2003 10:30 AM To: Michael Cc: iftop-users@lists.beasts.org Subject: Re: [Iftop-users] iftop on openbsd
ok. if i get time i'll try installing openbsd on vmware and have a play.
On Fri, Aug 29, 2003 at 12:24:09PM -0700, Michael wrote:
Thanks for the quick reply, this patch compiles successfully
However it still wont accept any keystrokes once iftop is started.. I've tried the keys to change the display while in iftop, and q to quit, and ctrl-z, c, and x, and Break and ctrl-just-about-everything =/ but I appreciate the help!
For me, keys work, but response is *incredibly* sluggish.
I think the problem is that OpenBSD's thread support is userland and therefore I/O in any thread blocks others. There's some blurb about this here:
http://groups.google.com/groups?selm=19991222000819.24957.qmail_hotmail.com%...
or see pthreads(3):
In OpenBSD, threads are implemented in a user-level library. A program using these routines must be linked with the -pthread option.
In particular, the thread running pcap_dispatch seems to stop any of the other threads running, much.
Replacing pthread_testcancel() with usleep(10000) makes it more responsive, but (a) is really ugly, and (b) may do bad things to the accuracy of the program. Paul-- thoughts?