Changeset 7535
- Timestamp:
- Feb 5, 2010, 9:08:33 AM (15 years ago)
- Location:
- source/ariba
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/AribaModule.cpp
r7532 r7535 59 59 60 60 use_logging_cpp(AribaModule); 61 const string AribaModule::BootstrapMechanismNames[5] = {"invalid", "static", "broadcast", "mdns", "sdp"}; 61 const string AribaModule::BootstrapMechanismNames[5] 62 = {"invalid", "static", "broadcast", "mdns", "sdp"}; 62 63 63 64 AribaModule::AribaModule() -
source/ariba/AribaModule.h
r7532 r7535 157 157 private: 158 158 159 // bootstrap mechanisms 159 /** 160 * Available bootstrap mechanisms 161 */ 160 162 enum BootstrapMechanism { 161 163 BootstrapMechanismInvalid = 0, … … 167 169 static const string BootstrapMechanismNames[5]; 168 170 169 // bootstrap node 171 /** 172 * bootstrap node information 173 */ 170 174 class BootstrapNode { 171 175 public: … … 189 193 }; 190 194 191 // bootstrap info 195 /* 196 * bootstrap info, all bootstrap nodes 197 * for a specific spovnet 198 */ 192 199 class BootstrapInfo { 193 200 public: … … 203 210 vector<BootstrapNode> nodes; 204 211 }; 205 vector<BootstrapInfo> bootstrapNodes; 212 213 vector<BootstrapInfo> bootstrapNodes; //< all available bootstrap information 206 214 207 215 protected: … … 210 218 bool started; //< flag, if module has been started 211 219 212 // bootstrap node management 220 /** 221 * bootstrap node management 222 * add a bootstrap node 223 */ 213 224 void addBootstrapNode( 214 225 const Name& spovnet, … … 217 228 const BootstrapMechanism& mechanism 218 229 ); 230 231 /** 232 * bootstrap node management 233 * add a bootstrap node 234 */ 219 235 void addBootstrapNode( 220 236 const Name& spovnet, … … 222 238 ); 223 239 240 /** 241 * bootstrap node management 242 * get all available bootstrap mechanisms 243 * where bootstrap nodes are available for 244 */ 224 245 vector<AribaModule::BootstrapMechanism> getBootstrapMechanisms( 225 246 const Name& spovnet 226 247 ) const; 227 248 249 /** 250 * get a endpoint descriptor for a spovnet 251 * using a specific bootstrap mechanisms. 252 * will currently only work with static 253 */ 228 254 const communication::EndpointDescriptor* getBootstrapNode( 229 255 const Name& spovnet, … … 231 257 ) const; 232 258 259 /** 260 * get the info field associated for a given 261 * spovnet through a given mechanism 262 */ 233 263 string getBootstrapInfo( 234 264 const Name& spovnet, … … 236 266 ) const; 237 267 238 communication::BaseCommunication* base_comm; 239 SideportListener* sideport_sniffer; 268 communication::BaseCommunication* base_comm; //< the base communication 269 SideportListener* sideport_sniffer; //< the sideport listener 240 270 }; 241 271 -
source/ariba/CommunicationListener.h
r7468 r7535 61 61 62 62 public: 63 static CommunicationListener DEFAULT; 63 static CommunicationListener DEFAULT; //< default implementation 64 64 65 65 protected: 66 66 67 /** 68 * Construct a communication listener 69 */ 67 70 CommunicationListener(); 71 72 /** 73 * Destruct a communication listener 74 */ 68 75 virtual ~CommunicationListener(); 69 76 70 77 // --- link events --- 71 78 79 /** 80 * Event called when a link goes up 81 * @param lnk The id of the link 82 * @param remote The remote node where the link ends 83 */ 72 84 virtual void onLinkUp(const LinkID& lnk, const NodeID& remote); 73 85 86 /** 87 * Event called when a link goes down 88 * @param lnk The id of the link 89 * @param remote The remote node where the link ends 90 */ 74 91 virtual void onLinkDown(const LinkID& lnk, const NodeID& remote); 75 92 93 /** 94 * Event called when a link has changed, 95 * e.g. through mobility 96 * @param lnk The id of the link 97 * @param remote The remote node where the link ends 98 */ 76 99 virtual void onLinkChanged(const LinkID& lnk, const NodeID& remote); 77 100 101 /** 102 * Event called when a link has failed 103 * @param lnk The id of the link 104 * @param remote The remote node where the link ends 105 */ 78 106 virtual void onLinkFail(const LinkID& lnk, const NodeID& remote); 79 107 108 /** 109 * Request from remote node to open up a link 110 * @param remote The remote node that requests the new link 111 */ 80 112 virtual bool onLinkRequest(const NodeID& remote); 81 113 82 114 // --- general receive method --- 83 115 116 /** 117 * Called when a message is incoming 118 * @param msg The data message that is received 119 * @param remote The remote node that sent the message 120 * @param lnk The link id of the link where the message is received 121 */ 84 122 virtual void onMessage(const DataMessage& msg, const NodeID& remote, 85 123 const LinkID& lnk = LinkID::UNSPECIFIED); … … 87 125 // --- dht functionality --- 88 126 127 /** 128 * Called when a key has been resolved in the DHT 129 * @param key The key that was requested 130 * @param value the data items the key was resolved to 131 */ 89 132 virtual void onKeyValue( const Data& key, const vector<Data>& value ); 90 133 -
source/ariba/DataMessage.h
r7500 r7535 33 33 class DataMessage { 34 34 private: 35 void* data; 36 size_t size; 35 void* data; //< internal buffer pointer 36 size_t size; //< internal buffer pointer size 37 37 public: 38 static const DataMessage UNSPECIFIED; 38 static const DataMessage UNSPECIFIED; //< default implementation of a data message 39 39 40 /** 41 * Default constructor for a data message 42 */ 40 43 inline DataMessage() { 41 44 this->data = NULL; … … 43 46 } 44 47 48 /** 49 * Constructor for a data message 50 * @param data Data buffer to carry in the message 51 * @param size Size of the buffer pointed to 52 */ 45 53 inline DataMessage( const void* data, const size_t size ) { 46 54 this->data = const_cast<void*>(data); … … 48 56 } 49 57 58 /** 59 * Copy constructor for a data message 60 * @param message The other message to copy from 61 */ 50 62 inline DataMessage(const DataMessage& message){ 51 63 this->data = message.data; … … 54 66 55 67 #ifdef USE_MESSAGE_UTILITY 68 /** 69 * Construct a data message from a normal message 70 * @param message The normal message to store 71 */ 56 72 inline DataMessage( const Message* message ) { 57 73 this->data = (void*)const_cast<Message*>(message); … … 59 75 } 60 76 77 /** 78 * Construct a data message from a normal message 79 * @param message The normal message to store 80 */ 61 81 inline DataMessage( const Message& message ) { 62 82 this->data = (void*)const_cast<Message*>(&message); … … 64 84 } 65 85 86 /** 87 * Get the internal message when constructued through one 88 * @return pointer to the message 89 */ 66 90 inline Message* getMessage() const { 67 91 if (isData()) { … … 71 95 } 72 96 97 /** 98 * Conversion function to convert to Message* 99 * @return internal message 100 */ 73 101 inline operator Message* () const { 74 102 return getMessage(); … … 76 104 #endif 77 105 106 /** 107 * Is the data message a normal message? 108 * @return true, if the data message is a normal message 109 */ 78 110 inline bool isMessage() const { 79 111 return size == ~(size_t)0; 80 112 } 81 113 114 /** 115 * Is the data message a data message 116 * @return true, if the data message is not a normal message 117 */ 82 118 inline bool isData() const { 83 119 return !isMessage(); 84 120 } 85 121 122 /** 123 * Directly access the internal data pointer 124 * @return internal data pointer 125 */ 86 126 inline void* getData() const { 87 127 return data; 88 128 } 89 129 130 /** 131 * Get the size of the internal buffer 132 * @return internal buffer size 133 */ 90 134 inline size_t getSize() const { 91 135 return size; 92 136 } 93 137 138 /** 139 * Is the data message invalid? 140 * @return true, if data message is invalid 141 */ 94 142 inline bool isUnspecified() const { 95 143 return data == NULL; 96 144 } 145 97 146 }; 98 147 -
source/ariba/LinkProperties.h
r7468 r7535 53 53 namespace ariba { 54 54 55 /** 56 * Link properties storage. Currently empty but will 57 * contain properties to create the link in the future 58 */ 55 59 class LinkProperties { 56 60 public: 61 /** 62 * Constructor of LinkProperties 63 */ 57 64 LinkProperties(); 58 ~LinkProperties();59 65 66 /** 67 * Destructor of LinkProperties 68 */ 69 virtual ~LinkProperties(); 70 71 /** 72 * Convert to readable string 73 * @return string representation 74 */ 60 75 string toString() const; 76 77 /** 78 * Default instance of LinkProperties 79 */ 61 80 static const LinkProperties DEFAULT; 62 81 }; -
source/ariba/Message.h
r7468 r7535 40 40 #define TIDYMESSAGE_H_ 41 41 42 /** THIS FILE IS ABOUT TO BE DEPRECATED !! */43 44 42 #include <inttypes.h> 45 43 #include "ariba/utility/messages.h" -
source/ariba/Name.h
r6919 r7535 149 149 150 150 private: 151 uint8_t* _bytes; 152 int _length; 153 bool _copy; 154 bool _hreadable; 151 uint8_t* _bytes; //< internal pointer 152 int _length; //< length of internal pointer 153 bool _copy; //< is the buffer a real copy 154 bool _hreadable; //< is the name human readable 155 155 156 156 void init(const char* name, int len, bool copy, bool hreadable); -
source/ariba/Node.h
r7532 r7535 182 182 * the node name of the remote node, if known -- otherwise it returns 183 183 * an unspecified name. 184 *185 * TODO: RFE -- send request to remote node and inform service.186 184 * 187 185 * @return A node's name or an unspecified name, if unknown … … 325 323 string getName() const; 326 324 327 328 325 protected: 329 326 // friends … … 334 331 AribaModule& ariba_mod; //< ariba module 335 332 SpoVNetID spovnetId; //< current spovnet id 336 NodeID nodeId; //< current node id333 NodeID nodeId; //< current node id 337 334 overlay::BaseOverlay* base_overlay; //< the base overlay 335 338 336 }; 339 337 -
source/ariba/SpoVNetProperties.h
r7468 r7535 66 66 class SpoVNetProperties { 67 67 public: 68 /** 69 * Different types of overlays that are supported 70 */ 68 71 enum OverlayType { 69 72 ONE_HOP_OVERLAY = 0,
Note:
See TracChangeset
for help on using the changeset viewer.