From 7e5ccec8bf8df4187c161f1e2dab600a434cf515 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Dejean?= Date: Sat, 13 Nov 2004 00:53:20 +0000 Subject: Bumped to 2.9.0 * configure.in: Bumped to 2.9.0 * configure.in: * examples/.cvsignore: * examples/Makefile.am: * examples/netlist.c: (main): * features.def: * include/glibtop/Makefile.am: * include/glibtop/command.h: * include/glibtop/netlist.h: * include/glibtop/sysdeps.h: * include/glibtop/union.h: * include/glibtop/version.h: * src/daemon/version.c: * sysdeps/linux/Makefile.am: * sysdeps/linux/netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s): * sysdeps/names/Makefile.am: * sysdeps/names/netlist.c: * sysdeps/solaris/Makefile.am: * sysdeps/solaris/netlist.c: (glibtop_init_netlist_s), (glibtop_get_netlist_s): Added new function glibtop_get_netlist(). Implemented for linux and solaris. Doc needed. --- include/glibtop/Makefile.am | 2 +- include/glibtop/command.h | 3 +- include/glibtop/netlist.h | 71 +++++++++++++++++++++++++++++++++++++++++++++ include/glibtop/sysdeps.h | 4 ++- include/glibtop/union.h | 2 ++ include/glibtop/version.h | 3 -- 6 files changed, 79 insertions(+), 6 deletions(-) create mode 100644 include/glibtop/netlist.h (limited to 'include') diff --git a/include/glibtop/Makefile.am b/include/glibtop/Makefile.am index 43735148..ba0b59c6 100644 --- a/include/glibtop/Makefile.am +++ b/include/glibtop/Makefile.am @@ -7,4 +7,4 @@ glibtop_HEADERS = close.h loadavg.h prockernel.h procstate.h \ procsegment.h read.h sysdeps.h global.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 + inodedb.h sysinfo.h ppp.h procargs.h netload.h netlist.h diff --git a/include/glibtop/command.h b/include/glibtop/command.h index 87688eb2..aa940ddc 100644 --- a/include/glibtop/command.h +++ b/include/glibtop/command.h @@ -57,8 +57,9 @@ G_BEGIN_DECLS #define GLIBTOP_CMND_FSUSAGE 21 #define GLIBTOP_CMND_NETLOAD 22 #define GLIBTOP_CMND_PPP 23 +#define GLIBTOP_CMND_NETLIST 24 -#define GLIBTOP_MAX_CMND 24 +#define GLIBTOP_MAX_CMND 25 #define _GLIBTOP_PARAM_SIZE 16 diff --git a/include/glibtop/netlist.h b/include/glibtop/netlist.h new file mode 100644 index 00000000..e296f09f --- /dev/null +++ b/include/glibtop/netlist.h @@ -0,0 +1,71 @@ +/* Copyright (C) 2004 BenoƮt Dejean + This file is part of LibGTop 2.0. + + 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_NETLIST_H__ +#define __GLIBTOP_NETLIST_H__ + +#include +#include + +G_BEGIN_DECLS + +#define GLIBTOP_NETLIST_NUMBER 0 + +#define GLIBTOP_MAX_NETLIST 1 + +typedef struct _glibtop_netlist glibtop_netlist; + +struct _glibtop_netlist +{ + guint64 flags; + guint32 number; +}; + +#define glibtop_get_netlist(netlist) glibtop_get_netlist_l(glibtop_global_server, netlist) + +#if GLIBTOP_SUID_NETLIST +#define glibtop_get_netlist_r glibtop_get_netlist_p +#else +#define glibtop_get_netlist_r glibtop_get_netlist_s +#endif + +char** glibtop_get_netlist_l (glibtop *server, glibtop_netlist *buf); + +#if GLIBTOP_SUID_NETLIST +void glibtop_init_netlist_p (glibtop *server); +char** glibtop_get_netlist_p (glibtop *server, glibtop_netlist *buf); +#else +void glibtop_init_netlist_s (glibtop *server); +char** glibtop_get_netlist_s (glibtop *server, glibtop_netlist *buf); +#endif + +#ifdef GLIBTOP_NAMES + +/* You need to link with -lgtop_names to get this stuff here. */ + +extern const char *glibtop_names_netlist []; +extern const unsigned glibtop_types_netlist []; +extern const char *glibtop_labels_netlist []; +extern const char *glibtop_descriptions_netlist []; + +#endif + +G_END_DECLS + +#endif diff --git a/include/glibtop/sysdeps.h b/include/glibtop/sysdeps.h index 11d2f9c3..7eb39313 100644 --- a/include/glibtop/sysdeps.h +++ b/include/glibtop/sysdeps.h @@ -51,8 +51,9 @@ G_BEGIN_DECLS #define GLIBTOP_SYSDEPS_FSUSAGE 20 #define GLIBTOP_SYSDEPS_NETLOAD 21 #define GLIBTOP_SYSDEPS_PPP 22 +#define GLIBTOP_SYSDEPS_NETLIST 23 -#define GLIBTOP_MAX_SYSDEPS 23 +#define GLIBTOP_MAX_SYSDEPS 24 #define GLIBTOP_SYSDEPS_ALL ((1 << GLIBTOP_MAX_SYSDEPS) - 1) @@ -86,6 +87,7 @@ struct _glibtop_sysdeps proc_map, /* glibtop_proc_map */ mountlist, /* glibtop_mountlist */ fsusage, /* glibtop_fsusage */ + netlist, /* glibtop_netlist */ netload, /* glibtop_netload */ ppp; /* glibtop_ppp */ }; diff --git a/include/glibtop/union.h b/include/glibtop/union.h index db1cc203..ed462468 100644 --- a/include/glibtop/union.h +++ b/include/glibtop/union.h @@ -48,6 +48,7 @@ #include #include +#include #include G_BEGIN_DECLS @@ -76,6 +77,7 @@ union _glibtop_union glibtop_proc_map proc_map; glibtop_mountlist mountlist; glibtop_fsusage fsusage; + glibtop_netlist netlist; glibtop_netload netload; glibtop_ppp ppp; }; diff --git a/include/glibtop/version.h b/include/glibtop/version.h index 67d9ab10..90ba06df 100644 --- a/include/glibtop/version.h +++ b/include/glibtop/version.h @@ -23,9 +23,6 @@ #define __GLIBTOP_VERSION_H__ #include -#include -#include -#include #define LIBGTOP_VERSION_STRING "Libgtop %s server version %s (%u,%u,%u,%u)." -- cgit v1.2.1