@Test public void testDiscoveryOspfGetSubNetAddress() throws Exception { DiscoveryLink discovery = m_linkd.getDiscoveryLink("example1"); OspfNbrInterface ospfinterface = new OspfNbrInterface(InetAddressUtils.addr("192.168.9.1")); ospfinterface.setOspfNbrIpAddr(InetAddressUtils.addr("192.168.15.45")); ospfinterface.setOspfNbrNetMask(InetAddressUtils.addr("255.255.255.0")); assertEquals(InetAddressUtils.addr("192.168.15.0"), discovery.getSubnetAddress(ospfinterface)); ospfinterface.setOspfNbrNetMask(InetAddressUtils.addr("255.255.0.0")); assertEquals(InetAddressUtils.addr("192.168.0.0"), discovery.getSubnetAddress(ospfinterface)); ospfinterface.setOspfNbrNetMask(InetAddressUtils.addr("255.255.255.252")); assertEquals(InetAddressUtils.addr("192.168.15.44"), discovery.getSubnetAddress(ospfinterface)); ospfinterface.setOspfNbrNetMask(InetAddressUtils.addr("255.255.255.240")); assertEquals(InetAddressUtils.addr("192.168.15.32"), discovery.getSubnetAddress(ospfinterface)); }
public DiscoveryLink getDiscoveryLink(final String pkgName) { final Package pkg = m_linkdConfig.getPackage(pkgName); if (pkg == null) return null; final DiscoveryLink discoveryLink = new DiscoveryLink(); discoveryLink.setLinkd(this); discoveryLink.setPackageName(pkg.getName()); discoveryLink.setInitialSleepTime(m_linkdConfig.getInitialSleepTime()); discoveryLink.setSnmpPollInterval(pkg.hasSnmp_poll_interval() ? pkg.getSnmp_poll_interval() : m_linkdConfig.getSnmpPollInterval()); discoveryLink.setDiscoveryInterval(pkg.hasDiscovery_link_interval() ? pkg.getDiscovery_link_interval() : m_linkdConfig.getDiscoveryLinkInterval()); discoveryLink.setDiscoveryUsingBridge(pkg.hasUseBridgeDiscovery() ? pkg.getUseBridgeDiscovery() : m_linkdConfig.useBridgeDiscovery()); discoveryLink.setDiscoveryUsingCdp(pkg.hasUseCdpDiscovery() ? pkg.getUseCdpDiscovery() : m_linkdConfig.useCdpDiscovery()); discoveryLink.setDiscoveryUsingRoutes(pkg.hasUseIpRouteDiscovery() ? pkg.getUseIpRouteDiscovery() : m_linkdConfig.useIpRouteDiscovery()); discoveryLink.setEnableDownloadDiscovery(pkg.hasEnableDiscoveryDownload() ? pkg.getEnableDiscoveryDownload() : m_linkdConfig.enableDiscoveryDownload()); discoveryLink.setForceIpRouteDiscoveryOnEtherNet(pkg.hasForceIpRouteDiscoveryOnEthernet() ? pkg.getForceIpRouteDiscoveryOnEthernet() : m_linkdConfig.forceIpRouteDiscoveryOnEthernet()); discoveryLink.setDiscoveryUsingLldp(pkg.hasUseLldpDiscovery() ? pkg.getUseLldpDiscovery() : m_linkdConfig.useLldpDiscovery()); discoveryLink.setDiscoveryUsingOspf(pkg.hasUseOspfDiscovery() ? pkg.getUseOspfDiscovery() : m_linkdConfig.useOspfDiscovery()); return discoveryLink; }
Linkd extends AbstractServiceDaemon { public DiscoveryLink getDiscoveryLink(final String pkgName) { final Package pkg = m_linkdConfig.getPackage(pkgName); if (pkg == null) return null; final DiscoveryLink discoveryLink = new DiscoveryLink(); discoveryLink.setLinkd(this); discoveryLink.setPackageName(pkg.getName()); discoveryLink.setInitialSleepTime(m_linkdConfig.getInitialSleepTime()); discoveryLink.setSnmpPollInterval(pkg.hasSnmp_poll_interval() ? pkg.getSnmp_poll_interval() : m_linkdConfig.getSnmpPollInterval()); discoveryLink.setDiscoveryInterval(pkg.hasDiscovery_link_interval() ? pkg.getDiscovery_link_interval() : m_linkdConfig.getDiscoveryLinkInterval()); discoveryLink.setDiscoveryUsingBridge(pkg.hasUseBridgeDiscovery() ? pkg.getUseBridgeDiscovery() : m_linkdConfig.useBridgeDiscovery()); discoveryLink.setDiscoveryUsingCdp(pkg.hasUseCdpDiscovery() ? pkg.getUseCdpDiscovery() : m_linkdConfig.useCdpDiscovery()); discoveryLink.setDiscoveryUsingRoutes(pkg.hasUseIpRouteDiscovery() ? pkg.getUseIpRouteDiscovery() : m_linkdConfig.useIpRouteDiscovery()); discoveryLink.setEnableDownloadDiscovery(pkg.hasEnableDiscoveryDownload() ? pkg.getEnableDiscoveryDownload() : m_linkdConfig.enableDiscoveryDownload()); discoveryLink.setForceIpRouteDiscoveryOnEtherNet(pkg.hasForceIpRouteDiscoveryOnEthernet() ? pkg.getForceIpRouteDiscoveryOnEthernet() : m_linkdConfig.forceIpRouteDiscoveryOnEthernet()); discoveryLink.setDiscoveryUsingLldp(pkg.hasUseLldpDiscovery() ? pkg.getUseLldpDiscovery() : m_linkdConfig.useLldpDiscovery()); discoveryLink.setDiscoveryUsingOspf(pkg.hasUseOspfDiscovery() ? pkg.getUseOspfDiscovery() : m_linkdConfig.useOspfDiscovery()); return discoveryLink; } }
Linkd extends AbstractServiceDaemon { public DiscoveryLink getDiscoveryLink(final String pkgName) { final Package pkg = m_linkdConfig.getPackage(pkgName); if (pkg == null) return null; final DiscoveryLink discoveryLink = new DiscoveryLink(); discoveryLink.setLinkd(this); discoveryLink.setPackageName(pkg.getName()); discoveryLink.setInitialSleepTime(m_linkdConfig.getInitialSleepTime()); discoveryLink.setSnmpPollInterval(pkg.hasSnmp_poll_interval() ? pkg.getSnmp_poll_interval() : m_linkdConfig.getSnmpPollInterval()); discoveryLink.setDiscoveryInterval(pkg.hasDiscovery_link_interval() ? pkg.getDiscovery_link_interval() : m_linkdConfig.getDiscoveryLinkInterval()); discoveryLink.setDiscoveryUsingBridge(pkg.hasUseBridgeDiscovery() ? pkg.getUseBridgeDiscovery() : m_linkdConfig.useBridgeDiscovery()); discoveryLink.setDiscoveryUsingCdp(pkg.hasUseCdpDiscovery() ? pkg.getUseCdpDiscovery() : m_linkdConfig.useCdpDiscovery()); discoveryLink.setDiscoveryUsingRoutes(pkg.hasUseIpRouteDiscovery() ? pkg.getUseIpRouteDiscovery() : m_linkdConfig.useIpRouteDiscovery()); discoveryLink.setEnableDownloadDiscovery(pkg.hasEnableDiscoveryDownload() ? pkg.getEnableDiscoveryDownload() : m_linkdConfig.enableDiscoveryDownload()); discoveryLink.setForceIpRouteDiscoveryOnEtherNet(pkg.hasForceIpRouteDiscoveryOnEthernet() ? pkg.getForceIpRouteDiscoveryOnEthernet() : m_linkdConfig.forceIpRouteDiscoveryOnEthernet()); discoveryLink.setDiscoveryUsingLldp(pkg.hasUseLldpDiscovery() ? pkg.getUseLldpDiscovery() : m_linkdConfig.useLldpDiscovery()); discoveryLink.setDiscoveryUsingOspf(pkg.hasUseOspfDiscovery() ? pkg.getUseOspfDiscovery() : m_linkdConfig.useOspfDiscovery()); return discoveryLink; } Linkd(); }
Linkd extends AbstractServiceDaemon { public DiscoveryLink getDiscoveryLink(final String pkgName) { final Package pkg = m_linkdConfig.getPackage(pkgName); if (pkg == null) return null; final DiscoveryLink discoveryLink = new DiscoveryLink(); discoveryLink.setLinkd(this); discoveryLink.setPackageName(pkg.getName()); discoveryLink.setInitialSleepTime(m_linkdConfig.getInitialSleepTime()); discoveryLink.setSnmpPollInterval(pkg.hasSnmp_poll_interval() ? pkg.getSnmp_poll_interval() : m_linkdConfig.getSnmpPollInterval()); discoveryLink.setDiscoveryInterval(pkg.hasDiscovery_link_interval() ? pkg.getDiscovery_link_interval() : m_linkdConfig.getDiscoveryLinkInterval()); discoveryLink.setDiscoveryUsingBridge(pkg.hasUseBridgeDiscovery() ? pkg.getUseBridgeDiscovery() : m_linkdConfig.useBridgeDiscovery()); discoveryLink.setDiscoveryUsingCdp(pkg.hasUseCdpDiscovery() ? pkg.getUseCdpDiscovery() : m_linkdConfig.useCdpDiscovery()); discoveryLink.setDiscoveryUsingRoutes(pkg.hasUseIpRouteDiscovery() ? pkg.getUseIpRouteDiscovery() : m_linkdConfig.useIpRouteDiscovery()); discoveryLink.setEnableDownloadDiscovery(pkg.hasEnableDiscoveryDownload() ? pkg.getEnableDiscoveryDownload() : m_linkdConfig.enableDiscoveryDownload()); discoveryLink.setForceIpRouteDiscoveryOnEtherNet(pkg.hasForceIpRouteDiscoveryOnEthernet() ? pkg.getForceIpRouteDiscoveryOnEthernet() : m_linkdConfig.forceIpRouteDiscoveryOnEthernet()); discoveryLink.setDiscoveryUsingLldp(pkg.hasUseLldpDiscovery() ? pkg.getUseLldpDiscovery() : m_linkdConfig.useLldpDiscovery()); discoveryLink.setDiscoveryUsingOspf(pkg.hasUseOspfDiscovery() ? pkg.getUseOspfDiscovery() : m_linkdConfig.useOspfDiscovery()); return discoveryLink; } Linkd(); DiscoveryLink getDiscoveryLink(final String pkgName); SnmpCollection getSnmpCollection(final int nodeid,
            final InetAddress ipaddr, final String sysoid,
            final String pkgName); List<SnmpCollection> getSnmpCollections(int nodeid,
                                                   final InetAddress ipaddr, final String sysoid); SnmpCollection createCollection(int nodeid,
            final InetAddress ipaddr); Collection<LinkableNode> getLinkableNodes(); Collection<LinkableNode> getLinkableNodesOnPackage(String pkg); boolean isInterfaceInPackage(InetAddress ipaddr, String pkg); boolean isInterfaceInPackageRange(InetAddress ipaddr, String pkg); boolean scheduleNodeCollection(int nodeid); boolean runSingleCollection(final int nodeId); boolean runSingleSnmpCollection(final int nodeId); boolean runSingleLinkDiscovery(final String packageName); @Transactional void updateNodeSnmpCollection(final SnmpCollection snmpcoll); QueryManager getQueryManager(); void setQueryManager(QueryManager queryMgr); Scheduler getScheduler(); void setScheduler(Scheduler scheduler); LinkdConfig getLinkdConfig(); void setLinkdConfig(final LinkdConfig config); EventForwarder getEventForwarder(); void setEventForwarder(EventForwarder eventForwarder); List<String> getActivePackages(); void addPackage(final String packageName); void addAtInterface(final AtInterface atinterface); Set<String> getMacAddressesForPackage(final String packageName); List<AtInterface> getAtInterfaces(final String packageName, final String macAddress); void clearAtInterfaces(final String packageName); String getSource(); }
