CernVM-FS
2.12.0
|
#include <resolv_conf_event_handler.h>
Public Types | |
typedef std::vector< std::pair < int, std::string > > | AddressList |
Public Member Functions | |
ResolvConfEventHandler (download::DownloadManager *download_manager, download::DownloadManager *external_download_manager) | |
virtual | ~ResolvConfEventHandler () |
virtual bool | Handle (const std::string &file_path, file_watcher::Event event, bool *clear_handler) |
Public Member Functions inherited from file_watcher::EventHandler | |
EventHandler () | |
virtual | ~EventHandler () |
Static Public Member Functions | |
static void | GetDnsAddresses (const std::string &resolv_file, AddressList *addresses) |
static void | SetDnsAddress (download::DownloadManager *download_manager, const AddressList &addresses) |
Private Attributes | |
download::DownloadManager * | download_manager_ |
download::DownloadManager * | external_download_manager_ |
Definition at line 21 of file resolv_conf_event_handler.h.
typedef std::vector<std::pair<int, std::string> > ResolvConfEventHandler::AddressList |
List of IP addresses
Each address is stored as a <TYPE, ADDRESS> pair, were TYPE is either 4 or 6.
Definition at line 29 of file resolv_conf_event_handler.h.
ResolvConfEventHandler::ResolvConfEventHandler | ( | download::DownloadManager * | download_manager, |
download::DownloadManager * | external_download_manager | ||
) |
Definition at line 40 of file resolv_conf_event_handler.cc.
|
virtual |
Definition at line 46 of file resolv_conf_event_handler.cc.
|
static |
Returns any nameserver IP addresses from file
Reads a file, line by line. Returns the IP addresses corresponding to nameservers (i.e. from lines "nameserver <IP_ADDRESS>")
Definition at line 67 of file resolv_conf_event_handler.cc.
Referenced by Handle().
|
virtual |
Handle function called per event
file_path | - the path of the file this event corresponds to |
event | - the type of event |
clear_handler | - (output) set this to true to have the event handler remove from the loop after this call |
Should return false in case of failure.
Setting the clear_handler parameter to false means that the FileWatcher object will attempt to re-register the handler for the same file name in the case a file was delete - useful for continuously watching a file which may be deleted and recreated
Implements file_watcher::EventHandler.
Definition at line 48 of file resolv_conf_event_handler.cc.
|
static |
Definition at line 99 of file resolv_conf_event_handler.cc.
Referenced by Handle().
|
private |
Definition at line 46 of file resolv_conf_event_handler.h.
Referenced by Handle().
|
private |
Definition at line 47 of file resolv_conf_event_handler.h.
Referenced by Handle().