char szArg[512] = {0};
struct statfs s;
- NxGetParameterArg(pszParam, 1, szArg, sizeof(szArg));
+ AgentGetParameterArg(pszParam, 1, szArg, sizeof(szArg));
if (szArg[0] != 0 && statfs(szArg, &s) == 0)
{
{
char szName[256];
- if (!NxGetParameterArg(pszParam, 1, szName, 256))
+ if (!AgentGetParameterArg(pszParam, 1, szName, 256))
return SYSINFO_RC_UNSUPPORTED;
return IPSCTLGetString(0, szName, pValue, MAX_RESULT_LENGTH);
//
LONG H_DiskInfo(char *, char *, char *);
-LONG H_ProcessList(char *, char *, NETXMS_VALUES_LIST *);
+LONG H_ProcessList(char *, char *, StringList *);
LONG H_Uptime(char *, char *, char *);
LONG H_Uname(char *, char *, char *);
LONG H_Hostname(char *, char *, char *);
LONG H_MemoryInfo(char *, char *, char *);
LONG H_NetIpForwarding(char *, char *, char *);
LONG H_NetIfStats(char *, char *, char *);
-LONG H_NetArpCache(char *, char *, NETXMS_VALUES_LIST *);
-LONG H_NetIfList(char *, char *, NETXMS_VALUES_LIST *);
-LONG H_NetRoutingTable(char *, char *, NETXMS_VALUES_LIST *);
+LONG H_NetArpCache(char *, char *, StringList *);
+LONG H_NetIfList(char *, char *, StringList *);
+LONG H_NetRoutingTable(char *, char *, StringList *);
#endif /* __IPSO_H__ */
typedef struct t_cbp
{
int nHandle;
- NETXMS_VALUES_LIST *pList;
+ StringList *pList;
} CBP;
"ifphys:%s:stats:opackets"
};
- if (!NxGetParameterArg(pszParam, 1, szName, sizeof(szName)))
+ if (!AgentGetParameterArg(pszParam, 1, szName, sizeof(szName)))
return SYSINFO_RC_UNSUPPORTED;
if (szName[0] != 0)
TranslateStr(szMacAddr, ":", "");
snprintf(szBuffer, 1024, "%s %s %d", szMacAddr, ptr,
if_nametoindex(szIfName) + 0x01000000);
- NxAddResultString(pArg->pList, szBuffer);
+ pArg->pList->add(szBuffer);
}
// Handler for Net.ArpCache enum
//
-LONG H_NetArpCache(char *pszParam, char *pArg, NETXMS_VALUES_LIST *pValue)
+LONG H_NetArpCache(char *pszParam, char *pArg, StringList *pValue)
{
LONG nRet = SYSINFO_RC_ERROR;
CBP data;
return nRet;
}
-LONG H_NetRoutingTable(char *pszParam, char *pArg, NETXMS_VALUES_LIST *pValue)
+LONG H_NetRoutingTable(char *pszParam, char *pArg, StringList *pValue)
{
#define sa2sin(x) ((struct sockaddr_in *)x)
#define ROUNDUP(a) \
(rtm->rtm_flags & RTF_GATEWAY) == 0 ? 3 : 4);
strcat(szOut, szTmp);
- NxAddResultString(pValue, szOut);
+ pValue->add(szOut);
}
}
// Handler for Net.InterfaceList enum
//
-LONG H_NetIfList(char *pszParam, char *pArg, NETXMS_VALUES_LIST *pValue)
+LONG H_NetIfList(char *pszParam, char *pArg, StringList *pValue)
{
int i, nSize, nHandle;
IFLIST ifList;
ifList.pData[i].szIpAddr, ifList.pData[i].nMask,
ifList.pData[i].nType, ifList.pData[i].szMacAddr,
ifList.pData[i].szName);
- NxAddResultString(pValue, szBuffer);
+ pValue->add(szBuffer);
}
}
ipsctl_close(nHandle);
double dLoad[3];
// get processor
- //NxGetParameterArg(pszParam, 1, szArg, sizeof(szArg));
+ //AgentGetParameterArg(pszParam, 1, szArg, sizeof(szArg));
if (getloadavg(dLoad, 3) == 3)
{
kvm_t *kd;
LONG nRet = SYSINFO_RC_ERROR;
- NxGetParameterArg(pszParam, 1, szArg, sizeof(szArg));
+ AgentGetParameterArg(pszParam, 1, szArg, sizeof(szArg));
kd = kvm_openfiles(NULL, NULL, NULL, O_RDONLY, NULL);
if (kd != NULL)
// Handler for System.ProcessList enum
//
-LONG H_ProcessList(char *pszParam, char *pArg, NETXMS_VALUES_LIST *pValue)
+LONG H_ProcessList(char *pszParam, char *pArg, StringList *pValue)
{
int i, nCount = -1;
char *kp;
snprintf(szBuff, sizeof(szBuff), "%d %s",
KP_PID(kp), KP_PNAME(kp));
- NxAddResultString(pValue, szBuff);
+ pValue->add(szBuff);
}
}
kvm_close(kd);
#define XML_USE_MSC_EXTENSIONS 1
#endif
+/* NetXMS node: we use this file only internally in case when Expat
+ is not available on target platform; thus we can use compiler's
+ default calling conventions whatever they are.
+ Leaving XMLCALL defined to __attribute__((cdecl)) with old gcc
+ causes lot of compilation errors; this broke IPSO build.
+*/
+
+#define XMLCALL
+
/* Expat tries very hard to make the API boundary very specifically
defined. There are two macros defined to control this boundary;
each of these can be defined before including this header to
#else /* UNICODE */
-#if HAVE_VASPRINTF
+#if HAVE_VASPRINTF && !defined(_IPSO)
vasprintf(&buffer, format, args);
#elif HAVE_VSCPRINTF && HAVE_DECL_VA_COPY
va_list argsCopy;