[SVN-NetXMS] revision 3301

From: NetXMS.org SVN Server <svn_at_DOMAIN_REMOVED>
Date: Wed, 11 Jun 2008 10:21:24 +0300

* { 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:3301
Author:victor

Date:2008-06-11 10:21:24 +0300 (Wed, 11 Jun 2008)

Comment:Fixed issues 220 and 221

Changes
U trunk/ChangeLog
U trunk/src/agent/core/nxagentd.cpp
U trunk/src/server/core/node.cpp
U trunk/src/server/core/snmp.cpp

Diff
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog 2008-06-09 20:31:03 UTC (rev 3300)
+++ trunk/ChangeLog 2008-06-11 07:21:24 UTC (rev 3301)
@@ -6,7 +6,7 @@
 - Scripts in event processing policy now has access to node properties
   via $node variable and to event properties via $event variable
 - Implemented XML encoding for NXCP messages
-- Fixed issues: #201
+- Fixed issues: #201, #220, #221
 
 
 *

Modified: trunk/src/agent/core/nxagentd.cpp
===================================================================
--- trunk/src/agent/core/nxagentd.cpp 2008-06-09 20:31:03 UTC (rev 3300)
+++ trunk/src/agent/core/nxagentd.cpp 2008-06-11 07:21:24 UTC (rev 3301)
@@ -1,7 +1,7 @@
 /* $Id$ */
 /*
 ** NetXMS multiplatform core agent
-** Copyright (C) 2003, 2004, 2005, 2006 Victor Kirhenshtein
+** Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Victor Kirhenshtein
 **
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by

Modified: trunk/src/server/core/node.cpp
===================================================================
--- trunk/src/server/core/node.cpp 2008-06-09 20:31:03 UTC (rev 3300)
+++ trunk/src/server/core/node.cpp 2008-06-11 07:21:24 UTC (rev 3301)
@@ -1,7 +1,7 @@
 /* $Id$ */
 /*
 ** NetXMS - Network Management System
-** Copyright (C) 2003, 2004, 2005, 2006, 2007 Victor Kirhenshtein
+** Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008 Victor Kirhenshtein
 **
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
@@ -529,11 +529,17 @@
         Cluster *pCluster;
         BOOL bAddToSubnet, bSyntheticMask = FALSE;
 
+ DbgPrintf(5, _T(&quot;Node::CreateNewInterface(%08X, %08X, %s, %d, %d) called for node %s [%d]&quot;),
+ dwIpAddr, dwNetMask, szName, dwIndex, dwType, m_szName, m_dwId);
+
    // Find subnet to place interface object to
    if (dwIpAddr != 0)
    {
                 pCluster = GetMyCluster();
                 bAddToSubnet = (pCluster != NULL) ? !pCluster-&gt;IsSyncAddr(dwIpAddr) : TRUE;
+ DbgPrintf(5, _T(&quot;Node::CreateNewInterface: node=%s [%d] cluster=%s [%d] add=%d&quot;),
+ m_szName, m_dwId, (pCluster != NULL) ? pCluster-&gt;Name() : _T(&quot;(null)&quot;),
+ (pCluster != NULL) ? pCluster-&gt;Id() : 0, bAddToSubnet);
                 if (bAddToSubnet)
                 {
                         pSubnet = FindSubnetForNode(dwIpAddr);
@@ -553,8 +559,7 @@
                                                 TCHAR szBuffer[16];
 
                                                 // Multicast address??
- DbgPrintf(2,
- &quot;Attempt to create interface object with multicast address %s&quot;,
+ DbgPrintf(2, _T(&quot;Attempt to create interface object with multicast address %s&quot;),
                                                                          IpToStr(dwIpAddr, szBuffer));
                                         }
                                 }
@@ -2994,9 +2999,13 @@
 {
         Subnet *pSubnet;
         Interface *pInterface;
+ Cluster *pCluster;
         NetObj **ppUnlinkList;
         int i, j, count;
+ BOOL isSync;
 
+ pCluster = GetMyCluster();
+
         // Check if we have subnet bindings for all interfaces
         for(i = 0; i &lt; pIfList-&gt;iNumEntries; i++)
         {
@@ -3009,17 +3018,27 @@
                                 break; // Something goes really wrong
                         }
 
+ // Is cluster interconnect interface?
+ isSync = (pCluster != NULL) ? pCluster-&gt;IsSyncAddr(pInterface-&gt;IpAddr()) : FALSE;
+
                         pSubnet = FindSubnetForNode(pIfList-&gt;pInterfaces[i].dwIpAddr);
                         if (pSubnet != NULL)
                         {
- if (pSubnet-&gt;IsSyntheticMask())
+ if (isSync)
                                 {
- DbgPrintf(4, _T(&quot;Setting correct netmask for subnet %s [%d] from node %s [%d]&quot;),
- pSubnet-&gt;Name(), pSubnet-&gt;Id(), m_szName, m_dwId);
- pSubnet-&gt;SetCorrectMask(pInterface-&gt;IpAddr() &amp; pInterface-&gt;IpNetMask(), pInterface-&gt;IpNetMask());
+ pSubnet = NULL; // No further checks on this subnet
                                 }
+ else
+ {
+ if (pSubnet-&gt;IsSyntheticMask())
+ {
+ DbgPrintf(4, _T(&quot;Setting correct netmask for subnet %s [%d] from node %s [%d]&quot;),
+ pSubnet-&gt;Name(), pSubnet-&gt;Id(), m_szName, m_dwId);
+ pSubnet-&gt;SetCorrectMask(pInterface-&gt;IpAddr() &amp; pInterface-&gt;IpNetMask(), pInterface-&gt;IpNetMask());
+ }
+ }
                         }
- else
+ else if (!isSync)
                         {
                                 // Create subnet
                                 pSubnet = new Subnet(pIfList-&gt;pInterfaces[i].dwIpAddr &amp; pIfList-&gt;pInterfaces[i].dwIpNetMask,
@@ -3056,6 +3075,13 @@
                                 {
                                         if (pSubnet-&gt;IpAddr() == (m_pChildList[j]-&gt;IpAddr() &amp; pSubnet-&gt;IpNetMask()))
                                         {
+ if (pCluster != NULL)
+ {
+ if (pCluster-&gt;IsSyncAddr(m_pChildList[j]-&gt;IpAddr()))
+ {
+ j = (int)m_dwChildCount; // Cause to unbind from this subnet
+ }
+ }
                                                 break;
                                         }
                                 }

Modified: trunk/src/server/core/snmp.cpp
===================================================================
--- trunk/src/server/core/snmp.cpp 2008-06-09 20:31:03 UTC (rev 3300)
+++ trunk/src/server/core/snmp.cpp 2008-06-11 07:21:24 UTC (rev 3301)
@@ -481,15 +481,23 @@
          if (SnmpGet(dwVersion, pTransport, szCommunity, szOid, NULL, 0,
                       &amp;pIfList-&gt;pInterfaces[i].dwType, sizeof(DWORD),
                       FALSE, FALSE) != SNMP_ERR_SUCCESS)
- break;
+ {
+ pIfList-&gt;pInterfaces[i].dwType = IFTYPE_OTHER;
+ }
 
          // MAC address
          sprintf(szOid, &quot;.1.3.6.1.2.1.2.2.1.6.%d&quot;, pIfList-&gt;pInterfaces[i].dwIndex);
          memset(szBuffer, 0, MAC_ADDR_LENGTH);
          if (SnmpGet(dwVersion, pTransport, szCommunity, szOid, NULL, 0,
- szBuffer, 256, FALSE, TRUE) != SNMP_ERR_SUCCESS)
- break;
- memcpy(pIfList-&gt;pInterfaces[i].bMacAddr, szBuffer, MAC_ADDR_LENGTH);
+ szBuffer, 256, FALSE, TRUE) == SNMP_ERR_SUCCESS)
+ {
+ memcpy(pIfList-&gt;pInterfaces[i].bMacAddr, szBuffer, MAC_ADDR_LENGTH);
+ }
+ else
+ {
+ // Unable to get MAC address
+ memset(pIfList-&gt;pInterfaces[i].bMacAddr, 0, MAC_ADDR_LENGTH);
+ }
       }
 
       if (i == iNumIf)
Received on Wed Jun 11 2008 - 10:21:24 EEST

This archive was generated by hypermail 2.2.0 : Wed Jun 11 2008 - 10:18:12 EEST