Split netload into netload and netinfo.
1999-11-28 Martin Baulig <martin@home-of-linux.org> Split netload into netload and netinfo. * include/glibtop/netinfo.h: New file. * include/glibtop/netload.h (glibtop_netload): Moved `if_flags', `mtu', `subnet' and `address' into the new `glibtop_netinfo'. * include/glibtop/sysdeps.h (GLIBTOP_SYSDEPS_NETINFO): Added. (glibtop_sysdeps): Added `netinfo. * include/glibtop/union.h (glibtop_union): Added `netinfo. * include/glibtop/command.h (GLIBTOP_CMND_NETINFO): Added.
This commit is contained in:
committed by
Martin Baulig
parent
53f9d03e30
commit
4a01752467
@@ -8,4 +8,4 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
|
||||
procsignal.h read_data.h union.h types.h gnuserv.h \
|
||||
parameter.h mountlist.h fsusage.h procmap.h signal.h \
|
||||
inodedb.h sysinfo.h ppp.h procargs.h netload.h \
|
||||
interfaces.h limits.h
|
||||
netinfo.h interfaces.h limits.h
|
||||
|
@@ -57,11 +57,12 @@ BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#define GLIBTOP_CMND_MOUNTLIST 20
|
||||
#define GLIBTOP_CMND_FSUSAGE 21
|
||||
#define GLIBTOP_CMND_NETLOAD 22
|
||||
#define GLIBTOP_CMND_INTERFACE_NAMES 23
|
||||
#define GLIBTOP_CMND_PPP 24
|
||||
#define GLIBTOP_CMND_INTERFACE_NAMES 22
|
||||
#define GLIBTOP_CMND_NETINFO 23
|
||||
#define GLIBTOP_CMND_NETLOAD 24
|
||||
#define GLIBTOP_CMND_PPP 25
|
||||
|
||||
#define GLIBTOP_MAX_CMND 25
|
||||
#define GLIBTOP_MAX_CMND 26
|
||||
|
||||
#define _GLIBTOP_PARAM_SIZE 16
|
||||
|
||||
|
104
include/glibtop/netinfo.h
Normal file
104
include/glibtop/netinfo.h
Normal file
@@ -0,0 +1,104 @@
|
||||
/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */
|
||||
|
||||
/* $Id$ */
|
||||
|
||||
/* Copyright (C) 1998-99 Martin Baulig
|
||||
This file is part of LibGTop 1.0.
|
||||
|
||||
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||
|
||||
LibGTop is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation; either version 2 of the License,
|
||||
or (at your option) any later version.
|
||||
|
||||
LibGTop is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with LibGTop; see the file COPYING. If not, write to the
|
||||
Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||
Boston, MA 02111-1307, USA.
|
||||
*/
|
||||
|
||||
#ifndef __GLIBTOP_NETINFO_H__
|
||||
#define __GLIBTOP_NETINFO_H__
|
||||
|
||||
#include <glibtop.h>
|
||||
#include <glibtop/global.h>
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#define GLIBTOP_NETINFO_IF_FLAGS 0
|
||||
#define GLIBTOP_NETINFO_MTU 1
|
||||
#define GLIBTOP_NETINFO_SUBNET 2
|
||||
#define GLIBTOP_NETINFO_ADDRESS 3
|
||||
|
||||
#define GLIBTOP_MAX_NETINFO 4
|
||||
|
||||
typedef struct _glibtop_netinfo glibtop_netinfo;
|
||||
|
||||
#include <glibtop/interfaces.h>
|
||||
|
||||
enum {
|
||||
GLIBTOP_IF_FLAGS_UP = 1,
|
||||
GLIBTOP_IF_FLAGS_BROADCAST,
|
||||
GLIBTOP_IF_FLAGS_DEBUG,
|
||||
GLIBTOP_IF_FLAGS_LOOPBACK,
|
||||
GLIBTOP_IF_FLAGS_POINTOPOINT,
|
||||
GLIBTOP_IF_FLAGS_RUNNING,
|
||||
GLIBTOP_IF_FLAGS_NOARP,
|
||||
GLIBTOP_IF_FLAGS_PROMISC,
|
||||
GLIBTOP_IF_FLAGS_ALLMULTI,
|
||||
GLIBTOP_IF_FLAGS_OACTIVE,
|
||||
GLIBTOP_IF_FLAGS_SIMPLEX,
|
||||
GLIBTOP_IF_FLAGS_LINK0,
|
||||
GLIBTOP_IF_FLAGS_LINK1,
|
||||
GLIBTOP_IF_FLAGS_LINK2,
|
||||
GLIBTOP_IF_FLAGS_ALTPHYS,
|
||||
GLIBTOP_IF_FLAGS_MULTICAST
|
||||
};
|
||||
|
||||
struct _glibtop_netinfo
|
||||
{
|
||||
u_int64_t flags,
|
||||
if_flags, /* GLIBTOP_NETINFO_IF_FLAGS */
|
||||
mtu, /* GLIBTOP_NETINFO_MTU */
|
||||
subnet, /* GLIBTOP_NETINFO_SUBNET */
|
||||
address; /* GLIBTOP_NETINFO_ADDRESS */
|
||||
};
|
||||
|
||||
#define glibtop_get_netinfo(netinfo,interface) glibtop_get_netinfo_l(glibtop_global_server, netinfo, interface)
|
||||
|
||||
#if GLIBTOP_SUID_NETINFO
|
||||
#define glibtop_get_netinfo_r glibtop_get_netinfo_p
|
||||
#else
|
||||
#define glibtop_get_netinfo_r glibtop_get_netinfo_s
|
||||
#endif
|
||||
|
||||
int glibtop_get_netinfo_l (glibtop *server, glibtop_netinfo *buf, const char *interface);
|
||||
|
||||
#if GLIBTOP_SUID_NETINFO
|
||||
int glibtop_init_netinfo_p (glibtop *server);
|
||||
int glibtop_get_netinfo_p (glibtop *server, glibtop_netinfo *buf, const char *interface);
|
||||
#else
|
||||
int glibtop_init_netinfo_s (glibtop *server);
|
||||
int glibtop_get_netinfo_s (glibtop *server, glibtop_netinfo *buf, const char *interface);
|
||||
#endif
|
||||
|
||||
#ifdef GLIBTOP_NAMES
|
||||
|
||||
/* You need to link with -lgtop_names to get this stuff here. */
|
||||
|
||||
extern const char *glibtop_names_netinfo [];
|
||||
extern const unsigned glibtop_types_netinfo [];
|
||||
extern const char *glibtop_labels_netinfo [];
|
||||
extern const char *glibtop_descriptions_netinfo [];
|
||||
|
||||
#endif
|
||||
|
||||
END_LIBGTOP_DECLS
|
||||
|
||||
#endif
|
@@ -31,53 +31,26 @@
|
||||
|
||||
BEGIN_LIBGTOP_DECLS
|
||||
|
||||
#define GLIBTOP_NETLOAD_IF_FLAGS 0
|
||||
#define GLIBTOP_NETLOAD_MTU 1
|
||||
#define GLIBTOP_NETLOAD_SUBNET 2
|
||||
#define GLIBTOP_NETLOAD_ADDRESS 3
|
||||
#define GLIBTOP_NETLOAD_PACKETS_IN 4
|
||||
#define GLIBTOP_NETLOAD_PACKETS_OUT 5
|
||||
#define GLIBTOP_NETLOAD_PACKETS_TOTAL 6
|
||||
#define GLIBTOP_NETLOAD_BYTES_IN 7
|
||||
#define GLIBTOP_NETLOAD_BYTES_OUT 8
|
||||
#define GLIBTOP_NETLOAD_BYTES_TOTAL 9
|
||||
#define GLIBTOP_NETLOAD_ERRORS_IN 10
|
||||
#define GLIBTOP_NETLOAD_ERRORS_OUT 11
|
||||
#define GLIBTOP_NETLOAD_ERRORS_TOTAL 12
|
||||
#define GLIBTOP_NETLOAD_COLLISIONS 13
|
||||
#define GLIBTOP_NETLOAD_PACKETS_IN 0
|
||||
#define GLIBTOP_NETLOAD_PACKETS_OUT 1
|
||||
#define GLIBTOP_NETLOAD_PACKETS_TOTAL 2
|
||||
#define GLIBTOP_NETLOAD_BYTES_IN 3
|
||||
#define GLIBTOP_NETLOAD_BYTES_OUT 4
|
||||
#define GLIBTOP_NETLOAD_BYTES_TOTAL 5
|
||||
#define GLIBTOP_NETLOAD_ERRORS_IN 6
|
||||
#define GLIBTOP_NETLOAD_ERRORS_OUT 7
|
||||
#define GLIBTOP_NETLOAD_ERRORS_TOTAL 8
|
||||
#define GLIBTOP_NETLOAD_COLLISIONS 9
|
||||
|
||||
#define GLIBTOP_MAX_NETLOAD 14
|
||||
#define GLIBTOP_MAX_NETLOAD 10
|
||||
|
||||
typedef struct _glibtop_netload glibtop_netload;
|
||||
|
||||
#include <glibtop/interfaces.h>
|
||||
|
||||
enum {
|
||||
GLIBTOP_IF_FLAGS_UP = 1,
|
||||
GLIBTOP_IF_FLAGS_BROADCAST,
|
||||
GLIBTOP_IF_FLAGS_DEBUG,
|
||||
GLIBTOP_IF_FLAGS_LOOPBACK,
|
||||
GLIBTOP_IF_FLAGS_POINTOPOINT,
|
||||
GLIBTOP_IF_FLAGS_RUNNING,
|
||||
GLIBTOP_IF_FLAGS_NOARP,
|
||||
GLIBTOP_IF_FLAGS_PROMISC,
|
||||
GLIBTOP_IF_FLAGS_ALLMULTI,
|
||||
GLIBTOP_IF_FLAGS_OACTIVE,
|
||||
GLIBTOP_IF_FLAGS_SIMPLEX,
|
||||
GLIBTOP_IF_FLAGS_LINK0,
|
||||
GLIBTOP_IF_FLAGS_LINK1,
|
||||
GLIBTOP_IF_FLAGS_LINK2,
|
||||
GLIBTOP_IF_FLAGS_ALTPHYS,
|
||||
GLIBTOP_IF_FLAGS_MULTICAST
|
||||
};
|
||||
|
||||
struct _glibtop_netload
|
||||
{
|
||||
u_int64_t flags,
|
||||
if_flags, /* GLIBTOP_NETLOAD_IF_FLAGS */
|
||||
mtu, /* GLIBTOP_NETLOAD_MTU */
|
||||
subnet, /* GLIBTOP_NETLOAD_SUBNET */
|
||||
address, /* GLIBTOP_NETLOAD_ADDRESS */
|
||||
packets_in, /* GLIBTOP_NETLOAD_PACKETS_IN */
|
||||
packets_out, /* GLIBTOP_NETLOAD_PACKETS_OUT */
|
||||
packets_total, /* GLIBTOP_NETLOAD_PACKETS_TOTAL*/
|
||||
|
@@ -50,11 +50,12 @@ BEGIN_LIBGTOP_DECLS
|
||||
#define GLIBTOP_SYSDEPS_PROC_MAP 17
|
||||
#define GLIBTOP_SYSDEPS_MOUNTLIST 18
|
||||
#define GLIBTOP_SYSDEPS_FSUSAGE 19
|
||||
#define GLIBTOP_SYSDEPS_NETLOAD 20
|
||||
#define GLIBTOP_SYSDEPS_INTERFACE_NAMES 21
|
||||
#define GLIBTOP_SYSDEPS_PPP 22
|
||||
#define GLIBTOP_SYSDEPS_INTERFACE_NAMES 20
|
||||
#define GLIBTOP_SYSDEPS_NETINFO 21
|
||||
#define GLIBTOP_SYSDEPS_NETLOAD 22
|
||||
#define GLIBTOP_SYSDEPS_PPP 23
|
||||
|
||||
#define GLIBTOP_MAX_SYSDEPS 25
|
||||
#define GLIBTOP_MAX_SYSDEPS 26
|
||||
|
||||
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
|
||||
|
||||
@@ -89,8 +90,9 @@ struct _glibtop_sysdeps
|
||||
proc_map, /* glibtop_proc_map */
|
||||
mountlist, /* glibtop_mountlist */
|
||||
fsusage, /* glibtop_fsusage */
|
||||
netload, /* glibtop_netload */
|
||||
interface_names, /* glibtop_interface_names */
|
||||
netinfo, /* glibtop_netinfo */
|
||||
netload, /* glibtop_netload */
|
||||
ppp; /* glibtop_ppp */
|
||||
};
|
||||
|
||||
|
@@ -50,6 +50,7 @@
|
||||
#include <glibtop/fsusage.h>
|
||||
|
||||
#include <glibtop/netload.h>
|
||||
#include <glibtop/netinfo.h>
|
||||
#include <glibtop/interfaces.h>
|
||||
#include <glibtop/ppp.h>
|
||||
|
||||
@@ -79,8 +80,9 @@ union _glibtop_union
|
||||
glibtop_proc_map proc_map;
|
||||
glibtop_mountlist mountlist;
|
||||
glibtop_fsusage fsusage;
|
||||
glibtop_netload netload;
|
||||
glibtop_interface_names interface_names;
|
||||
glibtop_netinfo netinfo;
|
||||
glibtop_netload netload;
|
||||
glibtop_ppp ppp;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user