Changeset 11574 for trunk/FACT++


Ignore:
Timestamp:
07/24/11 20:43:08 (13 years ago)
Author:
tbretz
Message:
Added the possibility to setup DIM_HOST_NODE with the --host program option.
Location:
trunk/FACT++/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/DimSetup.cc

    r11526 r11574  
    158158//!     Address of the Dim-dns
    159159//!
    160 void Dim::Setup(const std::string &dns)
     160void Dim::Setup(const std::string &dns, const std::string &host)
    161161{
    162     const string loc = Dim::GetLocalIp().c_str();
     162    const string loc = host.empty() ? Dim::GetLocalIp() : host;
    163163
    164164    setenv("DIM_DNS_NODE",  dns.c_str(), 1);
  • trunk/FACT++/src/DimSetup.h

    r11236 r11574  
    88    //std::string GetLocalIp(const std::string &dns="192.168.0.255");
    99    std::string GetLocalIp(const std::string &dns="14.0.0.1");
    10     void Setup(const std::string &dns);
     10    void Setup(const std::string &dns, const std::string &host="");
    1111}
    1212
  • trunk/FACT++/src/biasctrl.cc

    r11483 r11574  
    644644    po::options_description config("Program options");
    645645    config.add_options()
    646         ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     646        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     647        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    647648        ("log,l",     var<string>(n), "Write log-file")
    648649        ("no-dim,d",  po_bool(),      "Disable dim services")
     
    659660        ;
    660661
    661     conf.AddEnv("dns", "DIM_DNS_NODE");
     662    conf.AddEnv("dns",  "DIM_DNS_NODE");
     663    conf.AddEnv("host", "DIM_HOST_NODE");
    662664
    663665    conf.AddOptions(config);
     
    742744    }
    743745
    744     Dim::Setup(conf.Get<string>("dns"));
     746    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    745747
    746748    //try
  • trunk/FACT++/src/chatclient.cc

    r10802 r11574  
    33#include "Configuration.h"
    44#include "ChatClient.h"
     5#include "DimSetup.h"
    56
    67using namespace std;
     
    3031    po::options_description config("Program options");
    3132    config.add_options()
    32         ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     33        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     34        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    3335        ("log,l",     var<string>(n), "Write log-file")
    3436        ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
    3537        ;
    3638
    37     conf.AddEnv("dns", "DIM_DNS_NODE");
     39    conf.AddEnv("dns",  "DIM_DNS_NODE");
     40    conf.AddEnv("host", "DIM_HOST_NODE");
    3841
    3942    conf.AddOptions(config);
     
    103106    }
    104107
    105     // To allow overwriting of DIM_DNS_NODE set 0 to 1
    106     setenv("DIM_DNS_NODE", conf.Get<string>("dns").c_str(), 1);
     108    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    107109
    108110    if (conf.Get<int>("console")==0)
  • trunk/FACT++/src/chatserv.cc

    r11481 r11574  
    1616    po::options_description config("Program options");
    1717    config.add_options()
    18         ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     18        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     19        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    1920        ("log,l",     var<string>(n), "Write log-file")
    2021        ;
    2122
    22     conf.AddEnv("dns", "DIM_DNS_NODE");
     23    conf.AddEnv("dns",  "DIM_DNS_NODE");
     24    conf.AddEnv("host", "DIM_HOST_NODE");
    2325
    2426    conf.AddOptions(config);
     
    104106    }
    105107
    106     Dim::Setup(conf.Get<string>("dns"));
     108    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    107109
    108110    WindowLog log;
  • trunk/FACT++/src/datalogger.cc

    r11535 r11574  
    24492449    po::options_description configp("Program options");
    24502450    configp.add_options()
    2451         ("dns",       var<string>("localhost"),  "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     2451        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     2452        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    24522453        ("log,l",     var<string>(n), "Write log-file")
    24532454        ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
     
    24702471        ;
    24712472
    2472     conf.AddEnv("dns", "DIM_DNS_NODE");
     2473    conf.AddEnv("dns",  "DIM_DNS_NODE");
     2474    conf.AddEnv("host", "DIM_HOST_NODE");
    24732475
    24742476    conf.AddOptions(configp);
     
    25092511    }
    25102512
    2511     Dim::Setup(conf.Get<string>("dns"));
     2513    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    25122514
    25132515//    try
  • trunk/FACT++/src/dimctrl.cc

    r11403 r11574  
    4040    po::options_description config("Program options");
    4141    config.add_options()
    42         ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     42        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     43        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    4344        ("log,l",     var<string>(n), "Write log-file")
    4445        ("console,c", var<int>(0),    "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
     
    4849        ;
    4950
    50     conf.AddEnv("dns", "DIM_DNS_NODE");
     51    conf.AddEnv("dns",  "DIM_DNS_NODE");
     52    conf.AddEnv("host", "DIM_HOST_NODE");
    5153
    5254    conf.AddOptions(config);
     
    113115    }
    114116
    115     Dim::Setup(conf.Get<string>("dns"));
     117    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    116118
    117119    if (conf.Get<int>("console")==0)
  • trunk/FACT++/src/drivectrl.cc

    r11483 r11574  
    942942    po::options_description config("Program options");
    943943    config.add_options()
    944         ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     944        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     945        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    945946        ("log,l",     var<string>(n), "Write log-file")
    946947        ("no-dim,d",  po_switch(),    "Disable dim services")
     
    957958        ;
    958959
    959     conf.AddEnv("dns", "DIM_DNS_NODE");
     960    conf.AddEnv("dns",  "DIM_DNS_NODE");
     961    conf.AddEnv("host", "DIM_HOST_NODE");
    960962
    961963    conf.AddOptions(config);
     
    10401042    }
    10411043
    1042     Dim::Setup(conf.Get<string>("dns"));
     1044    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    10431045
    10441046    //try
  • trunk/FACT++/src/fadctrl.cc

    r11544 r11574  
    20652065    po::options_description config("Program options");
    20662066    config.add_options()
    2067         ("dns",       var<string>("localhost"),       "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     2067        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     2068        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    20682069        ("log,l",     var<string>(n), "Write log-file")
    20692070//        ("no-dim,d",  po_switch(),    "Disable dim services")
     
    21242125        ;
    21252126
    2126     conf.AddEnv("dns", "DIM_DNS_NODE");
     2127    conf.AddEnv("dns",  "DIM_DNS_NODE");
     2128    conf.AddEnv("host", "DIM_HOST_NODE");
    21272129
    21282130    conf.AddOptions(config);
     
    21872189    }
    21882190
    2189     Dim::Setup(conf.Get<string>("dns"));
     2191    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    21902192
    21912193//    try
  • trunk/FACT++/src/fscctrl.cc

    r11483 r11574  
    613613    po::options_description config("Program options");
    614614    config.add_options()
    615         ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     615        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     616        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    616617        ("log,l",     var<string>(n), "Write log-file")
    617618        ("no-dim,d",  po_bool(),      "Disable dim services")
     
    628629        ;
    629630
    630     conf.AddEnv("dns", "DIM_DNS_NODE");
     631    conf.AddEnv("dns",  "DIM_DNS_NODE");
     632    conf.AddEnv("host", "DIM_HOST_NODE");
    631633
    632634    conf.AddOptions(config);
     
    711713    }
    712714
    713     Dim::Setup(conf.Get<string>("dns"));
     715    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    714716
    715717    //try
  • trunk/FACT++/src/ftmctrl.cc

    r11563 r11574  
    24232423    po::options_description config("Program options");
    24242424    config.add_options()
    2425         ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
    2426         ("log,l",     var<string>(n), "Write log-file")
     2425        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     2426        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    24272427        ("no-dim,d",  po_bool(),      "Disable dim services")
    24282428        ("console,c", var<int>(),     "Use console (0=shell, 1=simple buffered, X=simple unbuffered)")
     
    24812481        ;
    24822482
    2483     conf.AddEnv("dns", "DIM_DNS_NODE");
     2483    conf.AddEnv("dns",  "DIM_DNS_NODE");
     2484    conf.AddEnv("host", "DIM_HOST_NODE");
    24842485
    24852486    conf.AddOptions(config);
     
    25652566    }
    25662567
    2567     Dim::Setup(conf.Get<string>("dns"));
     2568    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    25682569
    25692570    //try
  • trunk/FACT++/src/mcp.cc

    r11516 r11574  
    515515    po::options_description config("Program options");
    516516    config.add_options()
    517         ("dns",       var<string>("localhost"), "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     517        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     518        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    518519        ("log,l",     var<string>(n), "Write log-file")
    519520//        ("no-dim,d",  po_bool(),      "Disable dim services")
     
    530531        ;
    531532*/
    532     conf.AddEnv("dns", "DIM_DNS_NODE");
     533    conf.AddEnv("dns",  "DIM_DNS_NODE");
     534    conf.AddEnv("host", "DIM_HOST_NODE");
    533535
    534536    conf.AddOptions(config);
     
    613615    }
    614616
    615     Dim::Setup(conf.Get<string>("dns"));
     617    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    616618
    617619    //try
  • trunk/FACT++/src/scheduler.cc

    r11483 r11574  
    805805    po::options_description config("Configuration");
    806806    config.add_options()
    807         ("dns",       var<string>("localhost"),  "Dim nameserver host name (Overwites DIM_DNS_NODE environment variable)")
     807        ("dns",       var<string>("localhost"),       "Dim nameserver (overwites DIM_DNS_NODE environment variable)")
     808        ("host",      var<string>(""),                "Address with which the Dim nameserver can connect to this host (overwites DIM_HOST_NODE environment variable)")
    808809        ("log,l",     var<string>(n), "Write log-file")
    809810        ("no-dim,d",  po_switch(),    "Disable dim services")
     
    842843    p.add("schedule", 1); // The first positional options
    843844
    844     conf.AddEnv("dns", "DIM_DNS_NODE");
     845    conf.AddEnv("dns",  "DIM_DNS_NODE");
     846    conf.AddEnv("host", "DIM_HOST_NODE");
     847
    845848    conf.AddOptions(config);
    846849    conf.AddOptions(control);
     
    902905    }
    903906
    904     Dim::Setup(conf.Get<string>("dns"));
     907    Dim::Setup(conf.Get<string>("dns"), conf.Get<string>("host"));
    905908
    906909//    try
Note: See TracChangeset for help on using the changeset viewer.