some small changes to get nethogs into a more releaseable state again

This commit is contained in:
Arnout Engelen
2008-06-08 20:49:49 +00:00
parent c0e6a385e4
commit b8cbc9b6f5
5 changed files with 17 additions and 6 deletions

View File

@@ -1,5 +1,12 @@
Changelog Changelog
08/06/08 (Arnout, thanks to MeneerJansen for sparking some activity again :) )
- add 'if (DEBUG)' to debug message
- fix compiler warning by marking some constant
strings 'const'
- set view mode to 'kbps' by default,
instead of the 'grand total' number of bytes
27/08/05 (Arnout) 27/08/05 (Arnout)
- giving all unknown connections their own - giving all unknown connections their own
`unknown' process `unknown' process

View File

@@ -1,6 +1,6 @@
VERSION := 0 VERSION := 0
SUBVERSION := 6 SUBVERSION := 7
MINORVERSION := 2pre2 MINORVERSION := snapshot
#DESTDIR := /usr #DESTDIR := /usr
DESTDIR := /usr/local DESTDIR := /usr/local
@@ -8,7 +8,8 @@ DESTDIR := /usr/local
bin := $(DESTDIR)/bin bin := $(DESTDIR)/bin
man8 := $(DESTDIR)/share/man/man8/ man8 := $(DESTDIR)/share/man/man8/
all: nethogs decpcap_test nethogs_testsum all: nethogs decpcap_test
# nethogs_testsum
CFLAGS=-g -Wall CFLAGS=-g -Wall
#CFLAGS=-O2 #CFLAGS=-O2

View File

@@ -146,7 +146,10 @@ void Connection::add (Packet * packet)
std::cout << "Incoming: " << packet->len << std::endl; std::cout << "Incoming: " << packet->len << std::endl;
} }
sumRecv += packet->len; sumRecv += packet->len;
if (DEBUG)
{
std::cout << "sumRecv now: " << sumRecv << std::endl; std::cout << "sumRecv now: " << sumRecv << std::endl;
}
recv_packets->add (packet); recv_packets->add (packet);
} }
} }

View File

@@ -24,7 +24,7 @@ int VIEWMODE_KBPS = 0;
int VIEWMODE_TOTAL_KB = 1; int VIEWMODE_TOTAL_KB = 1;
int VIEWMODE_TOTAL_B = 2; int VIEWMODE_TOTAL_B = 2;
int VIEWMODE_TOTAL_MB = 3; int VIEWMODE_TOTAL_MB = 3;
int viewMode = VIEWMODE_TOTAL_B; int viewMode = VIEWMODE_KBPS;
int nViewModes = 4; int nViewModes = 4;
class Line class Line

View File

@@ -44,7 +44,7 @@ class Process
{ {
public: public:
/* the process makes a copy of the device name and name. */ /* the process makes a copy of the device name and name. */
Process (unsigned long m_inode, char * m_devicename, char * m_name = NULL) Process (unsigned long m_inode, const char * m_devicename, const char * m_name = NULL)
{ {
//std::cout << "ARN: Process created with dev " << m_devicename << std::endl; //std::cout << "ARN: Process created with dev " << m_devicename << std::endl;
if (DEBUG) if (DEBUG)