fixed problems with IPSO build
[public/netxms.git] / src / agent / subagents / ipso / ipso.h
1 /*
2 ** NetXMS subagent for IPSO
3 ** Copyright (C) 2006 Alex Kirhenshtein
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 **
19 **/
20
21 #ifndef __IPSO_H__
22 #define __IPSO_H__
23
24 #include <nms_common.h>
25 #include <nms_util.h>
26 #include <nms_agent.h>
27
28
29 //
30 // IPSO system functions and structures
31 //
32
33 struct ipsctl_value
34 {
35 WORD wSize;
36 WORD wType;
37 union
38 {
39 LONG nInt;
40 DWORD dwUInt;
41 INT64 nInt64;
42 QWORD qwUInt64;
43 char szStr[1];
44 struct
45 {
46 DWORD dwAddr;
47 BYTE nMaskBits;
48 } ipAddr;
49 } data;
50 };
51
52 #ifdef __cplusplus
53 extern "C" {
54 #endif
55
56 int ipsctl_open(void);
57 int ipsctl_close(int nHandle);
58 int ipsctl_get(int nHandle, char *pszName, struct ipsctl_value **ppData);
59 int ipsctl_iterate(int nHandle, char *pszRoot,
60 void (* pfCallback)(char *, void *), void *pArg);
61
62 char *if_indextoname(unsigned int ifindex, char *ifname);
63 unsigned int if_nametoindex(char *ifname);
64
65 #ifdef __cplusplus
66 }
67 #endif
68
69
70 //
71 // Wrappers for ipsctl_get()
72 //
73
74 LONG IPSCTLGetInt(int nCallerHandle, char *pszName, LONG *pnValue);
75 LONG IPSCTLGetString(int nCallerHandle, char *pszName,
76 char *pszValue, int nSize);
77
78
79 //
80 // File system stats
81 //
82
83 enum
84 {
85 DISK_AVAIL,
86 DISK_AVAIL_PERC,
87 DISK_FREE,
88 DISK_FREE_PERC,
89 DISK_USED,
90 DISK_USED_PERC,
91 DISK_TOTAL,
92 };
93
94
95 //
96 // Memory stats
97 //
98
99 enum
100 {
101 PHYSICAL_FREE,
102 PHYSICAL_USED,
103 PHYSICAL_TOTAL,
104 SWAP_FREE,
105 SWAP_USED,
106 SWAP_TOTAL,
107 VIRTUAL_FREE,
108 VIRTUAL_USED,
109 VIRTUAL_TOTAL,
110 };
111
112
113 //
114 // Network interface stats
115 //
116
117 enum
118 {
119 NET_IF_DESCRIPTION,
120 NET_IF_LINK,
121 NET_IF_ADMIN_STATUS,
122 NET_IF_BYTES_IN,
123 NET_IF_BYTES_OUT,
124 NET_IF_PACKETS_IN,
125 NET_IF_PACKETS_OUT
126 };
127
128
129 //
130 // Handlers
131 //
132
133 LONG H_DiskInfo(char *, char *, char *);
134 LONG H_ProcessList(char *, char *, StringList *);
135 LONG H_Uptime(char *, char *, char *);
136 LONG H_Uname(char *, char *, char *);
137 LONG H_Hostname(char *, char *, char *);
138 LONG H_CpuCount(char *, char *, char *);
139 LONG H_CpuLoad(char *, char *, char *);
140 LONG H_CpuUsage(char *, char *, char *);
141 LONG H_ProcessCount(char *, char *, char *);
142 LONG H_MemoryInfo(char *, char *, char *);
143 LONG H_NetIpForwarding(char *, char *, char *);
144 LONG H_NetIfStats(char *, char *, char *);
145 LONG H_NetArpCache(char *, char *, StringList *);
146 LONG H_NetIfList(char *, char *, StringList *);
147 LONG H_NetRoutingTable(char *, char *, StringList *);
148
149 #endif /* __IPSO_H__ */