From e9c8125828282e7a944c7fadb80a600c7dee4b62 Mon Sep 17 00:00:00 2001 From: Martin Baulig Date: Mon, 24 Jan 2000 01:38:23 +0000 Subject: [PATCH] Removed. 2000-01-24 Martin Baulig * interfaces.c, netinfo.c: Removed. --- sysdeps/kernel/ChangeLog | 4 + sysdeps/kernel/Makefile.am | 3 +- sysdeps/kernel/glibtop_server.h | 4 +- sysdeps/kernel/interfaces.c | 58 ------------ sysdeps/kernel/netinfo.c | 152 -------------------------------- 5 files changed, 7 insertions(+), 214 deletions(-) delete mode 100644 sysdeps/kernel/interfaces.c delete mode 100644 sysdeps/kernel/netinfo.c diff --git a/sysdeps/kernel/ChangeLog b/sysdeps/kernel/ChangeLog index 04fdd990..d4cd40de 100644 --- a/sysdeps/kernel/ChangeLog +++ b/sysdeps/kernel/ChangeLog @@ -1,3 +1,7 @@ +2000-01-24 Martin Baulig + + * interfaces.c, netinfo.c: Removed. + 2000-01-23 Martin Baulig This is now a LibGTop backend which can be loaded additionally diff --git a/sysdeps/kernel/Makefile.am b/sysdeps/kernel/Makefile.am index 216f342b..147c268c 100644 --- a/sysdeps/kernel/Makefile.am +++ b/sysdeps/kernel/Makefile.am @@ -18,8 +18,7 @@ libgtop_backend_kernel_la_SOURCES = \ proclist.c procstate.c procuid.c \ proctime.c procmem.c procsignal.c prockernel.c \ procsegment.c procargs.c procmap.c netload.c \ - netinfo.c interfaces.c procdata.c \ - backend-kernel.c marshal.c + procdata.c backend-kernel.c marshal.c libgtop_backend_kernel_la_LDFLAGS = \ $(LT_VERSION_INFO) diff --git a/sysdeps/kernel/glibtop_server.h b/sysdeps/kernel/glibtop_server.h index 6165e63a..c9edc1ed 100644 --- a/sysdeps/kernel/glibtop_server.h +++ b/sysdeps/kernel/glibtop_server.h @@ -47,8 +47,8 @@ BEGIN_LIBGTOP_DECLS #define GLIBTOP_IMPL_PROC_ARGS (1 << GLIBTOP_SYSDEPS_PROC_ARGS) #define GLIBTOP_IMPL_PROC_MAP (1 << GLIBTOP_SYSDEPS_PROC_MAP) #define GLIBTOP_IMPL_NETLOAD (1 << GLIBTOP_SYSDEPS_NETLOAD) -#define GLIBTOP_IMPL_NETINFO (1 << GLIBTOP_SYSDEPS_NETINFO) -#define GLIBTOP_IMPL_INTERFACE_NAMES (1 << GLIBTOP_SYSDEPS_INTERFACE_NAMES) +#define GLIBTOP_IMPL_NETINFO 0 +#define GLIBTOP_IMPL_INTERFACE_NAMES 0 #define GLIBTOP_IMPL_PPP 0 END_LIBGTOP_DECLS diff --git a/sysdeps/kernel/interfaces.c b/sysdeps/kernel/interfaces.c deleted file mode 100644 index b29a502e..00000000 --- a/sysdeps/kernel/interfaces.c +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig , 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 - -#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_k (glibtop *server) -{ - server->sysdeps.interface_names = _glibtop_sysdeps_interface_names; - - return 0; -} - -/* Provides network statistics. */ - -glibtop_interface * -glibtop_get_interface_names_k (glibtop *server, glibtop_interface_names *buf, - u_int64_t interface, u_int64_t number, - u_int64_t instance, u_int64_t strategy) -{ - glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0); - - memset (buf, 0, sizeof (glibtop_interface_names)); - - return NULL; -} diff --git a/sysdeps/kernel/netinfo.c b/sysdeps/kernel/netinfo.c deleted file mode 100644 index 353d6063..00000000 --- a/sysdeps/kernel/netinfo.c +++ /dev/null @@ -1,152 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 4 -*- */ - -/* $Id$ */ - -/* Copyright (C) 1998-99 Martin Baulig - This file is part of LibGTop 1.0. - - Contributed by Martin Baulig , 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 - -#include - -#include -#include - -#include -#include -#include - -#if !defined (_LIBC) && defined (__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1 -/* GNU LibC */ -#include -#include -#include -#include -#include -#include -#include -#else /* Libc 5 */ -#include -#include -#include -#include -#include -#include -#endif - -static const unsigned long _glibtop_sysdeps_netinfo = -(1L << GLIBTOP_NETINFO_IF_FLAGS) + -(1L << GLIBTOP_NETINFO_ADDRESS) + -(1L << GLIBTOP_NETINFO_SUBNET) + -(1L << GLIBTOP_NETINFO_MTU); - -/* Init function. */ - -int -glibtop_init_netinfo_k (glibtop *server) -{ - server->sysdeps.netinfo = _glibtop_sysdeps_netinfo; - - return 0; -} - -/* Provides network statistics. */ - -int -glibtop_get_netinfo_k (glibtop *server, glibtop_netinfo *buf, - const char *interface, unsigned transport) -{ - int skfd; - - memset (buf, 0, sizeof (glibtop_netinfo)); - - skfd = socket (AF_INET, SOCK_DGRAM, 0); - - if (skfd) { - struct ifreq ifr; - unsigned flags; - - strcpy (ifr.ifr_name, interface); - if (!ioctl (skfd, SIOCGIFFLAGS, &ifr)) { - buf->flags |= (1L << GLIBTOP_NETINFO_IF_FLAGS); - flags = ifr.ifr_flags; - } else - flags = 0; - - if (flags & IFF_UP) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_UP); - - if (flags & IFF_BROADCAST) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_BROADCAST); - - if (flags & IFF_DEBUG) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_DEBUG); - - if (flags & IFF_LOOPBACK) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_LOOPBACK); - - if (flags & IFF_POINTOPOINT) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_POINTOPOINT); - - if (flags & IFF_RUNNING) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_RUNNING); - - if (flags & IFF_NOARP) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_NOARP); - - if (flags & IFF_PROMISC) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_PROMISC); - - if (flags & IFF_ALLMULTI) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_ALLMULTI); - - if (flags & IFF_MULTICAST) - buf->if_flags |= (1L << GLIBTOP_IF_FLAGS_MULTICAST); - - strcpy (ifr.ifr_name, interface); - if (!ioctl (skfd, SIOCGIFADDR, &ifr)) { - struct sockaddr_in addr = - *(struct sockaddr_in *) &ifr.ifr_addr; - buf->address = addr.sin_addr.s_addr; - buf->flags |= (1L << GLIBTOP_NETINFO_ADDRESS); - } - - strcpy (ifr.ifr_name, interface); - if (!ioctl (skfd, SIOCGIFNETMASK, &ifr)) { - struct sockaddr_in addr = - *(struct sockaddr_in *) &ifr.ifr_addr; - buf->subnet = addr.sin_addr.s_addr; - buf->flags |= (1L << GLIBTOP_NETINFO_SUBNET); - } - - strcpy (ifr.ifr_name, interface); - if (!ioctl (skfd, SIOCGIFMTU, &ifr)) { - buf->mtu = ifr.ifr_mtu; - buf->flags |= (1L << GLIBTOP_NETINFO_MTU); - } - - close (skfd); - } - - return 0; -}