fake interfaces always created with expected state UP
authorVictor Kirhenshtein <victor@netxms.org>
Sat, 6 Aug 2016 15:37:13 +0000 (18:37 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Sat, 6 Aug 2016 15:37:39 +0000 (18:37 +0300)
src/server/core/node.cpp
src/server/core/poll.cpp
src/server/core/session.cpp
src/server/include/nms_objects.h
webui/webapp/Core/nxmc.warproduct

index 4ace2cc..464766e 100644 (file)
@@ -1056,19 +1056,19 @@ bool Node::filterInterface(InterfaceInfo *info)
 /**
  * Create new interface - convenience wrapper
  */
-Interface *Node::createNewInterface(const InetAddress& ipAddr, BYTE *macAddr)
+Interface *Node::createNewInterface(const InetAddress& ipAddr, BYTE *macAddr, bool fakeInterface)
 {
    InterfaceInfo info(1);
    info.ipAddrList.add(ipAddr);
    if (macAddr != NULL)
       memcpy(info.macAddr, macAddr, MAC_ADDR_LENGTH);
-   return createNewInterface(&info, false);
+   return createNewInterface(&info, false, fakeInterface);
 }
 
 /**
  * Create new interface
  */
-Interface *Node::createNewInterface(InterfaceInfo *info, bool manuallyCreated)
+Interface *Node::createNewInterface(InterfaceInfo *info, bool manuallyCreated, bool fakeInterface)
 {
        bool bSyntheticMask = false;
    TCHAR buffer[64];
@@ -1158,7 +1158,7 @@ Interface *Node::createNewInterface(InterfaceInfo *info, bool manuallyCreated)
    switch(defaultExpectedState)
    {
       case IF_DEFAULT_EXPECTED_STATE_AUTO:
-         pInterface->setExpectedState(IF_EXPECTED_STATE_AUTO);
+         pInterface->setExpectedState(fakeInterface ? IF_EXPECTED_STATE_UP : IF_EXPECTED_STATE_AUTO);
          break;
       case IF_DEFAULT_EXPECTED_STATE_IGNORE:
          pInterface->setExpectedState(IF_EXPECTED_STATE_IGNORE);
@@ -3179,7 +3179,7 @@ bool Node::updateInterfaceConfiguration(UINT32 rqid, int maskBits)
             sendPollerMsg(rqid, POLLER_INFO _T("   Found new interface \"%s\"\r\n"), ifInfo->name);
             if (filterInterface(ifInfo))
             {
-               createNewInterface(ifInfo, false);
+               createNewInterface(ifInfo, false, false);
                hasChanges = true;
             }
             else
@@ -3246,7 +3246,7 @@ bool Node::updateInterfaceConfiguration(UINT32 rqid, int maskBits)
                                                DbgPrintf(5, _T("Node::updateInterfaceConfiguration(%s [%u]): got MAC for unknown interface: %s"), m_name, m_id, szMac);
                   InetAddress ifaceAddr = m_ipAddress;
                   ifaceAddr.setMaskBits(maskBits);
-                  createNewInterface(ifaceAddr, pMacAddr);
+                  createNewInterface(ifaceAddr, pMacAddr, true);
                                        }
             }
                                else
@@ -3287,10 +3287,10 @@ bool Node::updateInterfaceConfiguration(UINT32 rqid, int maskBits)
                                DbgPrintf(5, _T("Node::updateInterfaceConfiguration(%s [%u]): got MAC for unknown interface: %s"), m_name, m_id, szMac);
             InetAddress ifaceAddr = m_ipAddress;
             ifaceAddr.setMaskBits(maskBits);
-               createNewInterface(ifaceAddr, pMacAddr);
+               createNewInterface(ifaceAddr, pMacAddr, true);
                        }
       }
-               DbgPrintf(6, _T("Node::updateInterfaceConfiguration(%s [%u]): pflist == NULL, dwCount = %u"), m_name, m_id, dwCount);
+               DbgPrintf(6, _T("Node::updateInterfaceConfiguration(%s [%u]): pIfList == NULL, dwCount = %u"), m_name, m_id, dwCount);
    }
 
        delete pIfList;
index 55e1c50..1c19eed 100644 (file)
@@ -336,7 +336,7 @@ static void DiscoveryPoller(void *arg)
    DbgPrintf(4, _T("Starting discovery poll for node %s (%s) in zone %d"),
                  node->getName(), (const TCHAR *)node->getIpAddress().toString(), (int)node->getZoneId());
 
-   // Retrieve and analize node's ARP cache
+   // Retrieve and analyze node's ARP cache
    ARP_CACHE *pArpCache = node->getArpCache();
    if (pArpCache != NULL)
    {
@@ -346,7 +346,7 @@ static void DiscoveryPoller(void *arg)
       DestroyArpCache(pArpCache);
    }
 
