Changeset 19232
- Timestamp:
- 10/03/18 20:32:17 (6 years ago)
- Location:
- trunk/FACT++/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/src/DimSetup.cc
r12348 r19232 158 158 //! Address of the Dim-dns 159 159 //! 160 void Dim::Setup(const std::string &dns, const std::string &host )160 void Dim::Setup(const std::string &dns, const std::string &host, const uint16_t &port) 161 161 { 162 162 if (dns.empty()) … … 172 172 setenv("DIM_DNS_NODE", dns.c_str(), 1); 173 173 setenv("DIM_HOST_NODE", loc.c_str(), 1); 174 if (port>0) 175 setenv("DIM_DNS_PORT", to_string(port).c_str(), 1); 174 176 175 cout << "Setting DIM_DNS_NODE =" << dns << endl; 177 cout << "Setting DIM_DNS_NODE =" << dns; 178 if (port>0) 179 cout << ':' << port << endl; 176 180 cout << "Setting DIM_HOST_NODE=" << loc << endl; 177 181 } -
trunk/FACT++/src/DimSetup.h
r14955 r19232 8 8 //std::string GetLocalIp(const std::string &dns="192.168.0.255"); 9 9 std::string GetLocalIp(const std::string &dns="10.0.100.1"); 10 void Setup(const std::string &dns="", const std::string &host="" );10 void Setup(const std::string &dns="", const std::string &host="", const uint16_t &port=0); 11 11 } 12 12 -
trunk/FACT++/src/Main.h
r18845 r19232 29 29 po::options_description config("Program options"); 30 30 config.add_options() 31 ("dns", var<string>("localhost"), "Dim nameserver (overwites DIM_DNS_NODE environment variable)") 32 ("host", var<string>(), "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)") 31 ("dns", var<string>("localhost"), "Dim nameserver (overwites DIM_DNS_NODE environment variable)") 32 ("port", var<uint16_t>(DNS_PORT), "Port to connect to dim nameserver.") 33 ("host", var<string>(""), "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)") 33 34 ("log,l", var<string>(n), "Name of local log-file") 34 35 ("logpath", var<string>(), "Absolute path to log-files (default: excutable's directory)") … … 45 46 46 47 conf.AddEnv("dns", "DIM_DNS_NODE"); 48 conf.AddEnv("port", "DIM_DNS_PORT"); 47 49 conf.AddEnv("host", "DIM_HOST_NODE"); 48 50 conf.AddEnv("home", "HOME"); … … 88 90 int execute(Configuration &conf, bool dummy=false) 89 91 { 90 Dim::Setup(conf.Get<string>("dns"), conf. Has("host")?conf.Get<string>("host"):"");92 Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"), conf.Get<uint16_t>("port")); 91 93 92 94 // -----------------------------------------------------------------
Note:
See TracChangeset
for help on using the changeset viewer.