1 /* Copyright (C) 1998-99 Martin Baulig 2 This file is part of LibGTop 1.0. 3 4 Contributed by Martin Baulig <martin@home-of-linux.org>, April 1998. 5 6 LibGTop is free software; you can redistribute it and/or modify it 7 under the terms of the GNU General Public License as published by 8 the Free Software Foundation; either version 2 of the License, 9 or (at your option) any later version. 10 11 LibGTop is distributed in the hope that it will be useful, but WITHOUT 12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14 for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with LibGTop; see the file COPYING. If not, write to the 18 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 19 Boston, MA 02110-1301, USA. 20 */ 21 22 #ifndef __GLIBTOP_COMMAND_H__ 23 #define __GLIBTOP_COMMAND_H__ 24 25 #include <glibtop.h> 26 #include <glibtop/sysdeps.h> 27 #include <glibtop/union.h> 28 29 G_BEGIN_DECLS 30 31 #define GLIBTOP_CMND_QUIT 0 32 #define GLIBTOP_CMND_SYSDEPS 1 33 34 #define GLIBTOP_CMND_CPU 2 35 #define GLIBTOP_CMND_MEM 3 36 #define GLIBTOP_CMND_SWAP 4 37 #define GLIBTOP_CMND_UPTIME 5 38 #define GLIBTOP_CMND_LOADAVG 6 39 #define GLIBTOP_CMND_SHM_LIMITS 7 40 #define GLIBTOP_CMND_MSG_LIMITS 8 41 #define GLIBTOP_CMND_SEM_LIMITS 9 42 #define GLIBTOP_CMND_PROCLIST 10 43 44 #define GLIBTOP_CMND_PROC_STATE 11 45 #define GLIBTOP_CMND_PROC_UID 12 46 #define GLIBTOP_CMND_PROC_MEM 13 47 #define GLIBTOP_CMND_PROC_TIME 14 48 #define GLIBTOP_CMND_PROC_SIGNAL 15 49 #define GLIBTOP_CMND_PROC_KERNEL 16 50 #define GLIBTOP_CMND_PROC_SEGMENT 17 51 #define GLIBTOP_CMND_PROC_ARGS 18 52 #define GLIBTOP_CMND_PROC_MAP 19 53 54 #define GLIBTOP_CMND_MOUNTLIST 20 55 #define GLIBTOP_CMND_FSUSAGE 21 56 #define GLIBTOP_CMND_NETLOAD 22 57 #define GLIBTOP_CMND_PPP 23 58 #define GLIBTOP_CMND_NETLIST 24 59 #define GLIBTOP_CMND_PROC_OPEN_FILES 25 60 #define GLIBTOP_CMND_PROC_WD 26 61 #define GLIBTOP_CMND_PROC_AFFINITY 27 62 #define GLIBTOP_CMND_PROC_IO 28 63 64 #define GLIBTOP_MAX_CMND 29 65 66 #define _GLIBTOP_PARAM_SIZE 16 67 68 typedef struct _glibtop_command glibtop_command; 69 70 typedef struct _glibtop_response glibtop_response; 71 typedef union _glibtop_response_union glibtop_response_union; 72 73 struct _glibtop_command 74 { 75 guint64 command; 76 guint64 size, data_size; 77 char parameter [_GLIBTOP_PARAM_SIZE]; 78 }; 79 80 union _glibtop_response_union 81 { 82 glibtop_union data; 83 glibtop_sysdeps sysdeps; 84 }; 85 86 struct _glibtop_response 87 { 88 gint64 offset; 89 guint64 size, data_size; 90 glibtop_response_union u; 91 }; 92 93 #define glibtop_call(p1, p2, p3, p4) glibtop_call_r(glibtop_global_server, p1, p2, p3, p4) 94 95 void * 96 glibtop_call_l (glibtop *server, unsigned command, size_t send_size, 97 const void *send_buf, size_t recv_size, void *recv_buf); 98 99 void * 100 glibtop_call_s (glibtop *server, unsigned command, size_t send_size, 101 const void *send_buf, size_t recv_size, void *recv_buf); 102 103 G_END_DECLS 104 105 #endif 106