-       // Retrieve and analize node's routing table
+       // Retrieve and analyze node's routing table
    DbgPrintf(5, _T("Discovery poll for node %s (%s) - reading routing table"),
              node->getName(), (const TCHAR *)node->getIpAddress().toString());
        ROUTING_TABLE *rt = node->getRoutingTable();
index 60e91b7..e432608 100644 (file)
@@ -5048,7 +5048,7 @@ void ClientSession::createObject(NXCPMessage *request)
                               ifInfo.slot = request->getFieldAsUInt32(VID_IF_SLOT);
                               ifInfo.port = request->getFieldAsUInt32(VID_IF_PORT);
                               ifInfo.isPhysicalPort = request->getFieldAsBoolean(VID_IS_PHYS_PORT);
-                              object = ((Node *)parent)->createNewInterface(&ifInfo, true);
+                              object = ((Node *)parent)->createNewInterface(&ifInfo, true, false);
                            }
                            break;
                         case OBJECT_MOBILEDEVICE:
index 3c5c8ea..00d0fa8 100644 (file)
@@ -1512,8 +1512,8 @@ public:
        time_t getDownTime() const { return m_downSince; }
 
    void addInterface(Interface *pInterface) { addChild(pInterface); pInterface->addParent(this); }
-   Interface *createNewInterface(InterfaceInfo *ifInfo, bool manuallyCreated);
-   Interface *createNewInterface(const InetAddress& ipAddr, BYTE *macAddr);
+   Interface *createNewInterface(InterfaceInfo *ifInfo, bool manuallyCreated, bool fakeInterface);
+   Interface *createNewInterface(const InetAddress& ipAddr, BYTE *macAddr, bool fakeInterface);
    void deleteInterface(Interface *iface);
 
        void setPrimaryName(const TCHAR *name) { nx_strncpy(m_primaryName, name, MAX_DNS_NAME); }
index a3dc971..fc70db1 100644 (file)
@@ -1,10 +1,9 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <?pde version="3.5"?>
 
-<product name="NXMC" uid="org.netxms.nxmc" version="2.0.4" useFeatures="false" includeLaunchers="false">
+<product name="NXMC" uid="org.netxms.nxmc" version="2.1-M1" useFeatures="false" includeLaunchers="false">
    <plugins>
       <plugin id="com.ibm.icu"/>
-      <plugin id="com.ibm.icu.base"/>
       <plugin id="javax.xml"/>
       <plugin id="org.apache.commons.codec"/>
       <plugin id="org.apache.commons.fileupload"/>
       <plugin id="org.eclipse.osgi.services.nl_ru" fragment="true"/>
       <plugin id="org.eclipse.osgi.services.nl_zh" fragment="true"/>
       <plugin id="org.eclipse.osgi.services.nl_zh_TW" fragment="true"/>
-      <plugin id="org.eclipse.rap.addons.filedialog"/>
-      <plugin id="org.eclipse.rap.addons.fileupload"/>
+      <plugin id="org.eclipse.rap.filedialog"/>
+      <plugin id="org.eclipse.rap.fileupload"/>
       <plugin id="org.eclipse.rap.jface"/>
       <plugin id="org.eclipse.rap.jface.databinding"/>
       <plugin id="org.eclipse.rap.jface.databinding.nl_cs" fragment="true"/>
 
    <configurations>
       <plugin id="com.ibm.icu" autoStart="true" startLevel="0" />
-      <plugin id="com.ibm.icu.base" autoStart="true" startLevel="0" />
       <plugin id="javax.xml" autoStart="true" startLevel="0" />
       <plugin id="org.apache.commons.codec" autoStart="true" startLevel="0" />
       <plugin id="org.apache.commons.fileupload" autoStart="true" startLevel="0" />
       <plugin id="org.eclipse.help" autoStart="true" startLevel="0" />
       <plugin id="org.eclipse.osgi" autoStart="true" startLevel="0" />
       <plugin id="org.eclipse.osgi.services" autoStart="true" startLevel="0" />
-      <plugin id="org.eclipse.rap.addons.filedialog" autoStart="true" startLevel="0" />
-      <plugin id="org.eclipse.rap.addons.fileupload" autoStart="true" startLevel="0" />
+      <plugin id="org.eclipse.rap.filedialog" autoStart="true" startLevel="0" />
+      <plugin id="org.eclipse.rap.fileupload" autoStart="true" startLevel="0" />
       <plugin id="org.eclipse.rap.jface" autoStart="true" startLevel="0" />
       <plugin id="org.eclipse.rap.jface.databinding" autoStart="true" startLevel="0" />
       <plugin id="org.eclipse.rap.rwt" autoStart="true" startLevel="0" />
 
    <warConfiguration webXml="/Core/WEB-INF/web.xml" launchIni="/Core/WEB-INF/launch.ini">
    <libraries>
-      <library path="org.eclipse.equinox.servletbridge_1.3.0.v20140430-1556.jar" fromTarget="true"/>
+      <library path="org.eclipse.equinox.servletbridge_1.3.200.v20160128-1435.jar" fromTarget="true"/>
    </libraries>
    </warConfiguration>
 </product>