OpenDDS  Snapshot(2023/04/25-14:16)
Classes | Typedefs | Enumerations | Functions
OpenDDS::ICE Namespace Reference

Classes

class  ActiveFoundationSet
 
class  Agent
 
struct  AgentHolder
 
class  AgentImpl
 
struct  AgentInfo
 
class  AgentInfoListener
 
struct  Candidate
 
struct  CandidatePair
 
struct  Checklist
 
class  Configuration
 
struct  ConnectivityCheck
 
struct  DeferredTriggeredCheck
 
class  Endpoint
 
struct  EndpointManager
 
struct  ScheduleTimerCommand
 
class  ServerReflexiveStateMachine
 
struct  Task
 

Typedefs

typedef std::vector< FoundationTypeFoundationList
 
typedef std::pair< std::string, std::string > FoundationType
 
typedef DCPS::RcHandle< ChecklistChecklistPtr
 
typedef DCPS::RcHandle< EndpointManagerEndpointManagerPtr
 
typedef std::set< GuidPairGuidSetType
 
typedef DCPS::RcHandle< TaskTaskPtr
 
typedef DCPS::WeakRcHandle< TaskWeakTaskPtr
 

Enumerations

enum  AgentType { FULL = 0x0, LITE = 0x1 }
 
enum  CandidateType { HOST = 0x0, SERVER_REFLEXIVE = 0x1, PEER_REFLEXIVE = 0x2, RELAYED = 0x3 }
 

Functions

typedef OPENDDS_MAP (OPENDDS_STRING, ICE::AgentInfo) AgentInfoMap
 
bool operator== (const ConnectivityCheck &a_cc, const STUN::TransactionId &a_tid)
 
bool operator== (const ConnectivityCheck &a_cc, const CandidatePair &a_cp)
 
std::ostreamoperator<< (std::ostream &stream, const GuidPair &guidp)
 
bool candidates_sorted (const Candidate &x, const Candidate &y)
 
bool candidates_equal (const Candidate &x, const Candidate &y)
 
ACE_UINT32 local_priority (const ACE_INET_Addr &addr)
 
Candidate make_host_candidate (const ACE_INET_Addr &address)
 
Candidate make_server_reflexive_candidate (const ACE_INET_Addr &address, const ACE_INET_Addr &base, const ACE_INET_Addr &server_address)
 
Candidate make_peer_reflexive_candidate (const ACE_INET_Addr &address, const ACE_INET_Addr &base, const ACE_INET_Addr &server_address, ACE_UINT32 priority)
 
Candidate make_peer_reflexive_candidate (const ACE_INET_Addr &address, ACE_UINT32 priority, size_t q)
 
typedef OPENDDS_VECTOR (ACE_INET_Addr) AddressListType
 

Typedef Documentation

◆ ChecklistPtr

Definition at line 288 of file Checklist.h.

◆ EndpointManagerPtr

Definition at line 260 of file EndpointManager.h.

◆ FoundationList

Definition at line 33 of file AgentImpl.h.

◆ FoundationType

typedef std::pair<std::string, std::string> OpenDDS::ICE::FoundationType

Definition at line 34 of file Checklist.h.

◆ GuidSetType

Definition at line 39 of file RTPS/ICE/Ice.h.

◆ TaskPtr

Definition at line 38 of file Task.h.

◆ WeakTaskPtr

Definition at line 39 of file Task.h.

Enumeration Type Documentation

◆ AgentType

Enumerator
FULL 
LITE 

Definition at line 30 of file Ice.h.

30  {
31  FULL = 0x0,
32  LITE = 0x1,
33 };

◆ CandidateType

Enumerator
HOST 
SERVER_REFLEXIVE 
PEER_REFLEXIVE 
RELAYED 

Definition at line 35 of file Ice.h.

35  {
36  HOST = 0x0,
37  SERVER_REFLEXIVE = 0x1,
38  PEER_REFLEXIVE = 0x2,
39  RELAYED = 0x3,
40 };

