Implement GLIBTOP_CMND_INTERFACE_NAMES.

This commit is contained in:
Martin Baulig
1999-11-21 18:46:36 +00:00
parent ac83dcc3b3
commit f8e6fb5674
2 changed files with 39 additions and 0 deletions

View File

@@ -31,6 +31,10 @@ handle_slave_connection (int input, int output)
const void *ptr G_GNUC_UNUSED;
int ret G_GNUC_UNUSED = -1;
u_int64_t interface G_GNUC_UNUSED;
u_int64_t number G_GNUC_UNUSED;
u_int64_t strategy G_GNUC_UNUSED;
unsigned short max_len G_GNUC_UNUSED;
pid_t pid G_GNUC_UNUSED;
@@ -108,6 +112,22 @@ handle_slave_connection (int input, int output)
ptr, (ptr != NULL) ? 0 : -1);
glibtop_free_r (server, ptr);
break;
#endif
#if GLIBTOP_SUID_INTERFACE_NAMES
case GLIBTOP_CMND_INTERFACE_NAMES:
memcpy (&interface, parameter, sizeof (u_int64_t));
memcpy (&number, parameter + sizeof (u_int64_t),
sizeof (u_int64_t));
memcpy (&strategy, parameter + 2 * sizeof (u_int64_t),
sizeof (u_int64_t));
ptr = glibtop_get_proc_args_p
(server, &resp->u.data.interface_names,
interface, number, strategy);
do_output (output, resp, _offset_data (interface_names),
ptr ? resp->u.data.interface_names.size+1 : 0,
ptr, (ptr != NULL) ? 0 : -1);
glibtop_free_r (server, ptr);
break;
#endif
default:
ret = handle_slave_command (cmnd, resp, parameter);