void CWakeOnAccess::QueueMACDiscoveryForAllRemotes() { std::vector<std::string> hosts; // add media sources CMediaSourceSettings& ms = CMediaSourceSettings::GetInstance(); AddHostsFromVecSource(ms.GetSources("video"), hosts); AddHostsFromVecSource(ms.GetSources("music"), hosts); AddHostsFromVecSource(ms.GetSources("files"), hosts); AddHostsFromVecSource(ms.GetSources("pictures"), hosts); AddHostsFromVecSource(ms.GetSources("programs"), hosts); // add mysql servers AddHostFromDatabase(g_advancedSettings.m_databaseVideo, hosts); AddHostFromDatabase(g_advancedSettings.m_databaseMusic, hosts); AddHostFromDatabase(g_advancedSettings.m_databaseEpg, hosts); AddHostFromDatabase(g_advancedSettings.m_databaseTV, hosts); // add from path substitutions .. for (CAdvancedSettings::StringMapping::iterator i = g_advancedSettings.m_pathSubstitutions.begin(); i != g_advancedSettings.m_pathSubstitutions.end(); ++i) { CURL url(i->second); AddHost (url.GetHostName(), hosts); } for (std::vector<std::string>::const_iterator it = hosts.begin(); it != hosts.end(); ++it) QueueMACDiscoveryForHost(*it); }
_X_HIDDEN int SecureRPCAdd(unsigned short data_length, const char *data, XID id) { if (data_length) AddHost((pointer) 0, FamilyNetname, data_length, data); rpc_id = id; return 1; }
static void AddHostsFromMediaSource(const CMediaSource& source, std::vector<std::string>& hosts) { for (std::vector<std::string>::const_iterator it = source.vecPaths.begin() ; it != source.vecPaths.end(); ++it) { CURL url(*it); AddHost (url.GetHostName(), hosts); } }
static void AddHostsFromMediaSource(const CMediaSource& source, std::vector<std::string>& hosts) { for (std::vector<std::string>::const_iterator it = source.vecPaths.begin() ; it != source.vecPaths.end(); ++it) { CURL url(*it); std::string host_name = url.GetHostName(); if (url.IsProtocol("upnp")) host_name = LookupUPnPHost(host_name); AddHost(host_name, hosts); } }
static void AddHostFromDatabase(const DatabaseSettings& setting, std::vector<std::string>& hosts) { if (StringUtils::EqualsNoCase(setting.type, "mysql")) AddHost(setting.host, hosts); }