HostDnsServiceDarwin.cpp revision 8dfc5e89cd3421bb0602f33768f00c1f1d40b1d2
/* $Id$ */
/** @file
* Darwin specific DNS information fetching.
*/
/*
* Copyright (C) 2004-2013 Oracle Corporation
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License (GPL) as published by the Free Software
* Foundation, in version 2 as it comes in the "COPYING" file of the
* VirtualBox OSE distribution. VirtualBox OSE is distributed in the
* hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
*/
#include "../HostDnsService.h"
#include <iprt/semaphore.h>
#include <CoreFoundation/CoreFoundation.h>
#include <SystemConfiguration/SCDynamicStore.h>
{
(const void **)&kStateNetworkGlobalDNSKey,
1, &kCFTypeArrayCallBacks);
if (!watchingArrayRef)
{
return E_OUTOFMEMORY;
}
CFRunLoopRun();
return VINF_SUCCESS;
}
{
}
{
}
{
&ctx);
if (!g_DnsWatcher)
return E_OUTOFMEMORY;
return update();
}
{
return S_OK;
}
void HostDnsServiceDarwin::stop()
{
if (g_RunLoopRef)
}
{
/**
* 0:vvl@nb-mbp-i7-2(0)# scutil
* > d.show
* <dictionary> {
* DomainName : vvl-domain
* SearchDomains : <array> {
* 0 : vvl-domain
* 1 : de.vvl-domain.com
* }
* ServerAddresses : <array> {
* 0 : 192.168.1.4
* 1 : 192.168.1.1
* 2 : 8.8.4.4
* }
* }
*/
if (!propertyRef)
return S_OK;
if (domainNameRef)
{
if (pszDomainName)
}
int i, arrayCount;
if (serverArrayRef)
{
for (i = 0; i < arrayCount; ++i)
{
if (!serverArrayRef)
continue;
if (!pszServerAddress)
continue;
}
}
if (searchArrayRef)
{
for (i = 0; i < arrayCount; ++i)
{
if (!searchArrayRef)
continue;
if (!pszSearchString)
continue;
}
}
this->HostDnsService::update();
return S_OK;
}