OpenDDS
Snapshot(2023/04/07-19:43)
|
#include <EndpointManager.h>
Classes | |
struct | ChangePasswordTask |
struct | ServerReflexiveTask |
Public Types | |
typedef std::set< std::string > | FoundationSet |
Public Member Functions | |
EndpointManager (AgentImpl *a_agent_impl, DCPS::WeakRcHandle< Endpoint > a_endpoint) | |
const AgentInfo & | agent_info () const |
const FoundationSet & | foundations () const |
void | add_agent_info_listener (const DCPS::GUID_t &a_local_guid, DCPS::WeakRcHandle< AgentInfoListener > a_agent_info_listener) |
void | remove_agent_info_listener (const DCPS::GUID_t &a_local_guid) |
void | start_ice (const DCPS::GUID_t &a_local_guid, const DCPS::GUID_t &a_remote_guid, const AgentInfo &a_remote_agent_info) |
void | stop_ice (const DCPS::GUID_t &local_guid, const DCPS::GUID_t &remote_guid) |
ACE_INET_Addr | get_address (const DCPS::GUID_t &a_local_guid, const DCPS::GUID_t &a_remote_guid) const |
void | receive (const ACE_INET_Addr &a_local_address, const ACE_INET_Addr &a_remote_address, const STUN::Message &a_message) |
void | set_responsible_checklist (const STUN::TransactionId &a_transaction_id, ChecklistPtr a_checklist) |
void | unset_responsible_checklist (const STUN::TransactionId &a_transaction_id, ChecklistPtr a_checklist) |
void | set_responsible_checklist (const GuidPair &a_guid_pair, ChecklistPtr a_checklist) |
void | unset_responsible_checklist (const GuidPair &a_guid_pair, ChecklistPtr a_checklist) |
void | set_responsible_checklist (const std::string &a_username, ChecklistPtr a_checklist) |
void | unset_responsible_checklist (const std::string &a_username, ChecklistPtr a_checklist) |
void | unfreeze () |
void | unfreeze (const FoundationType &a_foundation) |
void | compute_active_foundations (ActiveFoundationSet &a_active_foundations) const |
void | check_invariants () const |
void | ice_connect (const GuidSetType &guids, const ACE_INET_Addr &addr) |
void | ice_disconnect (const GuidSetType &guids, const ACE_INET_Addr &addr) |
void | network_change () |
void | send (const ACE_INET_Addr &address, const STUN::Message &message) |
void | purge () |
![]() | |
virtual | ~RcObject () |
virtual void | _add_ref () |
virtual void | _remove_ref () |
long | ref_count () const |
WeakObject * | _get_weak_object () const |
Public Attributes | |
AgentImpl *const | agent_impl |
DCPS::WeakRcHandle< Endpoint > const | endpoint |
Private Types | |
typedef std::deque< DeferredTriggeredCheck > | DeferredTriggeredCheckListType |
typedef std::map< std::string, DeferredTriggeredCheckListType > | DeferredTriggeredChecksType |
typedef std::map< std::string, ChecklistPtr > | UsernameToChecklistType |
typedef std::map< STUN::TransactionId, ChecklistPtr > | TransactionIdToChecklistType |
typedef std::map< GuidPair, ChecklistPtr > | GuidPairToChecklistType |
typedef std::map< DCPS::GUID_t, DCPS::WeakRcHandle< AgentInfoListener >, DCPS::GUID_tKeyLessThan > | AgentInfoListenersType |
Private Member Functions | |
void | change_username () |
void | change_password (bool password_only) |
void | set_host_addresses (const AddressListType &a_host_addresses) |
void | set_server_reflexive_address (const ACE_INET_Addr &a_server_reflexive_address, const ACE_INET_Addr &a_stun_server_address) |
void | regenerate_agent_info (bool password_only) |
void | server_reflexive_task (const DCPS::MonotonicTimePoint &a_now) |
bool | success_response (const STUN::Message &a_message) |
bool | error_response (const STUN::Message &a_message) |
ChecklistPtr | create_checklist (const AgentInfo &a_remote_agent_info) |
STUN::Message | make_unknown_attributes_error_response (const STUN::Message &a_message, const std::vector< STUN::AttributeType > &a_unknown_attributes) |
STUN::Message | make_bad_request_error_response (const STUN::Message &a_message, const std::string &a_reason) |
STUN::Message | make_unauthorized_error_response (const STUN::Message &a_message) |
void | request (const ACE_INET_Addr &a_local_address, const ACE_INET_Addr &a_remote_address, const STUN::Message &a_message) |
void | indication (const ACE_INET_Addr &a_local_address, const ACE_INET_Addr &a_remote_address, const STUN::Message &a_message) |
void | success_response (const ACE_INET_Addr &a_local_address, const ACE_INET_Addr &a_remote_address, const STUN::Message &a_message) |
void | error_response (const ACE_INET_Addr &a_local_address, const ACE_INET_Addr &a_remote_address, const STUN::Message &a_message) |
Additional Inherited Members | |
![]() | |
RcObject () | |
Definition at line 51 of file EndpointManager.h.
|
private |
Definition at line 198 of file EndpointManager.h.
|
private |
Definition at line 182 of file EndpointManager.h.
|
private |
Definition at line 183 of file EndpointManager.h.
typedef std::set<std::string> OpenDDS::ICE::EndpointManager::FoundationSet |
Definition at line 62 of file EndpointManager.h.
|
private |
Definition at line 195 of file EndpointManager.h.
|
private |
Definition at line 191 of file EndpointManager.h.
|
private |
Definition at line 187 of file EndpointManager.h.
OpenDDS::ICE::EndpointManager::EndpointManager | ( | AgentImpl * | a_agent_impl, |
DCPS::WeakRcHandle< Endpoint > | a_endpoint | ||
) |
Definition at line 28 of file EndpointManager.cpp.
References agent_info_, binding_request_, change_username(), OpenDDS::STUN::Message::clear_transaction_id(), endpoint, OpenDDS::ICE::FULL, ice_tie_breaker_, OpenDDS::DCPS::WeakRcHandle< T >::lock(), set_host_addresses(), TheSecurityRegistry, and OpenDDS::ICE::AgentInfo::type.
|
inline |
Definition at line 68 of file EndpointManager.h.
|
inline |
|
private |
Definition at line 176 of file EndpointManager.cpp.
References agent_info_, guid_pair_to_checklist_, OpenDDS::ICE::AgentInfo::password, regenerate_agent_info(), TheSecurityRegistry, and OpenDDS::DCPS::to_hex_dds_string().
Referenced by change_username().
|
private |
Definition at line 167 of file EndpointManager.cpp.
References agent_info_, change_password(), TheSecurityRegistry, OpenDDS::DCPS::to_hex_dds_string(), and OpenDDS::ICE::AgentInfo::username.
Referenced by EndpointManager(), and start_ice().
void OpenDDS::ICE::EndpointManager::check_invariants | ( | ) | const |
Definition at line 735 of file EndpointManager.cpp.
References deferred_triggered_checks_, guid_pair_to_checklist_, OpenDDS::ICE::Configuration::instance(), OPENDDS_ASSERT, OpenDDS::ICE::Configuration::server_reflexive_address_period(), transaction_id_to_checklist_, and username_to_checklist_.
void OpenDDS::ICE::EndpointManager::compute_active_foundations | ( | ActiveFoundationSet & | a_active_foundations | ) | const |
Definition at line 726 of file EndpointManager.cpp.
References username_to_checklist_.
|
private |
Definition at line 406 of file EndpointManager.cpp.
References agent_info_, deferred_triggered_checks_, ice_tie_breaker_, OpenDDS::DCPS::ref(), and OpenDDS::ICE::AgentInfo::username.
Referenced by regenerate_agent_info(), and start_ice().
|
private |
Definition at line 380 of file EndpointManager.cpp.
References ACE_ERROR, ACE_TEXT(), binding_request_, OpenDDS::STUN::Message::get_error_code(), OpenDDS::STUN::Message::get_error_reason(), OpenDDS::STUN::Message::get_unknown_attributes(), OpenDDS::STUN::Message::has_error_code(), OpenDDS::STUN::Message::has_unknown_attributes(), LM_WARNING, OpenDDS::STUN::Message::transaction_id, and OpenDDS::STUN::UNKNOWN_ATTRIBUTE.
Referenced by error_response(), and receive().
|
private |
Definition at line 696 of file EndpointManager.cpp.
References ACE_ERROR, ACE_TEXT(), OpenDDS::STUN::BINDING, error_response(), LM_WARNING, OpenDDS::STUN::Message::method, OpenDDS::STUN::Message::transaction_id, and transaction_id_to_checklist_.
|
inline |
Definition at line 63 of file EndpointManager.h.
Referenced by OpenDDS::ICE::Checklist::unfreeze().
ACE_INET_Addr OpenDDS::ICE::EndpointManager::get_address | ( | const DCPS::GUID_t & | a_local_guid, |
const DCPS::GUID_t & | a_remote_guid | ||
) | const |
Definition at line 129 of file EndpointManager.cpp.
References guid_pair_to_checklist_.
|
inline |
Definition at line 146 of file EndpointManager.h.
References OpenDDS::DCPS::WeakRcHandle< T >::lock().
Referenced by OpenDDS::ICE::Checklist::execute(), and OpenDDS::ICE::Checklist::succeeded().
|
inline |
Definition at line 154 of file EndpointManager.h.
References OpenDDS::DCPS::WeakRcHandle< T >::lock(), and send().
Referenced by OpenDDS::ICE::Checklist::execute().
|
private |
Definition at line 599 of file EndpointManager.cpp.
References ACE_ERROR, ACE_TEXT(), agent_info_, OpenDDS::STUN::BINDING, OpenDDS::STUN::Message::get_username(), OpenDDS::STUN::Message::has_fingerprint(), OpenDDS::STUN::Message::has_message_integrity(), LM_WARNING, OpenDDS::STUN::Message::method, OpenDDS::ICE::AgentInfo::password, OpenDDS::STUN::Message::unknown_comprehension_required_attributes(), OpenDDS::ICE::AgentInfo::username, username_to_checklist_, and OpenDDS::STUN::Message::verify_message_integrity().
Referenced by receive().
|
private |
Definition at line 442 of file EndpointManager.cpp.
References agent_info_, OpenDDS::STUN::Message::append_attribute(), OpenDDS::STUN::BAD_REQUEST, OpenDDS::STUN::Message::class_, OpenDDS::STUN::TransactionId::data, OpenDDS::STUN::ERROR_RESPONSE, OpenDDS::STUN::make_error_code(), OpenDDS::STUN::make_fingerprint(), OpenDDS::STUN::make_message_integrity(), memcpy(), OpenDDS::STUN::Message::method, OpenDDS::ICE::AgentInfo::password, OpenDDS::STUN::Message::password, and OpenDDS::STUN::Message::transaction_id.
Referenced by request().
|
private |
Definition at line 456 of file EndpointManager.cpp.
References agent_info_, OpenDDS::STUN::Message::append_attribute(), OpenDDS::STUN::Message::class_, OpenDDS::STUN::TransactionId::data, OpenDDS::STUN::ERROR_RESPONSE, OpenDDS::STUN::make_error_code(), OpenDDS::STUN::make_fingerprint(), OpenDDS::STUN::make_message_integrity(), memcpy(), OpenDDS::STUN::Message::method, OpenDDS::ICE::AgentInfo::password, OpenDDS::STUN::Message::password, OpenDDS::STUN::Message::transaction_id, and OpenDDS::STUN::UNAUTHORIZED.
Referenced by request().
|
private |
Definition at line 427 of file EndpointManager.cpp.
References agent_info_, OpenDDS::STUN::Message::append_attribute(), OpenDDS::STUN::Message::class_, OpenDDS::STUN::TransactionId::data, OpenDDS::STUN::ERROR_RESPONSE, OpenDDS::STUN::make_error_code(), OpenDDS::STUN::make_fingerprint(), OpenDDS::STUN::make_message_integrity(), OpenDDS::STUN::make_unknown_attributes(), memcpy(), OpenDDS::STUN::Message::method, OpenDDS::ICE::AgentInfo::password, OpenDDS::STUN::Message::password, OpenDDS::STUN::Message::transaction_id, and OpenDDS::STUN::UNKNOWN_ATTRIBUTE.
Referenced by request().
void OpenDDS::ICE::EndpointManager::network_change | ( | ) |
Definition at line 816 of file EndpointManager.cpp.
References endpoint, OpenDDS::DCPS::WeakRcHandle< T >::lock(), and set_host_addresses().
void OpenDDS::ICE::EndpointManager::purge | ( | void | ) |
Definition at line 832 of file EndpointManager.cpp.
References agent_info_listeners_, OPENDDS_END_VERSIONED_NAMESPACE_DECL, and username_to_checklist_.
void OpenDDS::ICE::EndpointManager::receive | ( | const ACE_INET_Addr & | a_local_address, |
const ACE_INET_Addr & | a_remote_address, | ||
const STUN::Message & | a_message | ||
) |
Definition at line 142 of file EndpointManager.cpp.
References ACE_ERROR, ACE_TEXT(), OpenDDS::STUN::Message::class_, OpenDDS::STUN::ERROR_RESPONSE, error_response(), OpenDDS::STUN::INDICATION, indication(), LM_WARNING, OpenDDS::STUN::REQUEST, request(), OpenDDS::STUN::SUCCESS_RESPONSE, and success_response().
|
private |
Definition at line 238 of file EndpointManager.cpp.
References ACE_GUARD, agent_impl, agent_info(), agent_info_, agent_info_listeners_, OpenDDS::ICE::AgentInfo::candidates, OpenDDS::ICE::candidates_equal(), OpenDDS::ICE::candidates_sorted(), create_checklist(), foundations_, host_addresses_, OpenDDS::ICE::make_host_candidate(), OpenDDS::ICE::make_server_reflexive_candidate(), OpenDDS::ICE::AgentImpl::mutex, server_reflexive_address_, stun_server_address_, and username_to_checklist_.
Referenced by change_password(), set_host_addresses(), and set_server_reflexive_address().
|
inline |
Definition at line 74 of file EndpointManager.h.
|
private |
Definition at line 470 of file EndpointManager.cpp.
References ACE_ERROR, ACE_TEXT(), agent_info_, OpenDDS::STUN::Message::append_attribute(), OpenDDS::STUN::BINDING, OpenDDS::STUN::Message::class_, OpenDDS::STUN::TransactionId::data, deferred_triggered_checks_, OpenDDS::STUN::Message::get_priority(), OpenDDS::STUN::Message::get_username(), OpenDDS::STUN::Message::has_fingerprint(), OpenDDS::STUN::Message::has_ice_controlled(), OpenDDS::STUN::Message::has_ice_controlling(), OpenDDS::STUN::Message::has_message_integrity(), OpenDDS::STUN::Message::has_use_candidate(), OpenDDS::ICE::Configuration::instance(), LM_WARNING, make_bad_request_error_response(), OpenDDS::STUN::make_fingerprint(), OpenDDS::STUN::make_mapped_address(), OpenDDS::STUN::make_message_integrity(), make_unauthorized_error_response(), make_unknown_attributes_error_response(), OpenDDS::STUN::make_xor_mapped_address(), memcpy(), OpenDDS::STUN::Message::method, OpenDDS::ICE::AgentInfo::password, OpenDDS::STUN::Message::password, send(), OpenDDS::STUN::SUCCESS_RESPONSE, OpenDDS::STUN::Message::transaction_id, OpenDDS::STUN::Message::unknown_comprehension_required_attributes(), OpenDDS::ICE::AgentInfo::username, username_to_checklist_, and OpenDDS::STUN::Message::verify_message_integrity().
Referenced by receive().
void OpenDDS::ICE::EndpointManager::send | ( | const ACE_INET_Addr & | address, |
const STUN::Message & | message | ||
) |
Definition at line 824 of file EndpointManager.cpp.
References endpoint, and OpenDDS::DCPS::WeakRcHandle< T >::lock().
Referenced by OpenDDS::ICE::Checklist::do_next_check(), OpenDDS::ICE::Checklist::execute(), request(), and server_reflexive_task().
|
private |
Definition at line 299 of file EndpointManager.cpp.
References OpenDDS::STUN::Message::append_attribute(), OpenDDS::STUN::BINDING, binding_request_, OpenDDS::STUN::Message::class_, deferred_triggered_checks_, endpoint, OpenDDS::STUN::Message::generate_transaction_id(), OpenDDS::STUN::INDICATION, OpenDDS::ICE::Configuration::instance(), OpenDDS::DCPS::WeakRcHandle< T >::lock(), OpenDDS::STUN::make_fingerprint(), OpenDDS::STUN::Message::method, next_stun_server_address_, OpenDDS::STUN::REQUEST, requesting_, send(), send_count_, OpenDDS::ICE::Configuration::server_reflexive_indication_count(), and set_host_addresses().
|
private |
Definition at line 188 of file EndpointManager.cpp.
References host_addresses_, OPENDDS_ASSERT, and regenerate_agent_info().
Referenced by EndpointManager(), network_change(), and server_reflexive_task().
|
inline |
Definition at line 93 of file EndpointManager.h.
References OPENDDS_ASSERT.
Referenced by OpenDDS::ICE::Checklist::add_guid(), OpenDDS::ICE::Checklist::Checklist(), and OpenDDS::ICE::Checklist::do_next_check().
|
inline |
Definition at line 108 of file EndpointManager.h.
References OPENDDS_ASSERT.
|
inline |
Definition at line 123 of file EndpointManager.h.
References OPENDDS_ASSERT.
|
private |
Definition at line 227 of file EndpointManager.cpp.
References regenerate_agent_info(), server_reflexive_address_, and stun_server_address_.
Referenced by success_response().
void OpenDDS::ICE::EndpointManager::start_ice | ( | const DCPS::GUID_t & | a_local_guid, |
const DCPS::GUID_t & | a_remote_guid, | ||
const AgentInfo & | a_remote_agent_info | ||
) |
Definition at line 51 of file EndpointManager.cpp.
References agent_info_, change_username(), create_checklist(), guid_pair_to_checklist_, OpenDDS::ICE::AgentInfo::password, OpenDDS::ICE::AgentInfo::username, and username_to_checklist_.
void OpenDDS::ICE::EndpointManager::stop_ice | ( | const DCPS::GUID_t & | local_guid, |
const DCPS::GUID_t & | remote_guid | ||
) |
Definition at line 116 of file EndpointManager.cpp.
References guid_pair_to_checklist_.
|
private |
Definition at line 349 of file EndpointManager.cpp.
References ACE_ERROR, ACE_TEXT(), binding_request_, OpenDDS::STUN::Message::get_mapped_address(), LM_WARNING, next_stun_server_address_, requesting_, send_count_, set_server_reflexive_address(), OpenDDS::STUN::Message::transaction_id, and OpenDDS::STUN::Message::unknown_comprehension_required_attributes().
Referenced by receive(), and success_response().
|
private |
Definition at line 666 of file EndpointManager.cpp.
References ACE_ERROR, ACE_TEXT(), OpenDDS::STUN::BINDING, LM_WARNING, OpenDDS::STUN::Message::method, success_response(), OpenDDS::STUN::Message::transaction_id, and transaction_id_to_checklist_.
void OpenDDS::ICE::EndpointManager::unfreeze | ( | ) |
Definition at line 768 of file EndpointManager.cpp.
References username_to_checklist_.
void OpenDDS::ICE::EndpointManager::unfreeze | ( | const FoundationType & | a_foundation | ) |
Definition at line 776 of file EndpointManager.cpp.
References username_to_checklist_.
|
inline |
Definition at line 99 of file EndpointManager.h.
References OPENDDS_ASSERT.
Referenced by OpenDDS::ICE::Checklist::do_next_check(), OpenDDS::ICE::Checklist::error_response(), OpenDDS::ICE::Checklist::remove_guid(), OpenDDS::ICE::Checklist::succeeded(), and OpenDDS::ICE::Checklist::success_response().
|
inline |
Definition at line 114 of file EndpointManager.h.
References OPENDDS_ASSERT.
|
inline |
Definition at line 129 of file EndpointManager.h.
References OPENDDS_ASSERT.
AgentImpl* const OpenDDS::ICE::EndpointManager::agent_impl |
Definition at line 52 of file EndpointManager.h.
Referenced by OpenDDS::ICE::Checklist::add_triggered_check(), OpenDDS::ICE::Checklist::fix_foundations(), OpenDDS::ICE::Checklist::generate_triggered_check(), regenerate_agent_info(), OpenDDS::ICE::Checklist::remove_from_in_progress(), OpenDDS::ICE::Checklist::succeeded(), and OpenDDS::ICE::Checklist::unfreeze().
|
private |
Definition at line 173 of file EndpointManager.h.
Referenced by change_password(), change_username(), create_checklist(), EndpointManager(), indication(), make_bad_request_error_response(), make_unauthorized_error_response(), make_unknown_attributes_error_response(), regenerate_agent_info(), request(), and start_ice().
|
private |
Definition at line 199 of file EndpointManager.h.
Referenced by purge(), and regenerate_agent_info().
|
private |
Definition at line 180 of file EndpointManager.h.
Referenced by EndpointManager(), error_response(), server_reflexive_task(), and success_response().
|
private |
Definition at line 257 of file EndpointManager.h.
|
private |
Definition at line 184 of file EndpointManager.h.
Referenced by check_invariants(), create_checklist(), request(), and server_reflexive_task().
DCPS::WeakRcHandle<Endpoint> const OpenDDS::ICE::EndpointManager::endpoint |
Definition at line 53 of file EndpointManager.h.
Referenced by EndpointManager(), network_change(), send(), and server_reflexive_task().
|
private |
Definition at line 174 of file EndpointManager.h.
Referenced by regenerate_agent_info().
|
private |
Definition at line 196 of file EndpointManager.h.
Referenced by change_password(), check_invariants(), get_address(), start_ice(), and stop_ice().
|
private |
Definition at line 169 of file EndpointManager.h.
Referenced by regenerate_agent_info(), and set_host_addresses().
|
private |
Definition at line 172 of file EndpointManager.h.
Referenced by create_checklist(), and EndpointManager().
|
private |
Definition at line 179 of file EndpointManager.h.
Referenced by server_reflexive_task(), and success_response().
|
private |
Definition at line 177 of file EndpointManager.h.
Referenced by server_reflexive_task(), and success_response().
|
private |
Definition at line 178 of file EndpointManager.h.
Referenced by server_reflexive_task(), and success_response().
|
private |
Definition at line 170 of file EndpointManager.h.
Referenced by regenerate_agent_info(), and set_server_reflexive_address().
|
private |
Definition at line 250 of file EndpointManager.h.
|
private |
Definition at line 171 of file EndpointManager.h.
Referenced by regenerate_agent_info(), and set_server_reflexive_address().
|
private |
Definition at line 192 of file EndpointManager.h.
Referenced by check_invariants(), error_response(), and success_response().
|
private |
Definition at line 188 of file EndpointManager.h.
Referenced by check_invariants(), compute_active_foundations(), indication(), purge(), regenerate_agent_info(), request(), start_ice(), and unfreeze().