Line data Source code
1 : /* 2 : * 3 : * 4 : * Distributed under the OpenDDS License. 5 : * See: http://www.opendds.org/license.html 6 : */ 7 : 8 : #ifndef OPENDDS_DCPS_ICE_H 9 : #define OPENDDS_DCPS_ICE_H 10 : 11 : #include "dcps_export.h" 12 : #include "GuidUtils.h" 13 : #include "PoolAllocationBase.h" 14 : #include "PoolAllocator.h" 15 : #include "Serializer.h" 16 : 17 : #include "dds/DdsDcpsInfoUtilsC.h" 18 : 19 : #include "ace/INET_Addr.h" 20 : 21 : #if !defined (ACE_LACKS_PRAGMA_ONCE) 22 : #pragma once 23 : #endif /* ACE_LACKS_PRAGMA_ONCE */ 24 : 25 : OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL 26 : 27 : namespace OpenDDS { 28 : namespace ICE { 29 : 30 : enum AgentType { 31 : FULL = 0x0, 32 : LITE = 0x1, 33 : }; 34 : 35 : enum CandidateType { 36 : HOST = 0x0, 37 : SERVER_REFLEXIVE = 0x1, 38 : PEER_REFLEXIVE = 0x2, 39 : RELAYED = 0x3, 40 : }; 41 : 42 : struct Candidate : DCPS::PoolAllocationBase { 43 : 44 0 : Candidate() : priority(0), type(HOST) {} 45 : 46 : ACE_INET_Addr address; 47 : // Transport - UDP or TCP 48 : std::string foundation; 49 : // Component ID 50 : ACE_UINT32 priority; 51 : CandidateType type; 52 : // Related Address and Port 53 : // Extensibility Parameters 54 : 55 : ACE_INET_Addr base; // Not sent. 56 : 57 : bool operator==(const Candidate& other) const 58 : { 59 : return 60 : this->address == other.address && 61 : this->foundation == other.foundation && 62 : this->priority == other.priority && 63 : this->type == other.type; 64 : } 65 : }; 66 : 67 : struct AgentInfo { 68 : 69 11 : AgentInfo() : type(FULL) {} 70 : 71 : typedef OPENDDS_VECTOR(Candidate) CandidatesType; 72 : typedef CandidatesType::const_iterator const_iterator; 73 : 74 : CandidatesType candidates; 75 : AgentType type; 76 : // Connectivity-Check Pacing Value 77 : std::string username; 78 : std::string password; 79 : // Extensions 80 : 81 : const_iterator begin() const 82 : { 83 : return candidates.begin(); 84 : } 85 : const_iterator end() const 86 : { 87 : return candidates.end(); 88 : } 89 : bool operator==(const AgentInfo& other) const 90 : { 91 : return 92 : this->username == other.username && 93 : this->password == other.password && 94 : this->type == other.type && 95 : this->candidates == other.candidates; 96 : } 97 : bool operator!=(const AgentInfo& other) const 98 : { 99 : return !(*this == other); 100 : } 101 : }; 102 : 103 : typedef OPENDDS_MAP(OPENDDS_STRING, ICE::AgentInfo) AgentInfoMap; 104 : 105 : } // namespace ICE 106 : } // namespace OpenDDS 107 : 108 : OPENDDS_END_VERSIONED_NAMESPACE_DECL 109 : 110 : #endif /* OPENDDS_ICE_H */