public void startModules( Collection<ICaptureInterface> enabledInterfaces, long spaceId, long realmId, boolean createInterfaceEntities) { if (running) return; final Set<WifiDaemonInterface> ifaces = new HashSet<WifiDaemonInterface>(); for (ICaptureInterface iface : enabledInterfaces) { if (!(iface instanceof IWirelessCaptureInterface)) { // XXX } final IWirelessCaptureInterface wifiInterface = (IWirelessCaptureInterface) iface; if (createInterfaceEntities) { final NetworkInterfaceEntity interfaceEntity = daemon.createNetworkInterfaceEntity(realmId, spaceId, iface.getName()); ifaces.add(new WifiDaemonInterface(wifiInterface, interfaceEntity.getId())); } else { ifaces.add(new WifiDaemonInterface(wifiInterface, realmId)); } } for (EnabledWifiModule module : enabledModules) { module.start((IWifiSniffingEngine) daemon.getSniffingEngine(), ifaces, spaceId); } running = true; }