本文整理汇总了C++中ConfigurationManager::flushAddressList方法的典型用法代码示例。如果您正苦于以下问题:C++ ConfigurationManager::flushAddressList方法的具体用法?C++ ConfigurationManager::flushAddressList怎么用?C++ ConfigurationManager::flushAddressList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ConfigurationManager
的用法示例。
在下文中一共展示了ConfigurationManager::flushAddressList方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: fetchAndUpdateDnsInfo
int VBoxNetDhcp::fetchAndUpdateDnsInfo()
{
ComHostPtr host;
if (SUCCEEDED(virtualbox->COMGETTER(Host)(host.asOutParam())))
{
AddressToOffsetMapping mapIp4Addr2Off;
int rc = localMappings(m_NATNetwork, mapIp4Addr2Off);
/* XXX: here could be several cases: 1. COM error, 2. not found (empty) 3. ? */
AssertMsgRCReturn(rc, ("Can't fetch local mappings"), rc);
RTNETADDRIPV4 address = getIpv4Address();
RTNETADDRIPV4 netmask = getIpv4Netmask();
AddressList nameservers;
rc = hostDnsServers(host, networkid(address, netmask), mapIp4Addr2Off, nameservers);
AssertMsgRCReturn(rc, ("Debug me!!!"), rc);
/* XXX: Search strings */
std::string domain;
rc = hostDnsDomain(host, domain);
AssertMsgRCReturn(rc, ("Debug me!!"), rc);
{
VBoxNetALock(this);
ConfigurationManager *confManager = ConfigurationManager::getConfigurationManager();
confManager->flushAddressList(RTNET_DHCP_OPT_DNS);
for (AddressList::iterator it = nameservers.begin(); it != nameservers.end(); ++it)
confManager->addToAddressList(RTNET_DHCP_OPT_DNS, *it);
confManager->setString(RTNET_DHCP_OPT_DOMAIN_NAME, domain);
}
}
return VINF_SUCCESS;
}