Changeset 9694 for source/ariba


Ignore:
Timestamp:
Mar 23, 2011, 12:06:05 PM (13 years ago)
Author:
mies
Message:

rolled back

Location:
source/ariba/communication
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/communication/BaseCommunication.h

    r9684 r9694  
    131131
    132132        /// Establishes a link to another end-point.
    133         const LinkID establishLink(const EndpointDescriptor& descriptor );
     133        const LinkID establishLink(const EndpointDescriptor& descriptor,
     134                const LinkID& linkid = LinkID::UNSPECIFIED, const QoSParameterSet& qos =
     135                                QoSParameterSet::DEFAULT, const SecurityParameterSet& sec =
     136                                SecurityParameterSet::DEFAULT);
    134137
    135138        /// Drops a link
    136         void dropLink( LinkID link );
     139        void dropLink(const LinkID link);
    137140
    138141        /**
     
    143146         * @return A sequence number for this message
    144147         */
    145         seqnum_t sendMessage( LinkID lid, const Message* message );
     148        seqnum_t sendMessage(const LinkID lid, const Message* message);
    146149
    147150        /**
     
    151154         * @return The end-point descriptor of the link's end-point
    152155         */
    153         const EndpointDescriptor& getEndpointDescriptor(
    154                         LinkID link = LinkID::UNSPECIFIED) const;
     156        const EndpointDescriptor& getEndpointDescriptor(const LinkID link =
     157                        LinkID::UNSPECIFIED) const;
    155158
    156159        /**
     
    209212        class LinkDescriptor {
    210213        public:
     214
    211215                /// default constructor
    212                 LinkDescriptor() : up(false), id(), localLocator(NULL), remoteLocator(NULL) {}
     216                LinkDescriptor() :
     217                        localLink(LinkID::UNSPECIFIED), localLocator(NULL),
     218                        remoteLink(LinkID::UNSPECIFIED), remoteLocator(NULL),
     219                        up(false) {
     220                }
    213221
    214222                ~LinkDescriptor() {
     
    218226
    219227                bool isUnspecified() const {
    220                         return id.isUnspecified();
     228                        return (this == &UNSPECIFIED());
    221229                }
     230
     231                static LinkDescriptor& UNSPECIFIED(){
     232                        static LinkDescriptor* unspec = NULL;
     233                        if(unspec == NULL) unspec = new LinkDescriptor();
     234                        return *unspec;
     235                }
     236
     237                bool unspecified;
     238
     239                /// link identifiers
     240                LinkID localLink;
     241                const address_v* localLocator;
     242
     243                /// used underlay addresses for the link
     244                LinkID remoteLink;
     245                const address_v* remoteLocator;
     246
     247                /// the remote end-point descriptor
     248                EndpointDescriptor remoteEndpoint;
    222249
    223250                /// flag, whether this link is up
    224251                bool up;
    225 
    226                 /// link identifier
    227                 LinkID id;
    228 
    229                 /// locators
    230                 const address_v* localLocator;
    231                 const address_v* remoteLocator;
    232 
    233                 /// the remote end-point descriptor
    234                 EndpointDescriptor remoteEndpoint;
    235252        };
    236253
     
    242259
    243260        /// Link management: add a link
    244         LinkDescriptor& addLink( LinkID link );
     261        void addLink( LinkDescriptor* link );
    245262
    246263        /// Link management: remove a link
    247         void removeLink( LinkID link);
     264        void removeLink(const LinkID& localLink);
    248265
    249266        /// Link management: get link information using the local link
    250         LinkDescriptor& queryLink( LinkID link) const;
     267        LinkDescriptor& queryLocalLink(const LinkID& localLink) const;
     268
     269        /// Link management: get link information using the remote link
     270        LinkDescriptor& queryRemoteLink(const LinkID& remoteLink) const;
    251271
    252272        /// The local end-point descriptor
     
    287307        /// convenience: send message to peer
    288308        void send( Message* message, const EndpointDescriptor& endpoint );
    289 
    290309        void send( Message* message, const LinkDescriptor& descriptor );
    291310
    292311        /// state of the base communication
    293312        bool started;
     313
    294314};
    295315
  • source/ariba/communication/messages/AribaBaseMsg.cpp

    r9684 r9694  
    4444vsznDefault(AribaBaseMsg);
    4545
    46 AribaBaseMsg::AribaBaseMsg( type_ _type, LinkID link ) :
    47         type((uint8_t)_type), link(link){
     46AribaBaseMsg::AribaBaseMsg( type_ _type,
     47        const LinkID& localLink, const LinkID& remoteLink ) :
     48        type((uint8_t)_type),
     49        localLink(localLink),remoteLink(remoteLink) {
    4850}
    4951
  • source/ariba/communication/messages/AribaBaseMsg.h

    r9684 r9694  
    4141
    4242#include <string>
    43 #include <stdint.h>
    44 
     43#include <boost/cstdint.hpp>
    4544#include "ariba/utility/messages.h"
    4645#include "ariba/utility/serialization.h"
    47 
    4846#include "ariba/utility/types/LinkID.h"
    4947#include "ariba/utility/types/Address.h"
     
    7472        };
    7573
    76         AribaBaseMsg( type_ type = typeData, LinkID link = LinkID::UNSPECIFIED );
     74        AribaBaseMsg( type_ type = typeData,
     75                        const LinkID& localLink = LinkID::UNSPECIFIED,
     76                        const LinkID& remoteLink = LinkID::UNSPECIFIED );
     77
    7778        virtual ~AribaBaseMsg();
    7879
     
    8384        }
    8485
    85         const LinkID& getLink() const {
    86                 return link;
     86        const LinkID& getLocalLink() const {
     87                return localLink;
     88        }
     89
     90        const LinkID& getRemoteLink() const {
     91                return remoteLink;
    8792        }
    8893
     
    96101
    97102private:
    98         // link message type
    99         uint8_t type;
     103        uint8_t type;           // the link message type
    100104
    101         // link identifier
    102         LinkID  link;
     105        // remote and local link ids
     106        LinkID localLink;       // the local link id
     107        LinkID remoteLink;      // the remote link id
    103108
    104         // remote and local endpoint descriptors (link reply/request only)
     109        // remote and local endpoint descriptors
    105110        EndpointDescriptor localDescriptor;
    106111        EndpointDescriptor remoteDescriptor;
     
    110115
    111116sznBeginDefault( ariba::communication::AribaBaseMsg, X ) {
    112         X && type && link;
    113         if (type == typeLinkReply || type == typeLinkRequest) {
     117        X && type && &localLink && &remoteLink;
     118        if (type == typeLinkReply || type == typeLinkRequest)
    114119                X && localDescriptor && remoteDescriptor;
    115         }
    116120        X && Payload();
    117121} sznEnd();
Note: See TracChangeset for help on using the changeset viewer.