Some systems may not distinguish between input and output bytes/pkts/errs

so we add `_total' fields:

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	*/
		packets_total,		/* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
		bytes_in,		/* GLIBTOP_NETLOAD_BYTES_IN	*/
		bytes_out,		/* GLIBTOP_NETLOAD_BYTES_OUT	*/
		bytes_total,		/* GLIBTOP_NETLOAD_BYTES_TOTAL	*/
		errors_in,		/* GLIBTOP_NETLOAD_ERRORS_IN	*/
		errors_out,		/* GLIBTOP_NETLOAD_ERRORS_OUT	*/
		errors_total,		/* GLIBTOP_NETLOAD_ERRORS_TOTAL	*/
		collisions;		/* GLIBTOP_NETLOAD_COLLISIONS	*/
};
This commit is contained in:
Martin Baulig
1998-10-26 10:44:16 +00:00
parent 1289b92d06
commit 13d9120f93
3 changed files with 23 additions and 9 deletions

View File

@@ -18,5 +18,5 @@ const char *|proc_args|ulong(size)|pid_t(pid):unsigned(max_len)
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
glibtop_mountentry *|@mountlist|ulong(number,size,total)|int(all_fs)
void|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string|mount_dir
void|netload|ulong(mtu,address,packets_in,packets_out,bytes_in,bytes_out,errors_in,errors_out,collisions)|string|interface
void|netload|ulong(mtu,address,packets_in,packets_out,packets_total,bytes_in,bytes_out,bytes_total,errors_in,errors_out,errors_total,collisions)|string|interface
void|ppp|ulong(state,bytes_in,bytes_out)|ushort(device)

View File

@@ -30,13 +30,16 @@ __BEGIN_DECLS
#define GLIBTOP_NETLOAD_MTU 0
#define GLIBTOP_NETLOAD_PACKETS_IN 1
#define GLIBTOP_NETLOAD_PACKETS_OUT 2
#define GLIBTOP_NETLOAD_BYTES_IN 3
#define GLIBTOP_NETLOAD_BYTES_OUT 4
#define GLIBTOP_NETLOAD_ERRORS_IN 5
#define GLIBTOP_NETLOAD_ERRORS_OUT 6
#define GLIBTOP_NETLOAD_COLLISIONS 7
#define GLIBTOP_NETLOAD_PACKETS_TOTAL 3
#define GLIBTOP_NETLOAD_BYTES_IN 4
#define GLIBTOP_NETLOAD_BYTES_OUT 5
#define GLIBTOP_NETLOAD_BYTES_TOTAL 6
#define GLIBTOP_NETLOAD_ERRORS_IN 7
#define GLIBTOP_NETLOAD_ERRORS_OUT 8
#define GLIBTOP_NETLOAD_ERRORS_TOTAL 9
#define GLIBTOP_NETLOAD_COLLISIONS 10
#define GLIBTOP_MAX_NETLOAD 8
#define GLIBTOP_MAX_NETLOAD 11
typedef struct _glibtop_netload glibtop_netload;
@@ -47,10 +50,13 @@ struct _glibtop_netload
address, /* GLIBTOP_NETLOAD_ADDRESS */
packets_in, /* GLIBTOP_NETLOAD_PACKETS_IN */
packets_out, /* GLIBTOP_NETLOAD_PACKETS_OUT */
packets_total, /* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
bytes_in, /* GLIBTOP_NETLOAD_BYTES_IN */
bytes_out, /* GLIBTOP_NETLOAD_BYTES_OUT */
bytes_total, /* GLIBTOP_NETLOAD_BYTES_TOTAL */
errors_in, /* GLIBTOP_NETLOAD_ERRORS_IN */
errors_out, /* GLIBTOP_NETLOAD_ERRORS_OUT */
errors_total, /* GLIBTOP_NETLOAD_ERRORS_TOTAL */
collisions; /* GLIBTOP_NETLOAD_COLLISIONS */
};

View File

@@ -23,12 +23,14 @@
const char *glibtop_names_netload [GLIBTOP_MAX_NETLOAD] =
{
"mtu", "packets_in", "packets_out", "bytes_in", "bytes_out",
"errors_in", "errors_out", "collisions"
"mtu", "packets_in", "packets_out", "packets_total",
"bytes_in", "bytes_out", "bytes_total", "errors_in",
"errors_out", "errors_total", "collisions"
};
const unsigned glibtop_types_netload [GLIBTOP_MAX_NETLOAD] =
{
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG,
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
@@ -39,10 +41,13 @@ const char *glibtop_labels_netload [GLIBTOP_MAX_NETLOAD] =
N_("MTU"),
N_("Packets In"),
N_("Packets Out"),
N_("Packets Total"),
N_("Bytes In"),
N_("Bytes Out"),
N_("Bytes Total"),
N_("Errors In"),
N_("Errors Out"),
N_("Errors Total"),
N_("Collisions")
};
@@ -51,9 +56,12 @@ const char *glibtop_descriptions_netload [GLIBTOP_MAX_NETLOAD] =
N_("Maximum Transfer Unit"),
N_("Packets In"),
N_("Packets Out"),
N_("Packets Total"),
N_("Bytes In"),
N_("Bytes Out"),
N_("Bytes Total"),
N_("Errors In"),
N_("Errors Out"),
N_("Errors Total"),
N_("Collisions")
};