Function Documentation

◆ candidates_equal()

bool OpenDDS::ICE::candidates_equal ( const Candidate x,
const Candidate y 
)

Definition at line 34 of file Ice.cpp.

References OpenDDS::ICE::Candidate::address, and OpenDDS::ICE::Candidate::base.

Referenced by OpenDDS::ICE::EndpointManager::regenerate_agent_info().

35 {
36  return x.address == y.address && x.base == y.base;
37 }

◆ candidates_sorted()

bool OpenDDS::ICE::candidates_sorted ( const Candidate x,
const Candidate y 
)

Definition at line 21 of file Ice.cpp.

References OpenDDS::ICE::Candidate::address, OpenDDS::ICE::Candidate::base, and OpenDDS::ICE::Candidate::priority.

Referenced by OpenDDS::ICE::Checklist::generate_triggered_check(), OpenDDS::ICE::EndpointManager::regenerate_agent_info(), and OpenDDS::ICE::Checklist::success_response().

22 {
23  if (x.address != y.address) {
24  return x.address < y.address;
25  }
26 
27  if (x.base != y.base) {
28  return x.base < y.base;
29  }
30 
31  return x.priority > y.priority;
32 }

◆ local_priority()

ACE_UINT32 OpenDDS::ICE::local_priority ( const ACE_INET_Addr addr)

Definition at line 56 of file Ice.cpp.

References ACE_Addr::get_type().

Referenced by OpenDDS::ICE::ConnectivityCheck::ConnectivityCheck(), make_host_candidate(), and make_server_reflexive_candidate().

57 {
58  if (addr.get_type() == AF_INET6) {
59  return 65535;
60  }
61  return 65534;
62 }
int get_type(void) const

◆ make_host_candidate()

Candidate OpenDDS::ICE::make_host_candidate ( const ACE_INET_Addr address)

Definition at line 64 of file Ice.cpp.

References OpenDDS::ICE::Candidate::address, OpenDDS::ICE::Candidate::base, OpenDDS::ICE::Candidate::foundation, HOST, OpenDDS::DCPS::LogAddr::ip(), local_priority(), OpenDDS::ICE::Candidate::priority, and OpenDDS::ICE::Candidate::type.

Referenced by OpenDDS::ICE::EndpointManager::regenerate_agent_info().

65 {
66  Candidate candidate;
67  candidate.address = address;
68  candidate.foundation = std::string("H") + DCPS::LogAddr::ip(address) + "U";
69  // See https://tools.ietf.org/html/rfc8445#section-5.1.2.1 for an explanation of the formula below.
70  candidate.priority = (126 << 24) + (local_priority(address) << 8) + ((256 - 1) << 0); // No local preference, component 1.
71  candidate.type = HOST;
72  candidate.base = address;
73  return candidate;
74 }
ACE_UINT32 local_priority(const ACE_INET_Addr &addr)
Definition: Ice.cpp:56

◆ make_peer_reflexive_candidate() [1/2]

Candidate OpenDDS::ICE::make_peer_reflexive_candidate ( const ACE_INET_Addr address,
const ACE_INET_Addr base,
const ACE_INET_Addr server_address,
ACE_UINT32  priority 
)

Definition at line 88 of file Ice.cpp.

References OpenDDS::ICE::Candidate::address, OpenDDS::ICE::Candidate::base, OpenDDS::ICE::Candidate::foundation, OpenDDS::DCPS::LogAddr::ip(), PEER_REFLEXIVE, OpenDDS::ICE::Candidate::priority, and OpenDDS::ICE::Candidate::type.

Referenced by OpenDDS::ICE::Checklist::generate_triggered_check(), and OpenDDS::ICE::Checklist::success_response().

89 {
90  Candidate candidate;
91  candidate.address = address;
92  candidate.foundation = std::string("P") + DCPS::LogAddr::ip(base) + "_" + DCPS::LogAddr::ip(server_address) + "U";
93  candidate.priority = priority;
94  candidate.type = PEER_REFLEXIVE;
95  candidate.base = base;
96  return candidate;
97 }

