HostDnsService.h revision 6c2ae4881e4220cc4bba0738d2b0d158d571ec9b
01bceecc7f7484a8820c77b884bb91cdefc97390vboxsync * Host DNS listener.
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * Copyright (C) 2005-2012 Oracle Corporation
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * available from http://www.virtualbox.org. This file is free software;
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * you can redistribute it and/or modify it under the terms of the GNU
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * General Public License (GPL) as published by the Free Software
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync * This class supposed to be a real DNS monitor object it should be singleton,
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync * it lifecycle starts and ends together with VBoxSVC.
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync static void shutdown();
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync void addMonitorProxy(const HostDnsMonitorProxy&) const;
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync void releaseMonitorProxy(const HostDnsMonitorProxy&) const;
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync void notifyAll() const;
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync * This class supposed to be a proxy for events on changing Host Name Resolving configurations.
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync void init(const HostDnsMonitor* mon, const VirtualBox* aParent);
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync void notify() const;
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync STDMETHOD(COMGETTER(NameServers))(ComSafeArrayOut(BSTR, aNameServers));
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync STDMETHOD(COMGETTER(DomainName))(BSTR *aDomainName);
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync STDMETHOD(COMGETTER(SearchStrings))(ComSafeArrayOut(BSTR, aSearchStrings));
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync static void hostDnsServiceStoreCallback(void *store, void *arrayRef, void *info);
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync void strList2List(std::vector<std::string>& lst, char *strLst);
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync# if defined(RT_OS_SOLARIS) || defined(RT_OS_LINUX) || defined(RT_OS_OS2)
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsyncclass HostDnsServiceResolvConf: public HostDnsMonitor
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync virtual HRESULT init(const char *aResolvConfFileName);
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync * XXX: https://blogs.oracle.com/praks/entry/file_events_notification
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsyncclass HostDnsServiceSolaris: public HostDnsServiceResolvConf
6c2ae4881e4220cc4bba0738d2b0d158d571ec9bvboxsync HRESULT init(){ return HostDnsServiceResolvConf::init("/etc/resolv.conf");}
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsyncclass HostDnsServiceLinux: public HostDnsServiceResolvConf
4a5eed4c1192804dd98b2d803ef27f610a0a5a90vboxsync static int hostMonitoringRoutine(RTTHREAD ThreadSelf, void *pvUser);
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsyncclass HostDnsServiceOs2: public HostDnsServiceResolvConf
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync /* XXX: \\MPTN\\ETC should be taken from environment variable ETC */
3f2299591cfeb8a37a3578bef9c44c1790860948vboxsync HRESULT init(){ return init("\\MPTN\\ETC\\RESOLV2");}
18b1f1bb3429f8bfc1a52cfaeb2445e9fb1f55cdvboxsync#endif /* !___H_DNSHOSTSERVICE */