|
Packit |
d37888 |
/* Copyright (C) 1998-99 Martin Baulig
|
|
Packit |
d37888 |
This file is part of LibGTop 1.0.
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998.
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
LibGTop is free software; you can redistribute it and/or modify it
|
|
Packit |
d37888 |
under the terms of the GNU General Public License as published by
|
|
Packit |
d37888 |
the Free Software Foundation; either version 2 of the License,
|
|
Packit |
d37888 |
or (at your option) any later version.
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
LibGTop is distributed in the hope that it will be useful, but WITHOUT
|
|
Packit |
d37888 |
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
Packit |
d37888 |
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
Packit |
d37888 |
for more details.
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
You should have received a copy of the GNU General Public License
|
|
Packit |
d37888 |
along with LibGTop; see the file COPYING. If not, write to the
|
|
Packit |
d37888 |
Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
|
Packit |
d37888 |
Boston, MA 02110-1301, USA.
|
|
Packit |
d37888 |
*/
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
#include <config.h>
|
|
Packit |
d37888 |
#include <glibtop.h>
|
|
Packit |
d37888 |
#include <glibtop/union.h>
|
|
Packit |
d37888 |
#include <glibtop/sysdeps.h>
|
|
Packit |
d37888 |
#include <glibtop/init_hooks.h>
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
const unsigned long glibtop_server_features =
|
|
Packit |
d37888 |
GLIBTOP_SUID_CPU +
|
|
Packit |
d37888 |
GLIBTOP_SUID_MEM +
|
|
Packit |
d37888 |
GLIBTOP_SUID_SWAP +
|
|
Packit |
d37888 |
GLIBTOP_SUID_UPTIME +
|
|
Packit |
d37888 |
GLIBTOP_SUID_LOADAVG +
|
|
Packit |
d37888 |
GLIBTOP_SUID_SHM_LIMITS +
|
|
Packit |
d37888 |
GLIBTOP_SUID_MSG_LIMITS +
|
|
Packit |
d37888 |
GLIBTOP_SUID_SEM_LIMITS +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROCLIST +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_STATE +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_UID +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_MEM +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_TIME +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_SIGNAL +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_KERNEL +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_SEGMENT +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_ARGS +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_MAP +
|
|
Packit |
d37888 |
GLIBTOP_SUID_NETLOAD +
|
|
Packit |
d37888 |
GLIBTOP_SUID_NETLIST +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_WD +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_AFFINITY +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PPP +
|
|
Packit |
d37888 |
GLIBTOP_SUID_PROC_IO;
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
const _glibtop_init_func_t _glibtop_init_hook_s [] = {
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_CPU
|
|
Packit |
d37888 |
_glibtop_init_cpu_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_MEM
|
|
Packit |
d37888 |
_glibtop_init_mem_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_SWAP
|
|
Packit |
d37888 |
_glibtop_init_swap_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_UPTIME
|
|
Packit |
d37888 |
_glibtop_init_uptime_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_LOADAVG
|
|
Packit |
d37888 |
_glibtop_init_loadavg_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_SHM_LIMITS
|
|
Packit |
d37888 |
_glibtop_init_shm_limits_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_MSG_LIMITS
|
|
Packit |
d37888 |
_glibtop_init_msg_limits_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_SEM_LIMITS
|
|
Packit |
d37888 |
_glibtop_init_sem_limits_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROCLIST
|
|
Packit |
d37888 |
_glibtop_init_proclist_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_STATE
|
|
Packit |
d37888 |
_glibtop_init_proc_state_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_UID
|
|
Packit |
d37888 |
_glibtop_init_proc_uid_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_MEM
|
|
Packit |
d37888 |
_glibtop_init_proc_mem_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_TIME
|
|
Packit |
d37888 |
_glibtop_init_proc_time_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_SIGNAL
|
|
Packit |
d37888 |
_glibtop_init_proc_signal_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_KERNEL
|
|
Packit |
d37888 |
_glibtop_init_proc_kernel_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_SEGMENT
|
|
Packit |
d37888 |
_glibtop_init_proc_segment_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_ARGS
|
|
Packit |
d37888 |
_glibtop_init_proc_args_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_MAP
|
|
Packit |
d37888 |
_glibtop_init_proc_map_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_NETLOAD
|
|
Packit |
d37888 |
_glibtop_init_netload_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_NETLIST
|
|
Packit |
d37888 |
_glibtop_init_netlist_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_WD
|
|
Packit |
d37888 |
_glibtop_init_proc_wd_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_AFFINITY
|
|
Packit |
d37888 |
_glibtop_init_proc_affinity_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PPP
|
|
Packit |
d37888 |
_glibtop_init_ppp_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if !GLIBTOP_SUID_PROC_IO
|
|
Packit |
d37888 |
_glibtop_init_proc_io_s,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
NULL
|
|
Packit |
d37888 |
};
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
const _glibtop_init_func_t _glibtop_init_hook_p [] = {
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_CPU
|
|
Packit |
d37888 |
_glibtop_init_cpu_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_MEM
|
|
Packit |
d37888 |
_glibtop_init_mem_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_SWAP
|
|
Packit |
d37888 |
_glibtop_init_swap_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_UPTIME
|
|
Packit |
d37888 |
_glibtop_init_uptime_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_LOADAVG
|
|
Packit |
d37888 |
_glibtop_init_loadavg_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_SHM_LIMITS
|
|
Packit |
d37888 |
_glibtop_init_shm_limits_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_MSG_LIMITS
|
|
Packit |
d37888 |
_glibtop_init_msg_limits_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_SEM_LIMITS
|
|
Packit |
d37888 |
_glibtop_init_sem_limits_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROCLIST
|
|
Packit |
d37888 |
_glibtop_init_proclist_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_STATE
|
|
Packit |
d37888 |
_glibtop_init_proc_state_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_UID
|
|
Packit |
d37888 |
_glibtop_init_proc_uid_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_MEM
|
|
Packit |
d37888 |
_glibtop_init_proc_mem_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_TIME
|
|
Packit |
d37888 |
_glibtop_init_proc_time_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_SIGNAL
|
|
Packit |
d37888 |
_glibtop_init_proc_signal_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_KERNEL
|
|
Packit |
d37888 |
_glibtop_init_proc_kernel_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_SEGMENT
|
|
Packit |
d37888 |
_glibtop_init_proc_segment_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_ARGS
|
|
Packit |
d37888 |
_glibtop_init_proc_args_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_MAP
|
|
Packit |
d37888 |
_glibtop_init_proc_map_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_NETLOAD
|
|
Packit |
d37888 |
_glibtop_init_netload_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_NETLIST
|
|
Packit |
d37888 |
_glibtop_init_netlist_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_WD
|
|
Packit |
d37888 |
_glibtop_init_proc_wd_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_AFFINITY
|
|
Packit |
d37888 |
_glibtop_init_proc_affinity_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PPP
|
|
Packit |
d37888 |
_glibtop_init_ppp_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
#if GLIBTOP_SUID_PROC_IO
|
|
Packit |
d37888 |
_glibtop_init_proc_io_p,
|
|
Packit |
d37888 |
#endif
|
|
Packit |
d37888 |
NULL
|
|
Packit |
d37888 |
};
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
/* Checks which features are implemented. */
|
|
Packit |
d37888 |
|
|
Packit |
d37888 |
void
|
|
Packit |
d37888 |
glibtop_get_sysdeps_r (glibtop *server, glibtop_sysdeps *buf)
|
|
Packit |
d37888 |
{
|
|
Packit |
d37888 |
*buf = server->sysdeps;
|
|
Packit |
d37888 |
}
|