Ignore:
Timestamp:
Jul 24, 2009, 3:23:11 PM (15 years ago)
Author:
mies
Message:

+ added new transport modules and adapted ariba to them
+ exchange endpoint descriptors an link establishment
+ clean up of base communication
+ link establishment with in the presence of multiple endpoints
+ local discovery for ipv6, ipv4 and bluetooth mac addresses

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/AribaModule.cpp

    r4065 r5284  
    5050#include "ariba/communication/BaseCommunication.h"
    5151#include "ariba/communication/EndpointDescriptor.h"
    52 #include "ariba/communication/modules/network/NetworkLocator.h"
    5352
    5453using namespace ariba::utility::Helper;
     
    5857namespace ariba {
    5958
     59use_logging_cpp(AribaModule);
     60
    6061AribaModule::AribaModule()
    61         : base_comm(NULL), sideport_sniffer(NULL),
    62                 ip_addr(NULL), started(false) {
    63 
    64         // init with default values
    65 
    66         this->tcp_port = 41402;
    67         this->udp_port = 41402;
     62        : base_comm(NULL), sideport_sniffer(NULL), started(false) {
    6863}
    6964
     
    10196                        Name name(type);
    10297                        EndpointDescriptor* desc = EndpointDescriptor::fromString(data);
     98                        logging_debug("Added bootstap info for " << type << ": " << desc->toString() );
    10399                        addBootstrapNode(name, desc);
    104100                }
     
    132128        }
    133129
    134         //logging_debug( "added bootstrap info: " << getBootstrapHints() );
     130        logging_debug( "Added bootstrap info: " << getBootstrapHints() );
    135131}
    136132
     
    171167        started = true;
    172168        base_comm = new BaseCommunication();
     169        base_comm->setEndpoints(endpoints);
    173170}
    174171
     
    192189// @see Module.h
    193190void AribaModule::setProperty(string key, string value) {
    194         if (key == "ip.addr") {
    195                 if (ip_addr != NULL) delete ip_addr;
    196                 communication::IPv4Locator* loc = new communication::IPv4Locator();
    197                 *loc = communication::IPv4Locator::fromString(value);
    198                 ip_addr = loc;
    199         }
    200         else if (key == "tcp.port") tcp_port = stoi(value);
    201         else if (key == "udp.port") udp_port = stoi(value);
     191        if (key == "endpoints") endpoints = value;
    202192        else if (key == "bootstrap.hints") addBootstrapHints(value);
    203193}
     
    205195// @see Module.h
    206196const string AribaModule::getProperty(string key) const {
    207         if (key == "ip.addr") return ip_addr->toString();
    208         else if (key == "tcp.port") return ultos(tcp_port);
    209         else if (key == "udp.port") return ultos(udp_port);
     197        if (key == "endpoints") return endpoints; // TODO: return local endpoints
    210198        else if (key == "bootstrap.hints") return getBootstrapHints();
    211199}
     
    214202const vector<string> AribaModule::getProperties() const {
    215203        vector<string> properties;
    216         properties.push_back("ip.addr");
    217         properties.push_back("tcp.port");
    218         properties.push_back("udp.port");
    219         properties.push_back("hints");
     204        properties.push_back("endpoints");
     205        properties.push_back("bootstrap.hints");
    220206        return properties;
    221207}
Note: See TracChangeset for help on using the changeset viewer.