Commit Graph

15 Commits

Author SHA1 Message Date
Martin Baulig
9152479981 Fixed all warnings. 1999-07-30 21:03:22 +00:00
Martin Baulig
6120c5e4a8 Use (1L << feature)' instead of (1 << feature)' to avoid problems
with integer overflows when we add more fields.
1999-05-06 21:35:36 +00:00
Martin Baulig
cf611f9157 Set the copyright of LibGTop to the GNU General Public License.
1999-02-22  Martin Baulig  <martin@home-of-linux.org>

	Set the copyright of LibGTop to the GNU General Public License.

	* copyright.txt: Set the year to 1998-99 and pretty-format it a
	little bit. Same in all C source and header files.
1999-02-23 11:47:35 +00:00
Martin Baulig
ce4f660965 Include a copy of the GNU Library General Public License here.
1999-02-22  Martin Baulig  <martin@home-of-linux.org>

	* COPYING.LIB: Include a copy of the GNU Library General
	Public License here.

	* copyright.txt: Set the year to 1998-99 and pretty-format it a
	little bit. Same in all C source and header files.
1999-02-22 16:19:36 +00:00
Martin Baulig
9142e721bb Don't include <linux/ip_fw.h> for libc5 systems since it is no longer
1999-02-20  Martin Baulig  <martin@home-of-linux.org>

	* netload.c: Don't include <linux/ip_fw.h> for libc5 systems
	since it is no longer required and makes trouble on Slakware.
1999-02-20 16:20:30 +00:00
Martin Baulig
8ba42b25e0 Use `server->os_version_code' instead of GLIBTOP_LINUX_VERSION_CODE.
1999-01-06  Martin Baulig  <martin@home-of-linux.org>

	* netload.c (glibtop_get_netload_s): Use `server->os_version_code'
	instead of GLIBTOP_LINUX_VERSION_CODE.
1999-01-06 19:59:04 +00:00
Martin Baulig
a66b6cc86d Set indent level to 4. 1999-01-06 19:30:55 +00:00
Martin Baulig
be97f1b90a When using glibc, don't include <netinet/ip_fw.h> any longer but all
1998-12-28  Martin Baulig  <martin@home-of-linux.org>

	* netload.c: When using glibc, don't include <netinet/ip_fw.h>
 	any longer but all headers that were included there; we only
 	needed this file to get those headers.
1998-12-28 22:37:37 +00:00
Martin Baulig
c90462bc26 No longer include <linux/version.h>, but use GLIBTOP_LINUX_VERSION_CODE
1998-12-03  Martin Baulig  <martin@home-of-linux.org>

	* netload.c: No longer include <linux/version.h>, but use
	GLIBTOP_LINUX_VERSION_CODE which is set by configure instead.
	Define _GLIBTOP_IP_FW_ACCTIN and _GLIBTOP_IP_FW_ACCTOUT here
	and use them instead of IP_FW_F_ACCTIN and IP_FW_F_ACCTOUT.
1998-12-03 16:12:43 +00:00
Martin Baulig
6b736f1f87 I really should include <linux/version.h> here ... 1998-11-30 20:52:54 +00:00
Martin Baulig
5fed8969c6 Use correct header files both for libc5 and glibc. With Linux >= 2.1.114
1998-11-30  Martin Baulig  <martin@home-of-linux.org>

	* netload.c: Use correct header files both for libc5 and glibc.
	With Linux >= 2.1.114 we no longer use IP accounting since it
	already has byte counts in /proc/net/dev.
1998-11-30 20:30:32 +00:00
Martin Baulig
a701fc7aa6 Minor /proc/net/dev parsing updates; has nothing to do with latest
compilation problems.
1998-11-27 10:34:01 +00:00
Martin Baulig
cd7976f3cd #include <net/if.h> #include <netinet/ip_fw.h>
#include <net/if.h>
#include <netinet/ip_fw.h>
1998-11-26 22:37:04 +00:00
Martin Baulig
9c0ec8c69f Added implementation for this function.
1998-11-22  Martin Baulig  <baulig@merkur.uni-trier.de>

	* netload.c (glibtop_get_netload_s): Added implementation
	for this function.

	The code here is smart enough to use /proc/net/ip_acct if
 	IP accounting is enabled in the kernel and activated on the
 	requested device and /proc/net/dev if not.

	To get separate statistics for received and transmitted
	packets you need to use two accounting rules:

	ipfwadm -A in -a -P all -W eth0
	ipfwadm -A out -a -P all -W eth0

	But before you activate IP accounting, please have a look
	at /proc/net/dev - if if already contains byte counters,
	then don't use IP accounting.
1998-11-22 19:24:14 +00:00
Martin Baulig
1289b92d06 Added new features to get network load:
typedef struct _glibtop_netload	glibtop_netload;

struct _glibtop_netload
{
	u_int64_t	flags,
		mtu,			/* GLIBTOP_NETLOAD_MTU		*/
		address,		/* GLIBTOP_NETLOAD_ADDRESS	*/
		packets_in,		/* GLIBTOP_NETLOAD_PACKETS_IN	*/
		packets_out,		/* GLIBTOP_NETLOAD_PACKETS_OUT	*/
		bytes_in,		/* GLIBTOP_NETLOAD_BYTES_IN	*/
		bytes_out,		/* GLIBTOP_NETLOAD_BYTES_OUT	*/
		errors_in,		/* GLIBTOP_NETLOAD_ERRORS_IN	*/
		errors_out,		/* GLIBTOP_NETLOAD_ERRORS_OUT	*/
		collisions;		/* GLIBTOP_NETLOAD_COLLISIONS	*/
};

Returns network load of the given interface, it is specified as string
like `isppp' or `ippp0':

extern void glibtop_get_netload_l __P((glibtop *, glibtop_netload *, const char *));
1998-10-26 10:39:14 +00:00