◆ make_peer_reflexive_candidate() [2/2]

Candidate OpenDDS::ICE::make_peer_reflexive_candidate ( const ACE_INET_Addr address,
ACE_UINT32  priority,
size_t  q 
)

Definition at line 99 of file Ice.cpp.

References OpenDDS::ICE::Candidate::address, OpenDDS::ICE::Candidate::foundation, PEER_REFLEXIVE, OpenDDS::ICE::Candidate::priority, OpenDDS::DCPS::to_dds_string(), and OpenDDS::ICE::Candidate::type.

100 {
101  Candidate candidate;
102  candidate.address = address;
103  candidate.foundation = std::string("Q") + OpenDDS::DCPS::to_dds_string(q) + "U";
104  candidate.priority = priority;
105  candidate.type = PEER_REFLEXIVE;
106  return candidate;
107 }
String to_dds_string(unsigned short to_convert)

◆ make_server_reflexive_candidate()

Candidate OpenDDS::ICE::make_server_reflexive_candidate ( const ACE_INET_Addr address,
const ACE_INET_Addr base,
const ACE_INET_Addr server_address 
)

Definition at line 76 of file Ice.cpp.

References OpenDDS::ICE::Candidate::address, OpenDDS::ICE::Candidate::base, OpenDDS::ICE::Candidate::foundation, OpenDDS::DCPS::LogAddr::ip(), local_priority(), OpenDDS::ICE::Candidate::priority, SERVER_REFLEXIVE, and OpenDDS::ICE::Candidate::type.

Referenced by OpenDDS::ICE::EndpointManager::regenerate_agent_info().

77 {
78  Candidate candidate;
79  candidate.address = address;
80  candidate.foundation = std::string("S") + DCPS::LogAddr::ip(base) + "_" + DCPS::LogAddr::ip(server_address) + "U";
81  // See https://tools.ietf.org/html/rfc8445#section-5.1.2.1 for an explanation of the formula below.
82  candidate.priority = (100 << 24) + (local_priority(address) << 8) + ((256 - 1) << 0); // No local preference, component 1.
83  candidate.type = SERVER_REFLEXIVE;
84  candidate.base = base;
85  return candidate;
86 }
ACE_UINT32 local_priority(const ACE_INET_Addr &addr)
Definition: Ice.cpp:56

◆ OPENDDS_MAP()

typedef OpenDDS::ICE::OPENDDS_MAP ( OPENDDS_STRING  ,
ICE::AgentInfo   
)

◆ OPENDDS_VECTOR()

typedef OpenDDS::ICE::OPENDDS_VECTOR ( ACE_INET_Addr  )

◆ operator<<()

std::ostream& OpenDDS::ICE::operator<< ( std::ostream stream,
const GuidPair guidp 
)
inline

Definition at line 146 of file Checklist.h.

References OpenDDS::DCPS::GuidPair::local, and OpenDDS::DCPS::GuidPair::remote.

147 {
148  stream << guidp.local << ':' << guidp.remote;
149  return stream;
150 }

◆ operator==() [1/2]

bool OpenDDS::ICE::operator== ( const ConnectivityCheck a_cc,
const STUN::TransactionId a_tid 
)
inline

Definition at line 135 of file Checklist.h.

References OpenDDS::ICE::ConnectivityCheck::request(), and OpenDDS::STUN::Message::transaction_id.

136 {
137  return a_cc.request().transaction_id == a_tid;
138 }

◆ operator==() [2/2]

bool OpenDDS::ICE::operator== ( const ConnectivityCheck a_cc,
const CandidatePair a_cp 
)
inline

Definition at line 140 of file Checklist.h.

References OpenDDS::ICE::ConnectivityCheck::candidate_pair().

141 {
142  return a_cc.candidate_pair() == a_cp;
143 }