IBR-DTN  1.0.0
Configuration.cpp
Go to the documentation of this file.
1 /*
2  * Configuration.cpp
3  *
4  * Copyright (C) 2011 IBR, TU Braunschweig
5  *
6  * Written-by: Johannes Morgenroth <morgenroth@ibr.cs.tu-bs.de>
7  *
8  * Licensed under the Apache License, Version 2.0 (the "License");
9  * you may not use this file except in compliance with the License.
10  * You may obtain a copy of the License at
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
14  * Unless required by applicable law or agreed to in writing, software
15  * distributed under the License is distributed on an "AS IS" BASIS,
16  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17  * See the License for the specific language governing permissions and
18  * limitations under the License.
19  *
20  */
21 
22 #include "config.h"
23 #include "Configuration.h"
24 #include "net/DiscoveryBeacon.h"
25 #include "net/DiscoveryBeacon.h"
26 #include "core/Node.h"
27 
28 #include <ibrdtn/ibrdtn.h>
29 #include <ibrdtn/utils/Utils.h>
30 #include <ibrdtn/utils/Clock.h>
31 
32 #include <ibrcommon/net/vinterface.h>
33 #include <ibrcommon/Logger.h>
34 #include <ibrcommon/link/LinkManager.h>
35 
36 #ifdef __WIN32__
37 #include <ibrcommon/link/Win32LinkManager.h>
38 #include <windows.h>
39 
40 #endif
41 
42 #include <getopt.h>
43 #include <unistd.h>
44 
45 #ifdef __DEVELOPMENT_ASSERTIONS__
46 #include <cassert>
47 #endif
48 
49 using namespace dtn::net;
50 using namespace dtn::core;
51 using namespace dtn::utils;
52 using namespace ibrcommon;
53 
54 namespace dtn
55 {
56  namespace daemon
57  {
58  Configuration::NetConfig::NetConfig(const std::string &n, NetType t)
59  : name(n), type(t), iface(ibrcommon::vinterface::ANY), mtu(0), port(0)
60  {
61  }
62 
64  {
65  }
66 
67  std::string Configuration::version() const
68  {
69  std::stringstream ss;
70  ss << PACKAGE_VERSION;
71  #ifdef BUILD_NUMBER
72  ss << " (build " << BUILD_NUMBER << ")";
73  #endif
74 
75  return ss.str();
76  }
77 
78  Configuration::Configuration()
79  : _filename("config.ini"), _doapi(true)
80  {
81  }
82 
83  Configuration::~Configuration()
84  {}
85 
87  : _enabled(true), _interval(5), _announce(true), _short(false), _version(2), _crosslayer(false) {}
88 
90  : _enabled(false), _quiet(false), _level(0), _profiling(false) {}
91 
93  : _quiet(false), _options(0), _timestamps(false), _verbose(false) {}
94 
96  : _routing("default"), _forwarding(true), _prefer_direct(true), _tcp_nodelay(true), _tcp_chunksize(4096), _tcp_idle_timeout(0), _keepalive_timeout(60), _default_net("lo"), _use_default_net(false), _auto_connect(0), _fragmentation(false), _scheduling(false), _link_request_interval(5000)
97  {}
98 
100  : _enabled(false), _tlsEnabled(false), _tlsRequired(false), _tlsOptionalOnBadClock(false), _level(SECURITY_LEVEL_NONE), _disableEncryption(false), _generate_dh_params(false)
101  {}
102 
104  : _daemonize(false), _kill(false), _threads(0)
105  {}
106 
108  : _reference(true), _sync(false), _discovery(false), _sigma(1.001f), _psi(0.8f), _sync_level(0.10f)
109  {}
110 
112  : _enabled(true), _port(0), _dnsbootstrapping(true), _ipv4(true), _ipv6(true), _blacklist(true), _selfannounce(true),
113  _minRating(1), _allowNeighbourToAnnounceMe(true), _allowNeighbourAnnouncement(true),
114  _ignoreDHTNeighbourInformations(false)
115  {}
116 
118  : _ctrl_path(""), _enabled(false)
119  {}
120 
122  : _smtpPort(25), _smtpUseTLS(false), _smtpUseSSL(false), _smtpNeedAuth(false), _smtpInterval(60), _smtpConnectionTimeout(-1), _smtpKeepAliveTimeout(30),
123  _imapPort(143), _imapUseTLS(false), _imapUseSSL(false), _imapInterval(60), _imapConnectionTimeout(-1), _imapPurgeMail(false),
124  _availableTime(1800), _returningMailsCheck(3)
125  {}
126 
136 
138  {
139  return _disco;
140  }
141 
143  {
144  return _debug;
145  }
146 
148  {
149  return _logger;
150  }
151 
153  {
154  return _network;
155  }
156 
158  {
159  return _security;
160  }
161 
163  {
164  return _daemon;
165  }
166 
168  {
169  return _timesync;
170  }
171 
173  {
174  return _dht;
175  }
176 
178  {
179  return _p2p;
180  }
181 
183  {
184  return _email;
185  }
186 
188  {
189  static Configuration conf;
190 
191  // reset configuration
192  if (reset) conf = Configuration();
193 
194  return conf;
195  }
196 
197  void Configuration::params(int argc, char *argv[])
198  {
199  int c;
200  int doapi = _doapi;
201  int disco = _disco._enabled;
202  int timestamp = _logger._timestamps;
203  int showversion = 0;
204 
205  // set number of threads to the number of available cpus
206  _daemon._threads = static_cast<dtn::data::Size>(ibrcommon::Thread::getNumberOfProcessors());
207 
208  while (1)
209  {
210  static struct option long_options[] =
211  {
212  /* These options set a flag. */
213  {"noapi", no_argument, &doapi, 0},
214  {"nodiscovery", no_argument, &disco, 0},
215  {"timestamp", no_argument, &timestamp, 1},
216  {"version", no_argument, &showversion, 1},
217 
218  /* These options don't set a flag. We distinguish them by their indices. */
219  {"help", no_argument, 0, 'h'},
220 #ifdef HAVE_LIBDAEMON
221  {"daemon", no_argument, 0, 'D'},
222  {"kill", no_argument, 0, 'k'},
223  {"pidfile", required_argument, 0, 'p'},
224 #endif
225 
226  {"quiet", no_argument, 0, 'q'},
227  {"interface", required_argument, 0, 'i'},
228  {"configuration", required_argument, 0, 'c'},
229  {"debug", required_argument, 0, 'd'},
230 #ifdef __WIN32__
231  {"interfaces", no_argument, 0, 'I'},
232 #endif
233  {0, 0, 0, 0}
234  };
235 
236  /* getopt_long stores the option index here. */
237  int option_index = 0;
238 
239 #ifdef HAVE_LIBDAEMON
240  c = getopt_long (argc, argv, "qhDkp:vi:c:d:t:",
241  long_options, &option_index);
242 #else
243  c = getopt_long (argc, argv, "qhvi:c:d:t:",
244  long_options, &option_index);
245 #endif
246 
247  /* Detect the end of the options. */
248  if (c == -1)
249  break;
250 
251  switch (c)
252  {
253  case 0:
254  /* If this option set a flag, do nothing else now. */
255  if (long_options[option_index].flag != 0)
256  break;
257  printf ("option %s", long_options[option_index].name);
258  if (optarg)
259  printf (" with arg %s", optarg);
260  printf ("\n");
261  break;
262 
263  case 'h':
264  std::cout << "IBR-DTN version: " << version() << std::endl;
265  std::cout << "Syntax: dtnd [options]" << std::endl;
266  std::cout << " -h|--help display this text" << std::endl;
267  std::cout << " -c <file> set a configuration file" << std::endl;
268 #ifdef HAVE_LIBDAEMON
269  std::cout << " -D daemonize the process" << std::endl;
270  std::cout << " -k stop the running daemon" << std::endl;
271  std::cout << " -p <file> store the pid in this pidfile" << std::endl;
272 #endif
273  std::cout << " -i <interface> interface to bind on (e.g. eth0)" << std::endl;
274  std::cout << " -d <level> enable debugging and set a verbose level" << std::endl;
275  std::cout << " -q enables the quiet mode (no logging to the console)" << std::endl;
276  std::cout << " -t <threads> specify a number of threads for parallel event processing" << std::endl;
277  std::cout << " -v be verbose - show NOTICE log messages" << std::endl;
278  std::cout << " --version show version and exit" << std::endl;
279  std::cout << " --noapi disable API module" << std::endl;
280  std::cout << " --nodiscovery disable discovery module" << std::endl;
281  std::cout << " --timestamp enables timestamps for logging instead of datetime values" << std::endl;
282 #ifdef __WIN32__
283  std::cout << " --interfaces list all available interfaces" << std::endl;
284 #endif
285  exit(0);
286  break;
287 
288  case 'v':
289  _logger._verbose = true;
290  break;
291 
292  case 'q':
293  _debug._quiet = true;
294  break;
295 
296  case 'c':
297  _filename = optarg;
298  break;
299 
300  case 'i':
301  _network._default_net = ibrcommon::vinterface(optarg);
302  _network._use_default_net = true;
303  break;
304 
305  case 'd':
306  _debug._enabled = true;
307  _debug._level = atoi(optarg);
308  break;
309 
310  case 'D':
311  _daemon._daemonize = true;
312  _debug._quiet = true;
313  break;
314 
315  case 'k':
316  _daemon._daemonize = true;
317  _daemon._kill = true;
318  break;
319 
320  case 'p':
321  _daemon._pidfile = std::string(optarg);
322  break;
323 
324  case 't':
325  _daemon._threads = atoi(optarg);
326  break;
327 
328 #ifdef __WIN32__
329  case 'I':
330  {
331  ibrcommon::LinkManager &lm = ibrcommon::LinkManager::getInstance();
332  try {
333  ibrcommon::Win32LinkManager &wlm = dynamic_cast<ibrcommon::Win32LinkManager&>(lm);
334 
335  std::set<ibrcommon::vinterface> ifs = wlm.getInterfaces();
336 
337  std::cout << "Available interfaces:" << std::endl;
338 
339  for (std::set<ibrcommon::vinterface>::const_iterator it = ifs.begin(); it != ifs.end(); ++it)
340  {
341  const ibrcommon::vinterface &iface = (*it);
342  std::cout << iface.toString() << '\t';
343  std::wcout << iface.getFriendlyName() << std::endl;
344  }
345  } catch (const std::bad_cast&) {
346  }
347  exit(0);
348  break;
349  }
350 #endif
351 
352  case '?':
353  /* getopt_long already printed an error message. */
354  break;
355 
356  default:
357  abort();
358  break;
359  }
360  }
361 
362  if (showversion == 1) {
363  std::cout << "IBR-DTN version: " << version() << std::endl;
364  exit(0);
365  }
366 
367  _doapi = doapi;
368  _disco._enabled = disco;
369  _logger._timestamps = timestamp;
370  }
371 
372  void Configuration::load(bool quiet)
373  {
374  load(_filename, quiet);
375  }
376 
377  void Configuration::load(const std::string &filename, bool quiet)
378  {
379  try {
380  // load main configuration
381  _conf = ibrcommon::ConfigFile(filename);
382  _filename = filename;
383 
384  if (!quiet) IBRCOMMON_LOGGER_TAG("Configuration", info) << "Configuration: " << filename << IBRCOMMON_LOGGER_ENDL;
385  } catch (const ibrcommon::ConfigFile::file_not_found&) {
386  if (!quiet) IBRCOMMON_LOGGER_TAG("Configuration", info) << "Using default settings. Call with --help for options." << IBRCOMMON_LOGGER_ENDL;
387  _conf = ConfigFile();
388 
389  // set the default user to nobody
390  _conf.add<std::string>("user", "nobody");
391  }
392 
393  // load all configuration extensions
394  _disco.load(_conf);
395  _debug.load(_conf);
396  _logger.load(_conf);
397  _network.load(_conf);
398  _security.load(_conf);
399  _timesync.load(_conf);
400  _dht.load(_conf);
401  _p2p.load(_conf);
402  _email.load(_conf);
403  }
404 
405  void Configuration::Discovery::load(const ibrcommon::ConfigFile &conf)
406  {
407  _interval = conf.read<unsigned int>("discovery_interval", 5);
408  _announce = (conf.read<int>("discovery_announce", 1) == 1);
409  _short = (conf.read<int>("discovery_short", 0) == 1);
410  _version = conf.read<int>("discovery_version", 2);
411  _crosslayer = (conf.read<std::string>("discovery_crosslayer", "no") == "yes");
412  }
413 
414  void Configuration::Logger::load(const ibrcommon::ConfigFile &conf)
415  {
416  try {
417  _logfile = conf.read<std::string>("logfile");
418  } catch (const ibrcommon::ConfigFile::key_not_found&) {
419  }
420  }
421 
422  void Configuration::Debug::load(const ibrcommon::ConfigFile &conf)
423  {
424  try {
425  _profiling = (conf.read<std::string>("profiling") == "yes");
426  } catch (const ibrcommon::ConfigFile::key_not_found&) { };
427  }
428 
429  void Configuration::Daemon::load(const ibrcommon::ConfigFile&)
430  {
431  }
432 
433  void Configuration::TimeSync::load(const ibrcommon::ConfigFile &conf)
434  {
435  try {
436  _reference = (conf.read<std::string>("time_reference") == "yes");
437  } catch (const ibrcommon::ConfigFile::key_not_found&) { };
438 
439  try {
440  _sync = (conf.read<std::string>("time_synchronize") == "yes");
441  } catch (const ibrcommon::ConfigFile::key_not_found&) { };
442 
443  try {
444  _discovery = (conf.read<std::string>("time_discovery_announcements") == "yes");
445  } catch (const ibrcommon::ConfigFile::key_not_found&) { };
446 
447  _sigma = conf.read<float>("time_sigma", 1.001f);
448  _psi = conf.read<float>("time_psi", 0.9f);
449  _sync_level = conf.read<float>("time_sync_level", 0.15f);
450 
451  // enable the clock modify feature
452  dtn::utils::Clock::setModifyClock(conf.read<std::string>("time_set_clock", "no") == "yes");
453  }
454 
455  void Configuration::DHT::load(const ibrcommon::ConfigFile &conf)
456  {
457  _enabled = (conf.read<std::string> ("dht_enabled", "no") == "yes");
458  _port = conf.read<int> ("dht_port", 9999);
459  _id = conf.read<string> ("dht_id", "");
460  _blacklist = (conf.read<std::string> ("dht_blacklist", "yes") == "yes");
461  _selfannounce = (conf.read<std::string> ("dht_self_announce", "yes") == "yes");
462  _dnsbootstrapping = (conf.read<std::string> ("dht_bootstrapping", "yes") == "yes");
463  string list = conf.read<string> ("dht_bootstrapping_domains", "");
464  _bootstrappingdomains = dtn::utils::Utils::tokenize(" ", list);
465  list = conf.read<string> ("dht_bootstrapping_ips", "");
466  _bootstrappingips = dtn::utils::Utils::tokenize(";", list);
467  _ipv4bind = conf.read<string> ("dht_bind_ipv4", "");
468  _ipv6bind = conf.read<string> ("dht_bind_ipv6", "");
469  _nodesFilePath = conf.read<string> ("dht_nodes_file", "");
470  _ipv4 = (conf.read<std::string> ("dht_enable_ipv4", "yes") == "yes");
471  _ipv6 = (conf.read<std::string> ("dht_enable_ipv6", "yes") == "yes");
472  _minRating = conf.read<int> ("dht_min_rating", 1);
473  _allowNeighbourToAnnounceMe = (conf.read<std::string> ("dht_allow_neighbours_to_announce_me", "yes") == "yes");
474  _allowNeighbourAnnouncement = (conf.read<std::string> ("dht_allow_neighbour_announcement", "yes") == "yes");
475  _ignoreDHTNeighbourInformations = (conf.read<std::string> ("dht_ignore_neighbour_informations", "no") == "yes");
476 
477  if (_minRating < 0) _minRating = 0;
478  }
479 
480  void Configuration::P2P::load(const ibrcommon::ConfigFile &conf)
481  {
482  try {
483  _ctrl_path = conf.read<std::string>("p2p_ctrlpath");
484  _enabled = true;
485  } catch (const ibrcommon::ConfigFile::key_not_found&) {
486  // do nothing here...
487  _enabled = false;
488  }
489  }
490 
491  void Configuration::EMail::load(const ibrcommon::ConfigFile &conf)
492  {
493  std::string tmp;
494  _address = conf.read<std::string> ("email_address", "root@localhost");
495  _smtpServer = conf.read<std::string> ("email_smtp_server", "localhost");
496  _smtpPort = conf.read<int> ("email_smtp_port", 25);
497  _smtpUsername = conf.read<std::string> ("email_smtp_username", "root");
498  _smtpPassword = conf.read<std::string> ("email_smtp_password", "");
499  _smtpInterval = conf.read<size_t> ("email_smtp_submit_interval", 60);
500  _smtpConnectionTimeout = conf.read<size_t> ("email_smtp_connection_timeout", -1);
501  _smtpKeepAliveTimeout = conf.read<size_t> ("email_smtp_keep_alive", 30);
502  _smtpNeedAuth = (conf.read<std::string> ("email_smtp_need_authentication", "no") == "yes");
503  _smtpUseTLS = (conf.read<std::string> ("email_smtp_socket_type", "") == "tls");
504  _smtpUseSSL = (conf.read<std::string> ("email_smtp_socket_type", "") == "ssl");
505  _imapServer = conf.read<std::string> ("email_imap_server", "localhost");
506  _imapPort = conf.read<int> ("email_imap_port", 143);
507  _imapUsername = conf.read<std::string> ("email_imap_username", _smtpUsername);
508  _imapPassword = conf.read<std::string> ("email_imap_password", _smtpPassword);
509  tmp = conf.read<string> ("email_imap_folder", "");
510  _imapFolder = dtn::utils::Utils::tokenize("/", tmp);
511  _imapInterval = conf.read<size_t> ("email_imap_lookup_interval", 60);
512  _imapConnectionTimeout = conf.read<size_t> ("email_imap_connection_timeout", -1);
513  _imapUseTLS = (conf.read<std::string> ("email_imap_socket_type", "") == "tls");
514  _imapUseSSL = (conf.read<std::string> ("email_imap_socket_type", "") == "ssl");
515  _imapPurgeMail = (conf.read<std::string> ("email_imap_purge_mail", "no") == "yes");
516  tmp = conf.read<string> ("email_certs_ca", "");
517  _tlsCACerts = dtn::utils::Utils::tokenize(",", tmp);
518  tmp = conf.read<string> ("email_certs_user", "");
519  _tlsUserCerts = dtn::utils::Utils::tokenize(",", tmp);
520  _availableTime = conf.read<size_t> ("email_node_available_time", 1800);
521  _returningMailsCheck = conf.read<size_t> ("email_returning_mails_checks", 3);
522  }
523 
525  {
526  return _quiet;
527  }
528 
530  {
531  return _profiling;
532  }
533 
535  {
536  return _enabled;
537  }
538 
540  {
541  return _level;
542  }
543 
544  std::string Configuration::getNodename() const
545  {
546  try {
547  return _conf.read<string>("local_uri");
548  } catch (const ibrcommon::ConfigFile::key_not_found&) {
549  std::vector<char> hostname_array(255);
550  if ( gethostname(&hostname_array[0], hostname_array.size()) != 0 )
551  {
552 #ifdef __WIN32__
553  // read hostname from registry
554  bool success = false;
555  HKEY hKey = 0;
556  DWORD dwType = REG_SZ;
557  DWORD dwBufSize = hostname_array.size();
558 
559  const char* subkey = "System\\CurrentControlSet\\Control\\ComputerName\\ActiveComputerName";
560  const char* win9x_subkey = "System\\CurrentControlSet\\Control\\ComputerName\\ComputerName";
561 
562  if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, subkey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
563  {
564  if ( RegQueryValueEx(hKey, "ComputerName", NULL, &dwType, (BYTE*)&hostname_array[0], &dwBufSize) == ERROR_SUCCESS )
565  {
566  success = true;
567  }
568 
569  RegCloseKey(hKey);
570  }
571 
572  if (!success) {
573  if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, win9x_subkey, 0, KEY_READ, &hKey) == ERROR_SUCCESS)
574  {
575  if ( RegQueryValueEx(hKey, "ComputerName", NULL, &dwType, (BYTE*)&hostname_array[0], &dwBufSize) == ERROR_SUCCESS )
576  {
577  success = true;
578  }
579 
580  RegCloseKey(hKey);
581  }
582  }
583 
584  if (!success) {
585  // not hostname available
586  return "dtn://local";
587  }
588 #endif
589  }
590 
591  return "dtn://" + std::string(&hostname_array[0]);
592  }
593  return "dtn://noname";
594  }
595 
596  const std::list<Configuration::NetConfig>& Configuration::Network::getInterfaces() const
597  {
598  return _interfaces;
599  }
600 
601  const std::set<ibrcommon::vaddress> Configuration::Discovery::address() const throw (ParameterNotFoundException)
602  {
603  std::set<ibrcommon::vaddress> ret;
604 
605  try {
606  std::string address_str = Configuration::getInstance()._conf.read<string>("discovery_address");
607  std::vector<std::string> addresses = dtn::utils::Utils::tokenize(" ", address_str);
608 
609  for (std::vector<std::string>::iterator iter = addresses.begin(); iter != addresses.end(); ++iter) {
610  ret.insert( ibrcommon::vaddress(*iter, port(), AF_UNSPEC) );
611  }
612  } catch (const ConfigFile::key_not_found&) {
613  throw ParameterNotFoundException();
614  }
615 
616  return ret;
617  }
618 
620  {
621  return Configuration::getInstance()._conf.read<int>("discovery_port", 4551);
622  }
623 
625  {
626  return _interval;
627  }
628 
630  {
631  return _crosslayer;
632  }
633 
635  {
637 
638  nc.port = _conf.read<int>("api_port", 4550);
639 
640  try {
641  const std::string interface_name = _conf.read<std::string>("api_interface");
642 
643  if (interface_name != "any")
644  {
645  nc.iface = ibrcommon::vinterface(interface_name);
646  }
647  } catch (const ConfigFile::key_not_found&) {
648  nc.iface = ibrcommon::vinterface(ibrcommon::vinterface::LOOPBACK);
649  }
650 
651  return nc;
652  }
653 
654  ibrcommon::File Configuration::getAPISocket() const
655  {
656  try {
657  return ibrcommon::File(_conf.read<std::string>("api_socket"));
658  } catch (const ConfigFile::key_not_found&) {
659  throw ParameterNotSetException();
660  }
661 
662  throw ParameterNotSetException();
663  }
664 
665  std::string Configuration::getStorage() const
666  {
667  return _conf.read<std::string>("storage", "default");
668  }
669 
671  {
672  return _conf.read<std::string>("use_persistent_bundlesets", "no") == "yes";
673  }
674 
675  void Configuration::Network::load(const ibrcommon::ConfigFile &conf)
676  {
680  _static_routes.clear();
681 
682  string key = "route1";
683  unsigned int keynumber = 1;
684 
685  while (conf.keyExists( key ))
686  {
687  vector<string> route = dtn::utils::Utils::tokenize(" ", conf.read<string>(key, "dtn:none dtn:none"));
688  _static_routes.insert( pair<std::string, std::string>( route.front(), route.back() ) );
689 
690  keynumber++;
691  stringstream ss; ss << "route" << keynumber; ss >> key;
692  }
693 
697  // read the node count
698  int count = 1;
699 
700  // initial prefix
701  std::string prefix = "static1_";
702 
703  while ( conf.keyExists(prefix + "uri") )
704  {
705  const dtn::data::EID node_eid( conf.read<std::string>(prefix + "uri", "dtn:none") );
706 
707  // create a address URI
708  std::stringstream ss;
709  ss << "ip=" << conf.read<std::string>(prefix + "address", "127.0.0.1") << ";port=" << conf.read<unsigned int>(prefix + "port", 4556) << ";";
710 
711  dtn::core::Node::Protocol p = Node::CONN_UNDEFINED;
712 
713  const std::string protocol = conf.read<std::string>(prefix + "proto", "tcp");
714  if (protocol == "tcp") p = Node::CONN_TCPIP;
715  if (protocol == "udp") p = Node::CONN_UDPIP;
716  if (protocol == "lowpan") p = Node::CONN_LOWPAN;
717  if (protocol == "zigbee") p = Node::CONN_LOWPAN; //Legacy: Stay compatible with older config files
718  if (protocol == "bluetooth") p = Node::CONN_BLUETOOTH;
719  if (protocol == "http") p = Node::CONN_HTTP;
720  if (protocol == "file") p = Node::CONN_FILE;
721  if (protocol == "dgram:udp") p = Node::CONN_DGRAM_UDP;
722  if (protocol == "dgram:ethernet") p = Node::CONN_DGRAM_ETHERNET;
723  if (protocol == "dgram:lowpan") p = Node::CONN_DGRAM_LOWPAN;
724  if (protocol == "email") {
725  p = Node::CONN_EMAIL;
726  ss.clear();
727  ss << "email=" << conf.read<std::string>(prefix + "email", "root@localhost") << ";";
728  }
729 
730  bool node_exists = false;
731 
732  dtn::core::Node::Type t = (conf.read<std::string>(prefix + "global", "no") == "yes") ?
734 
735  // get node
736  for (std::list<Node>::iterator iter = _nodes.begin(); iter != _nodes.end(); ++iter)
737  {
738  dtn::core::Node &n = (*iter);
739 
740  if (n.getEID() == node_eid)
741  {
742  n.add( dtn::core::Node::URI( t, p, ss.str(), 0, -5 ) );
743  n.setConnectImmediately( conf.read<std::string>(prefix + "immediately", "no") == "yes" );
744  node_exists = true;
745  break;
746  }
747  }
748 
749  if (!node_exists)
750  {
751  Node n(node_eid);
752  n.add( dtn::core::Node::URI( t, p, ss.str(), 0, -5 ) );
753  n.setConnectImmediately( conf.read<std::string>(prefix + "immediately", "no") == "yes" );
754  _nodes.push_back(n);
755  }
756 
757  count++;
758 
759  std::stringstream prefix_stream;
760  prefix_stream << "static" << count << "_";
761  prefix = prefix_stream.str();
762  }
763 
767  _routing = conf.read<string>("routing", "default");
768 
769  if(_routing == "prophet"){
770  /* read prophet parameters */
771  _prophet_config.p_encounter_max = conf.read<float>("prophet_p_encounter_max", 0.7f);
772  if(_prophet_config.p_encounter_max > 1 || _prophet_config.p_encounter_max <= 0)
773  _prophet_config.p_encounter_max = 0.7f;
774  _prophet_config.p_encounter_first = conf.read<float>("prophet_p_encounter_first", 0.5f);
775  if(_prophet_config.p_encounter_first > 1 || _prophet_config.p_encounter_first <= 0)
776  _prophet_config.p_encounter_first = 0.5f;
777  _prophet_config.p_first_threshold = conf.read<float>("prophet_p_first_threshold", 0.1f);
778  if(_prophet_config.p_first_threshold < 0 || _prophet_config.p_first_threshold >= _prophet_config.p_encounter_first)
779  _prophet_config.p_first_threshold = 0; //disable first threshold on misconfiguration
780  _prophet_config.beta = conf.read<float>("prophet_beta", 0.9f);
781  if(_prophet_config.beta < 0 || _prophet_config.beta > 1)
782  _prophet_config.beta = 0.9f;
783  _prophet_config.gamma = conf.read<float>("prophet_gamma", 0.999f);
784  if(_prophet_config.gamma <= 0 || _prophet_config.gamma > 1)
785  _prophet_config.gamma = 0.999f;
786  _prophet_config.delta = conf.read<float>("prophet_delta", 0.01f);
787  if(_prophet_config.delta < 0 || _prophet_config.delta > 1)
788  _prophet_config.delta = 0.01f;
789  _prophet_config.time_unit = conf.read<ibrcommon::Timer::time_t>("prophet_time_unit", 1);
790  if(_prophet_config.time_unit < 1)
791  _prophet_config.time_unit = 1;
792  _prophet_config.i_typ = conf.read<ibrcommon::Timer::time_t>("prophet_i_typ", 300);
793  if(_prophet_config.i_typ < 1)
794  _prophet_config.i_typ = 1;
795  _prophet_config.next_exchange_timeout = conf.read<ibrcommon::Timer::time_t>("prophet_next_exchange_timeout", 120);
796  _prophet_config.forwarding_strategy = conf.read<std::string>("prophet_forwarding_strategy", "GRTR");
797  _prophet_config.gtmx_nf_max = conf.read<unsigned int>("prophet_gtmx_nf_max", 30);
798  }
799 
803  _forwarding = (conf.read<std::string>("routing_forwarding", "yes") == "yes");
804 
808  _prefer_direct = (conf.read<std::string>("routing_prefer_direct", "yes") == "yes");
809 
813  _interfaces.clear();
814 
815  if (_use_default_net)
816  {
817  // create a new netconfig object
819 
820  // set default interface
821  nc.iface = ibrcommon::vinterface(_default_net);
822 
823  // set default port
824  nc.port = 4556;
825 
826  // add to interfaces list
827  _interfaces.push_back( nc );
828  }
829  else try
830  {
831  vector<string> nets = dtn::utils::Utils::tokenize(" ", conf.read<string>("net_interfaces") );
832  for (vector<string>::const_iterator iter = nets.begin(); iter != nets.end(); ++iter)
833  {
834  const std::string &netname = (*iter);
835 
836  const std::string key_type = "net_" + netname + "_type";
837  const std::string key_port = "net_" + netname + "_port";
838  const std::string key_interface = "net_" + netname + "_interface";
839  const std::string key_address = "net_" + netname + "_address";
840  const std::string key_path = "net_" + netname + "_path";
841  const std::string key_mtu = "net_" + netname + "_mtu";
842 
843  const std::string type_name = conf.read<string>(key_type, "tcp");
845 
846  if (type_name == "tcp") type = Configuration::NetConfig::NETWORK_TCP;
847  if (type_name == "udp") type = Configuration::NetConfig::NETWORK_UDP;
848  if (type_name == "http") type = Configuration::NetConfig::NETWORK_HTTP;
849  if (type_name == "lowpan") type = Configuration::NetConfig::NETWORK_LOWPAN;
850  if (type_name == "file") type = Configuration::NetConfig::NETWORK_FILE;
851  if (type_name == "dgram:udp") type = Configuration::NetConfig::NETWORK_DGRAM_UDP;
852  if (type_name == "dgram:lowpan") type = Configuration::NetConfig::NETWORK_DGRAM_LOWPAN;
853  if (type_name == "dgram:ethernet") type = Configuration::NetConfig::NETWORK_DGRAM_ETHERNET;
854  if (type_name == "email") type = Configuration::NetConfig::NETWORK_EMAIL;
855 
856  // create a new netconfig object
857  Configuration::NetConfig nc(netname, type);
858 
859  switch (type)
860  {
862  {
863  nc.url = conf.read<std::string>(key_address, "http://localhost/");
864  break;
865  }
866 
868  {
869  nc.url = conf.read<std::string>(key_path, "");
870  break;
871  }
872 
873  default:
874  {
875  nc.port = conf.read<int>(key_port, 4556);
876  nc.mtu = conf.read<int>(key_mtu, 1280);
877 
878  try {
879  nc.iface = ibrcommon::vinterface(conf.read<std::string>(key_interface));
880  } catch (const ConfigFile::key_not_found&) {
881  // no interface assigned
882  }
883 
884  break;
885  }
886  }
887 
888  // add to interfaces list
889  _interfaces.push_back(nc);
890  }
891  } catch (const ConfigFile::key_not_found&) {
892  // stop the one network is not found.
893  }
894 
898  _tcp_nodelay = (conf.read<std::string>("tcp_nodelay", "yes") == "yes");
899  _tcp_chunksize = conf.read<unsigned int>("tcp_chunksize", 4096);
900  _tcp_idle_timeout = conf.read<unsigned int>("tcp_idle_timeout", 0);
901 
905  _keepalive_timeout = conf.read<unsigned int>("keepalive_timeout", 60);
906 
910  _auto_connect = conf.read<dtn::data::Timeout>("net_autoconnect", 0);
911 
915  _fragmentation = (conf.read<std::string>("fragmentation", "yes") == "yes");
916 
920  try {
921  std::vector<string> inets = dtn::utils::Utils::tokenize(" ", conf.read<string>("net_internet") );
922  for (std::vector<string>::const_iterator iter = inets.begin(); iter != inets.end(); ++iter)
923  {
924  ibrcommon::vinterface inet_dev(*iter);
925  _internet_devices.insert(inet_dev);
926  }
927  } catch (const ibrcommon::ConfigFile::key_not_found&) { };
928 
932  _scheduling = (conf.read<std::string>("scheduling", "no") == "yes");
933 
937  _link_request_interval = conf.read<dtn::data::Timeout>("link_request_interval",5000);
938  }
939 
940  const std::multimap<std::string, std::string>& Configuration::Network::getStaticRoutes() const
941  {
942  return _static_routes;
943  }
944 
945  const std::list<Node>& Configuration::Network::getStaticNodes() const
946  {
947  return _nodes;
948  }
949 
950  ibrcommon::File Configuration::getPath(string name) const
951  {
952  stringstream ss;
953  ss << name << "_path";
954  string key; ss >> key;
955 
956  try {
957  return ibrcommon::File(_conf.read<string>(key));
958  } catch (const ConfigFile::key_not_found&) { }
959 
960  throw ParameterNotSetException();
961  }
962 
964  {
965  return _enabled;
966  }
967 
969  {
970  return _announce;
971  }
972 
974  {
975  return _short;
976  }
977 
979  {
980  return _version;
981  }
982 
983  bool Configuration::doAPI() const
984  {
985  return _doapi;
986  }
987 
989  {
990  if ( _routing == "none" ) return NO_ROUTING;
991  if ( _routing == "epidemic" ) return EPIDEMIC_ROUTING;
992  if ( _routing == "flooding" ) return FLOOD_ROUTING;
993  if ( _routing == "prophet" ) return PROPHET_ROUTING;
994  return DEFAULT_ROUTING;
995  }
996 
997 
999  {
1000  return _forwarding;
1001  }
1002 
1004  {
1005  return _prefer_direct;
1006  }
1007 
1009  {
1010  return _fragmentation;
1011  }
1012 
1014  {
1015  return _scheduling;
1016  }
1017 
1019  {
1020  return _tcp_nodelay;
1021  }
1022 
1024  {
1025  return _tcp_chunksize;
1026  }
1027 
1029  {
1030  return _tcp_idle_timeout;
1031  }
1032 
1034  {
1035  return _keepalive_timeout;
1036  }
1037 
1039  {
1040  return _auto_connect;
1041  }
1042 
1044  {
1045  return _prophet_config;
1046  }
1047 
1048  std::set<ibrcommon::vinterface> Configuration::Network::getInternetDevices() const
1049  {
1050  return _internet_devices;
1051  }
1052 
1054  {
1055  return _link_request_interval;
1056  }
1057 
1058  dtn::data::Size Configuration::getLimit(const std::string &suffix) const
1059  {
1060  std::string unparsed = _conf.read<std::string>("limit_" + suffix, "0");
1061 
1062  std::stringstream ss(unparsed);
1063 
1064  float value; ss >> value;
1065  char multiplier = 0; ss >> multiplier;
1066 
1067  switch (multiplier)
1068  {
1069  default:
1070  return static_cast<dtn::data::Size>(value);
1071  break;
1072 
1073  case 'G':
1074  return static_cast<dtn::data::Size>(value * 1000000000);
1075  break;
1076 
1077  case 'M':
1078  return static_cast<dtn::data::Size>(value * 1000000);
1079  break;
1080 
1081  case 'K':
1082  return static_cast<dtn::data::Size>(value * 1000);
1083  break;
1084  }
1085 
1086  return 0;
1087  }
1088 
1089  void Configuration::Security::load(const ibrcommon::ConfigFile &conf)
1090  {
1091  bool withTLS = false;
1092 #ifdef WITH_TLS
1093  withTLS = true;
1094  /* enable TLS if the certificate path, a certificate and the private key was given */
1095  bool activateTLS = true;
1096 
1097  // load public key file
1098  try {
1099  _cert = conf.read<std::string>("security_certificate");
1100 
1101  if (!_cert.exists())
1102  {
1103  IBRCOMMON_LOGGER_TAG("Configuration", warning) << "Certificate file " << _cert.getPath() << " does not exists!" << IBRCOMMON_LOGGER_ENDL;
1104  activateTLS = false;
1105  }
1106  } catch (const ibrcommon::ConfigFile::key_not_found&) {
1107  activateTLS = false;
1108  }
1109 
1110  // load KEY file
1111  try {
1112  _key = conf.read<std::string>("security_key");
1113 
1114  if (!_key.exists())
1115  {
1116  IBRCOMMON_LOGGER_TAG("Configuration", warning) << "KEY file " << _key.getPath() << " does not exists!" << IBRCOMMON_LOGGER_ENDL;
1117  activateTLS = false;
1118  }
1119  } catch (const ibrcommon::ConfigFile::key_not_found&) {
1120  activateTLS = false;
1121  }
1122 
1123  // read trustedCAPath
1124  try{
1125  _trustedCAPath = conf.read<std::string>("security_trusted_ca_path");
1126  if(!_trustedCAPath.isDirectory()){
1127  IBRCOMMON_LOGGER_TAG("Configuration", warning) << "Trusted CA Path " << _trustedCAPath.getPath() << " does not exists or is no directory!" << IBRCOMMON_LOGGER_ENDL;
1128  activateTLS = false;
1129  }
1130  } catch (const ibrcommon::ConfigFile::key_not_found&) {
1131  activateTLS = false;
1132  }
1133 
1134  // read if encryption should be disabled
1135  _disableEncryption = (conf.read<std::string>("security_tls_disable_encryption", "no") == "yes");
1136 
1137  if (activateTLS)
1138  {
1139  _tlsEnabled = true;
1140 
1141  /* read if TLS is required */
1142  _tlsRequired = (conf.read<std::string>("security_tls_required", "no") == "yes");
1143 
1144  /* If the clock is not in sync, SSL will fail. Accept plain connection when the clock is not sync'ed. */
1145  _tlsOptionalOnBadClock = (conf.read<std::string>("security_tls_fallback_badclock", "no") == "yes");
1146  }
1147 #endif
1148 
1149 #ifdef IBRDTN_SUPPORT_BSP
1150  // enable security if the security path is set
1151  try {
1152  _path = conf.read<std::string>("security_path");
1153 
1154  if (!_path.exists())
1155  {
1156  ibrcommon::File::createDirectory(_path);
1157  }
1158 
1159  _enabled = true;
1160  } catch (const ibrcommon::ConfigFile::key_not_found&) {
1161  return;
1162  }
1163 
1164  // load level
1165  _level = Level(conf.read<int>("security_level", 0));
1166 
1167  if ( !withTLS )
1168  {
1169  /* if TLS is enabled, the Certificate file and the key have been read earlier */
1170  // load CA file
1171  try {
1172  _cert = conf.read<std::string>("security_certificate");
1173 
1174  if (!_cert.exists())
1175  {
1176  IBRCOMMON_LOGGER_TAG("Configuration", warning) << "Certificate file " << _cert.getPath() << " does not exists!" << IBRCOMMON_LOGGER_ENDL;
1177  }
1178  } catch (const ibrcommon::ConfigFile::key_not_found&) { }
1179 
1180  // load KEY file
1181  try {
1182  _key = conf.read<std::string>("security_key");
1183 
1184  if (!_key.exists())
1185  {
1186  IBRCOMMON_LOGGER_TAG("Configuration", warning) << "KEY file " << _key.getPath() << " does not exists!" << IBRCOMMON_LOGGER_ENDL;
1187  }
1188  } catch (const ibrcommon::ConfigFile::key_not_found&) { }
1189  }
1190 
1191  // load KEY file
1192  try {
1193  _bab_default_key = conf.read<std::string>("security_bab_default_key");
1194 
1195  if (!_bab_default_key.exists())
1196  {
1197  IBRCOMMON_LOGGER_TAG("Configuration", warning) << "KEY file " << _bab_default_key.getPath() << " does not exists!" << IBRCOMMON_LOGGER_ENDL;
1198  }
1199  } catch (const ibrcommon::ConfigFile::key_not_found&) {
1200  }
1201 
1202  // automatic DH parameters
1203  try {
1204  _generate_dh_params = conf.read<std::string>("generate_dh_params") == "yes";
1205  } catch (const ibrcommon::ConfigFile::key_not_found&) {
1206  }
1207 #endif
1208  }
1209 
1211 
1213  {
1214  return _enabled;
1215  }
1216 
1218  {
1219  return _tlsEnabled;
1220  }
1221 
1223  {
1224  // TLS is only required, if the clock is in sync
1225  if ((dtn::utils::Clock::getRating() == 0) && _tlsOptionalOnBadClock) return false;
1226  return _tlsRequired;
1227  }
1228 
1229  const ibrcommon::File& Configuration::Security::getPath() const
1230  {
1231  return _path;
1232  }
1233 
1235  {
1236  return _level;
1237  }
1238 
1239  const ibrcommon::File& Configuration::Security::getBABDefaultKey() const
1240  {
1241  return _bab_default_key;
1242  }
1243 
1244  const ibrcommon::File& Configuration::Security::getCertificate() const
1245  {
1246  return _cert;
1247  }
1248 
1249  const ibrcommon::File& Configuration::Security::getKey() const
1250  {
1251  return _key;
1252  }
1253 
1254  const ibrcommon::File& Configuration::Security::getTrustedCAPath() const
1255  {
1256  return _trustedCAPath;
1257  }
1258 
1260  {
1261  return _disableEncryption;
1262  }
1263 
1265  {
1266  return _generate_dh_params;
1267  }
1268 
1270  {
1271  return _quiet;
1272  }
1273 
1274  const ibrcommon::File& Configuration::Logger::getLogfile() const
1275  {
1276  if (_logfile.getPath() == "") throw Configuration::ParameterNotSetException();
1277  return _logfile;
1278  }
1279 
1281  {
1282  return _verbose;
1283  }
1284 
1286  {
1287  return _timestamps;
1288  }
1289 
1290  unsigned int Configuration::Logger::options() const
1291  {
1292  return _options;
1293  }
1294 
1295  std::ostream& Configuration::Logger::output() const
1296  {
1297  return std::cout;
1298  }
1299 
1301  {
1302  return _daemonize;
1303  }
1304 
1306  {
1307  return _kill;
1308  }
1309 
1311  {
1312  return _threads;
1313  }
1314 
1315  const ibrcommon::File& Configuration::Daemon::getPidFile() const
1316  {
1317  if (_pidfile == ibrcommon::File()) throw ParameterNotSetException();
1318  return _pidfile;
1319  }
1320 
1322  {
1323  return _reference;
1324  }
1325 
1327  {
1328  return _sync;
1329  }
1330 
1332  {
1333  return _discovery;
1334  }
1335 
1337  {
1338  return _sigma;
1339  }
1340 
1342  {
1343  return _psi;
1344  }
1345 
1347  {
1348  return _sync_level;
1349  }
1350 
1352  {
1353  return _enabled;
1354  }
1355 
1357  {
1358  return _port == 0;
1359  }
1360 
1361  unsigned int Configuration::DHT::getPort() const
1362  {
1363  return _port;
1364  }
1365 
1367  {
1368  return _id;
1369  }
1370 
1372  {
1373  return _id == "";
1374  }
1375 
1377  {
1378  return _dnsbootstrapping;
1379  }
1380 
1382  {
1383  return _bootstrappingdomains;
1384  }
1385 
1387  {
1388  return !_bootstrappingips.empty();
1389  }
1390 
1391  std::vector<string> Configuration::DHT::getIPBootstrappingIPs() const
1392  {
1393  return _bootstrappingips;
1394  }
1395 
1397  {
1398  return _ipv4bind;
1399  }
1401  {
1402  return _ipv6bind;
1403  }
1404 
1406  {
1407  return _nodesFilePath;
1408  }
1409 
1411  {
1412  return _ipv4;
1413  }
1414 
1416  {
1417  return _ipv6;
1418  }
1419 
1421  {
1422  return _selfannounce;
1423  }
1424 
1426  {
1427  return _minRating;
1428  }
1429 
1431  {
1432  return _allowNeighbourAnnouncement;
1433  }
1434 
1436  {
1437  return _allowNeighbourToAnnounceMe;
1438  }
1439 
1441  {
1442  return _blacklist;
1443  }
1444 
1446  {
1447  return _ignoreDHTNeighbourInformations;
1448  }
1449 
1451  {
1452  return _enabled;
1453  }
1454 
1455  const std::string Configuration::P2P::getCtrlPath() const
1456  {
1457  return _ctrl_path;
1458  }
1459 
1461  {
1462  return _address;
1463  }
1464 
1466  {
1467  return _smtpServer;
1468  }
1469 
1471  {
1472  return _smtpPort;
1473  }
1474 
1476  {
1477  return _smtpUsername;
1478  }
1479 
1481  {
1482  return _smtpPassword;
1483  }
1484 
1486  {
1487  return _smtpInterval;
1488  }
1489 
1491  {
1492  return _smtpConnectionTimeout;
1493  }
1495  {
1496  return _smtpKeepAliveTimeout * 1000;
1497  }
1498 
1500  {
1501  return _smtpNeedAuth;
1502  }
1503 
1505  {
1506  return _smtpUseTLS;
1507  }
1508 
1510  {
1511  return _smtpUseSSL;
1512  }
1513 
1515  {
1516  return _imapServer;
1517  }
1518 
1520  {
1521  return _imapPort;
1522  }
1523 
1525  {
1526  return _imapUsername;
1527  }
1528 
1530  {
1531  return _imapPassword;
1532  }
1533 
1534  std::vector<std::string> Configuration::EMail::getImapFolder() const
1535  {
1536  return _imapFolder;
1537  }
1538 
1540  {
1541  return _imapInterval;
1542  }
1543 
1545  {
1546  return _imapConnectionTimeout;
1547  }
1548 
1550  {
1551  return _imapUseTLS;
1552  }
1553 
1555  {
1556  return _imapUseSSL;
1557  }
1558 
1560  {
1561  return _imapPurgeMail;
1562  }
1563 
1564  std::vector<std::string> Configuration::EMail::getTlsCACerts() const
1565  {
1566  return _tlsCACerts;
1567  }
1568 
1569  std::vector<std::string> Configuration::EMail::getTlsUserCerts() const
1570  {
1571  return _tlsUserCerts;
1572  }
1573 
1575  {
1576  return _availableTime;
1577  }
1578 
1580  {
1581  return _returningMailsCheck;
1582  }
1583  }
1584 }
static Configuration & getInstance(bool reset=false)
const std::list< NetConfig > & getInterfaces() const
dtn::data::Timeout getKeepaliveInterval() const
const ibrcommon::File & getBABDefaultKey() const
void params(int argc, char *argv[])
const Configuration::TimeSync & getTimeSync() const
const Configuration::Security & getSecurity() const
const Configuration::Discovery & getDiscovery() const
bool _debug
Definition: Main.cpp:67
dtn::data::Size getThreads() const
void load(const ibrcommon::ConfigFile &conf)
static void setModifyClock(bool val)
Definition: Clock.cpp:77
const Configuration::Logger & getLogger() const
ibrcommon::vinterface _default_net
void load(const ibrcommon::ConfigFile &conf)
size_t Length
Definition: Number.h:33
void load(const ibrcommon::ConfigFile &conf)
Configuration::NetConfig getAPIInterface() const
void load(const ibrcommon::ConfigFile &conf)
const std::string getCtrlPath() const
bool TLSRequired() const
Checks if TLS is required.
std::vector< string > getDNSBootstrappingNames() const
const ibrcommon::File & getLogfile() const
void load(const ibrcommon::ConfigFile &conf)
std::string getNodename() const
const ibrcommon::File & getKey() const
RoutingExtension getRoutingExtension() const
void load(const ibrcommon::ConfigFile &conf)
std::string getSmtpUsername() const
const Configuration::P2P & getP2P() const
const Configuration::Network & getNetwork() const
void load(const ibrcommon::ConfigFile &conf)
#define PACKAGE_VERSION
Definition: config.h:112
dtn::data::Size getLimit(const std::string &) const
const Configuration::DHT & getDHT() const
void load(bool quiet=false)
ibrcommon::File getPath(string name) const
bool TLSEncryptionDisabled() const
Checks if Encryption in TLS shall be disabled.
const ibrcommon::File & getCertificate() const
const Configuration::Debug & getDebug() const
const ibrcommon::File & getTrustedCAPath() const
Read the path for trusted Certificates from the Configuration.
size_t Timeout
Definition: Number.h:35
bool isGenerateDHParamsEnabled() const
Generate DH parameters automatically if necessary.
std::vector< std::string > getImapFolder() const
std::string getSmtpPassword() const
std::string version() const
const std::multimap< std::string, std::string > & getStaticRoutes() const
const std::list< Node > & getStaticNodes() const
void add(const URI &u)
Definition: Node.cpp:280
ProphetConfig getProphetConfig() const
std::string getImapPassword() const
#define BUILD_NUMBER
Definition: config.h:8
const ibrcommon::File & getPidFile() const
void load(const ibrcommon::ConfigFile &conf)
void load(const ibrcommon::ConfigFile &conf)
std::string getStorage() const
std::vector< std::string > getTlsCACerts() const
size_t Size
Definition: Number.h:34
static double getRating()
Definition: Clock.cpp:59
bool getUsePersistentBundleSets() const
const Configuration::EMail & getEMail() const
const dtn::data::EID & getEID() const
Definition: Node.cpp:406
dtn::data::Length getTCPChunkSize() const
const Configuration::Daemon & getDaemon() const
void setConnectImmediately(bool val)
Definition: Node.cpp:521
ibrcommon::File getAPISocket() const
const ibrcommon::File & getPath() const
void load(const ibrcommon::ConfigFile &conf)
dtn::data::Timeout getTCPIdleTimeout() const
std::string getImapUsername() const
bool doTLS() const
checks if TLS shall be activated
static std::vector< std::string > tokenize(const std::string &token, const std::string &data, const std::string::size_type max=std::string::npos)
Definition: Utils.cpp:60
std::vector< std::string > getTlsUserCerts() const
const std::set< ibrcommon::vaddress > address() const
dtn::data::Timeout getAutoConnect() const
std::vector< string > getIPBootstrappingIPs() const
std::set< ibrcommon::vinterface > getInternetDevices() const