Files
nethogs/nethogs.h
Arnout Engelen e50d81eb5c preliminary IPv6 support.
besides ::ffff:123.45.67.89, IPv6 packets now also really enter the system.

characterisation of local addresses and direction of the stream don't work
yet, so they are often filed under 'unknown' instead of their respective
process.
2004-09-01 11:21:00 +00:00

42 lines
842 B
C++

#ifndef __NETHOGS_H
#define __NETHOGS_H
#include <netinet/in.h>
#define _BSD_SOURCE 1
/* take the average speed over the last 5 seconds */
#define PERIOD 5
/* the amount of time after the last packet was recieved
* after which a process is removed */
#define PROCESSTIMEOUT 150
/* Set to '0' when compiling for a system that uses Linux Capabilities,
* like www.adamantix.org: in that case nethogs shouldn't check if it's
* running as root. Take care to give it sufficient privileges though. */
#ifndef NEEDROOT
#define NEEDROOT 1
#endif
#define DEBUG 1
#define PROGNAME_WIDTH 27
void forceExit(const char *msg);
class local_addr {
public:
local_addr (in_addr_t m_addr, local_addr * m_next = NULL)
{
addr = m_addr;
next = m_next;
}
bool contains (const in_addr_t & n_addr);
in_addr_t addr;
local_addr * next;
};
#endif