00001 #ifndef ARIBA_OVERLAY_LINKREQUEST_H_ 00002 #define ARIBA_OVERLAY_LINKREQUEST_H_ 00003 00004 #include "ariba/utility/messages.h" 00005 #include "ariba/utility/serialization.h" 00006 #include "ariba/communication/EndpointDescriptor.h" 00007 00008 using ariba::communication::EndpointDescriptor; 00009 00010 namespace ariba { 00011 namespace overlay { 00012 00013 using_serialization; 00014 00015 using ariba::utility::Message; 00016 00022 class LinkRequest : public Message { 00023 VSERIALIZEABLE; 00024 private: 00025 bool free_endpoint_; 00026 uint8_t flags; 00027 uint32_t nonce; 00028 const EndpointDescriptor* endpoint; 00029 00030 public: 00031 LinkRequest(); 00032 00033 LinkRequest( uint32_t nonce, const EndpointDescriptor* endpoint, 00034 bool reply = false ); 00035 00036 virtual ~LinkRequest(); 00037 00038 const EndpointDescriptor* getEndpoint() const { 00039 return endpoint; 00040 } 00041 00042 bool isReply() const { 00043 return flags & 1; 00044 } 00045 00046 uint32_t getNonce() const { 00047 return nonce; 00048 } 00049 }; 00050 00051 }} // ariba::overlay 00052 00053 sznBeginDefault( ariba::overlay::LinkRequest, X ) { 00054 if (X.isDeserializer()) endpoint = new EndpointDescriptor(); 00055 X && flags && nonce && reinterpret_cast<VSerializeable*>(const_cast<EndpointDescriptor*>(endpoint)); 00056 } sznEnd(); 00057 00058 #endif /* ARIBA_OVERLAY_LINKREQUEST_H_ */