From 6380440c002bee1216922a77172e4b1b07f3652d Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Sun, 21 Nov 1999 19:03:12 +0000 Subject: [PATCH] Reflect latest interface changes. --- sysdeps/freebsd/Makefile.am | 2 +- sysdeps/freebsd/glibtop_server.h | 1 + sysdeps/freebsd/interfaces.c | 54 ++++++++++++++++++++++++++++++ sysdeps/solaris/Makefile.am | 3 +- sysdeps/solaris/glibtop_server.h | 1 + sysdeps/solaris/interfaces.c | 54 ++++++++++++++++++++++++++++++ sysdeps/stub/Makefile.am | 2 +- sysdeps/stub/cpu.c | 4 +++ sysdeps/stub/interfaces.c | 54 ++++++++++++++++++++++++++++++ sysdeps/stub/loadavg.c | 4 +++ sysdeps/stub/mem.c | 4 +++ sysdeps/stub/msg_limits.c | 4 +++ sysdeps/stub/netload.c | 4 +++ sysdeps/stub/ppp.c | 4 +++ sysdeps/stub/procargs.c | 2 ++ sysdeps/stub/prockernel.c | 4 +++ sysdeps/stub/proclist.c | 2 ++ sysdeps/stub/procmap.c | 2 ++ sysdeps/stub/procmem.c | 4 +++ sysdeps/stub/procsegment.c | 4 +++ sysdeps/stub/procsignal.c | 4 +++ sysdeps/stub/procstate.c | 4 +++ sysdeps/stub/proctime.c | 4 +++ sysdeps/stub/procuid.c | 4 +++ sysdeps/stub/sem_limits.c | 4 +++ sysdeps/stub/shm_limits.c | 4 +++ sysdeps/stub/swap.c | 4 +++ sysdeps/stub/uptime.c | 4 +++ sysdeps/stub_suid/Makefile.am | 2 +- sysdeps/stub_suid/cpu.c | 4 +++ sysdeps/stub_suid/glibtop_server.h | 1 + sysdeps/stub_suid/interfaces.c | 54 ++++++++++++++++++++++++++++++ sysdeps/stub_suid/loadavg.c | 4 +++ sysdeps/stub_suid/mem.c | 4 +++ sysdeps/stub_suid/msg_limits.c | 4 +++ sysdeps/stub_suid/netload.c | 4 +++ sysdeps/stub_suid/nosuid.c | 1 + sysdeps/stub_suid/ppp.c | 4 +++ sysdeps/stub_suid/procargs.c | 2 ++ sysdeps/stub_suid/prockernel.c | 4 +++ sysdeps/stub_suid/proclist.c | 2 ++ sysdeps/stub_suid/procmap.c | 2 ++ sysdeps/stub_suid/procmem.c | 4 +++ sysdeps/stub_suid/procsegment.c | 4 +++ sysdeps/stub_suid/procsignal.c | 4 +++ sysdeps/stub_suid/procstate.c | 4 +++ sysdeps/stub_suid/proctime.c | 4 +++ sysdeps/stub_suid/procuid.c | 4 +++ sysdeps/stub_suid/sem_limits.c | 4 +++ sysdeps/stub_suid/shm_limits.c | 4 +++ sysdeps/stub_suid/swap.c | 4 +++ sysdeps/stub_suid/uptime.c | 4 +++ 52 files changed, 373 insertions(+), 4 deletions(-) create mode 100644 sysdeps/freebsd/interfaces.c create mode 100644 sysdeps/solaris/interfaces.c create mode 100644 sysdeps/stub/interfaces.c create mode 100644 sysdeps/stub_suid/interfaces.c diff --git a/sysdeps/freebsd/Makefile.am b/sysdeps/freebsd/Makefile.am index c37d3b66..606fa17b 100644 --- a/sysdeps/freebsd/Makefile.am +++ b/sysdeps/freebsd/Makefile.am @@ -13,7 +13,7 @@ libgtop_sysdeps_suid_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ procsegment.c procargs.c procmap.c netload.c \ - ppp.c + interfaces.c ppp.c libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO) diff --git a/sysdeps/freebsd/glibtop_server.h b/sysdeps/freebsd/glibtop_server.h index ccf3d29d..689f781c 100644 --- a/sysdeps/freebsd/glibtop_server.h +++ b/sysdeps/freebsd/glibtop_server.h @@ -45,6 +45,7 @@ BEGIN_LIBGTOP_DECLS #define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) #define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_INTERFACE_NAMES (1 << GLIBTOP_SYSDEPS_INTERFACE_NAMES) #define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) END_LIBGTOP_DECLS diff --git a/sysdeps/freebsd/interfaces.c b/sysdeps/freebsd/interfaces.c new file mode 100644 index 00000000..6874bfcf --- /dev/null +++ b/sysdeps/freebsd/interfaces.c @@ -0,0 +1,54 @@ +/* $Id$ */ + +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 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. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_interface_names = +(1L << GLIBTOP_INTERFACE_NAMES_NUMBER) + +(1L << GLIBTOP_INTERFACE_NAMES_SIZE); + +/* Init function. */ + +int +glibtop_init_interface_names_p (glibtop *server) +{ + server->sysdeps.interface_names = _glibtop_sysdeps_interface_names; + + return 0; +} + +/* Provides network statistics. */ + +char * +glibtop_get_interface_names_p (glibtop *server, glibtop_interface_names *buf, + unsigned interface, unsigned number, + unsigned strategy) +{ + glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0); + + memset (buf, 0, sizeof (glibtop_interface_names)); + + return NULL; +} diff --git a/sysdeps/solaris/Makefile.am b/sysdeps/solaris/Makefile.am index 6a71805f..887a8af9 100644 --- a/sysdeps/solaris/Makefile.am +++ b/sysdeps/solaris/Makefile.am @@ -9,7 +9,8 @@ libgtop_sysdeps_la_SOURCES = open.c close.c siglist.c cpu.c mem.c \ proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c \ prockernel.c procsegment.c procargs.c \ - procmap.c netload.c ppp.c procdata.c + procmap.c netload.c ppp.c procdata.c \ + interfaces.c libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO) diff --git a/sysdeps/solaris/glibtop_server.h b/sysdeps/solaris/glibtop_server.h index 0a13e6d4..6c4d348d 100644 --- a/sysdeps/solaris/glibtop_server.h +++ b/sysdeps/solaris/glibtop_server.h @@ -45,6 +45,7 @@ BEGIN_LIBGTOP_DECLS #define GLIBTOP_SUID_PROC_ARGS 0 #define GLIBTOP_SUID_PROC_MAP 0 #define GLIBTOP_SUID_NETLOAD 0 +#define GLIBTOP_SUID_INTERFACE_NAMES 0 #define GLIBTOP_SUID_PPP 0 END_LIBGTOP_DECLS diff --git a/sysdeps/solaris/interfaces.c b/sysdeps/solaris/interfaces.c new file mode 100644 index 00000000..b8091833 --- /dev/null +++ b/sysdeps/solaris/interfaces.c @@ -0,0 +1,54 @@ +/* $Id$ */ + +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 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. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_interface_names = +(1L << GLIBTOP_INTERFACE_NAMES_NUMBER) + +(1L << GLIBTOP_INTERFACE_NAMES_SIZE); + +/* Init function. */ + +int +glibtop_init_interface_names_s (glibtop *server) +{ + server->sysdeps.interface_names = _glibtop_sysdeps_interface_names; + + return 0; +} + +/* Provides network statistics. */ + +char * +glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf, + unsigned interface, unsigned number, + unsigned strategy) +{ + glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0); + + memset (buf, 0, sizeof (glibtop_interface_names)); + + return NULL; +} diff --git a/sysdeps/stub/Makefile.am b/sysdeps/stub/Makefile.am index 35b8ea65..35fdf37d 100644 --- a/sysdeps/stub/Makefile.am +++ b/sysdeps/stub/Makefile.am @@ -9,7 +9,7 @@ libgtop_sysdeps_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ procsegment.c procargs.c procmap.c netload.c \ - ppp.c + interfaces.c ppp.c libgtop_sysdeps_la_LDFLAGS = $(LT_VERSION_INFO) diff --git a/sysdeps/stub/cpu.c b/sysdeps/stub/cpu.c index 982e2ec8..e395f278 100644 --- a/sysdeps/stub/cpu.c +++ b/sysdeps/stub/cpu.c @@ -32,6 +32,8 @@ int glibtop_init_cpu_s (glibtop *server) { server->sysdeps.cpu = _glibtop_sysdeps_cpu; + + return 0; } /* Provides information about cpu usage. */ @@ -40,4 +42,6 @@ int glibtop_get_cpu_s (glibtop *server, glibtop_cpu *buf) { memset (buf, 0, sizeof (glibtop_cpu)); + + return 0; } diff --git a/sysdeps/stub/interfaces.c b/sysdeps/stub/interfaces.c new file mode 100644 index 00000000..b8091833 --- /dev/null +++ b/sysdeps/stub/interfaces.c @@ -0,0 +1,54 @@ +/* $Id$ */ + +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 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. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_interface_names = +(1L << GLIBTOP_INTERFACE_NAMES_NUMBER) + +(1L << GLIBTOP_INTERFACE_NAMES_SIZE); + +/* Init function. */ + +int +glibtop_init_interface_names_s (glibtop *server) +{ + server->sysdeps.interface_names = _glibtop_sysdeps_interface_names; + + return 0; +} + +/* Provides network statistics. */ + +char * +glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf, + unsigned interface, unsigned number, + unsigned strategy) +{ + glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0); + + memset (buf, 0, sizeof (glibtop_interface_names)); + + return NULL; +} diff --git a/sysdeps/stub/loadavg.c b/sysdeps/stub/loadavg.c index d85a1437..bc11f435 100644 --- a/sysdeps/stub/loadavg.c +++ b/sysdeps/stub/loadavg.c @@ -32,6 +32,8 @@ int glibtop_init_loadavg_s (glibtop *server) { server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; + + return 0; } /* Provides load averange. */ @@ -40,4 +42,6 @@ int glibtop_get_loadavg_s (glibtop *server, glibtop_loadavg *buf) { memset (buf, 0, sizeof (glibtop_loadavg)); + + return 0; } diff --git a/sysdeps/stub/mem.c b/sysdeps/stub/mem.c index f6e22e5d..ca65c73f 100644 --- a/sysdeps/stub/mem.c +++ b/sysdeps/stub/mem.c @@ -32,6 +32,8 @@ int glibtop_init_mem_s (glibtop *server) { server->sysdeps.mem = _glibtop_sysdeps_mem; + + return 0; } /* Provides information about memory usage. */ @@ -40,4 +42,6 @@ int glibtop_get_mem_s (glibtop *server, glibtop_mem *buf) { memset (buf, 0, sizeof (glibtop_mem)); + + return 0; } diff --git a/sysdeps/stub/msg_limits.c b/sysdeps/stub/msg_limits.c index af59729f..95dcb46b 100644 --- a/sysdeps/stub/msg_limits.c +++ b/sysdeps/stub/msg_limits.c @@ -32,6 +32,8 @@ int glibtop_init_msg_limits_s (glibtop *server) { server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; + + return 0; } /* Provides information about sysv ipc limits. */ @@ -40,4 +42,6 @@ int glibtop_get_msg_limits_s (glibtop *server, glibtop_msg_limits *buf) { memset (buf, 0, sizeof (glibtop_msg_limits)); + + return 0; } diff --git a/sysdeps/stub/netload.c b/sysdeps/stub/netload.c index 9fd3a81d..9f63de50 100644 --- a/sysdeps/stub/netload.c +++ b/sysdeps/stub/netload.c @@ -33,6 +33,8 @@ int glibtop_init_netload_s (glibtop *server) { server->sysdeps.netload = _glibtop_sysdeps_netload; + + return 0; } /* Provides network statistics. */ @@ -42,4 +44,6 @@ glibtop_get_netload_s (glibtop *server, glibtop_netload *buf, const char *interface) { memset (buf, 0, sizeof (glibtop_netload)); + + return 0; } diff --git a/sysdeps/stub/ppp.c b/sysdeps/stub/ppp.c index 0d682830..484e1425 100644 --- a/sysdeps/stub/ppp.c +++ b/sysdeps/stub/ppp.c @@ -33,6 +33,8 @@ int glibtop_init_ppp_s (glibtop *server) { server->sysdeps.ppp = _glibtop_sysdeps_ppp; + + return 0; } /* Provides PPP/ISDN information. */ @@ -41,4 +43,6 @@ int glibtop_get_ppp_s (glibtop *server, glibtop_ppp *buf, unsigned short device) { memset (buf, 0, sizeof (glibtop_ppp)); + + return 0; } diff --git a/sysdeps/stub/procargs.c b/sysdeps/stub/procargs.c index e2160d51..e441df3f 100644 --- a/sysdeps/stub/procargs.c +++ b/sysdeps/stub/procargs.c @@ -34,6 +34,8 @@ int glibtop_init_proc_args_s (glibtop *server) { server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; + + return 0; } /* Provides detailed information about a process. */ diff --git a/sysdeps/stub/prockernel.c b/sysdeps/stub/prockernel.c index 885f8851..87cf1e58 100644 --- a/sysdeps/stub/prockernel.c +++ b/sysdeps/stub/prockernel.c @@ -32,6 +32,8 @@ int glibtop_init_proc_kernel_s (glibtop *server) { server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; + + return 0; } /* Provides detailed information about a process. */ @@ -41,4 +43,6 @@ glibtop_get_proc_kernel_s (glibtop *server, glibtop_proc_kernel *buf, pid_t pid) { memset (buf, 0, sizeof (glibtop_proc_kernel)); + + return 0; } diff --git a/sysdeps/stub/proclist.c b/sysdeps/stub/proclist.c index 830f8fb9..659c4939 100644 --- a/sysdeps/stub/proclist.c +++ b/sysdeps/stub/proclist.c @@ -34,6 +34,8 @@ int glibtop_init_proclist_s (glibtop *server) { server->sysdeps.proclist = _glibtop_sysdeps_proclist; + + return 0; } /* Fetch list of currently running processes. diff --git a/sysdeps/stub/procmap.c b/sysdeps/stub/procmap.c index 2744feb0..727ba155 100644 --- a/sysdeps/stub/procmap.c +++ b/sysdeps/stub/procmap.c @@ -35,6 +35,8 @@ int glibtop_init_proc_map_s (glibtop *server) { server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; + + return 0; } /* Provides detailed information about a process. */ diff --git a/sysdeps/stub/procmem.c b/sysdeps/stub/procmem.c index 310c3657..67e13db4 100644 --- a/sysdeps/stub/procmem.c +++ b/sysdeps/stub/procmem.c @@ -32,6 +32,8 @@ int glibtop_init_proc_mem_s (glibtop *server) { server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; + + return 0; } /* Provides detailed information about a process. */ @@ -41,4 +43,6 @@ glibtop_get_proc_mem_s (glibtop *server, glibtop_proc_mem *buf, pid_t pid) { memset (buf, 0, sizeof (glibtop_proc_mem)); + + return 0; } diff --git a/sysdeps/stub/procsegment.c b/sysdeps/stub/procsegment.c index cff57511..39c42732 100644 --- a/sysdeps/stub/procsegment.c +++ b/sysdeps/stub/procsegment.c @@ -32,6 +32,8 @@ int glibtop_init_proc_segment_s (glibtop *server) { server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; + + return 0; } /* Provides detailed information about a process. */ @@ -41,4 +43,6 @@ glibtop_get_proc_segment_s (glibtop *server, glibtop_proc_segment *buf, pid_t pid) { memset (buf, 0, sizeof (glibtop_proc_segment)); + + return 0; } diff --git a/sysdeps/stub/procsignal.c b/sysdeps/stub/procsignal.c index dc7db28c..d42dea94 100644 --- a/sysdeps/stub/procsignal.c +++ b/sysdeps/stub/procsignal.c @@ -32,6 +32,8 @@ int glibtop_init_proc_signal_s (glibtop *server) { server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; + + return 0; } /* Provides detailed information about a process. */ @@ -41,4 +43,6 @@ glibtop_get_proc_signal_s (glibtop *server, glibtop_proc_signal *buf, pid_t pid) { memset (buf, 0, sizeof (glibtop_proc_signal)); + + return 0; } diff --git a/sysdeps/stub/procstate.c b/sysdeps/stub/procstate.c index 9dc0e5a3..f517166f 100644 --- a/sysdeps/stub/procstate.c +++ b/sysdeps/stub/procstate.c @@ -32,6 +32,8 @@ int glibtop_init_proc_state_s (glibtop *server) { server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; + + return 0; } /* Provides detailed information about a process. */ @@ -41,4 +43,6 @@ glibtop_get_proc_state_s (glibtop *server, glibtop_proc_state *buf, pid_t pid) { memset (buf, 0, sizeof (glibtop_proc_state)); + + return 0; } diff --git a/sysdeps/stub/proctime.c b/sysdeps/stub/proctime.c index 374849ff..5e63d110 100644 --- a/sysdeps/stub/proctime.c +++ b/sysdeps/stub/proctime.c @@ -32,6 +32,8 @@ int glibtop_init_proc_time_s (glibtop *server) { server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; + + return 0; } /* Provides detailed information about a process. */ @@ -41,4 +43,6 @@ glibtop_get_proc_time_s (glibtop *server, glibtop_proc_time *buf, pid_t pid) { memset (buf, 0, sizeof (glibtop_proc_time)); + + return 0; } diff --git a/sysdeps/stub/procuid.c b/sysdeps/stub/procuid.c index 498790a1..ecf859c9 100644 --- a/sysdeps/stub/procuid.c +++ b/sysdeps/stub/procuid.c @@ -32,6 +32,8 @@ int glibtop_init_proc_uid_s (glibtop *server) { server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; + + return 0; } /* Provides detailed information about a process. */ @@ -41,4 +43,6 @@ glibtop_get_proc_uid_s (glibtop *server, glibtop_proc_uid *buf, pid_t pid) { memset (buf, 0, sizeof (glibtop_proc_uid)); + + return 0; } diff --git a/sysdeps/stub/sem_limits.c b/sysdeps/stub/sem_limits.c index 5c45abe0..8bfb3cce 100644 --- a/sysdeps/stub/sem_limits.c +++ b/sysdeps/stub/sem_limits.c @@ -32,6 +32,8 @@ int glibtop_init_sem_limits_s (glibtop *server) { server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; + + return 0; } /* Provides information about sysv sem limits. */ @@ -40,4 +42,6 @@ int glibtop_get_sem_limits_s (glibtop *server, glibtop_sem_limits *buf) { memset (buf, 0, sizeof (glibtop_sem_limits)); + + return 0; } diff --git a/sysdeps/stub/shm_limits.c b/sysdeps/stub/shm_limits.c index 7ccd807e..a427eaa5 100644 --- a/sysdeps/stub/shm_limits.c +++ b/sysdeps/stub/shm_limits.c @@ -32,6 +32,8 @@ int glibtop_init_shm_limits_s (glibtop *server) { server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; + + return 0; } /* Provides information about sysv ipc limits. */ @@ -40,4 +42,6 @@ int glibtop_get_shm_limits_s (glibtop *server, glibtop_shm_limits *buf) { memset (buf, 0, sizeof (glibtop_shm_limits)); + + return 0; } diff --git a/sysdeps/stub/swap.c b/sysdeps/stub/swap.c index eca227f3..0f0a7fd4 100644 --- a/sysdeps/stub/swap.c +++ b/sysdeps/stub/swap.c @@ -32,6 +32,8 @@ int glibtop_init_swap_s (glibtop *server) { server->sysdeps.swap = _glibtop_sysdeps_swap; + + return 0; } /* Provides information about swap usage. */ @@ -40,4 +42,6 @@ int glibtop_get_swap_s (glibtop *server, glibtop_swap *buf) { memset (buf, 0, sizeof (glibtop_swap)); + + return 0; } diff --git a/sysdeps/stub/uptime.c b/sysdeps/stub/uptime.c index 8b346e5e..0f993a02 100644 --- a/sysdeps/stub/uptime.c +++ b/sysdeps/stub/uptime.c @@ -32,6 +32,8 @@ int glibtop_init_uptime_s (glibtop *server) { server->sysdeps.uptime = _glibtop_sysdeps_uptime; + + return 0; } /* Provides uptime and idle time. */ @@ -40,4 +42,6 @@ int glibtop_get_uptime_s (glibtop *server, glibtop_uptime *buf) { memset (buf, 0, sizeof (glibtop_uptime)); + + return 0; } diff --git a/sysdeps/stub_suid/Makefile.am b/sysdeps/stub_suid/Makefile.am index 43245598..2a261b44 100644 --- a/sysdeps/stub_suid/Makefile.am +++ b/sysdeps/stub_suid/Makefile.am @@ -13,7 +13,7 @@ libgtop_sysdeps_suid_la_SOURCES = open.c close.c siglist.c cpu.c mem.c swap.c \ sem_limits.c proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ procsegment.c procargs.c procmap.c netload.c \ - ppp.c + interfaces.c ppp.c libgtop_sysdeps_suid_la_LDFLAGS = $(LT_VERSION_INFO) diff --git a/sysdeps/stub_suid/cpu.c b/sysdeps/stub_suid/cpu.c index 420a799f..4b9909b7 100644 --- a/sysdeps/stub_suid/cpu.c +++ b/sysdeps/stub_suid/cpu.c @@ -35,6 +35,8 @@ int glibtop_init_cpu_p (glibtop *server) { server->sysdeps.cpu = _glibtop_sysdeps_cpu; + + return 0; } /* Provides information about cpu usage. */ @@ -45,4 +47,6 @@ glibtop_get_cpu_p (glibtop *server, glibtop_cpu *buf) glibtop_init_p (server, GLIBTOP_SYSDEPS_CPU, 0); memset (buf, 0, sizeof (glibtop_cpu)); + + return 0; } diff --git a/sysdeps/stub_suid/glibtop_server.h b/sysdeps/stub_suid/glibtop_server.h index ccf3d29d..689f781c 100644 --- a/sysdeps/stub_suid/glibtop_server.h +++ b/sysdeps/stub_suid/glibtop_server.h @@ -45,6 +45,7 @@ BEGIN_LIBGTOP_DECLS #define GLIBTOP_SUID_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) #define GLIBTOP_SUID_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) #define GLIBTOP_SUID_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) +#define GLIBTOP_SUID_INTERFACE_NAMES (1 << GLIBTOP_SYSDEPS_INTERFACE_NAMES) #define GLIBTOP_SUID_PPP (1 << GLIBTOP_SYSDEPS_PPP) END_LIBGTOP_DECLS diff --git a/sysdeps/stub_suid/interfaces.c b/sysdeps/stub_suid/interfaces.c new file mode 100644 index 00000000..6874bfcf --- /dev/null +++ b/sysdeps/stub_suid/interfaces.c @@ -0,0 +1,54 @@ +/* $Id$ */ + +/* Copyright (C) 1998-99 Martin Baulig + This file is part of LibGTop 1.0. + + Contributed by Martin Baulig , October 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. +*/ + +#include +#include +#include + +static const unsigned long _glibtop_sysdeps_interface_names = +(1L << GLIBTOP_INTERFACE_NAMES_NUMBER) + +(1L << GLIBTOP_INTERFACE_NAMES_SIZE); + +/* Init function. */ + +int +glibtop_init_interface_names_p (glibtop *server) +{ + server->sysdeps.interface_names = _glibtop_sysdeps_interface_names; + + return 0; +} + +/* Provides network statistics. */ + +char * +glibtop_get_interface_names_p (glibtop *server, glibtop_interface_names *buf, + unsigned interface, unsigned number, + unsigned strategy) +{ + glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0); + + memset (buf, 0, sizeof (glibtop_interface_names)); + + return NULL; +} diff --git a/sysdeps/stub_suid/loadavg.c b/sysdeps/stub_suid/loadavg.c index 63fc9fd9..10a3ae1b 100644 --- a/sysdeps/stub_suid/loadavg.c +++ b/sysdeps/stub_suid/loadavg.c @@ -35,6 +35,8 @@ int glibtop_init_loadavg_p (glibtop *server) { server->sysdeps.loadavg = _glibtop_sysdeps_loadavg; + + return 0; } /* Provides load averange. */ @@ -45,4 +47,6 @@ glibtop_get_loadavg_p (glibtop *server, glibtop_loadavg *buf) glibtop_init_p (server, GLIBTOP_SYSDEPS_LOADAVG, 0); memset (buf, 0, sizeof (glibtop_loadavg)); + + return 0; } diff --git a/sysdeps/stub_suid/mem.c b/sysdeps/stub_suid/mem.c index d5a86e61..33a467c3 100644 --- a/sysdeps/stub_suid/mem.c +++ b/sysdeps/stub_suid/mem.c @@ -35,6 +35,8 @@ int glibtop_init_mem_p (glibtop *server) { server->sysdeps.mem = _glibtop_sysdeps_mem; + + return 0; } /* Provides information about memory usage. */ @@ -45,4 +47,6 @@ glibtop_get_mem_p (glibtop *server, glibtop_mem *buf) glibtop_init_p (server, GLIBTOP_SYSDEPS_MEM, 0); memset (buf, 0, sizeof (glibtop_mem)); + + return 0; } diff --git a/sysdeps/stub_suid/msg_limits.c b/sysdeps/stub_suid/msg_limits.c index 01f9298f..88f79ddb 100644 --- a/sysdeps/stub_suid/msg_limits.c +++ b/sysdeps/stub_suid/msg_limits.c @@ -35,6 +35,8 @@ int glibtop_init_msg_limits_p (glibtop *server) { server->sysdeps.msg_limits = _glibtop_sysdeps_msg_limits; + + return 0; } /* Provides information about sysv ipc limits. */ @@ -45,4 +47,6 @@ glibtop_get_msg_limits_p (glibtop *server, glibtop_msg_limits *buf) glibtop_init_p (server, GLIBTOP_SYSDEPS_MSG_LIMITS, 0); memset (buf, 0, sizeof (glibtop_msg_limits)); + + return 0; } diff --git a/sysdeps/stub_suid/netload.c b/sysdeps/stub_suid/netload.c index 573066be..ad3a9917 100644 --- a/sysdeps/stub_suid/netload.c +++ b/sysdeps/stub_suid/netload.c @@ -33,6 +33,8 @@ int glibtop_init_netload_p (glibtop *server) { server->sysdeps.netload = _glibtop_sysdeps_netload; + + return 0; } /* Provides Network statistics. */ @@ -42,4 +44,6 @@ glibtop_get_netload_p (glibtop *server, glibtop_netload *buf, const char *interface) { memset (buf, 0, sizeof (glibtop_netload)); + + return 0; } diff --git a/sysdeps/stub_suid/nosuid.c b/sysdeps/stub_suid/nosuid.c index 9f6ce9cb..cd52852c 100644 --- a/sysdeps/stub_suid/nosuid.c +++ b/sysdeps/stub_suid/nosuid.c @@ -23,6 +23,7 @@ #include #include +#include void glibtop_open_s (glibtop *server, const char *program_name, diff --git a/sysdeps/stub_suid/ppp.c b/sysdeps/stub_suid/ppp.c index 41c38950..8c16ca2f 100644 --- a/sysdeps/stub_suid/ppp.c +++ b/sysdeps/stub_suid/ppp.c @@ -33,6 +33,8 @@ int glibtop_init_ppp_p (glibtop *server) { server->sysdeps.ppp = _glibtop_sysdeps_ppp; + + return 0; } /* Provides PPP/ISDN information. */ @@ -41,4 +43,6 @@ int glibtop_get_ppp_p (glibtop *server, glibtop_ppp *buf, unsigned short device) { memset (buf, 0, sizeof (glibtop_ppp)); + + return 0; } diff --git a/sysdeps/stub_suid/procargs.c b/sysdeps/stub_suid/procargs.c index 5576c556..b7427704 100644 --- a/sysdeps/stub_suid/procargs.c +++ b/sysdeps/stub_suid/procargs.c @@ -34,6 +34,8 @@ int glibtop_init_proc_args_p (glibtop *server) { server->sysdeps.proc_args = _glibtop_sysdeps_proc_args; + + return 0; } /* Provides detailed information about a process. */ diff --git a/sysdeps/stub_suid/prockernel.c b/sysdeps/stub_suid/prockernel.c index 6f81f537..97ba58cb 100644 --- a/sysdeps/stub_suid/prockernel.c +++ b/sysdeps/stub_suid/prockernel.c @@ -35,6 +35,8 @@ int glibtop_init_proc_kernel_p (glibtop *server) { server->sysdeps.proc_kernel = _glibtop_sysdeps_proc_kernel; + + return 0; } /* Provides detailed information about a process. */ @@ -46,4 +48,6 @@ glibtop_get_proc_kernel_p (glibtop *server, glibtop_proc_kernel *buf, glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_KERNEL, 0); memset (buf, 0, sizeof (glibtop_proc_kernel)); + + return 0; } diff --git a/sysdeps/stub_suid/proclist.c b/sysdeps/stub_suid/proclist.c index a17b77c8..e1cf2472 100644 --- a/sysdeps/stub_suid/proclist.c +++ b/sysdeps/stub_suid/proclist.c @@ -35,6 +35,8 @@ int glibtop_init_proclist_p (glibtop *server) { server->sysdeps.proclist = _glibtop_sysdeps_proclist; + + return 0; } unsigned * diff --git a/sysdeps/stub_suid/procmap.c b/sysdeps/stub_suid/procmap.c index a6a0c498..167a4038 100644 --- a/sysdeps/stub_suid/procmap.c +++ b/sysdeps/stub_suid/procmap.c @@ -34,6 +34,8 @@ int glibtop_init_proc_map_p (glibtop *server) { server->sysdeps.proc_map = _glibtop_sysdeps_proc_map; + + return 0; } /* Provides detailed information about a process. */ diff --git a/sysdeps/stub_suid/procmem.c b/sysdeps/stub_suid/procmem.c index caded400..1798b706 100644 --- a/sysdeps/stub_suid/procmem.c +++ b/sysdeps/stub_suid/procmem.c @@ -35,6 +35,8 @@ int glibtop_init_proc_mem_p (glibtop *server) { server->sysdeps.proc_mem = _glibtop_sysdeps_proc_mem; + + return 0; } /* Provides detailed information about a process. */ @@ -46,4 +48,6 @@ glibtop_get_proc_mem_p (glibtop *server, glibtop_proc_mem *buf, glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_MEM, 0); memset (buf, 0, sizeof (glibtop_proc_mem)); + + return 0; } diff --git a/sysdeps/stub_suid/procsegment.c b/sysdeps/stub_suid/procsegment.c index a4205a7a..4af7926a 100644 --- a/sysdeps/stub_suid/procsegment.c +++ b/sysdeps/stub_suid/procsegment.c @@ -35,6 +35,8 @@ int glibtop_init_proc_segment_p (glibtop *server) { server->sysdeps.proc_segment = _glibtop_sysdeps_proc_segment; + + return 0; } /* Provides detailed information about a process. */ @@ -46,4 +48,6 @@ glibtop_get_proc_segment_p (glibtop *server, glibtop_proc_segment *buf, glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SEGMENT, 0); memset (buf, 0, sizeof (glibtop_proc_segment)); + + return 0; } diff --git a/sysdeps/stub_suid/procsignal.c b/sysdeps/stub_suid/procsignal.c index ff3fae67..41bdb3e9 100644 --- a/sysdeps/stub_suid/procsignal.c +++ b/sysdeps/stub_suid/procsignal.c @@ -35,6 +35,8 @@ int glibtop_init_proc_signal_p (glibtop *server) { server->sysdeps.proc_signal = _glibtop_sysdeps_proc_signal; + + return 0; } /* Provides detailed information about a process. */ @@ -46,4 +48,6 @@ glibtop_get_proc_signal_p (glibtop *server, glibtop_proc_signal *buf, glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_SIGNAL, 0); memset (buf, 0, sizeof (glibtop_proc_signal)); + + return 0; } diff --git a/sysdeps/stub_suid/procstate.c b/sysdeps/stub_suid/procstate.c index 5f3536da..c6099b05 100644 --- a/sysdeps/stub_suid/procstate.c +++ b/sysdeps/stub_suid/procstate.c @@ -35,6 +35,8 @@ int glibtop_init_proc_state_p (glibtop *server) { server->sysdeps.proc_state = _glibtop_sysdeps_proc_state; + + return 0; } /* Provides detailed information about a process. */ @@ -46,4 +48,6 @@ glibtop_get_proc_state_p (glibtop *server, glibtop_proc_state *buf, glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_STATE, 0); memset (buf, 0, sizeof (glibtop_proc_state)); + + return 0; } diff --git a/sysdeps/stub_suid/proctime.c b/sysdeps/stub_suid/proctime.c index e73b4202..26a544a2 100644 --- a/sysdeps/stub_suid/proctime.c +++ b/sysdeps/stub_suid/proctime.c @@ -35,6 +35,8 @@ int glibtop_init_proc_time_p (glibtop *server) { server->sysdeps.proc_time = _glibtop_sysdeps_proc_time; + + return 0; } /* Provides detailed information about a process. */ @@ -46,4 +48,6 @@ glibtop_get_proc_time_p (glibtop *server, glibtop_proc_time *buf, glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_TIME, 0); memset (buf, 0, sizeof (glibtop_proc_time)); + + return 0; } diff --git a/sysdeps/stub_suid/procuid.c b/sysdeps/stub_suid/procuid.c index b0cdd67f..e13f77cb 100644 --- a/sysdeps/stub_suid/procuid.c +++ b/sysdeps/stub_suid/procuid.c @@ -35,6 +35,8 @@ int glibtop_init_proc_uid_p (glibtop *server) { server->sysdeps.proc_uid = _glibtop_sysdeps_proc_uid; + + return 0; } /* Provides detailed information about a process. */ @@ -46,4 +48,6 @@ glibtop_get_proc_uid_p (glibtop *server, glibtop_proc_uid *buf, glibtop_init_p (server, GLIBTOP_SYSDEPS_PROC_UID, 0); memset (buf, 0, sizeof (glibtop_proc_uid)); + + return 0; } diff --git a/sysdeps/stub_suid/sem_limits.c b/sysdeps/stub_suid/sem_limits.c index 2a7d40e1..d4ca6ab9 100644 --- a/sysdeps/stub_suid/sem_limits.c +++ b/sysdeps/stub_suid/sem_limits.c @@ -35,6 +35,8 @@ int glibtop_init_sem_limits_p (glibtop *server) { server->sysdeps.sem_limits = _glibtop_sysdeps_sem_limits; + + return 0; } /* Provides information about sysv sem limits. */ @@ -45,4 +47,6 @@ glibtop_get_sem_limits_p (glibtop *server, glibtop_sem_limits *buf) glibtop_init_p (server, GLIBTOP_SYSDEPS_SEM_LIMITS, 0); memset (buf, 0, sizeof (glibtop_sem_limits)); + + return 0; } diff --git a/sysdeps/stub_suid/shm_limits.c b/sysdeps/stub_suid/shm_limits.c index 289b3e75..cfa05dde 100644 --- a/sysdeps/stub_suid/shm_limits.c +++ b/sysdeps/stub_suid/shm_limits.c @@ -35,6 +35,8 @@ int glibtop_init_shm_limits_p (glibtop *server) { server->sysdeps.shm_limits = _glibtop_sysdeps_shm_limits; + + return 0; } /* Provides information about sysv ipc limits. */ @@ -45,4 +47,6 @@ glibtop_get_shm_limits_p (glibtop *server, glibtop_shm_limits *buf) glibtop_init_p (server, GLIBTOP_SYSDEPS_SHM_LIMITS, 0); memset (buf, 0, sizeof (glibtop_shm_limits)); + + return 0; } diff --git a/sysdeps/stub_suid/swap.c b/sysdeps/stub_suid/swap.c index 5233cc5d..b7257572 100644 --- a/sysdeps/stub_suid/swap.c +++ b/sysdeps/stub_suid/swap.c @@ -35,6 +35,8 @@ int glibtop_init_swap_p (glibtop *server) { server->sysdeps.swap = _glibtop_sysdeps_swap; + + return 0; } /* Provides information about swap usage. */ @@ -45,4 +47,6 @@ glibtop_get_swap_p (glibtop *server, glibtop_swap *buf) glibtop_init_p (server, GLIBTOP_SYSDEPS_SWAP, 0); memset (buf, 0, sizeof (glibtop_swap)); + + return 0; } diff --git a/sysdeps/stub_suid/uptime.c b/sysdeps/stub_suid/uptime.c index 1067541f..dec522ee 100644 --- a/sysdeps/stub_suid/uptime.c +++ b/sysdeps/stub_suid/uptime.c @@ -35,6 +35,8 @@ int glibtop_init_uptime_p (glibtop *server) { server->sysdeps.uptime = _glibtop_sysdeps_uptime; + + return 0; } /* Provides uptime and idle time. */ @@ -45,4 +47,6 @@ glibtop_get_uptime_p (glibtop *server, glibtop_uptime *buf) glibtop_init_p (server, GLIBTOP_SYSDEPS_UPTIME, 0); memset (buf, 0, sizeof (glibtop_uptime)); + + return 0; }