* { font-family: Consolas, Lucida Console, Courier New; font-size: 100%; }
h1 { font-size: 150%; }
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 100%; width: 100%; }
.highlight span { width: 100%; display:-moz-inline-stack; display:inline-block; zoom:1; *display:inline; }
body { background: #ffffff; }
body .c { color: #999988; font-style: italic } /* Comment */
body .err { color: #a61717; background-color: #e3d2d2 } /* Error */
body .k { font-weight: bold } /* Keyword */
body .o { font-weight: bold } /* Operator */
body .cm { color: #999988; font-style: italic } /* Comment.Multiline */
body .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
body .c1 { color: #999988; font-style: italic } /* Comment.Single */
body .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
body .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
body .ge { font-style: italic } /* Generic.Emph */
body .gr { color: #aa0000 } /* Generic.Error */
body .gh { color: #999999 } /* Generic.Heading */
body .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
body .go { color: #888888 } /* Generic.Output */
body .gp { color: #555555 } /* Generic.Prompt */
body .gs { font-weight: bold } /* Generic.Strong */
body .gu { color: #aaaaaa } /* Generic.Subheading */
body .gt { color: #aa0000 } /* Generic.Traceback */
body .kc { font-weight: bold } /* Keyword.Constant */
body .kd { font-weight: bold } /* Keyword.Declaration */
body .kp { font-weight: bold } /* Keyword.Pseudo */
body .kr { font-weight: bold } /* Keyword.Reserved */
body .kt { color: #445588; font-weight: bold } /* Keyword.Type */
body .m { color: #009999 } /* Literal.Number */
body .s { color: #bb8844 } /* Literal.String */
body .na { color: #008080 } /* Name.Attribute */
body .nb { color: #999999 } /* Name.Builtin */
body .nc { color: #445588; font-weight: bold } /* Name.Class */
body .no { color: #008080 } /* Name.Constant */
body .ni { color: #800080 } /* Name.Entity */
body .ne { color: #990000; font-weight: bold } /* Name.Exception */
body .nf { color: #990000; font-weight: bold } /* Name.Function */
body .nn { color: #555555 } /* Name.Namespace */
body .nt { color: #000080 } /* Name.Tag */
body .nv { color: #008080 } /* Name.Variable */
body .ow { font-weight: bold } /* Operator.Word */
body .w { color: #bbbbbb } /* Text.Whitespace */
body .mf { color: #009999 } /* Literal.Number.Float */
body .mh { color: #009999 } /* Literal.Number.Hex */
body .mi { color: #009999 } /* Literal.Number.Integer */
body .mo { color: #009999 } /* Literal.Number.Oct */
body .sb { color: #bb8844 } /* Literal.String.Backtick */
body .sc { color: #bb8844 } /* Literal.String.Char */
body .sd { color: #bb8844 } /* Literal.String.Doc */
body .s2 { color: #bb8844 } /* Literal.String.Double */
body .se { color: #bb8844 } /* Literal.String.Escape */
body .sh { color: #bb8844 } /* Literal.String.Heredoc */
body .si { color: #bb8844 } /* Literal.String.Interpol */
body .sx { color: #bb8844 } /* Literal.String.Other */
body .sr { color: #808000 } /* Literal.String.Regex */
body .s1 { color: #bb8844 } /* Literal.String.Single */
body .ss { color: #bb8844 } /* Literal.String.Symbol */
body .bp { color: #999999 } /* Name.Builtin.Pseudo */
body .vc { color: #008080 } /* Name.Variable.Class */
body .vg { color: #008080 } /* Name.Variable.Global */
body .vi { color: #008080 } /* Name.Variable.Instance */
body .il { color: #009999 } /* Literal.Number.Integer.Long */
Info
Revision:3392
Author:victor
Date:2008-07-22 20:11:15 +0300 (Tue, 22 Jul 2008)
Comment:subagent command handler call format changed; other minor fixes
Changes
U trunk/include/nms_agent.h
U trunk/src/agent/core/nxagentd.h
U trunk/src/agent/core/session.cpp
U trunk/src/agent/core/subagent.cpp
U trunk/src/server/include/nxsrvapi.h
Diff
Modified: trunk/include/nms_agent.h
===================================================================
--- trunk/include/nms_agent.h 2008-07-22 10:10:02 UTC (rev 3391)
+++ trunk/include/nms_agent.h 2008-07-22 17:11:15 UTC (rev 3392)
@@ -325,7 +325,7 @@
// Subagent initialization structure
//
-#define NETXMS_SUBAGENT_INFO_MAGIC ((DWORD)0x20070424)
+#define NETXMS_SUBAGENT_INFO_MAGIC ((DWORD)0x20080722)
class CSCPMessage;
@@ -337,7 +337,8 @@
BOOL (* pInit)(TCHAR *); // Called to initialize subagent. Can be NULL.
void (* pShutdown)(void); // Called at subagent unload. Can be NULL.
BOOL (* pCommandHandler)(DWORD dwCommand, CSCPMessage *pRequest,
- CSCPMessage *pResponse);
+ CSCPMessage *pResponse, SOCKET sock,
+ CSCP_ENCRYPTION_CONTEXT *ctx);
DWORD dwNumParameters;
NETXMS_SUBAGENT_PARAM *pParamList;
DWORD dwNumEnums;
Modified: trunk/src/agent/core/nxagentd.h
===================================================================
--- trunk/src/agent/core/nxagentd.h 2008-07-22 10:10:02 UTC (rev 3391)
+++ trunk/src/agent/core/nxagentd.h 2008-07-22 17:11:15 UTC (rev 3392)
@@ -330,7 +330,8 @@
BOOL InitSubAgent(HMODULE hModule, TCHAR *pszModuleName,
BOOL (* SubAgentInit)(NETXMS_SUBAGENT_INFO **, TCHAR *),
TCHAR *pszEntryPoint);
-BOOL ProcessCmdBySubAgent(DWORD dwCommand, CSCPMessage *pRequest, CSCPMessage *pResponse);
+BOOL ProcessCmdBySubAgent(DWORD dwCommand, CSCPMessage *pRequest, CSCPMessage *pResponse,
+ SOCKET sock, CSCP_ENCRYPTION_CONTEXT *ctx);
BOOL AddAction(const char *pszName, int iType, const char *pArg,
LONG (*fpHandler)(const TCHAR *, NETXMS_VALUES_LIST *, const TCHAR *),
Modified: trunk/src/agent/core/session.cpp
===================================================================
--- trunk/src/agent/core/session.cpp 2008-07-22 10:10:02 UTC (rev 3391)
+++ trunk/src/agent/core/session.cpp 2008-07-22 17:11:15 UTC (rev 3392)
@@ -486,7 +486,7 @@
break;
default:
// Attempt to process unknown command by subagents
- if (!ProcessCmdBySubAgent(dwCommand, pMsg, &msg))
+ if (!ProcessCmdBySubAgent(dwCommand, pMsg, &msg, m_hSocket, m_pCtx))
msg.SetVariable(VID_RCC, ERR_UNKNOWN_COMMAND);
break;
}
Modified: trunk/src/agent/core/subagent.cpp
===================================================================
--- trunk/src/agent/core/subagent.cpp 2008-07-22 10:10:02 UTC (rev 3391)
+++ trunk/src/agent/core/subagent.cpp 2008-07-22 17:11:15 UTC (rev 3392)
@@ -252,7 +252,8 @@
// Process unknown command by subagents
//
-BOOL ProcessCmdBySubAgent(DWORD dwCommand, CSCPMessage *pRequest, CSCPMessage *pResponse)
+BOOL ProcessCmdBySubAgent(DWORD dwCommand, CSCPMessage *pRequest, CSCPMessage *pResponse,
+ SOCKET sock, CSCP_ENCRYPTION_CONTEXT *ctx)
{
BOOL bResult = FALSE;
DWORD i;
@@ -260,7 +261,7 @@
for(i = 0; (i < m_dwNumSubAgents) && (!bResult); i++)
{
if (m_pSubAgentList[i].pInfo->pCommandHandler != NULL)
- bResult = m_pSubAgentList[i].pInfo->pCommandHandler(dwCommand, pRequest, pResponse);
+ bResult = m_pSubAgentList[i].pInfo->pCommandHandler(dwCommand, pRequest, pResponse, sock, ctx);
}
return bResult;
}
Modified: trunk/src/server/include/nxsrvapi.h
===================================================================
--- trunk/src/server/include/nxsrvapi.h 2008-07-22 10:10:02 UTC (rev 3391)
+++ trunk/src/server/include/nxsrvapi.h 2008-07-22 17:11:15 UTC (rev 3392)
@@ -339,8 +339,8 @@
DWORD GetNumDataLines(void) { return m_dwNumDataLines; }
const TCHAR *GetDataLine(DWORD dwIndex) { return dwIndex < m_dwNumDataLines ? m_ppDataLines[dwIndex] : _T("(error)"); }
- void SetCommandTimeout(DWORD dwTimeout) { if (dwTimeout > 500) m_dwCommandTimeout = dwTimeout; }
- void SetRecvTimeout(DWORD dwTimeout) { if (dwTimeout > 10000) m_dwRecvTimeout = dwTimeout; }
+ void SetCommandTimeout(DWORD dwTimeout) { m_dwCommandTimeout = max(dwTimeout, 500); }
+ void SetRecvTimeout(DWORD dwTimeout) { m_dwRecvTimeout = max(dwTimeout, 10000); }
void SetEncryptionPolicy(int iPolicy) { m_iEncryptionPolicy = iPolicy; }
void SetProxy(DWORD dwAddr, WORD wPort = AGENT_LISTEN_PORT,
int iAuthMethod = AUTH_NONE, const TCHAR *pszSecret = NULL);
Received on Tue Jul 22 2008 - 20:11:17 EEST
This archive was generated by hypermail 2.2.0 : Tue Jul 22 2008 - 20:10:00 EEST