- Timestamp:
- Jan 25, 2010, 10:50:57 AM (15 years ago)
- Location:
- source/ariba
- Files:
-
- 18 edited
Legend:
- Unmodified
- Added
- Removed
-
source/ariba/AribaModule.cpp
r6919 r7468 61 61 AribaModule::AribaModule() 62 62 : started(false), base_comm(NULL), sideport_sniffer(NULL) { 63 64 63 endpoints = "tcp{41322};rfcomm{10};"; 65 66 //srand( time(NULL) );67 //uint16_t tcpport = (rand() + 1024) % 50000;68 //uint16_t udpport = (rand() + 1024) % 50000;69 64 } 70 65 … … 203 198 if (key == "endpoints") return endpoints; // TODO: return local endpoints 204 199 else if (key == "bootstrap.hints") return getBootstrapHints(); 200 return ""; 205 201 } 206 202 -
source/ariba/CommunicationListener.cpp
r6266 r7468 61 61 } 62 62 63 bool CommunicationListener::onLinkRequest(const NodeID& remote, 64 const DataMessage& msg) { 63 bool CommunicationListener::onLinkRequest(const NodeID& remote) { 65 64 return true; 66 65 } … … 70 69 } 71 70 72 bool CommunicationListener::onEnableSideportListener() { 73 return true; 71 void CommunicationListener::onKeyValue( const Data& key, const vector<Data>& value ) { 74 72 } 75 73 76 void CommunicationListener::onKeyValue( const Data& key, const vector<Data>& value ) {77 78 }79 80 81 // --- extended message functionality ---82 //void CommunicationListener::onLinkQoSChanged(const LinkID& l, const NodeID& r,83 // const LinkProperties& p) {84 //}85 86 // --- extended message functionality ---87 // void CommunicationListener::onMessageSent(seqnum_t seq_num, bool failed,88 // const DataMessage& msg) {89 // }90 91 74 } // namespace ariba -
source/ariba/CommunicationListener.h
r6266 r7468 78 78 virtual void onLinkFail(const LinkID& lnk, const NodeID& remote); 79 79 80 virtual bool onLinkRequest(const NodeID& remote , const DataMessage& msg = DataMessage::UNSPECIFIED);80 virtual bool onLinkRequest(const NodeID& remote); 81 81 82 82 // --- general receive method --- … … 85 85 const LinkID& lnk = LinkID::UNSPECIFIED); 86 86 87 // --- sniffing related method ---88 89 virtual bool onEnableSideportListener();90 91 87 // --- dht functionality --- 92 88 93 89 virtual void onKeyValue( const Data& key, const vector<Data>& value ); 94 90 95 // --- extended message functionality ---96 97 // virtual void onLinkQoSChanged(const LinkID& lnk, const NodeID& remote,98 // const LinkProperties& prop);99 100 // --- extended message functionality ---101 102 // virtual void onMessageSent(seqnum_t seq_num, bool failed,103 // const DataMessage& msg = DataMessage::UNSPECIFIED);104 91 }; 105 92 -
source/ariba/Identifiers.h
r3055 r7468 46 46 47 47 namespace ariba { 48 49 typedef utility::NodeID NodeID; 50 typedef utility::LinkID LinkID; 51 typedef utility::SpoVNetID SpoVNetID; 52 typedef utility::ServiceID ServiceID; 53 48 typedef utility::NodeID NodeID; 49 typedef utility::LinkID LinkID; 50 typedef utility::SpoVNetID SpoVNetID; 51 typedef utility::ServiceID ServiceID; 54 52 } // namespace ariba 55 53 -
source/ariba/LinkProperties.cpp
r3037 r7468 44 44 45 45 LinkProperties::LinkProperties() { 46 this->reliable = true;47 // this->confidential = false;48 // this->integrity = false;49 46 } 50 47 … … 53 50 54 51 string LinkProperties::toString() const { 55 std::ostringstream buf; 56 buf << "[reliable=" << (reliable ? "yes" : "no") << "]"; 57 return buf.str(); 52 return ""; 58 53 } 59 54 -
source/ariba/LinkProperties.h
r3037 r7468 60 60 string toString() const; 61 61 static const LinkProperties DEFAULT; 62 63 bool reliable;64 65 //TODO: to be extended!66 // bool confidential;67 // bool integrity;68 69 //TODO: implement quality-of-service containers70 // SpoQ qosUpstream;71 // SpoQ qosDownstream;72 62 }; 73 63 -
source/ariba/Makefile.am
r6925 r7468 83 83 LinkProperties.h \ 84 84 Message.h \ 85 Module.h \ 85 86 DataMessage.h \ 86 Module.h \87 87 Name.h \ 88 88 Node.h \ -
source/ariba/Message.h
r2460 r7468 46 46 47 47 namespace ariba { 48 typedef uint16_t seqnum_t;49 typedef utility::Message Message;48 typedef uint16_t seqnum_t; 49 typedef utility::Message Message; 50 50 } // namespace ariba 51 51 -
source/ariba/Node.cpp
r6919 r7468 164 164 // now that we have a listener, we can ask if sniffing is ok 165 165 if( ariba_mod.sideport_sniffer != NULL ){ 166 // bool allow = listener->onEnableSideportListener();167 166 base_overlay->registerSidePort(ariba_mod.sideport_sniffer); 168 167 } … … 186 185 187 186 // @see Module.h 188 void Node::initialize() {189 190 }191 192 // @see Module.h193 void Node::start() {194 195 }196 197 // @see Module.h198 void Node::stop() {199 200 }201 202 // @see Module.h203 187 string Node::getName() const { 204 188 return name.toString(); 205 189 } 206 190 207 // @see Module.h208 void Node::setProperty(string key, string value) {209 210 }211 212 // @see Module.h213 const string Node::getProperty(string key) const {214 215 }216 217 // @see Module.h218 const vector<string> Node::getProperties() const {219 220 }221 222 191 } // namespace ariba -
source/ariba/Node.h
r6836 r7468 324 324 325 325 /** @see Module.h */ 326 void initialize();327 328 /** @see Module.h */329 void start();330 331 /** @see Module.h */332 void stop();333 334 /** @see Module.h */335 326 string getName() const; 336 327 337 /** @see Module.h */338 void setProperty(string key, string value);339 340 /** @see Module.h */341 const string getProperty(string key) const;342 343 /** @see Module.h */344 const vector<string> getProperties() const;345 328 346 329 protected: -
source/ariba/SideportListener.cpp
r6944 r7468 57 57 string SideportListener::getEndpointDescription( const LinkID& link ) const { 58 58 if( overlay == NULL ) { 59 std::cerr << "Sideport: No overlay found." << std::endl;60 59 return ""; 61 60 } 62 std::cerr << "WTF!!!" << std::endl;63 61 return overlay->getEndpointDescriptor(link).toString(); 64 62 } … … 66 64 string SideportListener::getEndpointDescription( const NodeID& node ) const { 67 65 if( overlay == NULL ) { 68 std::cerr << "Sideport: No overlay found." << std::endl;69 66 return ""; 70 67 } … … 146 143 147 144 BaseCommunication::LinkDescriptor& bclink = 148 overlay->bc->queryLocalLink(link->communicationId);145 overlay->bc->queryLocalLink(link->communicationId); 149 146 150 147 if(bclink.isUnspecified() || bclink.remoteLocator == NULL) return (Protocol)ret; -
source/ariba/SideportListener.h
r5920 r7468 53 53 namespace ariba { 54 54 55 // forward decl erations55 // forward declarations 56 56 class Node; 57 57 class AribaModule; … … 164 164 bool isRelayedNode(const NodeID& node); 165 165 166 167 166 /** 168 167 * Protocols for some layer, can be combined -
source/ariba/SpoVNetProperties.cpp
r3690 r7468 44 44 45 45 SpoVNetProperties::SpoVNetProperties() : 46 name( Name::random() ), type( CHORD_OVERLAY ), idLength( 192 ), 47 initiator( NodeID::UNSPECIFIED ), hidden( false ) { 48 49 id = name.toSpoVNetId(); 46 type( CHORD_OVERLAY ){ 50 47 } 51 48 52 49 SpoVNetProperties::SpoVNetProperties(const SpoVNetProperties& copy) : 53 name( copy.name ), id( copy.id ), 54 type( copy.type ), idLength( copy.idLength ), 55 initiator( copy.initiator ), hidden( copy.hidden ) { 50 type( copy.type ){ 56 51 } 57 52 58 53 SpoVNetProperties::~SpoVNetProperties() { 59 }60 61 const Name& SpoVNetProperties::getName() const {62 return name;63 }64 65 const SpoVNetID& SpoVNetProperties::getId() const {66 return id;67 }68 69 const NodeID& SpoVNetProperties::getInitiator() const {70 return initiator;71 }72 73 uint16_t SpoVNetProperties::getIdentifierLength() const {74 return idLength;75 54 } 76 55 … … 79 58 } 80 59 81 bool SpoVNetProperties::isHidden() const {82 return hidden;83 }84 85 60 std::string SpoVNetProperties::toString() const { 86 61 std::ostringstream buf; 87 62 buf << "spovnet" 88 << " name=" << name.toString() 89 << " id=" << id.toString() 90 << " overlay_type=" << type 91 << " id_length=" << idLength 92 << " initiator=" << initiator 93 << " hidden=" << hidden; 63 << " overlay_type=" << type; 94 64 return buf.str(); 95 65 } -
source/ariba/SpoVNetProperties.h
r5316 r7468 83 83 84 84 /** 85 * Constructs a new SpoVnet property object.86 *87 * TODO: replace with setters! for downwards compatibility88 */89 /*90 SpoVNetProperties(const Name& name, SpoVNetID id, OverlayType type,91 uint16_t idLength, const NodeID& initiator, bool hidden = false) :92 name(name), id(id), type(type), idLength(idLength),93 initiator(initiator), hidden(hidden) {94 }*/95 96 /**97 85 * Copy constructor. 98 86 */ … … 103 91 */ 104 92 virtual ~SpoVNetProperties(); 105 106 /**107 * Returns the canonical SpoVNet name108 */109 const Name& getName() const;110 111 /**112 * Returns the SpoVNet id113 */114 const SpoVNetID& getId() const;115 116 /**117 * Returns the node id of the initiator of the spovnet.118 * If the node id is unspecified, the initiator wanted to be anonymous.119 */120 const NodeID& getInitiator() const;121 122 /**123 * Returns the node identifier length in bites124 */125 uint16_t getIdentifierLength() const;126 127 void setIdentifierLength( uint16_t length ) {128 this->idLength = length;129 }130 93 131 94 /** … … 139 102 140 103 /** 141 * Returns true, if the spovnet is hidden142 */143 bool isHidden() const;144 145 void setHidden( bool is_hidden ) {146 this->hidden = is_hidden;147 }148 149 /**150 104 * Returns a human readable string representation of the SpoVNet properties 151 105 * … … 155 109 156 110 private: 157 Name name; 158 SpoVNetID id; 159 uint8_t type; 160 uint16_t idLength; 161 NodeID initiator; 162 bool hidden; 111 uint8_t type; 163 112 }; 164 113 -
source/ariba/utility/system/SystemQueue.cpp
r6919 r7468 95 95 } 96 96 97 void SystemQueue::dropAll( const SystemEventListener* mlistener){ 98 #ifndef UNDERLAY_OMNET 99 directScheduler.dropAll(mlistener); 100 delayScheduler.dropAll(mlistener); 101 #endif 102 } 103 97 104 bool SystemQueue::isEmpty() { 98 105 #ifndef UNDERLAY_OMNET … … 192 199 } 193 200 201 void SystemQueue::QueueThread::dropAll( const SystemEventListener* mlistener) { 202 boost::mutex::scoped_lock lock( queueMutex ); 203 204 bool deleted = false; 205 do{ 206 EventQueue::iterator i = eventsQueue.begin(); 207 EventQueue::iterator iend = eventsQueue.end(); 208 209 for( ; i != iend; i++){ 210 if((*i).getListener() == mlistener){ 211 eventsQueue.erase(i); 212 deleted = true; 213 break; 214 } 215 } 216 }while(deleted); 217 } 218 194 219 void SystemQueue::QueueThread::threadFunc( QueueThread* obj ) { 195 220 -
source/ariba/utility/system/SystemQueue.h
r6919 r7468 125 125 126 126 /** 127 * Drop all queued events for that listener 128 */ 129 void dropAll( const SystemEventListener* mlistener); 130 131 /** 127 132 * Check wheter this queue has items or not. 128 133 * … … 182 187 void enter(); 183 188 void leave(); 189 void dropAll( const SystemEventListener* mlistener); 184 190 185 191 protected: -
source/ariba/utility/system/Timer.cpp
r4987 r7468 100 100 running = false; 101 101 reset(); // cause the sleep to abort 102 //SystemQueue::instance().dropAll(this); 102 103 } 103 104 -
source/ariba/utility/system/Timer.h
r4987 r7468 40 40 #define __TIMER_H 41 41 42 #include <stdint.h> 42 43 #include "ariba/utility/system/SystemEventListener.h" 43 44 #include "ariba/utility/system/SystemQueue.h"
Note:
See TracChangeset
for help on using the changeset viewer.