removed some old files, small updates
This commit is contained in:
@@ -1,5 +1,13 @@
|
|||||||
Changelog
|
Changelog
|
||||||
|
|
||||||
|
27/08/05 (Arnout)
|
||||||
|
- giving all unknown connections their own
|
||||||
|
`unknown' process
|
||||||
|
- UDP support
|
||||||
|
- investigated memleak, turns out to be a problem in libc:
|
||||||
|
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=273051
|
||||||
|
https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=103142
|
||||||
|
|
||||||
18/09/04 (Arnout)
|
18/09/04 (Arnout)
|
||||||
- also compile with gcc-3.4
|
- also compile with gcc-3.4
|
||||||
|
|
||||||
|
|||||||
4
Makefile
4
Makefile
@@ -10,8 +10,8 @@ man8 := $(DESTDIR)/share/man/man8/
|
|||||||
|
|
||||||
all: nethogs
|
all: nethogs
|
||||||
|
|
||||||
#CFLAGS=-g -Wall
|
CFLAGS=-g -Wall
|
||||||
CFLAGS=-O2
|
#CFLAGS=-O2
|
||||||
OBJS=structs.o packet.o connection.o process.o refresh.o decpcap.o cui.o inode2prog.o
|
OBJS=structs.o packet.o connection.o process.o refresh.o decpcap.o cui.o inode2prog.o
|
||||||
GCC=g++
|
GCC=g++
|
||||||
.PHONY: tgz
|
.PHONY: tgz
|
||||||
|
|||||||
4
cui.cpp
4
cui.cpp
@@ -268,7 +268,9 @@ void do_refresh()
|
|||||||
uid_t uid = curproc->getVal()->getUid();
|
uid_t uid = curproc->getVal()->getUid();
|
||||||
if (!ROBUST)
|
if (!ROBUST)
|
||||||
{
|
{
|
||||||
assert (getpwuid(uid) != NULL);
|
struct passwd * pwuid = getpwuid(uid);
|
||||||
|
assert (pwuid != NULL);
|
||||||
|
free (pwuid);
|
||||||
assert (curproc->getVal()->pid >= 0);
|
assert (curproc->getVal()->pid >= 0);
|
||||||
assert (n < nproc);
|
assert (n < nproc);
|
||||||
}
|
}
|
||||||
|
|||||||
33
hashtbl.h
33
hashtbl.h
@@ -1,33 +0,0 @@
|
|||||||
#include <stdlib.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
class HashNode
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
~HashNode();
|
|
||||||
|
|
||||||
char * key;
|
|
||||||
void * content;
|
|
||||||
HashNode * next;
|
|
||||||
};
|
|
||||||
|
|
||||||
class HashTable
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
HashTable(int n_size);
|
|
||||||
~HashTable();
|
|
||||||
|
|
||||||
/* after calling 'add', the calling application
|
|
||||||
* must free the string */
|
|
||||||
void add(char * key, void * content);
|
|
||||||
void * get(char * key);
|
|
||||||
|
|
||||||
private:
|
|
||||||
int size;
|
|
||||||
HashNode ** table;
|
|
||||||
|
|
||||||
HashNode * newHashNode(char * key, void * content, HashNode * next);
|
|
||||||
unsigned int HashString(const char * str);
|
|
||||||
|
|
||||||
HashTable(); // We leave this unimplemented ;)
|
|
||||||
};
|
|
||||||
@@ -36,7 +36,7 @@
|
|||||||
// assertions. good for finding bugs
|
// assertions. good for finding bugs
|
||||||
// at an early stage of development.
|
// at an early stage of development.
|
||||||
// for production, should be 1.
|
// for production, should be 1.
|
||||||
#define ROBUST 0
|
#define ROBUST 1
|
||||||
|
|
||||||
#define REVERSEHACK 0
|
#define REVERSEHACK 0
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user