An Overlay-based
Virtual Network Substrate
SpoVNet

Changeset 3690


Ignore:
Timestamp:
May 26, 2009, 1:40:23 AM (10 years ago)
Author:
mies
Message:

Merged 20090512-mies-connectors changes r3472:r3689 into trunk.

Files:
15 added
146 edited

Legend:

Unmodified
Added
Removed
  • /

    • Property svn:mergeinfo changed (with no actual effect on merging)
  • sample/pingpong

    • Property svn:ignore
      •  

        old new  
        1717.libs
        1818.*
         19pingpong
  • source/ariba/Identifiers.cpp

    r2409 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Identifiers.h"
  • source/ariba/Makefile.am

    r3374 r3690  
    268268  overlay/messages/JoinReply.cpp \
    269269  overlay/messages/JoinRequest.cpp \
     270  overlay/messages/LinkRequest.cpp \
    270271  overlay/messages/OverlayMsg.cpp
    271272
     
    273274  overlay/messages/JoinReply.h \
    274275  overlay/messages/JoinRequest.h \
     276  overlay/messages/LinkRequest.h \
    275277  overlay/messages/OverlayMsg.h
    276278
     
    300302  overlay/modules/onehop/messages/NodeListingRequest.h \
    301303  overlay/modules/onehop/messages/NodeListingReply.h
     304
     305#------------> overlay :: modules :: chord
     306
     307libariba_la_SOURCES += \
     308  overlay/modules/chord/Chord.cpp \
     309  overlay/modules/chord/messages/ChordMessage.cpp \
     310  overlay/modules/chord/messages/Discovery.cpp
     311
     312nobase_libariba_la_HEADERS += \
     313  overlay/modules/chord/Chord.h \
     314  overlay/modules/chord/messages/ChordMessage.h \
     315  overlay/modules/chord/messages/Discovery.h \
     316  overlay/modules/chord/detail/chord_routing_table.hpp \
     317  overlay/modules/chord/detail/comparators.hpp \
     318  overlay/modules/chord/detail/distances.hpp \
     319  overlay/modules/chord/detail/minimizer_table.hpp \
     320  overlay/modules/chord/detail/table_listener.hpp
    302321
    303322#------------> utility
  • source/ariba/SpoVNetProperties.cpp

    r2440 r3690  
    4444
    4545SpoVNetProperties::SpoVNetProperties() :
    46                 name( Name::random() ), type( ONE_HOP_OVERLAY ), idLength( 192 ),
     46                name( Name::random() ), type( CHORD_OVERLAY ), idLength( 192 ),
    4747                initiator( NodeID::UNSPECIFIED ), hidden( false ) {
    4848
     
    5151
    5252SpoVNetProperties::SpoVNetProperties(const SpoVNetProperties& copy) :
    53                 name( copy.name ), id( copy.id ), 
     53                name( copy.name ), id( copy.id ),
    5454                type( copy.type ), idLength( copy.idLength ),
    5555                initiator( copy.initiator ), hidden( copy.hidden ) {
     
    8888                << " name=" << name.toString()
    8989                << " id=" << id.toString()
    90                 << " overlay_type=" << type 
    91                 << " id_length=" << idLength 
     90                << " overlay_type=" << type
     91                << " id_length=" << idLength
    9292                << " initiator=" << initiator
    9393                << " hidden=" << hidden;
  • source/ariba/SpoVNetProperties.h

    r3055 r3690  
    127127        uint16_t getIdentifierLength() const;
    128128
     129        void setIdentifierLength( uint16_t length ) {
     130                this->idLength = length;
     131        }
     132
     133
    129134        /**
    130135         * Returns the overlay type.
     
    132137        const OverlayType getBaseOverlayType() const;
    133138
     139        void setBaseOverlayType( OverlayType type ) {
     140                this->type = type;
     141        }
     142
     143
    134144        /**
    135145         * Returns true, if the spovnet is hidden
    136146         */
    137147        bool isHidden() const;
     148
     149        void setHidden( bool is_hidden ) {
     150                this->hidden = is_hidden;
     151        }
    138152
    139153        /**
  • source/ariba/communication/BaseCommunication.cpp

    r3067 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "BaseCommunication.h"
     
    160160
    161161const LinkID BaseCommunication::establishLink(
    162                         const EndpointDescriptor& descriptor,
    163                         const QoSParameterSet& qos,
    164                         const SecurityParameterSet& sec){
    165 
     162        const EndpointDescriptor& descriptor,
     163        const LinkID& link_id,
     164        const QoSParameterSet& qos,
     165        const SecurityParameterSet& sec) {
     166
     167        // copy link id
     168        LinkID linkid = link_id;
     169
     170        // debug
    166171        logging_debug( "request to establish link" );
    167172
     
    169174        // just use the first locator in the endp descriptors
    170175        //
    171 
    172176        if( descriptor.locator == NULL ){
    173177                logging_error( "invalid destination endpoint" );
     
    183187        const NetworkLocator* local =  localDescriptor.locator;
    184188
    185         //
    186         // create link and link descriptor
    187         //
    188 
    189         LinkID linkid = LinkID::create();
    190 
     189        // create link identifier and link descriptor
     190        if (linkid.isUnspecified()) linkid = LinkID::create();
    191191        logging_debug( "creating new local descriptor entry with local link id " << linkid.toString() );
    192192        LinkDescriptor linkDescriptor( linkid, local, LinkID::UNSPECIFIED, remote, descriptor, false );
  • source/ariba/communication/BaseCommunication.h

    r3037 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef BASECOMMUNICATION_H_
     
    147147
    148148        /**
    149          * Establishes a link to another end-point
     149         * Establishes a link to another end-point.
    150150         */
    151151        const LinkID establishLink(
    152                         const EndpointDescriptor& descriptor,
    153                         const QoSParameterSet& qos = QoSParameterSet::DEFAULT,
    154                         const SecurityParameterSet& sec = SecurityParameterSet::DEFAULT
     152                const EndpointDescriptor& descriptor,
     153                const LinkID& linkid = LinkID::UNSPECIFIED,
     154                const QoSParameterSet& qos = QoSParameterSet::DEFAULT,
     155                const SecurityParameterSet& sec = SecurityParameterSet::DEFAULT
    155156        );
    156157
    157158        /**
    158          * Drops a link
     159         * Drops a link.
    159160         *
    160161         * @param The link id of the link that should be dropped
  • source/ariba/communication/CommunicationEvents.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "CommunicationEvents.h"
  • source/ariba/communication/CommunicationEvents.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __COMMUNICATION_EVENTS_H
  • source/ariba/communication/EndpointDescriptor.cpp

    r3037 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "EndpointDescriptor.h"
  • source/ariba/communication/EndpointDescriptor.h

    r3037 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef ENDPOINTDESCRIPTOR_H_
     
    5656using_serialization;
    5757
    58 class EndpointDescriptor : VSerializeable {
     58class EndpointDescriptor : public VSerializeable {
    5959        VSERIALIZEABLE;
    6060
  • source/ariba/communication/messages/AribaBaseMsg.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "AribaBaseMsg.h"
  • source/ariba/communication/messages/AribaBaseMsg.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef ARIBA_BASE_MSG_H__
  • source/ariba/communication/modules/_namespace.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#undef NAMESPACE_BEGIN
  • source/ariba/communication/modules/modules.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef MODULES_H_
  • source/ariba/communication/modules/network/NetworkLocator.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "NetworkLocator.h"
  • source/ariba/communication/modules/network/NetworkLocator.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef NETWORKLOCATOR_H_
  • source/ariba/communication/modules/network/NetworkProtocol.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "NetworkProtocol.h"
  • source/ariba/communication/modules/network/NetworkProtocol.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef NETWORKPROTOCOL_H_
  • source/ariba/communication/modules/network/ip/IPv4Locator.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "IPv4Locator.h"
  • source/ariba/communication/modules/network/ip/IPv4Locator.h

    r2452 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef IPV4LOCATOR_H_
  • source/ariba/communication/modules/network/ip/IPv4NetworkProtocol.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "IPv4NetworkProtocol.h"
  • source/ariba/communication/modules/network/ip/IPv4NetworkProtocol.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef IPV4_NETWORK_PROTOCOL_H__
  • source/ariba/communication/modules/network/omnet/OmnetNetworkProtocol.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OmnetNetworkProtocol.h"
  • source/ariba/communication/modules/network/omnet/OmnetNetworkProtocol.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __OMNET_NETWORK_PROTOCOL_H
  • source/ariba/communication/modules/transport/TransportLocator.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "TransportLocator.h"
  • source/ariba/communication/modules/transport/TransportLocator.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef TRANSPORTLOCATOR_H_
  • source/ariba/communication/modules/transport/TransportProtocol.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "TransportProtocol.h"
  • source/ariba/communication/modules/transport/TransportProtocol.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef TRANSPORTPROTOCOL_H_
  • source/ariba/communication/modules/transport/omnet/AribaOmnetMessage.msg

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939message AribaOmnetMessage
  • source/ariba/communication/modules/transport/omnet/AribaOmnetModule.cpp

    r3055 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "AribaOmnetModule.h"
  • source/ariba/communication/modules/transport/omnet/AribaOmnetModule.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef ARIBA_OMNET_MODULE_H__
  • source/ariba/communication/modules/transport/tcp/TCPTransport.cpp

    r2467 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "TCPTransport.h"
  • source/ariba/communication/modules/transport/tcp/TCPTransport.h

    r2467 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef TCPTRANSPORT_H_
  • source/ariba/communication/modules/transport/tcp/TCPTransportLocator.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "TCPTransportLocator.h"
  • source/ariba/communication/modules/transport/tcp/TCPTransportLocator.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef TCPTRANSPORTLOCATOR_H_
  • source/ariba/communication/networkinfo/AddressInformation.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "AddressInformation.h"
  • source/ariba/communication/networkinfo/AddressInformation.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __ADDRESS_INFORMATION_H
  • source/ariba/communication/networkinfo/NetworkChangeDetection.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "NetworkChangeDetection.h"
  • source/ariba/communication/networkinfo/NetworkChangeDetection.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __NETWORK_CHANGE_DETECTION_H
  • source/ariba/communication/networkinfo/NetworkChangeInterface.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __NETWORK_CHANGE_INTERFACE_H
  • source/ariba/communication/networkinfo/NetworkInformation.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "NetworkInformation.h"
  • source/ariba/communication/networkinfo/NetworkInformation.h

    r2988 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __NETWORK_INFORMATION_H
  • source/ariba/communication/networkinfo/NetworkInterface.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "NetworkInterface.h"
  • source/ariba/communication/networkinfo/NetworkInterface.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __NETWORK_INTERFACE_H
  • source/ariba/overlay/BaseOverlay.cpp

    r3374 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "BaseOverlay.h"
     
    4343#include "ariba/CommunicationListener.h"
    4444#include "ariba/SideportListener.h"
     45
     46#include "ariba/overlay/messages/OverlayMsg.h"
     47#include "ariba/overlay/messages/JoinRequest.h"
     48#include "ariba/overlay/messages/JoinReply.h"
     49#include "ariba/overlay/messages/LinkRequest.h"
    4550
    4651namespace ariba {
     
    175180void BaseOverlay::createSpoVNet(const SpoVNetID& id, const OverlayParameterSet& param, const SecurityParameterSet& sec, const QoSParameterSet& qos){
    176181
    177         //
    178         // set the state that we are an initiator,
    179         // this way incoming messages are handled correctly
    180         //
    181 
    182         logging_info( "creating spovnet " + id.toString() << " with nodeid " << nodeId.toString() );
     182        // set the state that we are an initiator, this way incoming messages are
     183        // handled correctly
     184        logging_info( "creating spovnet " + id.toString() <<
     185                        " with nodeid " << nodeId.toString() );
    183186
    184187        spovnetId = id;
     
    192195        }
    193196
    194         //
    195197        // bootstrap against ourselfs
    196         //
    197 
    198198        overlayInterface->joinOverlay();
    199         BOOST_FOREACH( NodeListener* i, nodeListeners ){
     199        BOOST_FOREACH( NodeListener* i, nodeListeners )
    200200                i->onJoinCompleted( spovnetId );
    201         }
    202201
    203202        ovl.visChangeNodeIcon ( ovlId, nodeId, OvlVis::ICON_ID_CAMERA );
     
    205204}
    206205
    207 const LinkID BaseOverlay::establishLink(const NodeID& node, const ServiceID& service){
    208 
    209         // TODO: if this is not a onehop overlay the operation will go asynchronously
    210         const EndpointDescriptor& endpoint = overlayInterface->resolveNode( node );
    211         if( endpoint == EndpointDescriptor::UNSPECIFIED ){
    212                 logging_error( "could not resolve node to endpoint. unable to establish link" );
    213                 return LinkID::UNSPECIFIED;
    214         }
    215 
    216         logging_debug( "baseoverlay called to establish link between node " <<
    217                         node.toString() << " on endpoint " << endpoint.toString() <<
    218                         " for service " << service.toString() );
    219 
    220         return establishLink( endpoint, service );
    221 }
    222 
    223 const LinkID BaseOverlay::establishLink(const EndpointDescriptor& ep, const ServiceID& service){
     206
     207/// establishes a link between two arbitrary nodes
     208const LinkID BaseOverlay::establishLink( const NodeID& node,
     209                const ServiceID& service, const LinkID& link_id ) {
    224210
    225211        if( !communicationListeners.contains( service ) ){
     
    228214        }
    229215
    230         const LinkID link = bc->establishLink( ep );
     216        // copy link id
     217        LinkID linkid = link_id;
     218
     219        // create link id if necessary
     220        if (linkid.isUnspecified()) linkid = LinkID::create();
     221
     222        // debug message
     223        logging_debug( "BaseOverlay called to establish link between node " <<
     224                        node.toString() << " for service " << service.toString() );
     225
     226        // create link request message with own link id
     227        OverlayMsg overlay_msg( OverlayMsg::OverlayMessageTypeLinkRequest, service, nodeId );
     228        uint32_t nonce = (uint32_t)(rand() ^ (rand() << 16) ^ time(NULL));
     229        LinkRequest link_request_msg( nonce, &bc->getEndpointDescriptor() );
     230        overlay_msg.encapsulate( &link_request_msg );
     231        pendingLinks.insert( make_pair(nonce, linkid) );
     232
     233        // debug message
     234        logging_debug( "BaseOverlay routes LinkRequest message to node " << node.toString() );
     235
     236        // route message to overlay node
     237        overlayInterface->routeMessage( node, &overlay_msg );
     238
     239        CommunicationListener* receiver = communicationListeners.get( service );
     240        assert( receiver != NULL );
     241
     242        LinkItem item (linkid, NodeID::UNSPECIFIED, service, receiver);
     243        linkMapping.insert( make_pair(linkid, item) );
     244
     245        return linkid;
     246}
     247
     248const LinkID BaseOverlay::establishLink( const EndpointDescriptor& ep,
     249                const ServiceID& service, const LinkID& linkid  ){
     250
     251        if( !communicationListeners.contains( service ) ){
     252                logging_error( "no registered listener on serviceid " << service.toString() );
     253                return LinkID::UNSPECIFIED;
     254        }
     255
     256        const LinkID link = bc->establishLink( ep, linkid );
    231257
    232258        CommunicationListener* receiver = communicationListeners.get( service );
     
    260286seqnum_t BaseOverlay::sendMessage(const Message* message, const LinkID& link ){
    261287
    262         logging_debug( "baseoverlay is sending message on link " << link.toString() );
     288        logging_debug( "baseoverlay is sending data message on link " << link.toString() );
    263289
    264290        LinkMapping::iterator i = linkMapping.find( link );
     
    268294        }
    269295
    270         OverlayMsg overmsg( OverlayMsg::OverlayMessageTypeData, i->second.service, nodeId );
     296        OverlayMsg overmsg(
     297                OverlayMsg::OverlayMessageTypeData,     i->second.service, nodeId );
    271298        overmsg.encapsulate( const_cast<Message*>(message) );
    272299
     
    342369        return overlayInterface->resolveNode( node );
    343370}
     371
    344372
    345373bool BaseOverlay::bind(CommunicationListener* listener, const ServiceID& sid){
     
    567595}
    568596
     597
    569598bool BaseOverlay::receiveMessage(const Message* message,
    570         const LinkID& link, const NodeID& /*the nodeid is invalid in this case! removed var to prevent errors*/ ){
    571 
    572         OverlayMsg* overlayMsg = ((Message*)message)->decapsulate<OverlayMsg>();
     599        const LinkID& link, const NodeID&
     600        /*the nodeid is invalid in this case! removed var to prevent errors*/ ){
     601
     602        // decapsulate overlay message
     603        logging_debug( "go msg " << message->toString());
     604        OverlayMsg* overlayMsg = const_cast<Message*>(message)->decapsulate<OverlayMsg>();
    573605        if( overlayMsg == NULL ) return false;
    574606
     
    577609        if( item != linkMapping.end() ) item->second.markused();
    578610
    579         //
    580         // handle user date that we forward to the
    581         // appropriate service using the service id
    582         // in the message. as we don't know the class
    583         // of message that the service handles, we
    584         // forward it as a pure Message*
    585         //
    586 
     611        /* ************************************************************************
     612        /* handle user date that we forward to the appropriate service using the
     613         * service id in the message. as we don't know the class of message that
     614         * the service handles, we forward it as a pure Message
     615         */
    587616        if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeData) ) {
    588617
     
    601630        } // if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeData) )
    602631
    603         //
    604         // handle spovnet instance join requests
    605         //
    606 
     632        /* ************************************************************************
     633        /* Handle spovnet instance join requests
     634         */
    607635        else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeJoinRequest) &&
    608636                                                state == BaseOverlayStateInitiator){
     
    614642                                         joinReq->getSpoVNetID().toString() );
    615643
    616                 //
    617                 // make sure that the node actually wants to join
    618                 // the correct spovnet id that we administrate
    619                 //
    620 
     644                /* make sure that the node actually wants to join
     645                 * the correct spovnet id that we administrate */
    621646                if( joinReq->getSpoVNetID() != spovnetId ){
    622647                        logging_error( "received join request for spovnet we don't handle " <<
     
    641666                joiningNodes.push_back( overlayMsg->getSourceNode() );
    642667
    643                 //
    644                 // send back our spovnetid, default overlay parameters,
    645                 // join allow result, and ourself as the endpoint
    646                 // to bootstrap the overlay against
    647                 //
    648 
     668                // send back our spovnetid, default overlay parameters, join allow
     669                // result, and ourself as the end-point to bootstrap the overlay against
    649670                OverlayMsg retmsg( OverlayMsg::OverlayMessageTypeJoinReply, nodeId );
    650671                JoinReply replyMsg( spovnetId, OverlayParameterSet::DEFAULT,
     
    656677                return true;
    657678
    658         } // else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeJoinRequest) && state == BaseOverlayStateInitiator)
    659 
    660         //
    661         // handle replies to spovnet instance join requests
    662         //
    663 
     679        } // else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeJoinRequest)
     680          //          && state == BaseOverlayStateInitiator)
     681
     682        /* ************************************************************************
     683         * handle replies to spovnet instance join requests
     684         */
    664685        else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeJoinReply) &&
    665686                                                state == BaseOverlayStateJoinInitiated){
    666687
    667                 logging_debug( "baseoverlay received message of type OverlayMessageTypeJoinReply" );
     688                logging_debug(
     689                        "baseoverlay received message of type OverlayMessageTypeJoinReply");
    668690
    669691                JoinReply* replyMsg = overlayMsg->decapsulate<JoinReply>();
    670692                logging_info( "received spovnet join reply" );
    671693
    672                 //
    673                 // make sure that we actually wanted to get
    674                 // into the spovnet whose id is in the message
    675                 //
    676 
     694                // ensure that we actually wanted to get into the spovnet whose id is
     695                // in the message
    677696                if( replyMsg->getSpoVNetID() != spovnetId ){
    678697                        logging_error( "received spovnet join reply for spovnet " <<
     
    681700                                        spovnetId.toString() );
    682701
    683                         // state does not change here, maybe
    684                         // the reply does come in later
     702                        // state does not change here, maybe the reply does come in later
    685703                        return false;
    686704                }
    687705
    688                 //
    689                 // if we did not get access to the spovnet
    690                 // notify of the failure and
     706                // if we did not get access to the spovnet notify of the failure and
    691707                // close the link to the initiator
    692                 //
    693 
    694708                if( ! replyMsg->getJoinAllowed() ){
    695709
     
    708722                }
    709723
    710                 logging_info( "join request has been accepted for spovnet " << spovnetId.toString() );
    711 
    712                 //
    713                 // if we did get access to the spovnet
    714                 // we try to create the overlay structure
    715                 // as given in the reply message
    716                 //
    717 
    718                 overlayInterface = OverlayFactory::create( *this, replyMsg->getParam(), nodeId, this );
     724                logging_info( "join request has been accepted for spovnet " <<
     725                                spovnetId.toString() );
     726
     727                // if we did get access to the spovnet we try to create the overlay
     728                // structure as given in the reply message
     729                overlayInterface = OverlayFactory::create( *this,
     730                                replyMsg->getParam(), nodeId, this );
    719731
    720732                if( overlayInterface == NULL ){
     
    726738
    727739                        // inform all registered services of the event
    728                         BOOST_FOREACH( NodeListener* i, nodeListeners ){
     740                        BOOST_FOREACH( NodeListener* i, nodeListeners )
    729741                                i->onJoinFailed( spovnetId );
    730                         }
    731742
    732743                        return true;
    733744                }
    734745
    735                 //
    736                 // now start the join process for the overlay.
    737                 // the join process for the spovnet baseoverlay
    738                 // is now complete. we use the endpoint for
    739                 // overlay structure bootstrapping that the
    740                 // initiator provided in his reply message
    741                 //
    742 
     746                /* now start the join process for the overlay. the join process for the
     747                 * spovnet baseoverlay is now complete. we use the endpoint for overlay
     748                 * structure bootstrapping that the initiator provided in his reply
     749                 * message */
    743750                state = BaseOverlayStateCompleted;
    744751                ovl.visChangeNodeColor( ovlId, nodeId, OvlVis::NODE_COLORS_GREEN);
     
    757764
    758765
    759         //
    760         // handle update messages for link establishment
    761         //
    762 
     766        /* ************************************************************************
     767     * handle update messages for link establishment
     768     */
    763769        else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeUpdate) ){
    764770
    765                 logging_debug( "baseoverlay received message of type OverlayMessageTypeUpdate" );
     771                logging_debug(
     772                        "baseoverlay received message of type OverlayMessageTypeUpdate"
     773                );
    766774
    767775                const NodeID& sourcenode = overlayMsg->getSourceNode();
    768776                const ServiceID& service = overlayMsg->getService();
    769777
    770                 //
    771                 // we should have a linkmapping for the link, otherwise
    772                 // we ignore update messages
    773                 //
    774 
     778                // linkmapping for the link available? no-> ignore
    775779                LinkMapping::iterator i = linkMapping.find( link );
    776                 if( i == linkMapping.end() ){
     780                if( i == linkMapping.end() ) {
    777781                        logging_warn( "received overlay update message for link " <<
    778782                                        link.toString() << " for which we have no mapping" );
     
    780784                }
    781785
    782                 //
    783786                // update our link mapping information for this link
    784                 //
    785 
    786                 bool changed = ( i->second.node != sourcenode ) || ( i->second.service != service );
    787 
     787                bool changed =
     788                        ( i->second.node != sourcenode ) ||
     789                        ( i->second.service != service );
    788790                i->second.node = sourcenode;
    789791                i->second.service = service;
    790792
    791                 //
    792793                // if our link information changed, we send out an update, too
    793                 //
    794 
    795794                if( changed ){
    796795                        OverlayMsg overMsg( OverlayMsg::OverlayMessageTypeUpdate, i->second.service, nodeId );
     
    798797                }
    799798
    800                 //
    801799                // set the correct listener service for the linkitem
    802800                // now we can tell the registered service of the linkup event
    803                 //
    804 
    805801                if( !communicationListeners.contains( service ) ){
    806802                        logging_warn( "linkup event for service that has not been registered" );
     
    810806                CommunicationListener* iface = communicationListeners.get( service );
    811807                if( iface == NULL || iface == &CommunicationListener::DEFAULT ){
    812                         logging_warn( "linkup event for service that has been registered with a NULL interface" );
     808                        logging_warn( "linkup event for service that has been registered "
     809                                "with a NULL interface" );
    813810                        return true;
    814811                }
     
    817814                i->second.markused();
    818815
    819                 //
    820816                // ask the service whether it wants to accept this link
    821                 //
    822 
    823817                if( iface->onLinkRequest(sourcenode) ){
    824818
     
    838832        } // else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeUpdate) )
    839833
    840         //
    841         // bye messages to say goodbye
    842         //
    843 
    844         else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeBye)){
    845 
    846                 logging_debug( "baseoverlay received message of type OverlayMessageTypeBye" );
    847 
    848                 logging_debug( "received bye message from " <<
     834        /* ************************************************************************
     835         * handle bye messages
     836         */
     837        else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeBye) ) {
     838
     839                logging_debug( "BaseOverlay received message of type OverlayMessageTypeBye" );
     840                logging_debug( "Received bye message from " <<
    849841                                overlayMsg->getSourceNode().toString() );
    850842
    851                 //
    852                 // if we are the initiator and receive a bye from a node
    853                 // the node just left. if we are a node and receive a bye
    854                 // from the initiator, we have to close, too.
    855                 //
    856 
     843                /* if we are the initiator and receive a bye from a node
     844                 * the node just left. if we are a node and receive a bye
     845                 * from the initiator, we have to close, too.
     846                 */
    857847                if( overlayMsg->getSourceNode() == spovnetInitiator ){
    858848
     
    869859
    870860                } else {
    871 
    872                         // a node that said goodbye and we are the initiator
    873                         // don't have to do much here, as the node also
    874                         // will go out of the overlay structure
     861                        // a node that said goodbye and we are the initiator don't have to
     862                        // do much here, as the node also will go out of the overlay
     863                        // structure
    875864                        logging_info( "node left " << overlayMsg->getSourceNode() );
    876 
    877865                }
    878866
     
    881869        } // else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeBye))
    882870
    883         //
    884         // something wrong ...
    885         //
    886 
     871        /* ************************************************************************
     872         * handle link request forwarded through the overlay
     873         */
     874        else if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeLinkRequest)) {
     875                LinkRequest* linkReq = overlayMsg->decapsulate<LinkRequest>();
     876                const ServiceID& service = overlayMsg->getService();
     877                if (linkReq->isReply()) {
     878
     879                        // find link
     880                        PendingLinkMap::iterator i = pendingLinks.find( linkReq->getNonce() );
     881                        if ( i == pendingLinks.end() ) {
     882                                logging_error( "Nonce not found in link request" );
     883                                return true;
     884                        }
     885
     886                        // debug message
     887                        logging_debug( "LinkRequest reply received. Establishing link "
     888                                << i->second << " to " << (linkReq->getEndpoint()->toString())
     889                                << " for service " << service.toString()
     890                                << " with nonce " << linkReq->getNonce()
     891                        );
     892
     893                        // establishing link
     894                        bc->establishLink( *linkReq->getEndpoint(), i->second );
     895                } else {
     896                        OverlayMsg overlay_msg( OverlayMsg::OverlayMessageTypeLinkRequest, service, nodeId );
     897                        LinkRequest link_request_msg(
     898                                        linkReq->getNonce(), &bc->getEndpointDescriptor(), true );
     899                        overlay_msg.encapsulate( &link_request_msg );
     900
     901                        // debug message
     902                        logging_debug( "Sending LinkRequest reply for link with nonce " <<
     903                                        linkReq->getNonce()     );
     904
     905                        // route message back over overlay
     906                        overlayInterface->routeMessage(
     907                                overlayMsg->getSourceNode(), &overlay_msg
     908                        );
     909                }
     910        } // if( overlayMsg->isType(OverlayMsg::OverlayMessageTypeLinkRequest))
     911
     912        /* ************************************************************************
     913         * unknown message type ... error!
     914         */
    887915        else {
    888916
     
    10081036        }
    10091037
    1010         BOOST_FOREACH( const LinkID lnk, oldlinks ){
     1038        BOOST_FOREACH( const LinkID lnk, oldlinks ) {
    10111039                logging_debug( "auto-link " << lnk.toString() << " timed out and is getting dropped" );
    10121040                dropLink( lnk );
  • source/ariba/overlay/BaseOverlay.h

    r3374 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef BASEOVERLAY_H_
     
    6262#include "ariba/overlay/modules/OverlayFactory.h"
    6363#include "ariba/overlay/modules/OverlayStructureEvents.h"
    64 #include "ariba/overlay/messages/OverlayMsg.h"
    65 #include "ariba/overlay/messages/JoinRequest.h"
    66 #include "ariba/overlay/messages/JoinReply.h"
    67 
    68 // forward declerations
     64
     65// forward declarations
    6966namespace ariba {
    70         class NodeListener;
    71         class CommunicationListener;
    72         class SideportListener;
    73         namespace utility {
    74                 class OvlVis;
    75         }
     67class NodeListener;
     68class CommunicationListener;
     69class SideportListener;
     70namespace utility {
     71class OvlVis;
     72}
    7673}
    7774
     
    8784using ariba::CommunicationListener;
    8885
     86// communication
    8987using ariba::communication::EndpointDescriptor;
    9088using ariba::communication::BaseCommunication;
    9189using ariba::communication::CommunicationEvents;
    9290
    93 using ariba::overlay::OverlayMsg;
    94 using ariba::overlay::JoinRequest;
    95 using ariba::overlay::JoinReply;
    96 using ariba::overlay::OverlayInterface;
    97 using ariba::overlay::OverlayFactory;
    98 using ariba::overlay::OverlayStructureEvents;
    99 
     91// utilities
    10092using ariba::utility::NodeID;
    10193using ariba::utility::SpoVNetID;
     
    118110namespace overlay {
    119111
    120 class BaseOverlay :
    121         public MessageReceiver,
    122         public CommunicationEvents,
    123         public OverlayStructureEvents,
    124         protected Timer {
     112class BaseOverlay: public MessageReceiver, public CommunicationEvents,
     113        public OverlayStructureEvents, protected Timer {
     114
     115private:
     116        friend class OneHop;
     117        friend class Chord;
    125118
    126119        use_logging_h( BaseOverlay );
     120
    127121public:
     122
    128123        /**
    129124         * Constructs an empty non-functional base overlay instance
     
    139134         * Starts the Base Overlay instance
    140135         */
    141         void start( BaseCommunication& _basecomm, const NodeID& _nodeid );
     136        void start(BaseCommunication& _basecomm, const NodeID& _nodeid);
    142137
    143138        /**
     
    152147         * @param node Destination node id
    153148         * @param service Service to connect to
    154          */
    155         const LinkID establishLink( const NodeID& node, const ServiceID& service );
     149         * @param linkid Link identifier to be used with this link
     150         */
     151        const LinkID establishLink(const NodeID& node, const ServiceID& service,
     152                        const LinkID& linkid = LinkID::UNSPECIFIED);
    156153
    157154        /**
    158155         * Starts a link establishment procedure to the specified
     156         *
    159157         * endpoint and to the specified service
    160158         */
    161         const LinkID establishLink( const EndpointDescriptor& ep, const ServiceID& service );
    162 
    163         /**
    164          * TODO
    165          */
    166         void  dropLink( const LinkID& link );
    167 
    168         /**
    169          * TODO
    170          */
    171         seqnum_t sendMessage( const Message* message, const LinkID& link );
    172 
    173         /**
    174          * TODO
    175          */
    176         seqnum_t sendMessage( const Message* message, const NodeID& node, const ServiceID& service );
     159        const LinkID establishLink(const EndpointDescriptor& ep,
     160                        const ServiceID& service, const LinkID& linkid =
     161                                        LinkID::UNSPECIFIED);
     162
     163        /// drops a link
     164        void dropLink(const LinkID& link);
     165
     166        /// sends a message over an existing link
     167        seqnum_t sendMessage(const Message* message, const LinkID& link);
     168
     169        /// sends a message to a node and a specific service
     170        seqnum_t sendMessage(const Message* message, const NodeID& node,
     171                        const ServiceID& service);
    177172
    178173        /**
     
    180175         * Depending on the structure of the overlay, this can be very different.
    181176         */
    182         void broadcastMessage( Message* message, const ServiceID& service );
    183 
    184         /**
    185          * Get a list of overlay neighboring nodes.
    186          */
    187         vector<NodeID> getOverlayNeighbors() const;
     177        void broadcastMessage(Message* message, const ServiceID& service);
    188178
    189179        /**
     
    193183         * @return The end-point descriptor of the link's end-point
    194184         */
    195         const EndpointDescriptor& getEndpointDescriptor( const LinkID& link = LinkID::UNSPECIFIED ) const;
    196 
    197         /**
    198          * TODO
    199          */
    200         const EndpointDescriptor& getEndpointDescriptor( const NodeID& node ) const;
    201 
    202         /**
    203          * TODO
    204          */
     185        const EndpointDescriptor& getEndpointDescriptor(const LinkID& link =
     186                        LinkID::UNSPECIFIED) const;
     187
     188        /**
     189         * Get a list of overlay neighbors.
     190         *
     191         * @return A list of overlay neighbors.
     192         */
     193        vector<NodeID> getOverlayNeighbors() const;
     194
     195        /**
     196         * Returns a end-endpoint descriptor of a overlay neighbor.
     197         * If the node is not known -- an unspecified endpoint descriptor is
     198         * returned.
     199         *
     200         * @param node The node identifer of a overlay neighbor.
     201         * @return The end-point descriptor of the node or unspecified.
     202         */
     203        const EndpointDescriptor& getEndpointDescriptor(const NodeID& node) const;
     204
     205        // TODO: Doc
    205206        bool bind(CommunicationListener* listener, const ServiceID& sid);
    206207
    207         /**
    208          * TODO
    209          */
     208        // TODO: Doc
    210209        bool unbind(CommunicationListener* listener, const ServiceID& sid);
    211210
    212         /**
    213          * TODO
    214          */
     211        // TODO: Doc
    215212        bool bind(NodeListener* listener);
    216213
    217         /**
    218          * TODO
    219          */
     214        // TODO: Doc
    220215        bool unbind(NodeListener* listener);
    221216
    222         /**
    223          * TODO
    224          */
     217        // TODO: Doc
    225218        bool registerSidePort(SideportListener* _sideport);
    226219
    227         /**
    228          * TODO
    229          */
     220        // TODO: Doc
    230221        bool unregisterSidePort(SideportListener* _sideport);
    231222
     
    236227         * @return The NodeID of the link
    237228         */
    238         const NodeID& getNodeID( const LinkID& lid = LinkID::UNSPECIFIED ) const ;
     229        const NodeID& getNodeID(const LinkID& lid = LinkID::UNSPECIFIED) const;
    239230
    240231        /**
     
    245236         * @return a vector that contains all the link ids requested
    246237         */
    247         vector<LinkID> getLinkIDs( const NodeID& nid = NodeID::UNSPECIFIED ) const;
    248 
    249         /**
    250          * TODO
    251          */
    252         void joinSpoVNet( const SpoVNetID& id, const EndpointDescriptor& bootstrapEp );
    253 
    254         /**
    255          * TODO
    256          */
    257         void createSpoVNet(
    258                 const SpoVNetID& id,
    259                 const OverlayParameterSet& param = OverlayParameterSet::DEFAULT,
    260                 const SecurityParameterSet& sec  = SecurityParameterSet::DEFAULT,
    261                 const QoSParameterSet& qos = QoSParameterSet::DEFAULT
    262         );
    263 
    264         /**
    265          * TODO
     238        vector<LinkID> getLinkIDs(const NodeID& nid = NodeID::UNSPECIFIED) const;
     239
     240        /**
     241         * Join a existing sponaneous virtual network (spovnet).
     242         *
     243         * @param id A spovnet identifier
     244         * @param boot A bootstrap node
     245         */
     246        void joinSpoVNet(const SpoVNetID& id, const EndpointDescriptor& boot );
     247
     248        /**
     249         * Initiates a new spontaneous virtual network.
     250         * This makes this BaseOverlay to the SpoVNet-Initiator.
     251         *
     252         * @param id The spovnet identifier
     253         */
     254        void createSpoVNet(const SpoVNetID& id, const OverlayParameterSet& param =
     255                        OverlayParameterSet::DEFAULT, const SecurityParameterSet& sec =
     256                        SecurityParameterSet::DEFAULT, const QoSParameterSet& qos =
     257                        QoSParameterSet::DEFAULT);
     258
     259        /**
     260         * Let the node leave the SpoVNet.
    266261         */
    267262        void leaveSpoVNet();
     
    272267         * @see ariba::communication::CommunicationEvents.h
    273268         */
    274         virtual void onLinkUp( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
    275 
    276         /**
    277          * @see ariba::communication::CommunicationEvents.h
    278          */
    279         virtual void onLinkDown( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
    280 
    281         /**
    282          * @see ariba::communication::CommunicationEvents.h
    283          */
    284         virtual void onLinkChanged( const LinkID& id, const NetworkLocator* oldlocal, const NetworkLocator* newlocal, const NetworkLocator* oldremote, const NetworkLocator* newremote );
    285 
    286         /**
    287          * @see ariba::communication::CommunicationEvents.h
    288          */
    289         virtual void onLinkFail( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
    290 
    291         /**
    292          * @see ariba::communication::CommunicationEvents.h
    293          */
    294         virtual void onLinkQoSChanged( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote, const QoSParameterSet& qos );
    295 
    296         /**
    297          * @see ariba::communication::CommunicationEvents.h
    298          */
    299         virtual bool onLinkRequest( const LinkID& id, const NetworkLocator* local, const NetworkLocator* remote );
     269        virtual void onLinkUp(const LinkID& id, const NetworkLocator* local,
     270                        const NetworkLocator* remote);
     271
     272        /**
     273         * @see ariba::communication::CommunicationEvents.h
     274         */
     275        virtual void onLinkDown(const LinkID& id, const NetworkLocator* local,
     276                        const NetworkLocator* remote);
     277
     278        /**
     279         * @see ariba::communication::CommunicationEvents.h
     280         */
     281        virtual void onLinkChanged(const LinkID& id,
     282                        const NetworkLocator* oldlocal, const NetworkLocator* newlocal,
     283                        const NetworkLocator* oldremote, const NetworkLocator* newremote);
     284
     285        /**
     286         * @see ariba::communication::CommunicationEvents.h
     287         */
     288        virtual void onLinkFail(const LinkID& id, const NetworkLocator* local,
     289                        const NetworkLocator* remote);
     290
     291        /**
     292         * @see ariba::communication::CommunicationEvents.h
     293         */
     294        virtual void onLinkQoSChanged(const LinkID& id,
     295                        const NetworkLocator* local, const NetworkLocator* remote,
     296                        const QoSParameterSet& qos);
     297
     298        /**
     299         * @see ariba::communication::CommunicationEvents.h
     300         */
     301        virtual bool onLinkRequest(const LinkID& id, const NetworkLocator* local,
     302                        const NetworkLocator* remote);
    300303
    301304        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     305
     306        /**
     307         * Processes a received message.
     308         *
     309         * Beware: nodeid is not valid in this case! (since this class implements
     310         * nodeid's in the first place *g*)
     311         */
     312        virtual bool receiveMessage(
     313                const Message* message, const LinkID& link,     const NodeID&);
     314
    302315        //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    303         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    304 
    305         /**
    306          * TODO
    307          */
    308         virtual bool receiveMessage( const Message* message, const LinkID& link, const NodeID& ); // nodeid is not valid in this case!
    309 
    310         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    311         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    312         //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    313 
    314         /**
    315          * see OverlayStructureEvents.h, called from specific OverlayInterface class
    316          */
    317         virtual void incomingRouteMessage( Message* msg );
    318 
    319         /**
    320          * see OverlayStructureEvents.h, called from specific OverlayInterface class
    321          */
    322         virtual void onNodeJoin( const NodeID& node );
    323 
    324 
    325         /**
    326          * TODO, for timer events
     316
     317        /**
     318         * This method is called, when a routed message arrives from the
     319         * overlay.
     320         *
     321         * @see OverlayStructureEvents.h
     322         */
     323        virtual void incomingRouteMessage(Message* msg);
     324
     325        /**
     326         * This method is called, when a new node joined the network
     327         *
     328         * @see OverlayStructureEvents.h
     329         */
     330        virtual void onNodeJoin(const NodeID& node);
     331
     332        /**
     333         * Timer Event method
    327334         */
    328335        virtual void eventFunction();
     
    382389         */
    383390        typedef enum _BaseOverlayState {
    384                 BaseOverlayStateInvalid        = 0,
    385                 BaseOverlayStateInitiator      = 1,
    386                 BaseOverlayStateJoinInitiated  = 2,
    387                 BaseOverlayStateCompleted      = 3,
     391                BaseOverlayStateInvalid = 0,
     392                BaseOverlayStateInitiator = 1,
     393                BaseOverlayStateJoinInitiated = 2,
     394                BaseOverlayStateCompleted = 3,
    388395        } BaseOverlayState;
    389396
     
    403410        NodeID min, max;
    404411        NodeID succ, pred;
    405         void updateOvlVis( const NodeID& node );
     412        void updateOvlVis(const NodeID& node);
    406413
    407414        /**
     
    412419                static const LinkItem UNSPECIFIED;
    413420
    414                 LinkItem()
    415                         : link(LinkID::UNSPECIFIED), node(NodeID::UNSPECIFIED),
    416                                 service(ServiceID::UNSPECIFIED), interface(&CommunicationListener::DEFAULT),
    417                                 autolink(false), lastuse(0){
     421                LinkItem() :
     422                        link(LinkID::UNSPECIFIED), node(NodeID::UNSPECIFIED), service(
     423                                        ServiceID::UNSPECIFIED), interface(
     424                                        &CommunicationListener::DEFAULT), autolink(false), lastuse(
     425                                        0) {
    418426                }
    419427
    420                 LinkItem( const LinkID& _link, const NodeID& _node,
    421                                 const ServiceID& _service, CommunicationListener* _interface )
    422                         : link( _link ), node( _node ), service( _service ), interface( _interface ),
    423                                 autolink( false ), lastuse( time(NULL) ) {
     428                LinkItem(const LinkID& _link, const NodeID& _node,
     429                                const ServiceID& _service, CommunicationListener* _interface) :
     430                        link(_link), node(_node), service(_service), interface(_interface),
     431                                        autolink(false), lastuse(time(NULL)) {
    424432
    425433                        assert( _interface != NULL );
     
    434442
    435443                // information needed for auto links
    436 
    437                 void markused(){
     444                void markused() {
    438445                        lastuse = time(NULL);
    439446                }
     
    444451
    445452        typedef map<const LinkID, LinkItem> LinkMapping;
    446         typedef pair<const LinkID,LinkItem> LinkPair;
     453        typedef pair<const LinkID, LinkItem> LinkPair;
    447454        LinkMapping linkMapping;
    448455
     456        // map of a link request map a nonce to a LinkID
     457        typedef map<const uint32_t, LinkID> PendingLinkMap;
     458        PendingLinkMap pendingLinks;
    449459
    450460        /**
     
    457467};
    458468
    459 }} // namespace ariba, overlay
     469}
     470} // namespace ariba, overlay
    460471
    461472#endif /*BASEOVERLAY_H_*/
  • source/ariba/overlay/messages/JoinReply.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "JoinReply.h"
  • source/ariba/overlay/messages/JoinReply.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef JOIN_REPLY_H__
  • source/ariba/overlay/messages/JoinRequest.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "JoinRequest.h"
  • source/ariba/overlay/messages/JoinRequest.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef JOIN_REQUEST_H__
  • source/ariba/overlay/messages/OverlayMsg.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OverlayMsg.h"
  • source/ariba/overlay/messages/OverlayMsg.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef OVERLAY_MSG_H__
     
    6868                OverlayMessageTypeUpdate      = 4, // update message for link association
    6969                OverlayMessageTypeBye         = 5, // spovnet leave (no encapsulated messages)
     70                OverlayMessageTypeLinkRequest = 6, // link request (sent over the overlay)
    7071        } OverlayMessageType;
    7172
  • source/ariba/overlay/modules/OverlayFactory.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OverlayFactory.h"
     40
     41// structured overlays
     42#include "chord/Chord.h"
     43#include "onehop/OneHop.h"
    4044
    4145namespace ariba {
     
    5357
    5458                case OverlayParameterSet::OverlayStructureChord:
    55                         return NULL;
     59                        return new Chord( baseoverlay, nodeid, routeReceiver );
    5660
    5761                case OverlayParameterSet::OverlayStructureKademlia:
  • source/ariba/overlay/modules/OverlayFactory.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __OVERLAY_FACTORY_H
     
    4141
    4242#include "ariba/utility/types/OverlayParameterSet.h"
    43 #include "ariba/overlay/modules/OverlayInterface.h"
    44 #include "ariba/overlay/modules/onehop/OneHop.h"
     43
     44#include "OverlayInterface.h"
    4545
    4646using ariba::utility::OverlayParameterSet;
    47 using ariba::overlay::OverlayInterface;
    48 using ariba::overlay::OneHop;
    4947
    5048namespace ariba {
  • source/ariba/overlay/modules/OverlayInterface.cpp

    r3057 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OverlayInterface.h"
    4040#include "ariba/overlay/BaseOverlay.h"
    4141
     42// namespace ariba::overlay
    4243namespace ariba {
    4344namespace overlay {
    4445
    45 ServiceID OverlayInterface::OVERLAY_SERVICE_ID (0);
     46ServiceID OverlayInterface::OVERLAY_SERVICE_ID(0);
    4647
    47 OverlayInterface::OverlayInterface(
    48         BaseOverlay& _baseoverlay,
    49         const NodeID& _nodeid,
    50         OverlayStructureEvents* _eventsReceiver )
    51         :       baseoverlay( _baseoverlay ),
    52                 nodeid( _nodeid ),
    53                 eventsReceiver( _eventsReceiver ) {
     48OverlayInterface::OverlayInterface(BaseOverlay& _baseoverlay,
     49                const NodeID& _nodeid, OverlayStructureEvents* _eventsReceiver) :
     50        baseoverlay(_baseoverlay), nodeid(_nodeid), eventsReceiver(_eventsReceiver) {
    5451
    55         _baseoverlay.bind( this, OVERLAY_SERVICE_ID );
     52        _baseoverlay.bind(this, OVERLAY_SERVICE_ID);
    5653}
    5754
    58 OverlayInterface::~OverlayInterface(){
    59         baseoverlay.unbind( this, OVERLAY_SERVICE_ID );
     55OverlayInterface::~OverlayInterface() {
     56        baseoverlay.unbind(this, OVERLAY_SERVICE_ID);
    6057}
    6158
    62 void OverlayInterface::onLinkUp(const LinkID& lnk, const NodeID& remote){
     59void OverlayInterface::onLinkUp(const LinkID& lnk, const NodeID& remote) {
    6360}
    6461
    65 void OverlayInterface::onLinkDown(const LinkID& lnk, const NodeID& remote){
     62void OverlayInterface::onLinkDown(const LinkID& lnk, const NodeID& remote) {
    6663}
    6764
    68 void OverlayInterface::onLinkChanged(const LinkID& lnk, const NodeID& remote){
     65void OverlayInterface::onLinkChanged(const LinkID& lnk, const NodeID& remote) {
    6966}
    7067
    71 void OverlayInterface::onLinkFail(const LinkID& lnk, const NodeID& remote){
     68void OverlayInterface::onLinkFail(const LinkID& lnk, const NodeID& remote) {
    7269}
    7370
    74 void OverlayInterface::onLinkQoSChanged(const LinkID& lnk, const NodeID& remote, const LinkProperties& prop){
     71void OverlayInterface::onLinkQoSChanged(const LinkID& lnk,
     72                const NodeID& remote, const LinkProperties& prop) {
    7573}
    7674
    77 bool OverlayInterface::onLinkRequest(const NodeID& remote, const DataMessage& msg){
     75bool OverlayInterface::onLinkRequest(const NodeID& remote,
     76                const DataMessage& msg) {
    7877}
    7978
    80 void OverlayInterface::onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk){
     79void OverlayInterface::onMessage(const DataMessage& msg, const NodeID& remote,
     80                const LinkID& lnk) {
    8181}
    8282
  • source/ariba/overlay/modules/OverlayInterface.h

    r3067 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __OVERLAY_INTERFACE_H
     
    5757class BaseOverlay;
    5858
    59 class OverlayInterface : public CommunicationListener {
     59/**
     60 * This class declares an interface for an structured overlay.
     61 */
     62class OverlayInterface: public CommunicationListener {
    6063        friend class BaseOverlay;
     64
    6165public:
     66        /**
     67         * A node list
     68         */
     69        typedef vector<NodeID> NodeList;
     70
     71        /**
     72         * Constructs a new overlay.
     73         */
    6274        OverlayInterface(
    63                 BaseOverlay& _baseoverlay,
    64                 const NodeID& _nodeid,
    65                 OverlayStructureEvents* _eventsReceiver
    66         );
     75                        BaseOverlay& _baseoverlay,
     76                        const NodeID& _nodeid,
     77                        OverlayStructureEvents* _eventsReceiver );
    6778
     79        /**
     80         * Destrcuts the overlay.
     81         */
    6882        virtual ~OverlayInterface();
    6983
    70         typedef vector<NodeID> NodeList;
     84        /**
     85         * Creates the overlay.
     86         */
     87        virtual void createOverlay() = 0;
    7188
    72         virtual void createOverlay() = 0;
     89        /**
     90         * Destroys the overlay.
     91         */
    7392        virtual void deleteOverlay() = 0;
    7493
    75         virtual void joinOverlay( const EndpointDescriptor& bootstrapEp = EndpointDescriptor::UNSPECIFIED) = 0;
     94        /**
     95         * Joins the overlay. Starts integration and stabilization of the overlay
     96         * Node.
     97         *
     98         * @param bootstrap The bootstrap end-point descriptor or the default
     99         *    end-point, if this node is the initiator
     100         */
     101        virtual void joinOverlay(const EndpointDescriptor& bootstrap =
     102                EndpointDescriptor::UNSPECIFIED ) = 0;
     103
     104        /**
     105         * Leaves the overlay gracefully.
     106         */
    76107        virtual void leaveOverlay() = 0;
    77108
    78         virtual const EndpointDescriptor& resolveNode( const NodeID& node ) = 0;
    79         virtual void routeMessage( const NodeID& destnode, Message* msg ) = 0;
     109        /**
     110         * Resolves a overlay neighbor.
     111         *
     112         * @param node The node to resolve
     113         * @return Endpoint descriptor of local neighbor or UNSPECIFIED
     114         */
     115        virtual const EndpointDescriptor& resolveNode(const NodeID& node) = 0;
    80116
     117        /**
     118         * Routes a message to a given node by using overlay routing.
     119         *
     120         * @param destnode The destination node.
     121         * @param msg The message to be routed.
     122         */
     123        virtual void routeMessage(const NodeID& destnode, Message* msg) = 0;
     124
     125        /**
     126         * Returns the nodes known to this overlay.
     127         *
     128         * Usually this are the direct neighbors in the overlay structure.
     129         * For instance, Chord would return his predecessor, successor and finger
     130         * nodes. On the other hand OneHop would likely return all participating
     131         * nodes in the overlay.
     132         *
     133         * @return The list of all known nodes
     134         */
    81135        virtual NodeList getKnownNodes() const = 0;
    82136
    83         // functions from CommunicationListener that we _can_ use as overlay
     137        //--- functions from CommunicationListener that we _can_ use as overlay ---
     138
     139        /// @see CommunicationListener
    84140        virtual void onLinkUp(const LinkID& lnk, const NodeID& remote);
     141        /// @see CommunicationListener
    85142        virtual void onLinkDown(const LinkID& lnk, const NodeID& remote);
     143        /// @see CommunicationListener
    86144        virtual void onLinkChanged(const LinkID& lnk, const NodeID& remote);
     145        /// @see CommunicationListener
    87146        virtual void onLinkFail(const LinkID& lnk, const NodeID& remote);
    88         virtual void onLinkQoSChanged(const LinkID& lnk, const NodeID& remote, const LinkProperties& prop);
     147        /// @see CommunicationListener
     148        virtual void onLinkQoSChanged(const LinkID& lnk, const NodeID& remote,
     149                        const LinkProperties& prop);
     150        /// @see CommunicationListener
    89151        virtual bool onLinkRequest(const NodeID& remote, const DataMessage& msg);
    90         virtual void onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk = LinkID::UNSPECIFIED);
     152        /// @see CommunicationListener
     153        virtual void onMessage(const DataMessage& msg, const NodeID& remote,
     154                        const LinkID& lnk = LinkID::UNSPECIFIED);
    91155
    92156protected:
     157
     158        /// Reference to an active base overlay
    93159        BaseOverlay& baseoverlay;
     160
     161        /// The node identifier to use with this overlay
    94162        const NodeID& nodeid;
     163
     164        /// The listener used to inform about overlay structure changes
    95165        OverlayStructureEvents* eventsReceiver;
     166
     167        /// The service identifer of this overlay
    96168        static ServiceID OVERLAY_SERVICE_ID;
    97169};
  • source/ariba/overlay/modules/OverlayStructureEvents.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838#include "OverlayStructureEvents.h"
    3939
  • source/ariba/overlay/modules/OverlayStructureEvents.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __OVERLAY_STRUCTURE_EVENTS_H
     
    5555        friend class ariba::overlay::OverlayInterface;
    5656        friend class ariba::overlay::OneHop;
     57
    5758public:
    5859        OverlayStructureEvents();
  • source/ariba/overlay/modules/chord/Chord.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
     38
     39#include "ariba/overlay/BaseOverlay.h"
    3840
    3941#include "Chord.h"
     42#include "messages/ChordMessage.h"
     43#include "messages/Discovery.h"
     44
     45#include "detail/chord_routing_table.hpp"
    4046
    4147namespace ariba {
    4248namespace overlay {
    4349
    44 use_logging_cpp( OneHop );
     50typedef chord_routing_table::item route_item;
     51use_logging_cpp( Chord )
     52;
    4553
    4654Chord::Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
    4755                OverlayStructureEvents* _eventsReceiver) :
    48         OverlayInterface( _baseoverlay, _nodeid, _eventsReceiver ) {
     56        OverlayInterface(_baseoverlay, _nodeid, _eventsReceiver) {
     57
     58        // create routing table
     59        this->table = new chord_routing_table(_nodeid, 2);
     60        orphan_removal_counter = 0;
     61        stabilize_counter = 0;
     62        stabilize_finger = 0;
     63        bootstrapLink = LinkID::UNSPECIFIED;
    4964}
    5065
    5166Chord::~Chord() {
     67
     68        // delete routing table
     69        delete table;
     70}
     71
     72// helper: sets up a link using the base overlay
     73LinkID Chord::setup(const EndpointDescriptor& endp) {
     74
     75        logging_debug("request to setup link to " << endp.toString() );
     76        // establish link via base overlay
     77        return baseoverlay.establishLink(endp, OverlayInterface::OVERLAY_SERVICE_ID);
     78}
     79
     80// helper: sends a message using the "base overlay"
     81seqnum_t Chord::send(Message* msg, const LinkID& link) {
     82        return baseoverlay.sendMessage(msg, link);
     83}
     84
     85void Chord::send_discovery_to(const NodeID& destination, int ttl) {
     86        logging_debug("Initiating discovery of " << destination.toString() );
     87        Message msg;
     88        ChordMessage cmsg(ChordMessage::discovery, nodeid, destination);
     89        Discovery dmsg;
     90        dmsg.setSourceEndpoint(&baseoverlay.getEndpointDescriptor());
     91        dmsg.setFollowType(Discovery::normal);
     92        dmsg.setTTL((uint8_t) ttl);
     93        cmsg.encapsulate(&dmsg);
     94        msg.encapsulate(&cmsg);
     95        logging_debug("" << (int)cmsg.getType());
     96        this->onMessage(&msg, NodeID::UNSPECIFIED, LinkID::UNSPECIFIED);
    5297}
    5398
    5499void Chord::createOverlay() {
    55 
    56100}
    57101
     
    60104}
    61105
    62 void Chord::joinOverlay(
    63         const EndpointDescriptor& bootstrapEp = EndpointDescriptor::UNSPECIFIED
    64 ) {
    65 
     106void Chord::joinOverlay(const EndpointDescriptor& boot) {
     107        logging_info( "joining Chord overlay structure through end-point " <<
     108                        (boot == EndpointDescriptor::UNSPECIFIED ?
     109                                        "local" : boot.toString()) );
     110
     111        // initiator? no->setup first link
     112        if (!(boot == EndpointDescriptor::UNSPECIFIED)) bootstrapLink = setup(boot);
     113
     114        // timer for stabilization management
     115        Timer::setInterval(2500);
     116        Timer::start();
    66117}
    67118
    68119void Chord::leaveOverlay() {
    69 
    70 }
    71 
    72 const EndpointDescriptor& Chord::resolveNode( const NodeID& node ) {
    73 
    74 }
    75 
    76 void Chord::routeMessage( const NodeID& destnode, Message* msg ) {
    77 
    78 }
    79 
    80 NodeList Chord::getKnownNodes() const {
    81 
    82 }
    83 
    84 
    85 }} // namespace ariba, overlay
     120        Timer::stop();
     121        for (size_t i = 0; i < table->size(); i++) {
     122                route_item* it = (*table)[i];
     123                ChordMessage msg(ChordMessage::leave, nodeid, it->id);
     124                send(&msg,it->info);
     125        }
     126}
     127
     128const EndpointDescriptor& Chord::resolveNode(const NodeID& node) {
     129        const route_item* item = table->get(node);
     130        if (item == NULL || item->info.isUnspecified()) return EndpointDescriptor::UNSPECIFIED;
     131        return baseoverlay.getEndpointDescriptor(item->info);
     132}
     133
     134void Chord::routeMessage(const NodeID& destnode, Message* msg) {
     135        // get next hop
     136        const route_item* item = table->get_next_hop(destnode);
     137
     138        // message for this node? yes-> delegate to base overlay
     139        if (item->id == nodeid) baseoverlay.incomingRouteMessage(msg);
     140        else { // no-> send to next hop
     141                ChordMessage cmsg(ChordMessage::route, nodeid, destnode);
     142                cmsg.encapsulate(msg);
     143                send(&cmsg, item->info);
     144        }
     145}
     146
     147OverlayInterface::NodeList Chord::getKnownNodes() const {
     148        OverlayInterface::NodeList nodelist;
     149        for (size_t i = 0; i < table->size(); i++)
     150                if ((*table)[i]->ref_count != 0) nodelist.push_back((*table)[i]->id);
     151        return nodelist;
     152}
     153
     154/// @see CommunicationListener.h
     155/// @see OverlayInterface.h
     156void Chord::onLinkUp(const LinkID& lnk, const NodeID& remote) {
     157        logging_debug("link_up: link=" << lnk.toString() << " remote=" <<
     158                        remote.toString() );
     159        route_item* item = table->insert(remote);
     160
     161        if (!bootstrapLink.isUnspecified() && lnk == bootstrapLink) {
     162                send_discovery_to(nodeid);
     163                bootstrapLink = LinkID::UNSPECIFIED;
     164        }
     165
     166        // item added to routing table?
     167        if (item != NULL) { // yes-> add to routing table
     168                logging_debug("new routing neighbor: " << remote.toString() );
     169                item->info = lnk;
     170        } else { // no-> add orphan entry to routing table
     171                logging_debug("new orphan: " << remote.toString() );
     172                table->insert_orphan(remote)->info = lnk;
     173        }
     174}
     175
     176/// @see CommunicationListener.h or @see OverlayInterface.h
     177void Chord::onLinkDown(const LinkID& lnk, const NodeID& remote) {
     178        logging_debug("link_down: link=" << lnk.toString() << " remote=" <<
     179                        remote.toString() );
     180
     181        // remove link from routing table
     182        table->remove(remote);
     183}
     184
     185/// @see CommunicationListener.h
     186/// @see OverlayInterface.h
     187void Chord::onMessage(const DataMessage& msg, const NodeID& remote,
     188                const LinkID& link) {
     189
     190        // decode message
     191        typedef ChordMessage M;
     192        M* m = msg.getMessage()->convert<ChordMessage> ();
     193        if (m == NULL) return;
     194
     195        logging_debug("onMessage: type=" << (int)m->getType() );
     196
     197        // handle messages
     198        switch (m->getType()) {
     199
     200        // invalid message
     201        case M::invalid:
     202                break;
     203
     204                // route message with payload
     205        case M::route: {
     206                // find next hop
     207                const route_item* item = table->get_next_hop(m->getDestination());
     208
     209                // next hop == myself?
     210                if (m->getDestination() == nodeid) { // yes-> route to base overlay
     211                        logging_debug("send message to baseoverlay");
     212                        baseoverlay.incomingRouteMessage(m);
     213                }
     214                // no-> route to next hop
     215                else {
     216                        logging_debug("route chord message to " << item->id.toString() );
     217                        send(m, item->info);
     218                }
     219                break;
     220        }
     221
     222                // discovery request
     223        case M::discovery: {
     224                // decapsulate message
     225                Discovery* dmsg = m->decapsulate<Discovery> ();
     226                logging_debug("received discovery message with"
     227                                << " dest=" << m->getDestination().toString()
     228                                << " ttl=" << (int)dmsg->getTTL()
     229                                << " type=" << (int)dmsg->getFollowType()
     230                );
     231
     232                // check if source node can be added to routing table and setup link
     233                if (m->getSource() != nodeid && table->is_insertable(m->getSource())) setup(
     234                                *dmsg->getSourceEndpoint());
     235
     236                // delegate discovery message
     237                switch (dmsg->getFollowType()) {
     238
     239                // normal: route discovery message like every other message
     240                case Discovery::normal:
     241                        // closest node? yes-> split to follow successor and predecessor
     242                        if (table->is_closest_to(m->getDestination())) {
     243
     244                                if (table->get_successor() != NULL) {
     245                                        // send successor message
     246                                        ChordMessage cmsg_s(*m);
     247                                        Discovery dmsg_s(*dmsg);
     248                                        dmsg_s.setFollowType(Discovery::successor);
     249                                        cmsg_s.encapsulate(&dmsg_s);
     250                                        route_item* succ_item = table->get(*table->get_successor());
     251                                        logging_debug("split: routing discovery message to successor "
     252                                                        << succ_item->id.toString() );
     253                                        send(&cmsg_s, succ_item->info);
     254                                }
     255
     256                                // send predecessor message
     257                                if (table->get_predesessor() != NULL) {
     258                                        ChordMessage cmsg_p(*m);
     259                                        Discovery dmsg_p(*dmsg);
     260                                        dmsg_p.setFollowType(Discovery::predecessor);
     261                                        cmsg_p.encapsulate(&dmsg_p);
     262                                        route_item* pred_item = table->get(
     263                                                        *table->get_predesessor());
     264                                        logging_debug("split: routing discovery message to predecessor "
     265                                                        << pred_item->id.toString() );
     266                                        send(&cmsg_p, pred_item->info);
     267                                }
     268                        }
     269                        // no-> route message
     270                        else {
     271                                // find next hop
     272                                const route_item* item = table->get_next_hop(
     273                                                m->getDestination());
     274                                if (item->id == nodeid) break;
     275                                logging_debug("routing discovery message to " <<
     276                                                item->id.toString() );
     277                                send(m, item->info);
     278                        }
     279                        break;
     280
     281                        // successor mode: follow the successor until TTL is zero
     282                case Discovery::successor:
     283                case Discovery::predecessor: {
     284                        // time to live ended? yes-> stop routing
     285                        if (dmsg->getTTL() == 0) break;
     286
     287                        // decrease time-to-live
     288                        dmsg->setTTL(dmsg->getTTL() - 1);
     289
     290                        const route_item* item;
     291                        if (dmsg->getFollowType() == Discovery::successor) item
     292                                        = table->get(*table->get_successor());
     293                        else item = table->get(*table->get_predesessor());
     294                        logging_debug("routing discovery message to succ/pred "
     295                                        << item->id.toString() );
     296                        ChordMessage cmsg(*m);
     297                        cmsg.encapsulate(dmsg);
     298                        send(&cmsg, item->info);
     299                        break;
     300                }
     301                }
     302                break;
     303        }
     304
     305                // leave
     306        case M::leave: {
     307                baseoverlay.dropLink(link);
     308                break;
     309        }
     310        }
     311}
     312
     313void Chord::eventFunction() {
     314        stabilize_counter++;
     315        if (stabilize_counter == 3) {
     316                stabilize_counter = 0;
     317                stabilize_finger = ((stabilize_finger+1) % table->get_finger_table_size() );
     318                logging_debug("sending discovery message to my neighbors");
     319                send_discovery_to(nodeid);
     320                send_discovery_to(
     321                        table->get_finger_table(stabilize_finger).get_compare().get_center()
     322                );
     323                orphan_removal_counter++;
     324                if (orphan_removal_counter == 2) {
     325                        orphan_removal_counter = 0;
     326                        for (size_t i = 0; i < table->size(); i++) {
     327                                route_item* it = (*table)[i];
     328                                if (it->ref_count == 0) {
     329                                        baseoverlay.dropLink(it->info);
     330                                        logging_debug("dropping orphaned link " << it->info.toString() << " to " << it->id.toString());
     331                                }
     332                        }
     333                }
     334        }
     335        logging_debug("--- chord routing information ----------------------------------");
     336        logging_debug("predecessor: " << (table->get_predesessor()==NULL? "<none>" : table->get_predesessor()->toString()) );
     337        logging_debug("node_id    : " << nodeid.toString() );
     338        logging_debug("successor  : " << (table->get_successor()==NULL? "<none>" : table->get_successor()->toString()));
     339        logging_debug("----------------------------------------------------------------");
     340}
     341
     342}
     343} // namespace ariba, overlay
  • source/ariba/overlay/modules/chord/Chord.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef CHORD_H_
    4040#define CHORD_H_
    4141
     42#include "ariba/utility/system/Timer.h"
    4243#include "ariba/utility/logging/Logging.h"
    4344#include "ariba/communication/EndpointDescriptor.h"
     45#include "../OverlayInterface.h"
     46#include <vector>
     47
     48class chord_routing_table;
    4449
    4550namespace ariba {
    4651namespace overlay {
    4752
    48 using ariba::overlay::OverlayInterface;
    4953using ariba::communication::EndpointDescriptor;
     54using ariba::utility::Timer;
    5055
    51 class Chord : public OverlayInterface {
     56using namespace std;
     57
     58/**
     59 * This class implements a structured overlay inspired by chord.
     60 * It differs to the original form of chord in the following manner:
     61 *
     62 * (1) The graph is bidirectional
     63 * (2) Stabilization is done in a reactive manner
     64 *
     65 * It therefore can be considered as a kind of Chorded-Kademlia :)
     66 *
     67 * The resulting overlay graph has a diameter of O(log N).
     68 *
     69 * @author Sebastian Mies <mies@tm.uka.de>
     70 */
     71class Chord : public OverlayInterface, protected Timer {
    5272        use_logging_h( Chord );
    5373private:
     74        chord_routing_table* table;
     75        int orphan_removal_counter;
     76        int stabilize_counter;
     77        int stabilize_finger;
     78        LinkID bootstrapLink;
     79
     80        // helper: sets up a link using the "base overlay"
     81        LinkID setup( const EndpointDescriptor& endp );
     82
     83        // helper: sends a message using the "base overlay"
     84        seqnum_t send( Message* msg, const LinkID& link );
     85
     86        // stabilization: sends a discovery message to the specified neighborhood
     87        void send_discovery_to( const NodeID& destination, int ttl = 4 );
    5488
    5589public:
    5690        Chord(BaseOverlay& _baseoverlay, const NodeID& _nodeid,
    5791                        OverlayStructureEvents* _eventsReceiver);
    58         ~Chord();
     92        virtual ~Chord();
    5993
    60         void createOverlay();
     94        /// @see OverlayInterface.h
     95        virtual void createOverlay();
    6196
    62         void deleteOverlay();
     97        /// @see OverlayInterface.h
     98        virtual void deleteOverlay();
    6399
    64         void joinOverlay(
    65                 const EndpointDescriptor& bootstrapEp = EndpointDescriptor::UNSPECIFIED
     100        /// @see OverlayInterface.h
     101        virtual void joinOverlay(
     102                const EndpointDescriptor& boot = EndpointDescriptor::UNSPECIFIED
    66103        );
    67104
    68         void leaveOverlay();
     105        /// @see OverlayInterface.h
     106        virtual void leaveOverlay();
    69107
    70         const EndpointDescriptor& resolveNode( const NodeID& node );
     108        /// @see OverlayInterface.h
     109        virtual const EndpointDescriptor& resolveNode( const NodeID& node );
    71110
    72         void routeMessage( const NodeID& destnode, Message* msg );
     111        /// @see OverlayInterface.h
     112        virtual void routeMessage( const NodeID& destnode, Message* msg );
    73113
    74         NodeList getKnownNodes() const;
     114        /// @see OverlayInterface.h
     115        virtual NodeList getKnownNodes() const;
     116
     117        /// @see CommunicationListener.h or @see OverlayInterface.h
     118        virtual void onLinkUp(const LinkID& lnk, const NodeID& remote);
     119
     120        /// @see CommunicationListener.h or @see OverlayInterface.h
     121        virtual void onLinkDown(const LinkID& lnk, const NodeID& remote);
     122
     123        /// @see CommunicationListener.h or @see OverlayInterface.h
     124        virtual void onMessage(const DataMessage& msg, const NodeID& remote,
     125                        const LinkID& lnk = LinkID::UNSPECIFIED);
     126
     127        /// @see Timer.h
     128        virtual void eventFunction();
    75129};
    76130
  • source/ariba/overlay/modules/onehop/OneHop.cpp

    r3067 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OneHop.h"
    4040#include "ariba/overlay/BaseOverlay.h"
     41
     42#include "ariba/overlay/modules/onehop/messages/OneHopMessage.h"
     43#include "ariba/overlay/modules/onehop/messages/NodeListingRequest.h"
     44#include "ariba/overlay/modules/onehop/messages/NodeListingReply.h"
    4145
    4246namespace ariba {
     
    8488                return;
    8589        }
    86 
    87         baseoverlay.sendMessage( msg, i->second );
    88 }
    89 
    90 void OneHop::createOverlay(){
    91 
     90        OneHopMessage onehopRoute( OneHopMessage::OneHopMessageTypeRoute );
     91        onehopRoute.encapsulate(msg);
     92
     93        baseoverlay.sendMessage( &onehopRoute, i->second );
     94}
     95
     96void OneHop::createOverlay() {
    9297        // don't need to bootstrap against ourselfs.
    9398        // the create and join process is completed now.
    94 
    9599        logging_info( "creating onehop overlay structure" );
    96100        state = OneHopStateCompleted;
     
    119123void OneHop::joinOverlay(const EndpointDescriptor& bootstrapEp){
    120124
    121         logging_info( "joining onehop overlay structure through endpoint " <<
     125        logging_info( "joining onehop overlay structure through end-point " <<
    122126                        (bootstrapEp == EndpointDescriptor::UNSPECIFIED ?
    123127                                        "local" : bootstrapEp.toString()) );
     
    133137
    134138                state = OneHopStateCompleted;
    135 
    136 
    137139        } else {
    138 
    139140                bootstrapLink = baseoverlay.establishLink( bootstrapEp,
    140141                                        OverlayInterface::OVERLAY_SERVICE_ID );
     
    175176        if( state == OneHopStateInvalid ) return;
    176177
    177         //
    178178        // node went down, remove from overlay mapping
    179         //
    180 
    181179        logging_debug( "node " << remote.toString() << " left overlay structure" );
    182180
     
    223221        //
    224222
    225         if( onemsg->isType( OneHopMessage::OneHopMessageTypeListingRequest) ){
     223        if( onemsg->isType( OneHopMessage::OneHopMessageTypeListingRequest ) ){
    226224
    227225                NodeListingRequest* request = onemsg->decapsulate<NodeListingRequest>();
     
    316314        } // if( reply != NULL )
    317315
     316        if( onemsg->isType( OneHopMessage::OneHopMessageTypeRoute) ){
     317                logging_debug( "Route message arrived at destination node -> delegate to BaseOverlay" );
     318                baseoverlay.incomingRouteMessage( onemsg );
     319        }
     320
     321
    318322}
    319323
  • source/ariba/overlay/modules/onehop/OneHop.h

    r3057 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef _ONE_HOP_H
     
    4242#include <map>
    4343#include "ariba/overlay/modules/OverlayInterface.h"
    44 #include "ariba/overlay/modules/onehop/messages/OneHopMessage.h"
    45 #include "ariba/overlay/modules/onehop/messages/NodeListingRequest.h"
    46 #include "ariba/overlay/modules/onehop/messages/NodeListingReply.h"
    4744#include "ariba/utility/logging/Logging.h"
    4845
    4946using std::map;
    50 using ariba::overlay::OverlayInterface;
    51 using ariba::overlay::OneHopMessage;
    52 using ariba::overlay::NodeListingRequest;
    53 using ariba::overlay::NodeListingReply;
    5447
    5548namespace ariba {
    5649namespace overlay {
    5750
    58 class OneHop : public OverlayInterface {
     51class OneHop: public OverlayInterface {
    5952        use_logging_h( OneHop );
    6053public:
    61         OneHop(
    62                 BaseOverlay& _overlay,
    63                 const NodeID& _nodeid,
    64                 OverlayStructureEvents* _eventsReceiver
    65         );
     54        OneHop(BaseOverlay& _overlay, const NodeID& _nodeid,
     55                        OverlayStructureEvents* _eventsReceiver);
    6656
    6757        virtual ~OneHop();
    6858
    6959protected:
     60        /// @see OverlayInterface.h
     61        virtual void createOverlay();
    7062
    71         //
    72         // OverlayInterface.h
    73         //
    74 
    75         virtual void createOverlay();
     63        /// @see OverlayInterface.h
    7664        virtual void deleteOverlay();
    7765
    78         virtual void joinOverlay(const EndpointDescriptor& bootstrapEp = EndpointDescriptor::UNSPECIFIED);
     66        /// @see OverlayInterface.h
     67        virtual void joinOverlay(const EndpointDescriptor& boot =
     68                        EndpointDescriptor::UNSPECIFIED);
     69
     70        /// @see OverlayInterface.h
    7971        virtual void leaveOverlay();
    8072
    81         virtual const EndpointDescriptor& resolveNode( const NodeID& node );
    82         virtual void routeMessage( const NodeID& destnode, Message* msg );
     73        /// @see OverlayInterface.h
     74        virtual const EndpointDescriptor& resolveNode(const NodeID& node);
    8375
     76        /// @see OverlayInterface.h
     77        virtual void routeMessage(const NodeID& destnode, Message* msg);
     78
     79        /// @see OverlayInterface.h
    8480        virtual NodeList getKnownNodes() const;
    8581
    86         //
    87         // see CommunicationListener.h or OverlayInterface.h
    88         //
     82        /// @see CommunicationListener.h or @see OverlayInterface.h
     83        virtual void onLinkUp(const LinkID& lnk, const NodeID& remote);
    8984
    90         virtual void onLinkUp(const LinkID& lnk, const NodeID& remote);
     85        /// @see CommunicationListener.h or @see OverlayInterface.h
    9186        virtual void onLinkDown(const LinkID& lnk, const NodeID& remote);
    92         virtual void onMessage(const DataMessage& msg, const NodeID& remote, const LinkID& lnk = LinkID::UNSPECIFIED);
     87
     88        /// @see CommunicationListener.h or @see OverlayInterface.h
     89        virtual void onMessage(const DataMessage& msg, const NodeID& remote,
     90                        const LinkID& lnk = LinkID::UNSPECIFIED);
    9391
    9492private:
    95 
    96         /**
    97          * The other nodes in the overlay
    98          */
    99         typedef map<const NodeID,const LinkID> OverlayNodeMapping;
     93        /// The other nodes in the overlay
     94        typedef map<const NodeID, const LinkID> OverlayNodeMapping;
    10095        OverlayNodeMapping overlayNodes;
    10196
    102         /**
    103          * The current state of the overlay
    104          */
     97        /// The current state of the overlay
    10598        typedef enum _OneHopState {
    106                 OneHopStateInvalid                = 0,
    107                 OneHopStateJoinInitiated          = 1,
    108                 OneHopStateJoinListingRequested   = 2,
    109                 OneHopStateCompleted              = 3,
     99                OneHopStateInvalid = 0,
     100                OneHopStateJoinInitiated = 1,
     101                OneHopStateJoinListingRequested = 2,
     102                OneHopStateCompleted = 3,
    110103        } OneHopState;
    111104
    112105        OneHopState state;
    113 
    114106        uint16_t pendingLinks;
    115107        LinkID bootstrapLink;
    116 
    117108};
    118109
  • source/ariba/overlay/modules/onehop/messages/NodeListingReply.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "NodeListingReply.h"
  • source/ariba/overlay/modules/onehop/messages/NodeListingReply.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef NODE_LISTING_REPLY_H__
     
    7777
    7878sznBeginDefault( ariba::overlay::NodeListingReply, X ) {
    79         uint16_t len = X.isSerializer() ? descriptors.size() : 0;
     79        uint16_t len = descriptors.size();
    8080        X && len;
    81         if (X.isDeserializer()) {
    82                 descriptors.resize(len);
    83         }
    84         for (int i=0; i<len; i++) {
    85                 if (X.isDeserializer()) descriptors[i].second = new EndpointDescriptor();
    86                 X && &descriptors[i].first && reinterpret_cast<VSerializeable*>(descriptors[i].second);
    87         }
     81        if (X.isDeserializer()) descriptors.resize(len);
     82        for (int i=0; i<len; i++)
     83                X && &descriptors[i].first && VO(descriptors[i].second);
    8884} sznEnd();
    8985
  • source/ariba/overlay/modules/onehop/messages/NodeListingRequest.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "NodeListingRequest.h"
  • source/ariba/overlay/modules/onehop/messages/NodeListingRequest.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef NODE_LISTING_REQUEST_H__
  • source/ariba/overlay/modules/onehop/messages/OneHopMessage.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OneHopMessage.h"
  • source/ariba/overlay/modules/onehop/messages/OneHopMessage.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __ONE_HOP_MESSAGE_H
     
    5757                OneHopMessageTypeListingRequest = 1,
    5858                OneHopMessageTypeListingReply   = 2,
     59                OneHopMessageTypeRoute          = 3,
    5960        } OneHopMessageType;
    6061
  • source/ariba/utility/configuration/ConfigFile.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// ConfigFile.h
    33// Class for reading named values from configuration files
     
    2323// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    2424// IN THE SOFTWARE.
    25 // [Licence]
     25// [License]
    2626
    2727#include "ConfigFile.h"
  • source/ariba/utility/configuration/ConfigFile.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// ConfigFile.h
    33// Class for reading named values from configuration files
     
    2323// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
    2424// IN THE SOFTWARE.
    25 // [Licence]
     25// [License]
    2626
    2727
  • source/ariba/utility/configuration/Configuration.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Configuration.h"
  • source/ariba/utility/configuration/Configuration.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __CONFIGURATION_H
  • source/ariba/utility/internal/Utilities.hpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef UTILITIES_HPP_
     
    6060/* check whether X is a signed integer */
    6161#define if_int(X) \
    62         typename boost::enable_if<boost::is_integral<X>,int>::type __i##X = 0,\
    63         typename boost::enable_if<boost::is_signed<X>,int>::type __s##X = 0
     62        typename boost::enable_if<boost::is_integral<X>,void*>::type __i##X = NULL,\
     63        typename boost::enable_if<boost::is_signed<X>,void*>::type __s##X = NULL
    6464
    6565/* signature conversion */
     
    7474CONVERT_SIGN( uint32_t, int32_t );
    7575CONVERT_SIGN( uint64_t, int64_t );
     76
    7677#endif /* UTILITIES_HPP_ */
  • source/ariba/utility/logging/Logging.h

    r2467 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef LOGGING_H__
  • source/ariba/utility/measurement/PathloadMeasurement.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "PathloadMeasurement.h"
  • source/ariba/utility/measurement/PathloadMeasurement.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __PATHLOAD_MEASUREMENT_H
  • source/ariba/utility/messages.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef MESSAGES_H_
  • source/ariba/utility/messages/Message.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Message.h"
  • source/ariba/utility/messages/Message.h

    r3601 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef MESSAGE_H_
     
    236236                return NULL;
    237237        }
    238        
     238
    239239        /**
    240240         * The same as decapsulate, but this function
    241241         * is used in the samples to make the semantics easier
    242          * to understand. The semantics is shown to be: you get 
    243          * a message and convert it to your type. Not as: you 
     242         * to understand. The semantics is shown to be: you get
     243         * a message and convert it to your type. Not as: you
    244244         * get a message and have to extract your message from it.
    245          */ 
     245         */
    246246        template<class T>
    247247        inline T* convert() {
    248                 return decapsulate<T>();       
     248                return decapsulate<T>();
    249249        }
    250250
  • source/ariba/utility/messages/MessageControlInfo.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "MessageControlInfo.h"
  • source/ariba/utility/messages/MessageControlInfo.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef MESSAGECONTROLINFO_H_
  • source/ariba/utility/messages/MessageProvider.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "MessageProvider.h"
  • source/ariba/utility/messages/MessageProvider.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef MESSAGEPROVIDER_H_
  • source/ariba/utility/messages/MessageReceiver.cpp

    r2467 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "MessageReceiver.h"
  • source/ariba/utility/messages/MessageReceiver.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef MESSAGERECEIVER_H__
  • source/ariba/utility/messages/MessageSender.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "MessageSender.h"
  • source/ariba/utility/messages/MessageSender.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef MESSAGESENDER_H_
  • source/ariba/utility/messages/MessageUtilities.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef MESSAGEUTILITIES_H_
  • source/ariba/utility/messages/TextMessage.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "TextMessage.h"
  • source/ariba/utility/messages/TextMessage.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef TEXTMESSAGE_H_
  • source/ariba/utility/messages/_namespace.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#undef NAMESPACE_BEGIN
  • source/ariba/utility/misc/Demultiplexer.hpp

    r2473 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef DEMULTIPLEXER_H__
  • source/ariba/utility/misc/Helper.cpp

    r3683 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Helper.h"
  • source/ariba/utility/misc/Helper.h

    r3683 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __HELPER_H
  • source/ariba/utility/misc/KeyMapping.hpp

    r2801 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef KEY_MAPPING_H__
  • source/ariba/utility/misc/OvlVis.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OvlVis.h"
  • source/ariba/utility/misc/OvlVis.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef OVLVIS_H__
  • source/ariba/utility/misc/sha1.cpp

    r2995 r3690  
    1 // [licence]
     1// [License]
    22// 100% free public domain implementation of the SHA-1 algorithm
    33// by Dominik Reichl <dominik.reichl@t-online.de>
    4 // [licence]
     4// [License]
    55/*
    66      Version 1.5 - 2005-01-01
  • source/ariba/utility/misc/sha1.h

    r3689 r3690  
    1 // [licence]
     1// [License]
    22// 100% free public domain implementation of the SHA-1 algorithm
    33// by Dominik Reichl <dominik.reichl@t-online.de>
    4 // [licence]
     4// [License]
    55/*
    66        Version 1.5 - 2005-01-01
  • source/ariba/utility/serialization.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SERIALIZATION_H_
  • source/ariba/utility/serialization/Data.hpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef DATA_HPP_
  • source/ariba/utility/serialization/DataStream.hpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef DATASTREAM_HPP_
     
    4242//== Library includes ==
    4343#include <boost/cstdint.hpp>
     44#include <boost/type_traits/make_unsigned.hpp>
     45
    4446#include <iostream>
    4547#include <vector>
     
    153155        template<typename X>
    154156        finline void remove(X& obj, if_uint(X)) {
     157                if (!isMeasure()) bits[index].get(obj);
     158                index += sizeof(X) * 8;
     159        }
     160
     161        /* support signed ints */
     162        template<typename X>
     163        finline void add(X& sobj, if_int(X)) {
     164                typedef typename boost::make_unsigned<X>::type UX;
     165                UX& obj = *((UX*)&sobj);
     166                if (!isMeasure())
     167                bitcpy( sobj, 0, bits.getBuffer(), index);
     168                index += sizeof(X) * 8;
     169        }
     170
     171        template<typename X>
     172        finline void remove(X& sobj, if_int(X)) {
     173                typedef typename boost::make_unsigned<X>::type UX;
     174                UX& obj = *((UX*)&sobj);
    155175                if (!isMeasure()) bits[index].get(obj);
    156176                index += sizeof(X) * 8;
  • source/ariba/utility/serialization/DataUtilities.hpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939/* This file implements some common bit operations for unsigned integer types
  • source/ariba/utility/serialization/Serialization.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Serialization.hpp"
  • source/ariba/utility/serialization/Serialization.hpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SERIALIZATION_HPP_
  • source/ariba/utility/serialization/TestSerialization.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Data.hpp"
  • source/ariba/utility/system/BlockingMethod.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "BlockingMethod.h"
  • source/ariba/utility/system/BlockingMethod.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef BLOCKING_METHOD_H__
  • source/ariba/utility/system/StartupInterface.h

    r3037 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __STARTUP_INTERFACE_H
  • source/ariba/utility/system/StartupWrapper.cpp

    r3071 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "StartupWrapper.h"
  • source/ariba/utility/system/StartupWrapper.h

    r3041 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __STARTUP_WRAPPER_H
  • source/ariba/utility/system/SystemEvent.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "SystemEvent.h"
  • source/ariba/utility/system/SystemEvent.h

    r2852 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SYSTEMEVENT_H_
  • source/ariba/utility/system/SystemEventListener.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "SystemEventListener.h"
  • source/ariba/utility/system/SystemEventListener.h

    r2851 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SYSTEMEVENTLISTENER_H_
  • source/ariba/utility/system/SystemEventType.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "SystemEventType.h"
  • source/ariba/utility/system/SystemEventType.h

    r2433 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SYSTEMEVENTTYPE_H_
  • source/ariba/utility/system/SystemQueue.cpp

    r2850 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
  • source/ariba/utility/system/SystemQueue.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SYSTEMQUEUE_H_
  • source/ariba/utility/system/Timer.cpp

    r3578 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Timer.h"
  • source/ariba/utility/system/Timer.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __TIMER_H
  • source/ariba/utility/types.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef TYPES_H_
  • source/ariba/utility/types/Address.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Address.h"
  • source/ariba/utility/types/Address.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef ADDRESS_H_
  • source/ariba/utility/types/Data.hpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "../serialization/Data.hpp"
  • source/ariba/utility/types/Identifier.cpp

    r2801 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Identifier.h"
  • source/ariba/utility/types/Identifier.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef IDENTIFIER_H_
  • source/ariba/utility/types/LinkID.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "LinkID.h"
  • source/ariba/utility/types/LinkID.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef LINKID_H_
  • source/ariba/utility/types/Locator.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "Locator.h"
  • source/ariba/utility/types/Locator.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef LOCATOR_H_
  • source/ariba/utility/types/NodeID.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "NodeID.h"
  • source/ariba/utility/types/NodeID.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef __NODEID_H
  • source/ariba/utility/types/OverlayParameterSet.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "OverlayParameterSet.h"
  • source/ariba/utility/types/OverlayParameterSet.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef OVERLAYPARAMETERSET_H_
     
    5353
    5454        typedef enum _OverlayStructure {
    55                 OverlayStructureOneHop   = 1,
    56                 OverlayStructureChord    = 2,
    57                 OverlayStructureKademlia = 3,
     55                OverlayStructureOneHop   = 0,
     56                OverlayStructureChord    = 1,
     57                OverlayStructureKademlia = 2,
    5858        } OverlayStructure;
    5959
    60         OverlayParameterSet(OverlayStructure _structure = OverlayStructureOneHop);
     60        OverlayParameterSet(OverlayStructure _structure = OverlayStructureChord);
    6161        virtual ~OverlayParameterSet();
    6262
  • source/ariba/utility/types/QoSParameterSet.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "QoSParameterSet.h"
  • source/ariba/utility/types/QoSParameterSet.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef QOS_PARAMETER_SET_H__
  • source/ariba/utility/types/SecurityParameterSet.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "SecurityParameterSet.h"
  • source/ariba/utility/types/SecurityParameterSet.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SECURITY_PARAMETER_SET_H
  • source/ariba/utility/types/ServiceID.cpp

    r2473 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "ServiceID.h"
  • source/ariba/utility/types/ServiceID.h

    r2473 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SERVICEID_H_
  • source/ariba/utility/types/SpoVNetID.cpp

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#include "SpoVNetID.h"
  • source/ariba/utility/types/SpoVNetID.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#ifndef SPOVNETID_H_
  • source/ariba/utility/types/_namespace.h

    r3689 r3690  
    1 // [Licence]
     1// [License]
    22// The Ariba-Underlay Copyright
    33//
     
    3535// official policies, either expressed or implied, of the Institute of
    3636// Telematics.
    37 // [Licence]
     37// [License]
    3838
    3939#undef NAMESPACE_BEGIN
Note: See TracChangeset for help on using the changeset viewer.