Linkd extends AbstractServiceDaemon { public DiscoveryLink getDiscoveryLink(final String pkgName) { final Package pkg = m_linkdConfig.getPackage(pkgName); if (pkg == null) return null; final DiscoveryLink discoveryLink = new DiscoveryLink(); discoveryLink.setLinkd(this); discoveryLink.setPackageName(pkg.getName()); discoveryLink.setInitialSleepTime(m_linkdConfig.getInitialSleepTime()); discoveryLink.setSnmpPollInterval(pkg.hasSnmp_poll_interval() ? pkg.getSnmp_poll_interval() : m_linkdConfig.getSnmpPollInterval()); discoveryLink.setDiscoveryInterval(pkg.hasDiscovery_link_interval() ? pkg.getDiscovery_link_interval() : m_linkdConfig.getDiscoveryLinkInterval()); discoveryLink.setDiscoveryUsingBridge(pkg.hasUseBridgeDiscovery() ? pkg.getUseBridgeDiscovery() : m_linkdConfig.useBridgeDiscovery()); discoveryLink.setDiscoveryUsingCdp(pkg.hasUseCdpDiscovery() ? pkg.getUseCdpDiscovery() : m_linkdConfig.useCdpDiscovery()); discoveryLink.setDiscoveryUsingRoutes(pkg.hasUseIpRouteDiscovery() ? pkg.getUseIpRouteDiscovery() : m_linkdConfig.useIpRouteDiscovery()); discoveryLink.setEnableDownloadDiscovery(pkg.hasEnableDiscoveryDownload() ? pkg.getEnableDiscoveryDownload() : m_linkdConfig.enableDiscoveryDownload()); discoveryLink.setForceIpRouteDiscoveryOnEtherNet(pkg.hasForceIpRouteDiscoveryOnEthernet() ? pkg.getForceIpRouteDiscoveryOnEthernet() : m_linkdConfig.forceIpRouteDiscoveryOnEthernet()); discoveryLink.setDiscoveryUsingLldp(pkg.hasUseLldpDiscovery() ? pkg.getUseLldpDiscovery() : m_linkdConfig.useLldpDiscovery()); discoveryLink.setDiscoveryUsingOspf(pkg.hasUseOspfDiscovery() ? pkg.getUseOspfDiscovery() : m_linkdConfig.useOspfDiscovery()); return discoveryLink; } Linkd(); DiscoveryLink getDiscoveryLink(final String pkgName); SnmpCollection getSnmpCollection(final int nodeid,
            final InetAddress ipaddr, final String sysoid,
            final String pkgName); List<SnmpCollection> getSnmpCollections(int nodeid,
                                                   final InetAddress ipaddr, final String sysoid); SnmpCollection createCollection(int nodeid,
            final InetAddress ipaddr); Collection<LinkableNode> getLinkableNodes(); Collection<LinkableNode> getLinkableNodesOnPackage(String pkg); boolean isInterfaceInPackage(InetAddress ipaddr, String pkg); boolean isInterfaceInPackageRange(InetAddress ipaddr, String pkg); boolean scheduleNodeCollection(int nodeid); boolean runSingleCollection(final int nodeId); boolean runSingleSnmpCollection(final int nodeId); boolean runSingleLinkDiscovery(final String packageName); @Transactional void updateNodeSnmpCollection(final SnmpCollection snmpcoll); QueryManager getQueryManager(); void setQueryManager(QueryManager queryMgr); Scheduler getScheduler(); void setScheduler(Scheduler scheduler); LinkdConfig getLinkdConfig(); void setLinkdConfig(final LinkdConfig config); EventForwarder getEventForwarder(); void setEventForwarder(EventForwarder eventForwarder); List<String> getActivePackages(); void addPackage(final String packageName); void addAtInterface(final AtInterface atinterface); Set<String> getMacAddressesForPackage(final String packageName); List<AtInterface> getAtInterfaces(final String packageName, final String macAddress); void clearAtInterfaces(final String packageName); String getSource();  }