VirtualBox

Changeset 49818 in vbox for trunk/src


Ignore:
Timestamp:
Dec 9, 2013 5:52:34 AM (11 years ago)
Author:
vboxsync
Message:

HostDnsService.cpp: adds helper routines to dump fetched host DNS information and dump it (host DNS information) on change and on fetch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/HostDnsService.cpp

    r49718 r49818  
    2222#include <iprt/cpp/utils.h>
    2323
     24#include "Logging.h"
    2425#include "VirtualBoxImpl.h"
    2526#include <iprt/thread.h>
     
    3435static HostDnsMonitor *g_monitor;
    3536
     37static void dumpHostDnsInformation(const HostDnsInformation&);
     38static void dumpHostDnsStrVector(const std::string&, const std::vector<std::string>&);
    3639
    3740/* Lockee */
     
    241244        updateInfo();
    242245
     246    LogRel(("HostDnsMonitorProxy::GetNameServers:\n"));
     247    dumpHostDnsStrVector("Name Server", m->info->servers);
     248
    243249    detachVectorOfString(m->info->servers, ComSafeArrayOutArg(aNameServers));
    244250
     
    254260        updateInfo();
    255261
     262    LogRel(("HostDnsMonitorProxy::GetDomainName:%s\n", m->info->domain.c_str()));
     263
    256264    Utf8Str(m->info->domain.c_str()).cloneTo(aDomainName);
    257265
     
    266274    if (m->fModified)
    267275        updateInfo();
     276
     277    LogRel(("HostDnsMonitorProxy::GetSearchStrings:\n"));
     278    dumpHostDnsStrVector("Search String", m->info->searchList);
    268279
    269280    detachVectorOfString(m->info->searchList, ComSafeArrayOutArg(aSearchStrings));
     
    288299    HostDnsInformation *old = m->info;
    289300
     301    LogRel(("HostDnsMonitorProxy: Host's DNS information updated:\n"));
     302    dumpHostDnsInformation(*info);
     303
    290304    m->info = info;
    291305    if (old)
     306    {
     307        LogRel(("HostDnsMonitorProxy: Old host information:\n"));
     308        dumpHostDnsInformation(*old);
     309
    292310        delete old;
     311    }
    293312
    294313    m->fModified = false;
    295314}
     315
     316
     317static void dumpHostDnsInformation(const HostDnsInformation& info)
     318{
     319    dumpHostDnsStrVector("DNS server", info.servers);
     320    dumpHostDnsStrVector("SearchString", info.searchList);
     321
     322    if (!info.domain.empty())
     323        LogRel(("DNS domain: %s\n", info.domain.c_str()));
     324}
     325
     326
     327static void dumpHostDnsStrVector(const std::string& prefix, const std::vector<std::string>& v)
     328{
     329    int i = 0;
     330    for (std::vector<std::string>::const_iterator it = v.begin();
     331         it != v.end();
     332         ++it, ++i)
     333        LogRel(("%s %d: %s\n", prefix.c_str(), i, it->c_str()));
     334}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette