Some fixes thanks to Bart Mertens (nethogs Debian maintainer)
This commit is contained in:
@@ -6,6 +6,7 @@ Changelog
|
||||
strings 'const'
|
||||
- set view mode to 'kbps' by default,
|
||||
instead of the 'grand total' number of bytes
|
||||
- some fixes thanks to Bart Martens
|
||||
|
||||
27/08/05 (Arnout)
|
||||
- giving all unknown connections their own
|
||||
|
||||
1
cui.cpp
1
cui.cpp
@@ -2,6 +2,7 @@
|
||||
#include <string>
|
||||
#include <pwd.h>
|
||||
#include <sys/types.h>
|
||||
#include <algorithm>
|
||||
|
||||
#include <ncurses.h>
|
||||
#include "nethogs.h"
|
||||
|
||||
@@ -338,12 +338,13 @@ int main (int argc, char** argv)
|
||||
}
|
||||
|
||||
dp_handle * newhandle = dp_open_live(current_dev->name, BUFSIZ, promisc, 100, errbuf);
|
||||
if (newhandle != NULL)
|
||||
{
|
||||
dp_addcb (newhandle, dp_packet_ip, process_ip);
|
||||
dp_addcb (newhandle, dp_packet_ip6, process_ip6);
|
||||
dp_addcb (newhandle, dp_packet_tcp, process_tcp);
|
||||
dp_addcb (newhandle, dp_packet_udp, process_udp);
|
||||
if (newhandle != NULL)
|
||||
{
|
||||
|
||||
/* The following code solves sf.net bug 1019381, but is only available
|
||||
* in newer versions (from 0.8 it seems) of libpcap
|
||||
*
|
||||
@@ -356,6 +357,10 @@ int main (int argc, char** argv)
|
||||
}
|
||||
handles = new handle (newhandle, current_dev->name, handles);
|
||||
}
|
||||
else
|
||||
{
|
||||
fprintf(stderr, "Error opening handler for device %s\n", current_dev->name);
|
||||
}
|
||||
|
||||
current_dev = current_dev->next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user