Added new feature to get PPP/ISDN support:
enum { GLIBTOP_PPP_STATE_UNKNOWN = 0, GLIBTOP_PPP_STATE_HANGUP, GLIBTOP_PPP_STATE_ONLINE }; struct _glibtop_ppp { u_int64_t flags, state, /* GLIBTOP_PPP_STATE */ bytes_in, /* GLIBTOP_PPP_BYTES_IN */ bytes_out; /* GLIBTOP_PPP_BYTES_OUT */ }; Currently only implemented in the FreeBSD port with ISDN via I4B. - Martin
This commit is contained in:
16
ChangeLog
16
ChangeLog
@@ -1,3 +1,19 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
Added PPP/ISDN support.
|
||||||
|
|
||||||
|
* include/glibtop/ppp.h: New file.
|
||||||
|
* features.def: Added new feature `ppp'.
|
||||||
|
|
||||||
|
* acconfig.h (HAVE_I4B): Defined if we have the I4B package.
|
||||||
|
(HAVE_I4B_ACCT): Defined if we have ISDN statistics with I4B.
|
||||||
|
|
||||||
|
* misc: New directory.
|
||||||
|
* misc/i4b_acct.txt: Read this file to get ISDN statistics on BSD.
|
||||||
|
|
||||||
|
* lib/lib.awk: New type `ushort' for the features.def which is
|
||||||
|
`unsigned short'.
|
||||||
|
|
||||||
1998-10-20 Martin Baulig <martin@home-of-linux.org>
|
1998-10-20 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* include/glibtop/proc_signal.h: Use a 2-element-array of
|
* include/glibtop/proc_signal.h: Use a 2-element-array of
|
||||||
|
@@ -6,7 +6,8 @@ else
|
|||||||
examples_SUBDIRS =
|
examples_SUBDIRS =
|
||||||
endif
|
endif
|
||||||
|
|
||||||
SUBDIRS = po intl support macros include sysdeps lib src $(examples_SUBDIRS)
|
SUBDIRS = po intl support macros misc include sysdeps lib src \
|
||||||
|
$(examples_SUBDIRS)
|
||||||
|
|
||||||
include_HEADERS = glibtop.h
|
include_HEADERS = glibtop.h
|
||||||
|
|
||||||
|
@@ -141,3 +141,6 @@
|
|||||||
|
|
||||||
#undef HAVE_XAUTH
|
#undef HAVE_XAUTH
|
||||||
|
|
||||||
|
/* Define if your have the I4B package. */
|
||||||
|
#undef HAVE_I4B
|
||||||
|
#undef HAVE_I4B_ACCT
|
||||||
|
@@ -342,6 +342,7 @@ AC_OUTPUT([
|
|||||||
Makefile
|
Makefile
|
||||||
po/Makefile.in
|
po/Makefile.in
|
||||||
intl/Makefile
|
intl/Makefile
|
||||||
|
misc/Makefile
|
||||||
include/Makefile
|
include/Makefile
|
||||||
include/glibtop/Makefile
|
include/glibtop/Makefile
|
||||||
sysdeps/Makefile
|
sysdeps/Makefile
|
||||||
|
@@ -1,3 +1,7 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* first.c (glibtop_get_ppp): Get PPP/ISDN statistics.
|
||||||
|
|
||||||
1998-09-28 Martin Baulig <martin@home-of-linux.org>
|
1998-09-28 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* Makefile.am: Install everything in $(libexecdir)/libgtop.
|
* Makefile.am: Install everything in $(libexecdir)/libgtop.
|
||||||
|
@@ -172,6 +172,17 @@ main (int argc, char *argv [])
|
|||||||
|
|
||||||
printf ("\n");
|
printf ("\n");
|
||||||
|
|
||||||
|
for (c = 0; c < PROFILE_COUNT; c++)
|
||||||
|
glibtop_get_ppp (&data.ppp, 0);
|
||||||
|
|
||||||
|
printf ("PPP (0x%08lx): %lu, %lu, %lu\n",
|
||||||
|
(unsigned long) data.ppp.flags,
|
||||||
|
(unsigned long) data.ppp.state,
|
||||||
|
(unsigned long) data.ppp.bytes_in,
|
||||||
|
(unsigned long) data.ppp.bytes_out);
|
||||||
|
|
||||||
|
printf ("\n");
|
||||||
|
|
||||||
glibtop_get_sysdeps (&sysdeps);
|
glibtop_get_sysdeps (&sysdeps);
|
||||||
|
|
||||||
printf ("Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
|
printf ("Sysdeps (0x%08lx): %lu, %lu, %lu, %lu, %lu, "
|
||||||
|
@@ -17,3 +17,4 @@ void|proc_segment|ulong(text_rss,shlib_rss,data_rss,stack_rss,dirty_size,start_c
|
|||||||
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
|
glibtop_map_entry *|proc_map|ulong(number,size,total)|pid_t(pid)
|
||||||
glibtop_mountentry *|@mountlist|ulong(number,size,total)|int(all_fs)
|
glibtop_mountentry *|@mountlist|ulong(number,size,total)|int(all_fs)
|
||||||
void|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string|mount_dir
|
void|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string|mount_dir
|
||||||
|
void|ppp|ulong(state,bytes_in,bytes_out)|ushort(device)
|
||||||
|
@@ -7,4 +7,4 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \
|
|||||||
procsegment.h read.h sysdeps.h xmalloc.h global.h \
|
procsegment.h read.h sysdeps.h xmalloc.h global.h \
|
||||||
procsignal.h read_data.h union.h types.h gnuserv.h \
|
procsignal.h read_data.h union.h types.h gnuserv.h \
|
||||||
parameter.h mountlist.h fsusage.h procmap.h signal.h \
|
parameter.h mountlist.h fsusage.h procmap.h signal.h \
|
||||||
inodedb.h sysinfo.h
|
inodedb.h sysinfo.h ppp.h
|
||||||
|
@@ -52,8 +52,9 @@ __BEGIN_DECLS
|
|||||||
|
|
||||||
#define GLIBTOP_CMND_MOUNTLIST 19
|
#define GLIBTOP_CMND_MOUNTLIST 19
|
||||||
#define GLIBTOP_CMND_FSUSAGE 20
|
#define GLIBTOP_CMND_FSUSAGE 20
|
||||||
|
#define GLIBTOP_CMND_PPP 21
|
||||||
|
|
||||||
#define GLIBTOP_MAX_CMND 21
|
#define GLIBTOP_MAX_CMND 22
|
||||||
|
|
||||||
#define _GLIBTOP_PARAM_SIZE 16
|
#define _GLIBTOP_PARAM_SIZE 16
|
||||||
|
|
||||||
|
83
include/glibtop/ppp.h
Normal file
83
include/glibtop/ppp.h
Normal file
@@ -0,0 +1,83 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#ifndef __GLIBTOP_PPP_H__
|
||||||
|
#define __GLIBTOP_PPP_H__
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
|
#include <glibtop/global.h>
|
||||||
|
|
||||||
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
#define GLIBTOP_PPP_STATE 0
|
||||||
|
#define GLIBTOP_PPP_BYTES_IN 1
|
||||||
|
#define GLIBTOP_PPP_BYTES_OUT 2
|
||||||
|
|
||||||
|
#define GLIBTOP_MAX_PPP 3
|
||||||
|
|
||||||
|
typedef struct _glibtop_ppp glibtop_ppp;
|
||||||
|
|
||||||
|
enum {
|
||||||
|
GLIBTOP_PPP_STATE_UNKNOWN = 0,
|
||||||
|
GLIBTOP_PPP_STATE_HANGUP,
|
||||||
|
GLIBTOP_PPP_STATE_ONLINE
|
||||||
|
};
|
||||||
|
|
||||||
|
struct _glibtop_ppp
|
||||||
|
{
|
||||||
|
u_int64_t flags,
|
||||||
|
state, /* GLIBTOP_PPP_STATE */
|
||||||
|
bytes_in, /* GLIBTOP_PPP_BYTES_IN */
|
||||||
|
bytes_out; /* GLIBTOP_PPP_BYTES_OUT */
|
||||||
|
};
|
||||||
|
|
||||||
|
#define glibtop_get_ppp(ppp,device) glibtop_get_ppp_l(glibtop_global_server, ppp, device)
|
||||||
|
|
||||||
|
#if GLIBTOP_SUID_PPP
|
||||||
|
#define glibtop_get_ppp_r glibtop_get_ppp_p
|
||||||
|
#else
|
||||||
|
#define glibtop_get_ppp_r glibtop_get_ppp_s
|
||||||
|
#endif
|
||||||
|
|
||||||
|
extern void glibtop_get_ppp_l __P((glibtop *, glibtop_ppp *, unsigned short));
|
||||||
|
|
||||||
|
#if GLIBTOP_SUID_PPP
|
||||||
|
extern void glibtop_init_ppp_p __P((glibtop *));
|
||||||
|
extern void glibtop_get_ppp_p __P((glibtop *, glibtop_ppp *, unsigned short));
|
||||||
|
#else
|
||||||
|
extern void glibtop_init_ppp_s __P((glibtop *));
|
||||||
|
extern void glibtop_get_ppp_s __P((glibtop *, glibtop_ppp *, unsigned short));
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef GLIBTOP_NAMES
|
||||||
|
|
||||||
|
/* You need to link with -lgtop_names to get this stuff here. */
|
||||||
|
|
||||||
|
extern const char *glibtop_names_ppp [];
|
||||||
|
extern const unsigned glibtop_types_ppp [];
|
||||||
|
extern const char *glibtop_labels_ppp [];
|
||||||
|
extern const char *glibtop_descriptions_ppp [];
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
__END_DECLS
|
||||||
|
|
||||||
|
#endif
|
@@ -46,8 +46,9 @@ __BEGIN_DECLS
|
|||||||
#define GLIBTOP_SYSDEPS_PROC_MAP 17
|
#define GLIBTOP_SYSDEPS_PROC_MAP 17
|
||||||
#define GLIBTOP_SYSDEPS_MOUNTLIST 18
|
#define GLIBTOP_SYSDEPS_MOUNTLIST 18
|
||||||
#define GLIBTOP_SYSDEPS_FSUSAGE 19
|
#define GLIBTOP_SYSDEPS_FSUSAGE 19
|
||||||
|
#define GLIBTOP_SYSDEPS_PPP 20
|
||||||
|
|
||||||
#define GLIBTOP_MAX_SYSDEPS 20
|
#define GLIBTOP_MAX_SYSDEPS 21
|
||||||
|
|
||||||
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
|
#define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1)
|
||||||
|
|
||||||
@@ -79,7 +80,8 @@ struct _glibtop_sysdeps
|
|||||||
proc_segment, /* glibtop_proc_segment */
|
proc_segment, /* glibtop_proc_segment */
|
||||||
proc_map, /* glibtop_proc_map */
|
proc_map, /* glibtop_proc_map */
|
||||||
mountlist, /* glibtop_mountlist */
|
mountlist, /* glibtop_mountlist */
|
||||||
fsusage; /* glibtop_fsusage */
|
fsusage, /* glibtop_fsusage */
|
||||||
|
ppp; /* glibtop_ppp */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define glibtop_get_sysdeps(sysdeps) glibtop_get_sysdeps_r(glibtop_global_server,sysdeps)
|
#define glibtop_get_sysdeps(sysdeps) glibtop_get_sysdeps_r(glibtop_global_server,sysdeps)
|
||||||
|
@@ -44,6 +44,8 @@
|
|||||||
#include <glibtop/mountlist.h>
|
#include <glibtop/mountlist.h>
|
||||||
#include <glibtop/fsusage.h>
|
#include <glibtop/fsusage.h>
|
||||||
|
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
typedef union _glibtop_union glibtop_union;
|
typedef union _glibtop_union glibtop_union;
|
||||||
@@ -69,6 +71,7 @@ union _glibtop_union
|
|||||||
glibtop_proc_map proc_map;
|
glibtop_proc_map proc_map;
|
||||||
glibtop_mountlist mountlist;
|
glibtop_mountlist mountlist;
|
||||||
glibtop_fsusage fsusage;
|
glibtop_fsusage fsusage;
|
||||||
|
glibtop_ppp ppp;
|
||||||
};
|
};
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
@@ -45,6 +45,7 @@ BEGIN {
|
|||||||
convert["ulong"] = "u_int64_t";
|
convert["ulong"] = "u_int64_t";
|
||||||
convert["pid_t"] = "pid_t";
|
convert["pid_t"] = "pid_t";
|
||||||
convert["int"] = "int";
|
convert["int"] = "int";
|
||||||
|
convert["ushort"] = "unsigned short";
|
||||||
}
|
}
|
||||||
|
|
||||||
function output(line) {
|
function output(line) {
|
||||||
|
2
misc/.cvsignore
Normal file
2
misc/.cvsignore
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
Makefile.in
|
||||||
|
Makefile
|
2
misc/Makefile.am
Normal file
2
misc/Makefile.am
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
EXTRA_DIST = i4b_acct.h i4b_acct.txt
|
||||||
|
|
75
misc/i4b_acct.h
Normal file
75
misc/i4b_acct.h
Normal file
@@ -0,0 +1,75 @@
|
|||||||
|
/* This file contains modified code from `/usr/src/i4b/driver/i4b_isppp.c'
|
||||||
|
* which belongs to the I4B package.
|
||||||
|
*
|
||||||
|
* The original copyright of this file [/usr/src/i4b/driver/i4b_isppp.c] is
|
||||||
|
*
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*
|
||||||
|
* Copyright (c) 1997 Joerg Wunsch. All rights reserved.
|
||||||
|
*
|
||||||
|
* Copyright (c) 1997, 1998 Hellmuth Michaelis. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions
|
||||||
|
* are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer in the
|
||||||
|
* documentation and/or other materials provided with the distribution.
|
||||||
|
* 3. Neither the name of the author nor the names of any co-contributors
|
||||||
|
* may be used to endorse or promote products derived from this software
|
||||||
|
* without specific prior written permission.
|
||||||
|
* 4. Altered versions must be plainly marked as such, and must not be
|
||||||
|
* misrepresented as being the original software and/or documentation.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||||
|
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||||
|
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||||
|
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||||
|
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||||
|
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||||
|
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||||
|
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||||
|
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||||
|
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||||
|
* SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* -----------------------------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
#define I4BISPPPACCT 1 /* enable accounting messages */
|
||||||
|
|
||||||
|
struct i4bisppp_softc {
|
||||||
|
/*
|
||||||
|
* struct sppp starts with a struct ifnet, but we gotta allocate
|
||||||
|
* more space for it. NB: do not relocate this union, it must
|
||||||
|
* be first in isppp_softc. The tls and tlf hooks below want to
|
||||||
|
* convert a ``struct sppp *'' into a ``struct isppp_softc *''.
|
||||||
|
*/
|
||||||
|
union {
|
||||||
|
struct ifnet scu_if;
|
||||||
|
struct sppp scu_sp;
|
||||||
|
} sc_if_un;
|
||||||
|
#define sc_if sc_if_un.scu_if
|
||||||
|
int sc_state; /* state of the interface */
|
||||||
|
#ifndef __FreeBSD__
|
||||||
|
int sc_unit; /* unit number for Net/OpenBSD */
|
||||||
|
#endif
|
||||||
|
void *sc_cdp; /* ptr to call descriptor */
|
||||||
|
|
||||||
|
#ifdef I4BISPPPACCT
|
||||||
|
int sc_iinb; /* isdn driver # of inbytes */
|
||||||
|
int sc_ioutb; /* isdn driver # of outbytes */
|
||||||
|
int sc_inb; /* # of bytes rx'd */
|
||||||
|
int sc_outb; /* # of bytes tx'd */
|
||||||
|
int sc_linb; /* last # of bytes rx'd */
|
||||||
|
int sc_loutb; /* last # of bytes tx'd */
|
||||||
|
int sc_fn; /* flag, first null acct */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||||
|
struct callout_handle sc_ch;
|
||||||
|
#endif
|
||||||
|
};
|
96
misc/i4b_acct.txt
Normal file
96
misc/i4b_acct.txt
Normal file
@@ -0,0 +1,96 @@
|
|||||||
|
To get ISDN statistics with the I4B package do the following:
|
||||||
|
|
||||||
|
* Look at the declaration of `struct i4bisppp_softc' in
|
||||||
|
/usr/src/i4b/driver/i4b_isppp.c.
|
||||||
|
|
||||||
|
It is looking like this:
|
||||||
|
|
||||||
|
struct i4bisppp_softc {
|
||||||
|
/*
|
||||||
|
* struct sppp starts with a struct ifnet, but we gotta allocate
|
||||||
|
* more space for it. NB: do not relocate this union, it must
|
||||||
|
* be first in isppp_softc. The tls and tlf hooks below want to
|
||||||
|
* convert a ``struct sppp *'' into a ``struct isppp_softc *''.
|
||||||
|
*/
|
||||||
|
union {
|
||||||
|
struct ifnet scu_if;
|
||||||
|
struct sppp scu_sp;
|
||||||
|
} sc_if_un;
|
||||||
|
#define sc_if sc_if_un.scu_if
|
||||||
|
int sc_state; /* state of the interface */
|
||||||
|
#ifndef __FreeBSD__
|
||||||
|
int sc_unit; /* unit number for Net/OpenBSD */
|
||||||
|
#endif
|
||||||
|
call_desc_t *sc_cdp; /* ptr to call descriptor */
|
||||||
|
|
||||||
|
#ifdef I4BISPPPACCT
|
||||||
|
int sc_iinb; /* isdn driver # of inbytes */
|
||||||
|
int sc_ioutb; /* isdn driver # of outbytes */
|
||||||
|
int sc_inb; /* # of bytes rx'd */
|
||||||
|
int sc_outb; /* # of bytes tx'd */
|
||||||
|
int sc_linb; /* last # of bytes rx'd */
|
||||||
|
int sc_loutb; /* last # of bytes tx'd */
|
||||||
|
int sc_fn; /* flag, first null acct */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||||
|
struct callout_handle sc_ch;
|
||||||
|
#endif
|
||||||
|
} i4bisppp_softc[NI4BISPPP];
|
||||||
|
|
||||||
|
* Create a new file /usr/include/machine/i4b_acct.h and put the declaration
|
||||||
|
of this structure in this file.
|
||||||
|
|
||||||
|
* Replace `call_desc_t *' with `void *' in it.
|
||||||
|
|
||||||
|
* The result should look like this:
|
||||||
|
|
||||||
|
struct i4bisppp_softc {
|
||||||
|
/*
|
||||||
|
* struct sppp starts with a struct ifnet, but we gotta allocate
|
||||||
|
* more space for it. NB: do not relocate this union, it must
|
||||||
|
* be first in isppp_softc. The tls and tlf hooks below want to
|
||||||
|
* convert a ``struct sppp *'' into a ``struct isppp_softc *''.
|
||||||
|
*/
|
||||||
|
union {
|
||||||
|
struct ifnet scu_if;
|
||||||
|
struct sppp scu_sp;
|
||||||
|
} sc_if_un;
|
||||||
|
#define sc_if sc_if_un.scu_if
|
||||||
|
int sc_state; /* state of the interface */
|
||||||
|
#ifndef __FreeBSD__
|
||||||
|
int sc_unit; /* unit number for Net/OpenBSD */
|
||||||
|
#endif
|
||||||
|
void *sc_cdp; /* ptr to call descriptor */
|
||||||
|
|
||||||
|
#ifdef I4BISPPPACCT
|
||||||
|
int sc_iinb; /* isdn driver # of inbytes */
|
||||||
|
int sc_ioutb; /* isdn driver # of outbytes */
|
||||||
|
int sc_inb; /* # of bytes rx'd */
|
||||||
|
int sc_outb; /* # of bytes tx'd */
|
||||||
|
int sc_linb; /* last # of bytes rx'd */
|
||||||
|
int sc_loutb; /* last # of bytes tx'd */
|
||||||
|
int sc_fn; /* flag, first null acct */
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if defined(__FreeBSD__) && __FreeBSD__ >= 3
|
||||||
|
struct callout_handle sc_ch;
|
||||||
|
#endif
|
||||||
|
};
|
||||||
|
|
||||||
|
* Put a
|
||||||
|
|
||||||
|
#define I4BISPPPACCT 1 /* enable accounting messages */
|
||||||
|
|
||||||
|
at the top of your /usr/include/machine/i4b_acct.h
|
||||||
|
|
||||||
|
* This file should now look about like `misc/i4b_acct.h' in the LibGTop
|
||||||
|
source directory.
|
||||||
|
|
||||||
|
* Done.
|
||||||
|
|
||||||
|
This is necessary since LibGTop reads its data directly out of the kernel
|
||||||
|
and the `struct i4bisppp_softc' is only defined there and in no header file
|
||||||
|
(someone can tell the I4B people to put it in some header file ?).
|
||||||
|
|
||||||
|
Martin <martin@home-of-linux.org>
|
@@ -45,7 +45,8 @@ GLIBTOP_SUID_PROC_TIME +
|
|||||||
GLIBTOP_SUID_PROC_SIGNAL +
|
GLIBTOP_SUID_PROC_SIGNAL +
|
||||||
GLIBTOP_SUID_PROC_KERNEL +
|
GLIBTOP_SUID_PROC_KERNEL +
|
||||||
GLIBTOP_SUID_PROC_SEGMENT +
|
GLIBTOP_SUID_PROC_SEGMENT +
|
||||||
GLIBTOP_SUID_PROC_MAP;
|
GLIBTOP_SUID_PROC_MAP +
|
||||||
|
GLIBTOP_SUID_PPP;
|
||||||
|
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
@@ -101,6 +101,7 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
|
|||||||
const void *parameter)
|
const void *parameter)
|
||||||
{
|
{
|
||||||
glibtop *server = glibtop_global_server;
|
glibtop *server = glibtop_global_server;
|
||||||
|
unsigned short device;
|
||||||
pid_t pid;
|
pid_t pid;
|
||||||
|
|
||||||
switch (cmnd->command) {
|
switch (cmnd->command) {
|
||||||
@@ -213,6 +214,13 @@ handle_slave_command (glibtop_command *cmnd, glibtop_response *resp,
|
|||||||
(server, &resp->u.data.proc_segment, pid);
|
(server, &resp->u.data.proc_segment, pid);
|
||||||
resp->offset = _offset_data (proc_segment);
|
resp->offset = _offset_data (proc_segment);
|
||||||
break;
|
break;
|
||||||
|
#endif
|
||||||
|
#if GLIBTOP_SUID_PPP
|
||||||
|
case GLIBTOP_CMND_PPP:
|
||||||
|
memcpy (&device, parameter, sizeof (unsigned short));
|
||||||
|
glibtop_get_ppp_p (server, &resp->u.data.ppp, device);
|
||||||
|
resp->offset = _offset_data (ppp);
|
||||||
|
break;
|
||||||
#endif
|
#endif
|
||||||
default:
|
default:
|
||||||
glibtop_error ("Child received unknown command %u",
|
glibtop_error ("Child received unknown command %u",
|
||||||
|
@@ -73,6 +73,9 @@ glibtop_init_func_t _glibtop_init_hook_p [] = {
|
|||||||
#endif
|
#endif
|
||||||
#if GLIBTOP_SUID_PROC_MAP
|
#if GLIBTOP_SUID_PROC_MAP
|
||||||
glibtop_init_proc_map_p,
|
glibtop_init_proc_map_p,
|
||||||
|
#endif
|
||||||
|
#if GLIBTOP_SUID_PPP
|
||||||
|
glibtop_init_ppp_p,
|
||||||
#endif
|
#endif
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
@@ -1,3 +1,12 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* ppp.c: New file to get PPP/ISDN statistics. Currently this only
|
||||||
|
get ISDN statistics if you have the I4B package.
|
||||||
|
|
||||||
|
To get the number of bytes transferred in/out you need to read the
|
||||||
|
file `misc/i4b_acct.txt' in the LibGTop source directory to see
|
||||||
|
how to enable this.
|
||||||
|
|
||||||
1998-10-03 Martin Baulig <martin@home-of-linux.org>
|
1998-10-03 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* procstate.c (glibtop_get_procstate_s): Use correct values for
|
* procstate.c (glibtop_get_procstate_s): Use correct values for
|
||||||
|
@@ -10,7 +10,7 @@ libgtop_sysdeps_suid_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \
|
|||||||
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
||||||
sem_limits.c proclist.c procstate.c procuid.c \
|
sem_limits.c proclist.c procstate.c procuid.c \
|
||||||
proctime.c procmem.c procsignal.c prockernel.c \
|
proctime.c procmem.c procsignal.c prockernel.c \
|
||||||
procsegment.c procmap.c
|
procsegment.c procmap.c ppp.c
|
||||||
|
|
||||||
libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO)
|
libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||||
|
|
||||||
|
@@ -41,6 +41,7 @@ __BEGIN_DECLS
|
|||||||
#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL)
|
#define GLIBTOP_SUID_PROC_KERNEL (1 << GLIBTOP_SYSDEPS_PROC_KERNEL)
|
||||||
#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT)
|
#define GLIBTOP_SUID_PROC_SEGMENT (1 << GLIBTOP_SYSDEPS_PROC_SEGMENT)
|
||||||
#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP)
|
#define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP)
|
||||||
|
#define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP)
|
||||||
|
|
||||||
__END_DECLS
|
__END_DECLS
|
||||||
|
|
||||||
|
131
sysdeps/freebsd/ppp.c
Normal file
131
sysdeps/freebsd/ppp.c
Normal file
@@ -0,0 +1,131 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
|
#include <glibtop/error.h>
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
|
#include <glibtop_suid.h>
|
||||||
|
|
||||||
|
#ifdef HAVE_I4B
|
||||||
|
|
||||||
|
#include <net/if.h>
|
||||||
|
#include <net/if_types.h>
|
||||||
|
#include <net/netisr.h>
|
||||||
|
#include <net/route.h>
|
||||||
|
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#include <net/if_sppp.h>
|
||||||
|
#else
|
||||||
|
#include <i4b/sppp/if_sppp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Read `misc/i4b_acct.txt' for details ... */
|
||||||
|
#ifdef HAVE_I4B_ACCT
|
||||||
|
#include <machine/i4b_acct.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
static const unsigned long _glibtop_sysdeps_ppp =
|
||||||
|
(1 << GLIBTOP_PPP_STATE);
|
||||||
|
|
||||||
|
#ifdef HAVE_I4B_ACCT
|
||||||
|
static const unsigned long _glibtop_sysdeps_ppp_acct =
|
||||||
|
(1 << GLIBTOP_PPP_BYTES_IN) + (1 << GLIBTOP_PPP_BYTES_OUT);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#endif /* HAVE_I4B */
|
||||||
|
|
||||||
|
/* nlist structure for kernel access */
|
||||||
|
static struct nlist nlst [] = {
|
||||||
|
#ifdef HAVE_I4B
|
||||||
|
{ "_i4bisppp_softc" },
|
||||||
|
#endif
|
||||||
|
{ 0 }
|
||||||
|
};
|
||||||
|
|
||||||
|
/* Init function. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_init_ppp_p (glibtop *server)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_I4B
|
||||||
|
#ifdef HAVE_I4B_ACCT
|
||||||
|
server->sysdeps.ppp = _glibtop_sysdeps_ppp |
|
||||||
|
_glibtop_sysdeps_ppp_acct;
|
||||||
|
#else
|
||||||
|
server->sysdeps.ppp = _glibtop_sysdeps_ppp;
|
||||||
|
#endif
|
||||||
|
#endif /* HAVE_I4B */
|
||||||
|
|
||||||
|
if (kvm_nlist (server->machine.kd, nlst) != 0)
|
||||||
|
glibtop_error_io_r (server, "kvm_nlist");
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provides information about ppp usage. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||||
|
{
|
||||||
|
#ifdef HAVE_I4B
|
||||||
|
#ifdef HAVE_I4B_ACCT
|
||||||
|
struct i4bisppp_softc data;
|
||||||
|
#else
|
||||||
|
struct sppp data;
|
||||||
|
#endif
|
||||||
|
int phase;
|
||||||
|
|
||||||
|
glibtop_init_p (server, (1 << GLIBTOP_SYSDEPS_PPP), 0);
|
||||||
|
|
||||||
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
|
||||||
|
if (kvm_read (server->machine.kd, nlst [0].n_value,
|
||||||
|
&data, sizeof (data)) != sizeof (data))
|
||||||
|
glibtop_error_io_r (server, "kvm_read (i4bisppp_softc)");
|
||||||
|
|
||||||
|
#ifdef HAVE_I4B_ACCT
|
||||||
|
phase = data.sc_if_un.scu_sp.pp_phase;
|
||||||
|
#else
|
||||||
|
phase = data.pp_phase;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
switch (phase) {
|
||||||
|
case PHASE_DEAD:
|
||||||
|
case PHASE_TERMINATE:
|
||||||
|
buf->state = GLIBTOP_PPP_STATE_HANGUP;
|
||||||
|
break;
|
||||||
|
case PHASE_ESTABLISH:
|
||||||
|
case PHASE_NETWORK:
|
||||||
|
buf->state = GLIBTOP_PPP_STATE_ONLINE;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
buf->state = GLIBTOP_PPP_STATE_UNKNOWN;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
buf->flags = _glibtop_sysdeps_ppp;
|
||||||
|
|
||||||
|
#ifdef HAVE_I4B_ACCT
|
||||||
|
buf->bytes_in = data.sc_iinb;
|
||||||
|
buf->bytes_out = data.sc_ioutb;
|
||||||
|
buf->flags |= _glibtop_sysdeps_ppp_acct;
|
||||||
|
#endif
|
||||||
|
#endif /* HAVE_I4B */
|
||||||
|
}
|
@@ -1,3 +1,7 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* ppp.c: New file. Currently empty.
|
||||||
|
|
||||||
1998-06-14 Martin Baulig <martin@home-of-linux.org>
|
1998-06-14 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* kernel.s: New file - declaration of the table () function
|
* kernel.s: New file - declaration of the table () function
|
||||||
|
@@ -8,7 +8,7 @@ libgtop_sysdeps_la_SOURCES = open.c close.c kernel.s cpu.c mem.c swap.c \
|
|||||||
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
||||||
sem_limits.c proclist.c procstate.c procuid.c \
|
sem_limits.c proclist.c procstate.c procuid.c \
|
||||||
proctime.c procmem.c procsignal.c prockernel.c \
|
proctime.c procmem.c procsignal.c prockernel.c \
|
||||||
procsegment.c siglist.c procmap.c
|
procsegment.c siglist.c procmap.c ppp.c
|
||||||
|
|
||||||
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
|
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||||
|
|
||||||
|
42
sysdeps/kernel/ppp.c
Normal file
42
sysdeps/kernel/ppp.c
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
|
#include <glibtop/error.h>
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
|
static const unsigned long _glibtop_sysdeps_ppp = 0;
|
||||||
|
|
||||||
|
/* Init function. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_init_ppp_s (glibtop *server)
|
||||||
|
{
|
||||||
|
server->sysdeps.ppp = _glibtop_sysdeps_ppp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provides PPP/ISDN information. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||||
|
{
|
||||||
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
}
|
@@ -1,3 +1,7 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* ppp.c: New file. Currently empty.
|
||||||
|
|
||||||
1998-10-11 Martin Baulig <martin@home-of-linux.org>
|
1998-10-11 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* procdata.c: Removed this obsolete file.
|
* procdata.c: Removed this obsolete file.
|
||||||
|
@@ -8,7 +8,8 @@ libgtop_sysdeps_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
|
|||||||
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
||||||
sem_limits.c proclist.c procstate.c procuid.c \
|
sem_limits.c proclist.c procstate.c procuid.c \
|
||||||
proctime.c procmem.c procsignal.c prockernel.c \
|
proctime.c procmem.c procsignal.c prockernel.c \
|
||||||
procsegment.c procmap.c siglist.c sysinfo.c
|
procsegment.c procmap.c siglist.c sysinfo.c \
|
||||||
|
ppp.c
|
||||||
libgtop_sysdeps_la_LIBADD = @GLIB_LIBS@
|
libgtop_sysdeps_la_LIBADD = @GLIB_LIBS@
|
||||||
|
|
||||||
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
|
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||||
|
42
sysdeps/linux/ppp.c
Normal file
42
sysdeps/linux/ppp.c
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
|
#include <glibtop/error.h>
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
|
static const unsigned long _glibtop_sysdeps_ppp = 0;
|
||||||
|
|
||||||
|
/* Init function. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_init_ppp_s (glibtop *server)
|
||||||
|
{
|
||||||
|
server->sysdeps.ppp = _glibtop_sysdeps_ppp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provides PPP/ISDN information. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||||
|
{
|
||||||
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
}
|
@@ -9,7 +9,7 @@ libgtop_names_la_SOURCES = cpu.c mem.c swap.c uptime.c loadavg.c \
|
|||||||
proclist.c sysdeps.c procstate.c procuid.c \
|
proclist.c sysdeps.c procstate.c procuid.c \
|
||||||
proctime.c procmem.c procsignal.c \
|
proctime.c procmem.c procsignal.c \
|
||||||
prockernel.c procsegment.c fsusage.c \
|
prockernel.c procsegment.c fsusage.c \
|
||||||
mountlist.c procmap.c
|
mountlist.c procmap.c ppp.c
|
||||||
|
|
||||||
libgtop_names_la_LDFLAGS = $(LT_VERSION_INFO)
|
libgtop_names_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||||
|
|
||||||
|
46
sysdeps/names/ppp.c
Normal file
46
sysdeps/names/ppp.c
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
|
const char *glibtop_names_ppp [GLIBTOP_MAX_PPP] =
|
||||||
|
{
|
||||||
|
"state", "bytes_in", "bytes_out"
|
||||||
|
};
|
||||||
|
|
||||||
|
const unsigned glibtop_types_ppp [GLIBTOP_MAX_PPP] =
|
||||||
|
{
|
||||||
|
GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG, GLIBTOP_TYPE_ULONG
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *glibtop_labels_ppp [GLIBTOP_MAX_PPP] =
|
||||||
|
{
|
||||||
|
N_("PPP State"),
|
||||||
|
N_("Input bytes"),
|
||||||
|
N_("Output bytes")
|
||||||
|
};
|
||||||
|
|
||||||
|
const char *glibtop_descriptions_ppp [GLIBTOP_MAX_PPP] =
|
||||||
|
{
|
||||||
|
N_("PPP State"),
|
||||||
|
N_("Number of input bytes"),
|
||||||
|
N_("Number of output bytes")
|
||||||
|
};
|
5
sysdeps/osf1/ChangeLog
Normal file
5
sysdeps/osf1/ChangeLog
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* ChangeLog: New file.
|
||||||
|
* ppp.c: New file.
|
||||||
|
|
@@ -6,7 +6,7 @@ lib_LTLIBRARIES = libgtop_sysdeps.la libgtop_sysdeps_suid.la
|
|||||||
|
|
||||||
libgtop_sysdeps_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \
|
libgtop_sysdeps_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \
|
||||||
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
||||||
sem_limits.c
|
sem_limits.c ppp.c
|
||||||
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
|
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||||
libgtop_sysdeps_la_LIBADD = -lmach
|
libgtop_sysdeps_la_LIBADD = -lmach
|
||||||
|
|
||||||
|
42
sysdeps/osf1/ppp.c
Normal file
42
sysdeps/osf1/ppp.c
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
|
#include <glibtop/error.h>
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
|
static const unsigned long _glibtop_sysdeps_ppp = 0;
|
||||||
|
|
||||||
|
/* Init function. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_init_ppp_s (glibtop *server)
|
||||||
|
{
|
||||||
|
server->sysdeps.ppp = _glibtop_sysdeps_ppp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provides PPP/ISDN information. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||||
|
{
|
||||||
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
}
|
@@ -1,3 +1,7 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* ppp.c: New file.
|
||||||
|
|
||||||
1998-08-24 Martin Baulig <martin@home-of-linux.org>
|
1998-08-24 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* *.c: Added initialization functions `glibtop_init_<feature>_s'.
|
* *.c: Added initialization functions `glibtop_init_<feature>_s'.
|
||||||
|
@@ -8,7 +8,7 @@ libgtop_sysdeps_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \
|
|||||||
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
||||||
sem_limits.c proclist.c procstate.c procuid.c \
|
sem_limits.c proclist.c procstate.c procuid.c \
|
||||||
proctime.c procmem.c procsignal.c prockernel.c \
|
proctime.c procmem.c procsignal.c prockernel.c \
|
||||||
procsegment.c procmap.c
|
procsegment.c procmap.c ppp.c
|
||||||
|
|
||||||
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
|
libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||||
|
|
||||||
|
42
sysdeps/stub/ppp.c
Normal file
42
sysdeps/stub/ppp.c
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
|
#include <glibtop/error.h>
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
|
static const unsigned long _glibtop_sysdeps_ppp = 0;
|
||||||
|
|
||||||
|
/* Init function. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_init_ppp_s (glibtop *server)
|
||||||
|
{
|
||||||
|
server->sysdeps.ppp = _glibtop_sysdeps_ppp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provides PPP/ISDN information. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||||
|
{
|
||||||
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
}
|
5
sysdeps/stub_suid/ChangeLog
Normal file
5
sysdeps/stub_suid/ChangeLog
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* ChangeLog: New file.
|
||||||
|
* ppp.c: New file.
|
||||||
|
|
@@ -12,7 +12,7 @@ libgtop_sysdeps_suid_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \
|
|||||||
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
||||||
sem_limits.c proclist.c procstate.c procuid.c \
|
sem_limits.c proclist.c procstate.c procuid.c \
|
||||||
proctime.c procmem.c procsignal.c prockernel.c \
|
proctime.c procmem.c procsignal.c prockernel.c \
|
||||||
procsegment.c
|
procsegment.c ppp.c
|
||||||
|
|
||||||
libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO)
|
libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||||
|
|
||||||
|
42
sysdeps/stub_suid/ppp.c
Normal file
42
sysdeps/stub_suid/ppp.c
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
|
#include <glibtop/error.h>
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
|
static const unsigned long _glibtop_sysdeps_ppp = 0;
|
||||||
|
|
||||||
|
/* Init function. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_init_ppp_p (glibtop *server)
|
||||||
|
{
|
||||||
|
server->sysdeps.ppp = _glibtop_sysdeps_ppp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provides PPP/ISDN information. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||||
|
{
|
||||||
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
}
|
@@ -1,3 +1,7 @@
|
|||||||
|
1998-10-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* ppp.c: New file.
|
||||||
|
|
||||||
1998-08-25 Martin Baulig <martin@home-of-linux.org>
|
1998-08-25 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'.
|
* *.c (glibtop_init_p): Using correct `(1 << GLIBTOP_SYSDPES_*)'.
|
||||||
|
@@ -12,7 +12,7 @@ libgtop_sysdeps_suid_la_SOURCES = open.c close.c cpu.c mem.c swap.c \
|
|||||||
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
uptime.c loadavg.c shm_limits.c msg_limits.c \
|
||||||
sem_limits.c proclist.c procstate.c procuid.c \
|
sem_limits.c proclist.c procstate.c procuid.c \
|
||||||
proctime.c procmem.c procsignal.c prockernel.c \
|
proctime.c procmem.c procsignal.c prockernel.c \
|
||||||
procsegment.c
|
procsegment.c ppp.c
|
||||||
libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO)
|
libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO)
|
||||||
libgtop_sysdeps_suid_la_LIBADD = -lkvm
|
libgtop_sysdeps_suid_la_LIBADD = -lkvm
|
||||||
|
|
||||||
|
42
sysdeps/sun4/ppp.c
Normal file
42
sysdeps/sun4/ppp.c
Normal file
@@ -0,0 +1,42 @@
|
|||||||
|
/* $Id$ */
|
||||||
|
|
||||||
|
/* Copyright (C) 1995, 1996, 1997 Free Software Foundation, Inc.
|
||||||
|
This file is part of the Gnome Top Library.
|
||||||
|
Contributed by Martin Baulig <martin@home-of-linux.org>, October 1998.
|
||||||
|
|
||||||
|
The Gnome Top Library is free software; you can redistribute it and/or
|
||||||
|
modify it under the terms of the GNU Library General Public License as
|
||||||
|
published by the Free Software Foundation; either version 2 of the
|
||||||
|
License, or (at your option) any later version.
|
||||||
|
|
||||||
|
The Gnome Top Library 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
|
||||||
|
Library General Public License for more details.
|
||||||
|
|
||||||
|
You should have received a copy of the GNU Library General Public
|
||||||
|
License along with the GNU C Library; see the file COPYING.LIB. If not,
|
||||||
|
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
||||||
|
Boston, MA 02111-1307, USA. */
|
||||||
|
|
||||||
|
#include <glibtop.h>
|
||||||
|
#include <glibtop/error.h>
|
||||||
|
#include <glibtop/ppp.h>
|
||||||
|
|
||||||
|
static const unsigned long _glibtop_sysdeps_ppp = 0;
|
||||||
|
|
||||||
|
/* Init function. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_init_ppp_s (glibtop *server)
|
||||||
|
{
|
||||||
|
server->sysdeps.ppp = _glibtop_sysdeps_ppp;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Provides PPP/ISDN information. */
|
||||||
|
|
||||||
|
void
|
||||||
|
glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device)
|
||||||
|
{
|
||||||
|
memset (buf, 0, sizeof (glibtop_ppp));
|
||||||
|
}
|
Reference in New Issue
Block a user