Ignore:
Timestamp:
Feb 4, 2010, 5:29:37 PM (14 years ago)
Author:
Christoph Mayer
Message:

-von außen konfigurierbare bootstrap module, -periodicbroadcast crash fix

File:
1 edited

Legend:

Unmodified
Added
Removed
  • source/ariba/AribaModule.h

    r5767 r7532  
    4444#include <ctime>
    4545#include <cstdlib>
    46 #include "ariba/utility/logging/Logging.h"
     46#include <algorithm>
    4747
    4848using std::vector;
     
    156156
    157157private:
     158
     159        // bootstrap mechanisms
     160        enum BootstrapMechanism {
     161                BootstrapMechanismInvalid = 0,
     162                BootstrapMechanismStatic = 1,
     163                BootstrapMechanismBroadcast = 2,
     164                BootstrapMechanismMulticastDNS = 3,
     165                BootstrapMechanismSDP = 4,
     166        };
     167        static const string BootstrapMechanismNames[5];
     168
    158169        // bootstrap node
    159170        class BootstrapNode {
    160171        public:
    161172                inline BootstrapNode() :
    162                         timestamp(0), desc(NULL) {
     173                        timestamp(0), desc(NULL), mechanism(BootstrapMechanismInvalid), info("") {
    163174
    164175                }
    165176                inline BootstrapNode(const BootstrapNode& copy) :
    166                         timestamp(copy.timestamp), desc(copy.desc) {
    167                 }
    168                 inline BootstrapNode(uint32_t timestamp,
    169                                 communication::EndpointDescriptor* desc) :
    170                         timestamp(timestamp), desc(desc) {
     177                        timestamp(copy.timestamp), desc(copy.desc), mechanism(copy.mechanism), info(copy.info) {
     178                }
     179                inline BootstrapNode(
     180                                uint32_t timestamp,
     181                                communication::EndpointDescriptor* desc,
     182                                BootstrapMechanism mechanism, string info) :
     183                        timestamp(timestamp), desc(desc), mechanism(mechanism), info(info) {
    171184                }
    172185                uint32_t timestamp;
    173186                communication::EndpointDescriptor* desc;
     187                BootstrapMechanism mechanism;
     188                string info;
    174189        };
    175190
     
    192207protected:
    193208        // members
    194         string bootstrapFile; //< file with bootstrap information
    195         string endpoints;
     209        string endpoints; //< local endpoints the ariba module is bound to
    196210        bool started; //< flag, if module has been started
    197211
    198212        // bootstrap node management
    199         void addBootstrapNode(const Name& spovnet,
    200                         communication::EndpointDescriptor* desc);
     213        void addBootstrapNode(
     214                        const Name& spovnet,
     215                        communication::EndpointDescriptor* desc,
     216                        const string& info,
     217                        const BootstrapMechanism& mechanism
     218                        );
     219        void addBootstrapNode(
     220                        const Name& spovnet,
     221                        const BootstrapNode& node
     222                        );
     223
     224        vector<AribaModule::BootstrapMechanism> getBootstrapMechanisms(
     225                        const Name& spovnet
     226                        ) const;
     227
    201228        const communication::EndpointDescriptor* getBootstrapNode(
    202                         const Name& spovnet) const;
     229                        const Name& spovnet,
     230                        const BootstrapMechanism mechanism
     231                        ) const;
     232
     233        string getBootstrapInfo(
     234                        const Name& spovnet,
     235                        const BootstrapMechanism mechanism
     236                        ) const;
    203237
    204238        communication::BaseCommunication* base_comm;
Note: See TracChangeset for help on using the changeset viewer.