Added `instance' argument.
1999-11-28 Martin Baulig <martin@home-of-linux.org> * include/glibtop/interfaces.h (glibtop_get_interface_names): Added `instance' argument.
This commit is contained in:
committed by
Martin Baulig
parent
776b6965fb
commit
53f9d03e30
@@ -1,3 +1,8 @@
|
|||||||
|
1999-11-28 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
|
* include/glibtop/interfaces.h (glibtop_get_interface_names):
|
||||||
|
Added `instance' argument.
|
||||||
|
|
||||||
1999-11-28 Martin Baulig <martin@home-of-linux.org>
|
1999-11-28 Martin Baulig <martin@home-of-linux.org>
|
||||||
|
|
||||||
* lib/lib.pl: We now have a new, more extensible client/server
|
* lib/lib.pl: We now have a new, more extensible client/server
|
||||||
|
@@ -19,5 +19,5 @@ 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)
|
||||||
retval|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string(mount_dir)
|
retval|@fsusage|ulong(blocks,bfree,bavail,files,ffree)|string(mount_dir)
|
||||||
retval|netload|ulong(if_flags,mtu,subnet,address,packets_in,packets_out,packets_total,bytes_in,bytes_out,bytes_total,errors_in,errors_out,errors_total,collisions)|string(interface)
|
retval|netload|ulong(if_flags,mtu,subnet,address,packets_in,packets_out,packets_total,bytes_in,bytes_out,bytes_total,errors_in,errors_out,errors_total,collisions)|string(interface)
|
||||||
char *|interface_names|ulong(size)|unsigned(interface,number,strategy)
|
char *|interface_names|ulong(size)|unsigned(interface,number,instance,strategy)
|
||||||
retval|ppp|ulong(state,bytes_in,bytes_out)|ushort(device)
|
retval|ppp|ulong(state,bytes_in,bytes_out)|ushort(device)
|
||||||
|
@@ -38,21 +38,45 @@ BEGIN_LIBGTOP_DECLS
|
|||||||
|
|
||||||
typedef struct _glibtop_interface_names glibtop_interface_names;
|
typedef struct _glibtop_interface_names glibtop_interface_names;
|
||||||
|
|
||||||
typedef enum _glibtop_protocol glibtop_protocol;
|
|
||||||
typedef enum _glibtop_interface glibtop_interface;
|
typedef enum _glibtop_interface glibtop_interface;
|
||||||
|
typedef enum _glibtop_transport glibtop_transport;
|
||||||
|
typedef enum _glibtop_protocol glibtop_protocol;
|
||||||
|
|
||||||
enum _glibtop_protocol {
|
enum _glibtop_protocol {
|
||||||
GLIBTOP_NETLOAD_DEFAULT = 0,
|
GLIBTOP_NETLOAD_DEFAULT = 0,
|
||||||
GLIBTOP_NETLOAD_IPV4,
|
GLIBTOP_NETLOAD_ICMP,
|
||||||
GLIBTOP_NETLOAD_IPV6,
|
GLIBTOP_NETLOAD_TCP,
|
||||||
GLIBTOP_NETLOAD_IPX,
|
GLIBTOP_NETLOAD_UDP,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum _glibtop_transport {
|
||||||
|
GLIBTOP_TRANSPORT_DEFAULT = 0,
|
||||||
|
GLIBTOP_TRANSPORT_OTHER,
|
||||||
|
GLIBTOP_TRANSPORT_IPV4,
|
||||||
|
GLIBTOP_TRANSPORT_IPV6,
|
||||||
|
GLIBTOP_TRANSPORT_IPX,
|
||||||
|
GLIBTOP_TRANSPORT_X25,
|
||||||
|
GLIBTOP_TRANSPORT_DECNET,
|
||||||
|
GLIBTOP_TRANSPORT_APPLETALK,
|
||||||
|
GLIBTOP_TRANSPORT_NETBEUI,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum _glibtop_interface {
|
enum _glibtop_interface {
|
||||||
GLIBTOP_INTERFACE_ALL = 0,
|
GLIBTOP_INTERFACE_ALL = 0,
|
||||||
GLIBTOP_INTERFACE_ETHERNET,
|
GLIBTOP_INTERFACE_OTHER,
|
||||||
GLIBTOP_INTERFACE_LOOPBACK,
|
/* Network interfaces */
|
||||||
|
GLIBTOP_INTERFACE_ETHERNET = 101,
|
||||||
|
GLIBTOP_INTERFACE_FDDI,
|
||||||
|
GLIBTOP_INTERFACE_FRAME_RELAY,
|
||||||
|
GLIBTOP_INTERFACE_TOKEN_RING,
|
||||||
|
GLIBTOP_INTERFACE_ARCNET,
|
||||||
|
GLIBTOP_INTERFACE_ATM,
|
||||||
|
/* Dummy interfaces */
|
||||||
|
GLIBTOP_INTERFACE_LOOPBACK = 501,
|
||||||
GLIBTOP_INTERFACE_DUMMY,
|
GLIBTOP_INTERFACE_DUMMY,
|
||||||
|
/* Dialup interfaces */
|
||||||
|
GLIBTOP_INTERFACE_PARA = 801,
|
||||||
|
GLIBTOP_INTERFACE_SLIP,
|
||||||
GLIBTOP_INTERFACE_PPP,
|
GLIBTOP_INTERFACE_PPP,
|
||||||
GLIBTOP_INTERFACE_ISDN
|
GLIBTOP_INTERFACE_ISDN
|
||||||
};
|
};
|
||||||
@@ -69,7 +93,7 @@ struct _glibtop_interface_names
|
|||||||
size; /* GLIBTOP_INTERFACES_SIZE */
|
size; /* GLIBTOP_INTERFACES_SIZE */
|
||||||
};
|
};
|
||||||
|
|
||||||
#define glibtop_get_interface_names(buf, interface,number,strategy) glibtop_get_interface_names_l(glibtop_global_server, buf, interface, number, strategy)
|
#define glibtop_get_interface_names(buf,interface,number,instance,strategy) glibtop_get_interface_names_l (glibtop_global_server, buf, interface, number, instance, strategy)
|
||||||
|
|
||||||
#if GLIBTOP_SUID_INTERFACE_NAMES
|
#if GLIBTOP_SUID_INTERFACE_NAMES
|
||||||
#define glibtop_get_interface_names_r glibtop_get_interface_names_p
|
#define glibtop_get_interface_names_r glibtop_get_interface_names_p
|
||||||
@@ -77,14 +101,14 @@ struct _glibtop_interface_names
|
|||||||
#define glibtop_get_interface_names_r glibtop_get_interface_names_s
|
#define glibtop_get_interface_names_r glibtop_get_interface_names_s
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
char *glibtop_get_interface_names_l (glibtop *server, glibtop_interface_names *buf, unsigned interface, unsigned number, unsigned strategy);
|
char *glibtop_get_interface_names_l (glibtop *server, glibtop_interface_names *buf, unsigned interface, unsigned number, unsigned instance, unsigned strategy);
|
||||||
|
|
||||||
#if GLIBTOP_SUID_INTERFACE_NAMES
|
#if GLIBTOP_SUID_INTERFACE_NAMES
|
||||||
int glibtop_init_interface_names_p (glibtop *server);
|
int glibtop_init_interface_names_p (glibtop *server);
|
||||||
char *glibtop_get_interface_names_p (glibtop *server, glibtop_interface_names *buf, unsigned interface, unsigned number, unsigned strategy);
|
char *glibtop_get_interface_names_p (glibtop *server, glibtop_interface_names *buf, unsigned interface, unsigned number, unsigned instance, unsigned strategy);
|
||||||
#else
|
#else
|
||||||
int glibtop_init_interface_names_s (glibtop *server);
|
int glibtop_init_interface_names_s (glibtop *server);
|
||||||
char *glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf, unsigned interface, unsigned number, unsigned strategy);
|
char *glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf, unsigned interface, unsigned number, unsigned instance, unsigned strategy);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef GLIBTOP_NAMES
|
#ifdef GLIBTOP_NAMES
|
||||||
|
@@ -48,6 +48,7 @@ handle_parent_connection (int s)
|
|||||||
|
|
||||||
u_int64_t interface G_GNUC_UNUSED;
|
u_int64_t interface G_GNUC_UNUSED;
|
||||||
u_int64_t number G_GNUC_UNUSED;
|
u_int64_t number G_GNUC_UNUSED;
|
||||||
|
u_int64_t instance G_GNUC_UNUSED;
|
||||||
u_int64_t strategy G_GNUC_UNUSED;
|
u_int64_t strategy G_GNUC_UNUSED;
|
||||||
|
|
||||||
glibtop_send_version (glibtop_global_server, s);
|
glibtop_send_version (glibtop_global_server, s);
|
||||||
@@ -240,11 +241,14 @@ handle_parent_connection (int s)
|
|||||||
memcpy (&interface, parameter, sizeof (u_int64_t));
|
memcpy (&interface, parameter, sizeof (u_int64_t));
|
||||||
memcpy (&number, parameter + sizeof (u_int64_t),
|
memcpy (&number, parameter + sizeof (u_int64_t),
|
||||||
sizeof (u_int64_t));
|
sizeof (u_int64_t));
|
||||||
memcpy (&strategy, parameter + 2 * sizeof (u_int64_t),
|
memcpy (&instance, parameter + 2 * sizeof (u_int64_t),
|
||||||
|
sizeof (u_int64_t));
|
||||||
|
memcpy (&strategy, parameter + 3 * sizeof (u_int64_t),
|
||||||
sizeof (u_int64_t));
|
sizeof (u_int64_t));
|
||||||
ptr = glibtop_get_interface_names_l (server,
|
ptr = glibtop_get_interface_names_l (server,
|
||||||
&resp->u.data.interface_names,
|
&resp->u.data.interface_names,
|
||||||
interface, number, strategy);
|
interface, number, instance,
|
||||||
|
strategy);
|
||||||
do_output (s, resp, _offset_data (interface_names),
|
do_output (s, resp, _offset_data (interface_names),
|
||||||
ptr ? resp->u.data.interface_names.size+1 : 0, ptr,
|
ptr ? resp->u.data.interface_names.size+1 : 0, ptr,
|
||||||
(ptr != NULL) ? 0 : -1);
|
(ptr != NULL) ? 0 : -1);
|
||||||
|
@@ -33,6 +33,7 @@ handle_slave_connection (int input, int output)
|
|||||||
|
|
||||||
u_int64_t interface G_GNUC_UNUSED;
|
u_int64_t interface G_GNUC_UNUSED;
|
||||||
u_int64_t number G_GNUC_UNUSED;
|
u_int64_t number G_GNUC_UNUSED;
|
||||||
|
u_int64_t instance G_GNUC_UNUSED;
|
||||||
u_int64_t strategy G_GNUC_UNUSED;
|
u_int64_t strategy G_GNUC_UNUSED;
|
||||||
|
|
||||||
unsigned short max_len G_GNUC_UNUSED;
|
unsigned short max_len G_GNUC_UNUSED;
|
||||||
@@ -118,11 +119,13 @@ handle_slave_connection (int input, int output)
|
|||||||
memcpy (&interface, parameter, sizeof (u_int64_t));
|
memcpy (&interface, parameter, sizeof (u_int64_t));
|
||||||
memcpy (&number, parameter + sizeof (u_int64_t),
|
memcpy (&number, parameter + sizeof (u_int64_t),
|
||||||
sizeof (u_int64_t));
|
sizeof (u_int64_t));
|
||||||
memcpy (&strategy, parameter + 2 * sizeof (u_int64_t),
|
memcpy (&instance, parameter + 2 * sizeof (u_int64_t),
|
||||||
|
sizeof (u_int64_t));
|
||||||
|
memcpy (&strategy, parameter + 3 * sizeof (u_int64_t),
|
||||||
sizeof (u_int64_t));
|
sizeof (u_int64_t));
|
||||||
ptr = glibtop_get_proc_args_p
|
ptr = glibtop_get_proc_args_p
|
||||||
(server, &resp->u.data.interface_names,
|
(server, &resp->u.data.interface_names,
|
||||||
interface, number, strategy);
|
interface, number, instance, strategy);
|
||||||
do_output (output, resp, _offset_data (interface_names),
|
do_output (output, resp, _offset_data (interface_names),
|
||||||
ptr ? resp->u.data.interface_names.size+1 : 0,
|
ptr ? resp->u.data.interface_names.size+1 : 0,
|
||||||
ptr, (ptr != NULL) ? 0 : -1);
|
ptr, (ptr != NULL) ? 0 : -1);
|
||||||
|
@@ -44,7 +44,7 @@ glibtop_init_interface_names_p (glibtop *server)
|
|||||||
char *
|
char *
|
||||||
glibtop_get_interface_names_p (glibtop *server, glibtop_interface_names *buf,
|
glibtop_get_interface_names_p (glibtop *server, glibtop_interface_names *buf,
|
||||||
unsigned interface, unsigned number,
|
unsigned interface, unsigned number,
|
||||||
unsigned strategy)
|
unsigned instance, unsigned strategy)
|
||||||
{
|
{
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ glibtop_init_interface_names_s (glibtop *server)
|
|||||||
char *
|
char *
|
||||||
glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf,
|
glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf,
|
||||||
unsigned interface, unsigned number,
|
unsigned interface, unsigned number,
|
||||||
unsigned strategy)
|
unsigned instance, unsigned strategy)
|
||||||
{
|
{
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ glibtop_init_interface_names_s (glibtop *server)
|
|||||||
char *
|
char *
|
||||||
glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf,
|
glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf,
|
||||||
unsigned interface, unsigned number,
|
unsigned interface, unsigned number,
|
||||||
unsigned strategy)
|
unsigned instance, unsigned strategy)
|
||||||
{
|
{
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ glibtop_init_interface_names_s (glibtop *server)
|
|||||||
char *
|
char *
|
||||||
glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf,
|
glibtop_get_interface_names_s (glibtop *server, glibtop_interface_names *buf,
|
||||||
unsigned interface, unsigned number,
|
unsigned interface, unsigned number,
|
||||||
unsigned strategy)
|
unsigned instance, unsigned strategy)
|
||||||
{
|
{
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
||||||
|
|
||||||
|
@@ -44,7 +44,7 @@ glibtop_init_interface_names_p (glibtop *server)
|
|||||||
char *
|
char *
|
||||||
glibtop_get_interface_names_p (glibtop *server, glibtop_interface_names *buf,
|
glibtop_get_interface_names_p (glibtop *server, glibtop_interface_names *buf,
|
||||||
unsigned interface, unsigned number,
|
unsigned interface, unsigned number,
|
||||||
unsigned strategy)
|
unsigned instance, unsigned strategy)
|
||||||
{
|
{
|
||||||
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
glibtop_init_s (&server, GLIBTOP_SYSDEPS_INTERFACE_NAMES, 0);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user