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

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/communication/messages/AribaBaseMsg.h

    r4625 r5284  
    4848#include "ariba/utility/types/ServiceID.h"
    4949
     50#include "../EndpointDescriptor.h"
     51
    5052using std::string;
    5153using ariba::utility::Address;
     
    6264        VSERIALIZEABLE;
    6365public:
     66        enum type_ {
     67                typeData = 0,
     68                typeLinkRequest = 1,
     69                typeLinkReply = 2,
     70                typeLinkClose = 3,
     71                typeLinkUpdate = 4
     72        };
    6473
    65         typedef enum _LINK_STATE {
    66                 LINK_STATE_DATA          = 0,
    67                 LINK_STATE_OPEN_REQUEST  = 1,
    68                 LINK_STATE_OPEN_REPLY    = 2,
    69                 LINK_STATE_CLOSE_REQUEST = 3, // there is no close reply. send request and local link is closed
    70                 LINK_STATE_UPDATE        = 4,
    71         } LINK_STATE;
    72 
    73         AribaBaseMsg(
    74                         const Address* address    = NULL,
    75                         LINK_STATE _state         = LINK_STATE_DATA,
    76                         const LinkID& _localLink  = LinkID::UNSPECIFIED,
    77                         const LinkID& _remoteLink = LinkID::UNSPECIFIED );
     74        AribaBaseMsg( type_ type = typeData,
     75                        const LinkID& localLink = LinkID::UNSPECIFIED,
     76                        const LinkID& remoteLink = LinkID::UNSPECIFIED );
    7877
    7978        virtual ~AribaBaseMsg();
    8079
    81         const LINK_STATE getType();
    82         const string getTypeString();
    83         const LinkID& getLocalLink();
    84         const LinkID& getRemoteLink();
     80        const string getTypeString() const;
     81
     82        const type_ getType() const {
     83                return (type_)type;
     84        }
     85
     86        const LinkID& getLocalLink() const {
     87                return localLink;
     88        }
     89
     90        const LinkID& getRemoteLink() const {
     91                return remoteLink;
     92        }
     93
     94        EndpointDescriptor& getLocalDescriptor() {
     95                return localDescriptor;
     96        }
     97
     98        EndpointDescriptor& getRemoteDescriptor() {
     99                return remoteDescriptor;
     100        }
    85101
    86102private:
    87         uint8_t state;          // the link message type
     103        uint8_t type;           // the link message type
     104
     105        // remote and local link ids
    88106        LinkID localLink;       // the local link id
    89107        LinkID remoteLink;      // the remote link id
    90108
     109        // remote and local endpoint descriptors
     110        EndpointDescriptor localDescriptor;
     111        EndpointDescriptor remoteDescriptor;
    91112};
    92113
     
    94115
    95116sznBeginDefault( ariba::communication::AribaBaseMsg, X ) {
    96         X && state && &localLink && &remoteLink && Payload();
     117        X && type && &localLink && &remoteLink;
     118        if (type == typeLinkReply || type == typeLinkRequest)
     119                X && localDescriptor && remoteDescriptor;
     120        X && Payload();
    97121} sznEnd();
    98122
Note: See TracChangeset for help on using the changeset viewer.