OpenDDS  Snapshot(2023/04/07-19:43)
Classes | Public Types | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
OpenDDS::RTPS::Spdp Class Reference

#include <Spdp.h>

Inheritance diagram for OpenDDS::RTPS::Spdp:
Inheritance graph
[legend]
Collaboration diagram for OpenDDS::RTPS::Spdp:
Collaboration graph
[legend]

Classes

class  IceConnect
 
class  SendStun
 
struct  SpdpTransport
 

Public Types

typedef DiscoveredParticipantMap::iterator DiscoveredParticipantIter
 
typedef DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
 
typedef std::pair< DDS::Security::ParticipantCryptoHandle, DDS::Security::SharedSecretHandle_var > ParticipantCryptoInfoPair
 

Public Member Functions

typedef OPENDDS_MAP_CMP (GUID_t, DiscoveredParticipant, GUID_tKeyLessThan) DiscoveredParticipantMap
 
 Spdp (DDS::DomainId_t domain, DCPS::GUID_t &guid, const DDS::DomainParticipantQos &qos, RtpsDiscovery *disco, XTypes::TypeLookupService_rch tls)
 
 Spdp (DDS::DomainId_t domain, const DCPS::GUID_t &guid, const DDS::DomainParticipantQos &qos, RtpsDiscovery *disco, XTypes::TypeLookupService_rch tls, DDS::Security::IdentityHandle id_handle, DDS::Security::PermissionsHandle perm_handle, DDS::Security::ParticipantCryptoHandle crypto_handle)
 
 ~Spdp ()
 
const DCPS::GUID_tguid () const
 
void init_bit (RcHandle< DCPS::BitSubscriber > bit_subscriber)
 
void fini_bit ()
 
bool get_default_locators (const DCPS::GUID_t &part_id, DCPS::LocatorSeq &target, bool &inlineQos)
 
bool get_last_recv_locator (const DCPS::GUID_t &part_id, DCPS::LocatorSeq &target, bool &inlineQos)
 
void signal_liveliness (DDS::LivelinessQosPolicyKind kind)
 
bool initialized ()
 
void shutdown ()
 
bool shutting_down ()
 
bool associated () const
 
bool has_discovered_participant (const DCPS::GUID_t &guid) const
 
ACE_CDR::ULong get_participant_flags (const DCPS::GUID_t &guid) const
 
Security::SecurityConfig_rch get_security_config () const
 
DDS::Security::ParticipantCryptoHandle crypto_handle () const
 
DDS::Security::ParticipantCryptoHandle remote_crypto_handle (const DCPS::GUID_t &remote_participant) const
 
void handle_auth_request (const DDS::Security::ParticipantStatelessMessage &msg)
 
void send_handshake_request (const DCPS::GUID_t &guid, DiscoveredParticipant &dp)
 
void handle_handshake_message (const DDS::Security::ParticipantStatelessMessage &msg)
 
bool handle_participant_crypto_tokens (const DDS::Security::ParticipantVolatileMessageSecure &msg)
 
DDS::OctetSeq local_participant_data_as_octets () const
 
void handle_participant_data (DCPS::MessageId id, const ParticipantData_t &pdata, const DCPS::MonotonicTimePoint &now, const DCPS::SequenceNumber &seq, const ACE_INET_Addr &from, bool from_sedp)
 
bool validateSequenceNumber (const DCPS::MonotonicTimePoint &now, const DCPS::SequenceNumber &seq, DiscoveredParticipantIter &iter)
 
void process_handshake_deadlines (const DCPS::MonotonicTimePoint &tv)
 
void process_handshake_resends (const DCPS::MonotonicTimePoint &tv)
 
void write_secure_updates ()
 
void write_secure_disposes ()
 
bool is_security_enabled () const
 
bool is_expectant_opendds (const GUID_t &participant) const
 
ParticipantCryptoInfoPair lookup_participant_crypto_info (const DCPS::GUID_t &id) const
 
void send_participant_crypto_tokens (const DCPS::GUID_t &id)
 
DDS::DomainId_t get_domain_id () const
 
DDS::Security::PermissionsHandle lookup_participant_permissions (const DCPS::GUID_t &id) const
 
AuthState lookup_participant_auth_state (const GUID_t &id) const
 
void process_participant_ice (const ParameterList &plist, const ParticipantData_t &pdata, const DCPS::GUID_t &guid)
 
const ParticipantData_tget_participant_data (const DCPS::GUID_t &guid) const
 
ParticipantData_tget_participant_data (const DCPS::GUID_t &guid)
 
DCPS::MonotonicTime_t get_participant_discovered_at () const
 
DCPS::MonotonicTime_t get_participant_discovered_at (const DCPS::GUID_t &guid) const
 
u_short get_spdp_port () const
 
u_short get_sedp_port () const
 
void rtps_relay_only_now (bool f)
 
void use_rtps_relay_now (bool f)
 
void use_ice_now (bool f)
 
void sedp_rtps_relay_address (const ACE_INET_Addr &address)
 
void sedp_stun_server_address (const ACE_INET_Addr &address)
 
BuiltinEndpointSet_t available_builtin_endpoints () const
 
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints () const
 
DCPS::WeakRcHandle< ICE::Endpointget_ice_endpoint_if_added ()
 
ParticipantData_t build_local_pdata (bool always_in_the_clear, Security::DiscoveredParticipantDataKind kind)
 
DCPS::RcHandle< RtpsDiscoveryConfigconfig () const
 
void spdp_rtps_relay_address_change ()
 
void append_transport_statistics (DCPS::TransportStatisticsSequence &seq)
 
void ignore_domain_participant (const GUID_t &ignoreId)
 
void remove_domain_participant (const GUID_t &removeId)
 
bool update_domain_participant_qos (const DDS::DomainParticipantQos &qos)
 
bool has_domain_participant (const GUID_t &ignoreId) const
 
DCPS::TopicStatus assert_topic (GUID_t &topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, bool hasDcpsKey, DCPS::TopicCallbacks *topic_callbacks)
 
DCPS::TopicStatus find_topic (const char *topicName, CORBA::String_out dataTypeName, DDS::TopicQos_out qos, GUID_t &topicId)
 
DCPS::TopicStatus remove_topic (const GUID_t &topicId)
 
void ignore_topic (const GUID_t &ignoreId)
 
bool update_topic_qos (const GUID_t &topicId, const DDS::TopicQos &qos)
 
GUID_t add_publication (const GUID_t &topicId, DCPS::DataWriterCallbacks_rch publication, const DDS::DataWriterQos &qos, const DCPS::TransportLocatorSeq &transInfo, const DDS::PublisherQos &publisherQos, const XTypes::TypeInformation &type_info)
 
void remove_publication (const GUID_t &publicationId)
 
void ignore_publication (const GUID_t &ignoreId)
 
bool update_publication_qos (const GUID_t &publicationId, const DDS::DataWriterQos &qos, const DDS::PublisherQos &publisherQos)
 
void update_publication_locators (const GUID_t &publicationId, const DCPS::TransportLocatorSeq &transInfo)
 
GUID_t add_subscription (const GUID_t &topicId, DCPS::DataReaderCallbacks_rch subscription, const DDS::DataReaderQos &qos, const DCPS::TransportLocatorSeq &transInfo, const DDS::SubscriberQos &subscriberQos, const char *filterClassName, const char *filterExpr, const DDS::StringSeq &params, const XTypes::TypeInformation &type_info)
 
void remove_subscription (const GUID_t &subscriptionId)
 
void ignore_subscription (const GUID_t &ignoreId)
 
bool update_subscription_qos (const GUID_t &subscriptionId, const DDS::DataReaderQos &qos, const DDS::SubscriberQos &subscriberQos)
 
bool update_subscription_params (const GUID_t &subId, const DDS::StringSeq &params)
 
void update_subscription_locators (const GUID_t &subId, const DCPS::TransportLocatorSeq &transInfo)
 
RcHandle< DCPS::TransportInstsedp_transport_inst () const
 
void request_remote_complete_type_objects (const GUID_t &remote_entity, const XTypes::TypeInformation &remote_type_info, DCPS::TypeObjReqCond &cond)
 
- Public Member Functions inherited from OpenDDS::DCPS::RcObject
virtual ~RcObject ()
 
virtual void _add_ref ()
 
virtual void _remove_ref ()
 
long ref_count () const
 
WeakObject_get_weak_object () const
 
- Public Member Functions inherited from OpenDDS::ICE::AgentInfoListener
virtual ~AgentInfoListener ()
 

Protected Member Functions

Sedpendpoint_manager ()
 
void purge_discovered_participant (const DiscoveredParticipantIter &iter)
 
void enqueue_location_update_i (DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
 
void process_location_updates_i (const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
 
void publish_location_update_i (const DiscoveredParticipantIter &iter)
 
bool announce_domain_participant_qos ()
 
- Protected Member Functions inherited from OpenDDS::DCPS::RcObject
 RcObject ()
 

Private Member Functions

typedef OPENDDS_MAP_CMP (GUID_t, DDS::Security::AuthRequestMessageToken, GUID_tKeyLessThan) PendingRemoteAuthTokenMap
 
void init (DDS::DomainId_t domain, DCPS::GUID_t &guid, const DDS::DomainParticipantQos &qos, XTypes::TypeLookupService_rch tls)
 
void data_received (const DataSubmessage &data, const ParameterList &plist, const ACE_INET_Addr &from)
 
void match_unauthenticated (const DiscoveredParticipantIter &dp_iter)
 
DDS::ParticipantBuiltinTopicData get_part_bit_data (bool secure) const
 
bool secure_part_user_data () const
 
void update_rtps_relay_application_participant_i (DiscoveredParticipantIter iter, bool new_participant)
 
DDS::ReturnCode_t send_handshake_message (const DCPS::GUID_t &guid, DiscoveredParticipant &dp, const DDS::Security::ParticipantStatelessMessage &msg)
 
DCPS::MonotonicTimePoint schedule_handshake_resend (const DCPS::TimeDuration &time, const DCPS::GUID_t &guid)
 
bool match_authenticated (const DCPS::GUID_t &guid, DiscoveredParticipantIter &iter)
 
void attempt_authentication (const DiscoveredParticipantIter &iter, bool from_discovery)
 
void update_agent_info (const DCPS::GUID_t &local_guid, const ICE::AgentInfo &agent_info)
 
void remove_agent_info (const DCPS::GUID_t &local_guid)
 
typedef OPENDDS_MULTIMAP (DCPS::MonotonicTimePoint, DCPS::GUID_t) TimeQueue
 
void remove_lease_expiration_i (DiscoveredParticipantIter iter)
 
void update_lease_expiration_i (DiscoveredParticipantIter iter, const DCPS::MonotonicTimePoint &now)
 
void process_lease_expirations (const DCPS::MonotonicTimePoint &now)
 
void start_ice (DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail, const ICE::AgentInfo &agent_info)
 
void stop_ice (DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
 
void purge_handshake_deadlines (DiscoveredParticipantIter iter)
 
void purge_handshake_resends (DiscoveredParticipantIter iter)
 
void set_auth_state (DiscoveredParticipant &dp, AuthState state)
 

Private Attributes

ACE_Thread_Mutex lock_
 
DCPS::RcHandle< DCPS::BitSubscriberbit_subscriber_
 
DDS::DomainParticipantQos qos_
 
DiscoveredParticipantMap participants_
 
RtpsDiscoverydisco_
 
DCPS::RcHandle< RtpsDiscoveryConfigconfig_
 
const double quick_resend_ratio_
 
const DCPS::TimeDuration min_resend_delay_
 
DCPS::TimeDuration lease_duration_
 
DCPS::TimeDuration lease_extension_
 
XTypes::TypeLookupService_rch type_lookup_service_
 
const DDS::DomainId_t domain_
 
DCPS::GUID_t guid_
 
const DCPS::MonotonicTime_t participant_discovered_at_
 
bool is_application_participant_
 
DCPS::RcHandle< SpdpTransporttport_
 
AtomicBool initialized_flag_
 Spdp initialized. More...
 
bool eh_shutdown_
 
DCPS::ConditionVariable< ACE_Thread_Mutexshutdown_cond_
 
AtomicBool shutdown_flag_
 Spdp shutting down. More...
 
BuiltinEndpointSet_t available_builtin_endpoints_
 
DCPS::RcHandle< Sedpsedp_
 
TimeQueue lease_expirations_
 
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints_
 
Security::SecurityConfig_rch security_config_
 
bool security_enabled_
 
DCPS::SequenceNumber stateless_sequence_number_
 
DDS::Security::IdentityHandle identity_handle_
 
DDS::Security::PermissionsHandle permissions_handle_
 
DDS::Security::ParticipantCryptoHandle crypto_handle_
 
DDS::Security::IdentityToken identity_token_
 
DDS::Security::IdentityStatusToken identity_status_token_
 
DDS::Security::PermissionsToken permissions_token_
 
DDS::Security::PermissionsCredentialToken permissions_credential_token_
 
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
 
DCPS::RcHandle< ICE::Agentice_agent_
 
TimeQueue handshake_deadlines_
 
TimeQueue handshake_resends_
 
size_t n_participants_in_authentication_
 

Friends

class Sedp
 
class ::DDS_TEST
 

Detailed Description

Each instance of class Spdp represents the implementation of the RTPS Simple Participant Discovery Protocol for a single local DomainParticipant.

Definition at line 61 of file Spdp.h.

Member Typedef Documentation

◆ DiscoveredParticipantConstIter

typedef DiscoveredParticipantMap::const_iterator OpenDDS::RTPS::Spdp::DiscoveredParticipantConstIter

Definition at line 71 of file Spdp.h.

◆ DiscoveredParticipantIter

typedef DiscoveredParticipantMap::iterator OpenDDS::RTPS::Spdp::DiscoveredParticipantIter

Definition at line 70 of file Spdp.h.

◆ ParticipantCryptoInfoPair

typedef std::pair<DDS::Security::ParticipantCryptoHandle, DDS::Security::SharedSecretHandle_var> OpenDDS::RTPS::Spdp::ParticipantCryptoInfoPair

Definition at line 165 of file Spdp.h.

Constructor & Destructor Documentation

◆ Spdp() [1/2]

OpenDDS::RTPS::Spdp::Spdp ( DDS::DomainId_t  domain,
DCPS::GUID_t guid,
const DDS::DomainParticipantQos qos,
RtpsDiscovery disco,
XTypes::TypeLookupService_rch  tls 
)

Definition at line 216 of file Spdp.cpp.

References ACE_GUARD, init(), lock_, and participant_sec_attr_.

221  : qos_(qos)
222  , disco_(disco)
223  , config_(disco_->config())
224  , quick_resend_ratio_(disco_->config()->quick_resend_ratio())
225  , min_resend_delay_(disco_->config()->min_resend_delay())
226  , lease_duration_(disco_->config()->lease_duration())
227  , lease_extension_(disco_->config()->lease_extension())
228  , domain_(domain)
229  , guid_(guid)
230  , participant_discovered_at_(MonotonicTimePoint::now().to_monotonic_time())
232  , tport_(DCPS::make_rch<SpdpTransport>(rchandle_from(this)))
233  , initialized_flag_(false)
234  , eh_shutdown_(false)
236  , shutdown_flag_(false)
238  , sedp_(DCPS::make_rch<Sedp>(guid_, DCPS::ref(*this), DCPS::ref(lock_)))
239 #ifdef OPENDDS_SECURITY
241  , security_config_()
242  , security_enabled_(false)
248 #endif
249 {
251 
252  init(domain, guid, qos, tls);
253 
254 #ifdef OPENDDS_SECURITY
255  init_participant_sec_attributes(participant_sec_attr_);
256 #endif
257 
258 }
RtpsDiscovery * disco_
Definition: Spdp.h:383
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
Definition: Spdp.h:632
DDS::Security::IdentityHandle identity_handle_
Definition: Spdp.h:623
bool is_application_participant_
Definition: Spdp.h:395
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
const DDS::DomainId_t domain_
Definition: Spdp.h:392
reference_wrapper< T > ref(T &r)
Definition: RcHandle_T.h:237
const DCPS::MonotonicTime_t participant_discovered_at_
Definition: Spdp.h:394
const InstanceHandle_t HANDLE_NIL
size_t n_participants_in_authentication_
Definition: Spdp.h:648
RtpsDiscoveryConfig_rch config() const
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
bool eh_shutdown_
Definition: Spdp.h:600
DDS::DomainParticipantQos qos_
Definition: Spdp.h:380
const DCPS::TimeDuration min_resend_delay_
Definition: Spdp.h:386
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
void init(DDS::DomainId_t domain, DCPS::GUID_t &guid, const DDS::DomainParticipantQos &qos, XTypes::TypeLookupService_rch tls)
Definition: Spdp.cpp:132
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
bool security_enabled_
Definition: Spdp.h:619
DDS::Security::ParticipantCryptoHandle crypto_handle_
Definition: Spdp.h:625
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints_
Definition: Spdp.h:617
DCPS::TimeDuration lease_duration_
Definition: Spdp.h:387
Security::SecurityConfig_rch security_config_
Definition: Spdp.h:618
DDS::Security::PermissionsHandle permissions_handle_
Definition: Spdp.h:624
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310
const double quick_resend_ratio_
Definition: Spdp.h:385
static DCPS::RcHandle< Agent > instance()
Definition: Ice.cpp:122
DCPS::TimeDuration lease_extension_
Definition: Spdp.h:388
BuiltinEndpointSet_t available_builtin_endpoints_
Definition: Spdp.h:605
DCPS::GUID_t guid_
Definition: Spdp.h:393
DCPS::ConditionVariable< ACE_Thread_Mutex > shutdown_cond_
Definition: Spdp.h:601
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ Spdp() [2/2]

OpenDDS::RTPS::Spdp::Spdp ( DDS::DomainId_t  domain,
const DCPS::GUID_t guid,
const DDS::DomainParticipantQos qos,
RtpsDiscovery disco,
XTypes::TypeLookupService_rch  tls,
DDS::Security::IdentityHandle  id_handle,
DDS::Security::PermissionsHandle  perm_handle,
DDS::Security::ParticipantCryptoHandle  crypto_handle 
)

Definition at line 261 of file Spdp.cpp.

References access(), ACE_ERROR, ACE_GUARD, ACE_TEXT(), DDS::Security::SecurityException::code, guid_, identity_handle_, identity_status_token_, identity_token_, init(), LM_ERROR, lock_, DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, participant_sec_attr_, permissions_credential_token_, permissions_handle_, permissions_token_, security_config_, and sedp_.

269  : qos_(qos)
270  , disco_(disco)
271  , config_(disco_->config())
272  , quick_resend_ratio_(disco_->config()->quick_resend_ratio())
273  , min_resend_delay_(disco_->config()->min_resend_delay())
274  , lease_duration_(disco_->config()->lease_duration())
275  , lease_extension_(disco_->config()->lease_extension())
276  , domain_(domain)
277  , guid_(guid)
278  , participant_discovered_at_(MonotonicTimePoint::now().to_monotonic_time())
280  , tport_(DCPS::make_rch<SpdpTransport>(rchandle_from(this)))
281  , initialized_flag_(false)
282  , eh_shutdown_(false)
284  , shutdown_flag_(false)
286  , sedp_(DCPS::make_rch<Sedp>(guid_, DCPS::ref(*this), DCPS::ref(lock_)))
289  , security_enabled_(security_config_->get_authentication() && security_config_->get_access_control() &&
290  security_config_->get_crypto_key_factory() && security_config_->get_crypto_key_exchange())
291  , identity_handle_(identity_handle)
292  , permissions_handle_(perm_handle)
296 {
298 
299  init(domain, guid_, qos, tls);
300 
301  DDS::Security::Authentication_var auth = security_config_->get_authentication();
302  DDS::Security::AccessControl_var access = security_config_->get_access_control();
303 
304  DDS::Security::SecurityException se = {"", 0, 0};
305 
306  if (!auth->get_identity_token(identity_token_, identity_handle_, se)) {
307  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
308  ACE_TEXT("Spdp::Spdp() - ")
309  ACE_TEXT("unable to get identity token. Security Exception[%d.%d]: %C\n"),
310  se.code, se.minor_code, se.message.in()));
311  throw std::runtime_error("unable to get identity token");
312  }
313  if (!auth->get_identity_status_token(identity_status_token_, identity_handle_, se)) {
314  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
315  ACE_TEXT("Spdp::Spdp() - ")
316  ACE_TEXT("unable to get identity status token. Security Exception[%d.%d]: %C\n"),
317  se.code, se.minor_code, se.message.in()));
318  throw std::runtime_error("unable to get identity status token");
319  }
320  if (!access->get_permissions_token(permissions_token_, permissions_handle_, se)) {
321  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
322  ACE_TEXT("Spdp::Spdp() - ")
323  ACE_TEXT("unable to get permissions handle. Security Exception[%d.%d]: %C\n"),
324  se.code, se.minor_code, se.message.in()));
325  throw std::runtime_error("unable to get permissions token");
326  }
327  if (!access->get_permissions_credential_token(permissions_credential_token_, permissions_handle_, se)) {
328  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
329  ACE_TEXT("Spdp::Spdp() - ")
330  ACE_TEXT("unable to get permissions credential handle. Security Exception[%d.%d]: %C\n"),
331  se.code, se.minor_code, se.message.in()));
332  throw std::runtime_error("unable to get permissions credential token");
333  }
334 
335  if (!auth->set_permissions_credential_and_token(identity_handle_, permissions_credential_token_, permissions_token_, se)) {
336  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
337  ACE_TEXT("Spdp::Spdp() - ")
338  ACE_TEXT("unable to set permissions credential and token. Security Exception[%d.%d]: %C\n"),
339  se.code, se.minor_code, se.message.in()));
340  throw std::runtime_error("unable to set permissions credential and token");
341  }
342 
343  init_participant_sec_attributes(participant_sec_attr_);
344 
345  if (!access->get_participant_sec_attributes(permissions_handle_, participant_sec_attr_, se)) {
346  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: ")
347  ACE_TEXT("Spdp::Spdp() - ")
348  ACE_TEXT("failed to retrieve participant security attributes. Security Exception[%d.%d]: %C\n"),
349  se.code, se.minor_code, se.message.in()));
350  throw std::runtime_error("unable to retrieve participant security attributes");
351  }
352 
353  sedp_->init_security(identity_handle, perm_handle, crypto_handle);
354 }
RtpsDiscovery * disco_
Definition: Spdp.h:383
#define ACE_ERROR(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
Definition: Spdp.h:632
DDS::Security::IdentityHandle identity_handle_
Definition: Spdp.h:623
DDS::Security::PermissionsToken permissions_token_
Definition: Spdp.h:629
int access(const char *path, int amode)
DDS::Security::ParticipantCryptoHandle crypto_handle() const
Definition: Spdp.h:129
bool is_application_participant_
Definition: Spdp.h:395
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
static SecurityRegistry * instance()
Return a singleton instance of this class.
const DDS::DomainId_t domain_
Definition: Spdp.h:392
reference_wrapper< T > ref(T &r)
Definition: RcHandle_T.h:237
const DCPS::MonotonicTime_t participant_discovered_at_
Definition: Spdp.h:394
size_t n_participants_in_authentication_
Definition: Spdp.h:648
RtpsDiscoveryConfig_rch config() const
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
bool eh_shutdown_
Definition: Spdp.h:600
DDS::DomainParticipantQos qos_
Definition: Spdp.h:380
const DCPS::TimeDuration min_resend_delay_
Definition: Spdp.h:386
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
void init(DDS::DomainId_t domain, DCPS::GUID_t &guid, const DDS::DomainParticipantQos &qos, XTypes::TypeLookupService_rch tls)
Definition: Spdp.cpp:132
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DDS::Security::IdentityStatusToken identity_status_token_
Definition: Spdp.h:628
bool security_enabled_
Definition: Spdp.h:619
DDS::Security::PermissionsCredentialToken permissions_credential_token_
Definition: Spdp.h:630
DDS::Security::ParticipantCryptoHandle crypto_handle_
Definition: Spdp.h:625
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints_
Definition: Spdp.h:617
DDS::Security::IdentityToken identity_token_
Definition: Spdp.h:627
DCPS::TimeDuration lease_duration_
Definition: Spdp.h:387
Security::SecurityConfig_rch security_config_
Definition: Spdp.h:618
DDS::Security::PermissionsHandle permissions_handle_
Definition: Spdp.h:624
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310
const double quick_resend_ratio_
Definition: Spdp.h:385
static DCPS::RcHandle< Agent > instance()
Definition: Ice.cpp:122
DCPS::TimeDuration lease_extension_
Definition: Spdp.h:388
BuiltinEndpointSet_t available_builtin_endpoints_
Definition: Spdp.h:605
DCPS::GUID_t guid_
Definition: Spdp.h:393
DCPS::ConditionVariable< ACE_Thread_Mutex > shutdown_cond_
Definition: Spdp.h:601
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ ~Spdp()

OpenDDS::RTPS::Spdp::~Spdp ( )

Definition at line 419 of file Spdp.cpp.

420 {
421 }

Member Function Documentation

◆ add_publication()

GUID_t OpenDDS::RTPS::Spdp::add_publication ( const GUID_t topicId,
DCPS::DataWriterCallbacks_rch  publication,
const DDS::DataWriterQos qos,
const DCPS::TransportLocatorSeq transInfo,
const DDS::PublisherQos publisherQos,
const XTypes::TypeInformation type_info 
)
inline

Definition at line 260 of file Spdp.h.

267  {
268  return endpoint_manager().add_publication(topicId, publication, qos,
269  transInfo, publisherQos, type_info);
270  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
GUID_t add_publication(const GUID_t &topicId, DCPS::DataWriterCallbacks_rch publication, const DDS::DataWriterQos &qos, const DCPS::TransportLocatorSeq &transInfo, const DDS::PublisherQos &publisherQos, const XTypes::TypeInformation &type_info)
Definition: Sedp.cpp:6122

◆ add_subscription()

GUID_t OpenDDS::RTPS::Spdp::add_subscription ( const GUID_t topicId,
DCPS::DataReaderCallbacks_rch  subscription,
const DDS::DataReaderQos qos,
const DCPS::TransportLocatorSeq transInfo,
const DDS::SubscriberQos subscriberQos,
const char *  filterClassName,
const char *  filterExpr,
const DDS::StringSeq params,
const XTypes::TypeInformation type_info 
)
inline

Definition at line 297 of file Spdp.h.

307  {
308  return endpoint_manager().add_subscription(topicId, subscription, qos, transInfo,
309  subscriberQos, filterClassName, filterExpr, params, type_info);
310  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
GUID_t add_subscription(const GUID_t &topicId, DCPS::DataReaderCallbacks_rch subscription, const DDS::DataReaderQos &qos, const DCPS::TransportLocatorSeq &transInfo, const DDS::SubscriberQos &subscriberQos, const char *filterClassName, const char *filterExpr, const DDS::StringSeq &params, const XTypes::TypeInformation &type_info)
Definition: Sedp.cpp:6261

◆ announce_domain_participant_qos()

bool OpenDDS::RTPS::Spdp::announce_domain_participant_qos ( )
protected

Definition at line 2287 of file Spdp.cpp.

References is_security_enabled(), OpenDDS::RTPS::Spdp::SpdpTransport::SEND_DIRECT, OpenDDS::RTPS::Spdp::SpdpTransport::SEND_MULTICAST, OpenDDS::RTPS::Spdp::SpdpTransport::SEND_RELAY, and write_secure_updates().

Referenced by update_domain_participant_qos().

2288 {
2289 
2290 #ifdef OPENDDS_SECURITY
2291  if (is_security_enabled()) {
2293  }
2294 #endif
2295 
2296  return true;
2297 }
bool is_security_enabled() const
Definition: Spdp.h:159
void write_secure_updates()
Definition: Spdp.cpp:425

◆ append_transport_statistics()

void OpenDDS::RTPS::Spdp::append_transport_statistics ( DCPS::TransportStatisticsSequence seq)

Definition at line 2790 of file Spdp.cpp.

References ACE_GUARD, OpenDDS::DCPS::append(), lock_, sedp_, and tport_.

2791 {
2792  {
2794  append(seq, tport_->transport_statistics_);
2795  tport_->transport_statistics_.clear();
2796  }
2797  sedp_->append_transport_statistics(seq);
2798 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
void append(TransportStatisticsSequence &seq, const InternalTransportStatistics &istats)
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556

◆ assert_topic()

DCPS::TopicStatus OpenDDS::RTPS::Spdp::assert_topic ( GUID_t topicId,
const char *  topicName,
const char *  dataTypeName,
const DDS::TopicQos qos,
bool  hasDcpsKey,
DCPS::TopicCallbacks topic_callbacks 
)

Definition at line 4658 of file Spdp.cpp.

References ACE_ERROR, ACE_TEXT(), OpenDDS::RTPS::Sedp::assert_topic(), OpenDDS::DCPS::DCPS_debug_level, endpoint_manager(), LM_ERROR, and OpenDDS::DCPS::PRECONDITION_NOT_MET.

4661 {
4662  if (std::strlen(topicName) > 256 || std::strlen(dataTypeName) > 256) {
4663  if (DCPS_debug_level) {
4664  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR LocalParticipant::assert_topic() - ")
4665  ACE_TEXT("topic or type name length limit (256) exceeded\n")));
4666  }
4668  }
4669 
4670  return endpoint_manager().assert_topic(topicId, topicName, dataTypeName, qos, hasDcpsKey, topic_callbacks);
4671 }
#define ACE_ERROR(X)
Sedp & endpoint_manager()
Definition: Spdp.h:354
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
DCPS::TopicStatus assert_topic(GUID_t &topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, bool hasDcpsKey, DCPS::TopicCallbacks *topic_callbacks)
Definition: Sedp.cpp:6060

◆ associated()

bool OpenDDS::RTPS::Spdp::associated ( ) const

◆ attempt_authentication()

void OpenDDS::RTPS::Spdp::attempt_authentication ( const DiscoveredParticipantIter iter,
bool  from_discovery 
)
private

Definition at line 1333 of file Spdp.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::RTPS::DiscoveredParticipant::auth_req_msg_, OpenDDS::RTPS::DiscoveredParticipant::auth_state_, OpenDDS::RTPS::AUTH_STATE_AUTHENTICATED, OpenDDS::RTPS::AUTH_STATE_UNAUTHENTICATED, DDS::Security::SecurityException::code, config_, DDS::Security::ParticipantGenericMessage::destination_endpoint_guid, DDS::Security::ParticipantGenericMessage::destination_participant_guid, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, DDS::Security::GMCLASSID_SECURITY_AUTH_REQUEST, guid(), guid_, OpenDDS::DCPS::GUID_UNKNOWN, OpenDDS::RTPS::DiscoveredParticipant::handshake_deadline_, handshake_deadlines_, OpenDDS::RTPS::DiscoveredParticipant::handshake_resend_falloff_, OpenDDS::RTPS::DiscoveredParticipant::handshake_state_, OpenDDS::RTPS::HANDSHAKE_STATE_BEGIN_HANDSHAKE_REPLY, OpenDDS::RTPS::HANDSHAKE_STATE_BEGIN_HANDSHAKE_REQUEST, OpenDDS::RTPS::HANDSHAKE_STATE_DONE, OpenDDS::RTPS::DiscoveredParticipant::have_auth_req_msg_, OpenDDS::RTPS::DiscoveredParticipant::identity_handle_, identity_handle_, OpenDDS::RTPS::DiscoveredParticipant::identity_token_, OpenDDS::RTPS::DiscoveredParticipant::is_requester_, LM_DEBUG, OpenDDS::RTPS::DiscoveredParticipant::local_auth_request_token_, OpenDDS::DCPS::make_id(), DDS::Security::SecurityException::message, DDS::Security::ParticipantGenericMessage::message_class_id, DDS::Security::ParticipantGenericMessage::message_data, DDS::Security::ParticipantGenericMessage::message_identity, DDS::Security::SecurityException::minor_code, OpenDDS::DCPS::TimePoint_T< MonotonicClock >::now(), purge_handshake_deadlines(), DDS::Security::ParticipantGenericMessage::related_message_identity, OpenDDS::RTPS::DiscoveredParticipant::remote_auth_request_token_, DDS::RETCODE_OK, schedule_handshake_resend(), security_config_, OpenDDS::DCPS::security_debug, sedp_, send_handshake_request(), DDS::Security::MessageIdentity::sequence_number, set_auth_state(), DDS::Security::ParticipantGenericMessage::source_endpoint_guid, DDS::Security::MessageIdentity::source_guid, stateless_sequence_number_, tport_, DDS::Security::VALIDATION_FAILED, DDS::Security::VALIDATION_OK, DDS::Security::VALIDATION_PENDING_HANDSHAKE_MESSAGE, DDS::Security::VALIDATION_PENDING_HANDSHAKE_REQUEST, and OpenDDS::DCPS::TimeDuration::zero_value.

Referenced by handle_auth_request(), and handle_participant_data().

1334 {
1335  const DCPS::GUID_t& guid = iter->first;
1336  DiscoveredParticipant& dp = iter->second;
1337 
1338  if (DCPS::security_debug.auth_debug) {
1339  ACE_DEBUG((LM_DEBUG, "(%P|%t) {auth_debug} DEBUG: Spdp::attempt_authentication "
1340  "for %C from_discovery=%d have_remote_token=%d auth_state=%d handshake_state=%d\n",
1341  DCPS::LogGuid(guid).c_str(),
1342  from_discovery, !(dp.remote_auth_request_token_ == DDS::Security::Token()),
1343  dp.auth_state_, dp.handshake_state_));
1344  }
1345 
1346  dp.handshake_resend_falloff_.set(config_->auth_resend_period());
1347 
1348  if (!from_discovery && dp.handshake_state_ != HANDSHAKE_STATE_DONE) {
1349  // Ignore auth reqs when already in progress.
1351  return;
1352  }
1353 
1354  // Reset.
1356  dp.handshake_deadline_ = DCPS::MonotonicTimePoint::now() + config_->max_auth_time();
1357  handshake_deadlines_.insert(std::make_pair(dp.handshake_deadline_, guid));
1358  tport_->handshake_deadline_task_->schedule(config_->max_auth_time());
1359 
1360  DDS::Security::Authentication_var auth = security_config_->get_authentication();
1361  DDS::Security::SecurityException se = {"", 0, 0};
1362 
1363  const DDS::Security::ValidationResult_t vr = auth->validate_remote_identity(
1364  dp.identity_handle_, dp.local_auth_request_token_, dp.remote_auth_request_token_,
1365  identity_handle_, dp.identity_token_, guid, se);
1366 
1367  dp.have_auth_req_msg_ = !(dp.local_auth_request_token_ == DDS::Security::Token());
1368  if (dp.have_auth_req_msg_) {
1369  dp.auth_req_msg_.message_identity.source_guid = guid_;
1370  dp.auth_req_msg_.message_identity.sequence_number = (++stateless_sequence_number_).getValue();
1371  dp.auth_req_msg_.message_class_id = DDS::Security::GMCLASSID_SECURITY_AUTH_REQUEST;
1372  dp.auth_req_msg_.destination_participant_guid = guid;
1373  dp.auth_req_msg_.destination_endpoint_guid = GUID_UNKNOWN;
1374  dp.auth_req_msg_.source_endpoint_guid = GUID_UNKNOWN;
1375  dp.auth_req_msg_.related_message_identity.source_guid = GUID_UNKNOWN;
1376  dp.auth_req_msg_.related_message_identity.sequence_number = 0;
1377  dp.auth_req_msg_.message_data.length(1);
1378  dp.auth_req_msg_.message_data[0] = dp.local_auth_request_token_;
1379  // Send the auth req immediately to reset the remote if they are
1380  // still authenticated with us.
1381  if (sedp_->write_stateless_message(dp.auth_req_msg_, make_id(guid, ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER)) != DDS::RETCODE_OK) {
1382  if (DCPS::security_debug.auth_debug) {
1383  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} Spdp::attempt_authentication() - ")
1384  ACE_TEXT("Unable to write auth req message.\n")));
1385  }
1386  } else {
1387  if (DCPS::security_debug.auth_debug) {
1388  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::attempt_authentication() - ")
1389  ACE_TEXT("Sent auth req message for participant: %C\n"),
1390  DCPS::LogGuid(guid).c_str()));
1391  }
1392  }
1393  schedule_handshake_resend(dp.handshake_resend_falloff_.get(), guid);
1394  }
1395 
1396  switch (vr) {
1399  dp.handshake_state_ = HANDSHAKE_STATE_DONE;
1401  return;
1402  }
1404  if (DCPS::security_debug.auth_debug) {
1405  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::attempt_authentication() - ")
1406  ACE_TEXT("Attempting authentication (expecting request) for participant: %C\n"),
1407  DCPS::LogGuid(guid).c_str()));
1408  }
1409  dp.handshake_state_ = HANDSHAKE_STATE_BEGIN_HANDSHAKE_REPLY;
1410  dp.is_requester_ = true;
1411  return; // We'll need to wait for an inbound handshake request from the remote participant
1412  }
1414  if (DCPS::security_debug.auth_debug) {
1415  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::attempt_authentication() - ")
1416  ACE_TEXT("Attempting authentication (sending request/expecting reply) for participant: %C\n"),
1417  DCPS::LogGuid(guid).c_str()));
1418  }
1419  dp.handshake_state_ = HANDSHAKE_STATE_BEGIN_HANDSHAKE_REQUEST;
1420  send_handshake_request(guid, dp);
1421  return;
1422  }
1424  if (DCPS::security_debug.auth_debug) {
1425  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::attempt_authentication() - ")
1426  ACE_TEXT("Remote participant identity is invalid. Security Exception[%d.%d]: %C\n"),
1427  se.code, se.minor_code, se.message.in()));
1428  }
1430  dp.handshake_state_ = HANDSHAKE_STATE_DONE;
1432  return;
1433  }
1434  default: {
1435  if (DCPS::security_debug.auth_debug) {
1436  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::attempt_authentication() - ")
1437  ACE_TEXT("Unexpected return value while validating remote identity. Security Exception[%d.%d]: %C\n"),
1438  se.code, se.minor_code, se.message.in()));
1439  }
1441  dp.handshake_state_ = HANDSHAKE_STATE_DONE;
1443  return;
1444  }
1445  }
1446 }
#define ACE_DEBUG(X)
DDS::Security::IdentityHandle identity_handle_
Definition: Spdp.h:623
DCPS::MonotonicTimePoint schedule_handshake_resend(const DCPS::TimeDuration &time, const DCPS::GUID_t &guid)
Definition: Spdp.cpp:1956
const ReturnCode_t RETCODE_OK
void set_auth_state(DiscoveredParticipant &dp, AuthState state)
Definition: Spdp.cpp:4764
void purge_handshake_deadlines(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4315
static TimePoint_T< MonotonicClock > now()
Definition: TimePoint_T.inl:41
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
static const TimeDuration zero_value
Definition: TimeDuration.h:31
Handshake concluded or timed out.
Replier should call begin_handshake_reply.
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
void send_handshake_request(const DCPS::GUID_t &guid, DiscoveredParticipant &dp)
Definition: Spdp.cpp:1271
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
Security::SecurityConfig_rch security_config_
Definition: Spdp.h:618
TimeQueue handshake_deadlines_
Definition: Spdp.h:643
ACE_TEXT("TCP_Factory")
DCPS::GUID_t guid_
Definition: Spdp.h:393
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
Definition: MessageTypes.h:84
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
Requester should call begin_handshake_request.
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200
const string GMCLASSID_SECURITY_AUTH_REQUEST
DCPS::SequenceNumber stateless_sequence_number_
Definition: Spdp.h:621

◆ available_builtin_endpoints()

BuiltinEndpointSet_t OpenDDS::RTPS::Spdp::available_builtin_endpoints ( ) const
inline

◆ available_extended_builtin_endpoints()

DDS::Security::ExtendedBuiltinEndpointSet_t OpenDDS::RTPS::Spdp::available_extended_builtin_endpoints ( ) const
inline

Definition at line 203 of file Spdp.h.

Referenced by OpenDDS::RTPS::Sedp::associate(), and OpenDDS::RTPS::Sedp::init().

204  {
206  }
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints_
Definition: Spdp.h:617

◆ build_local_pdata()

ParticipantData_t OpenDDS::RTPS::Spdp::build_local_pdata ( bool  always_in_the_clear,
Security::DiscoveredParticipantDataKind  kind 
)

Definition at line 2198 of file Spdp.cpp.

References ACE_ERROR, ACE_TEXT(), available_builtin_endpoints_, available_extended_builtin_endpoints_, config_, OpenDDS::DCPS::DCPS_debug_level, domain_, get_part_bit_data(), guid_, OpenDDS::DCPS::GUID_t::guidPrefix, identity_status_token_, identity_token_, is_application_participant_, lease_duration_, LM_ERROR, OpenDDS::RTPS::LOCATOR_KIND_UDPv4, participant_discovered_at_, participant_sec_attr_, permissions_token_, DDS::Security::ParticipantSecurityAttributes::plugin_participant_attributes, DDS::DomainParticipantQos::property, OpenDDS::RTPS::PROTOCOLVERSION, qos_, ACE_Time_Value::sec(), OpenDDS::RTPS::security_attributes_to_bitmask(), sedp_, OpenDDS::DCPS::TimeDuration::value(), and OpenDDS::RTPS::VENDORID_OPENDDS.

Referenced by OpenDDS::RTPS::Sedp::write_durable_dcps_participant_secure(), and write_secure_updates().

2204 {
2205  // The RTPS spec has no constants for the builtinTopics{Writer,Reader}
2206 
2207  // This locator list should not be empty, but we won't actually be using it.
2208  // The OpenDDS publication/subscription data will have locators included.
2209  DCPS::LocatorSeq nonEmptyList(1);
2210  nonEmptyList.length(1);
2211  nonEmptyList[0].kind = LOCATOR_KIND_UDPv4;
2212  nonEmptyList[0].port = 12345;
2213  std::memset(nonEmptyList[0].address, 0, 12);
2214  nonEmptyList[0].address[12] = 127;
2215  nonEmptyList[0].address[13] = 0;
2216  nonEmptyList[0].address[14] = 0;
2217  nonEmptyList[0].address[15] = 1;
2218 
2219  const GuidPrefix_t& gp = guid_.guidPrefix;
2220 
2221  const DCPS::LocatorSeq unicast_locators = sedp_->unicast_locators();
2222  const DCPS::LocatorSeq multicast_locators = sedp_->multicast_locators();
2223 
2224  if (unicast_locators.length() == 0 && multicast_locators.length() == 0) {
2225  if (DCPS::DCPS_debug_level > 0) {
2226  ACE_ERROR((LM_ERROR,
2227  ACE_TEXT("(%P|%t) ERROR: ")
2228  ACE_TEXT("Spdp::build_local_pdata: ")
2229  ACE_TEXT("no locators\n")));
2230  }
2231  }
2232 
2233 #ifdef OPENDDS_SECURITY
2234  const Security::SPDPdiscoveredParticipantData pdata = {
2235  kind,
2236  { // ParticipantBuiltinTopicDataSecure
2237  { // ParticipantBuiltinTopicData (security enhanced)
2238  get_part_bit_data(!always_in_the_clear),
2241  qos_.property,
2242  {
2245  },
2247  },
2249  },
2250 #else
2251  const SPDPdiscoveredParticipantData pdata = {
2252  get_part_bit_data(false),
2253 #endif
2254  { // ParticipantProxy_t
2255  domain_
2256  , ""
2257  , PROTOCOLVERSION
2258  , {gp[0], gp[1], gp[2], gp[3], gp[4], gp[5],
2259  gp[6], gp[7], gp[8], gp[9], gp[10], gp[11]}
2261  , false /*expectsIQoS*/
2263  , 0
2264  , unicast_locators
2265  , multicast_locators
2266  , nonEmptyList /*defaultMulticastLocatorList*/
2267  , nonEmptyList /*defaultUnicastLocatorList*/
2268  , {0 /*manualLivelinessCount*/} //FUTURE: implement manual liveliness
2269  , qos_.property
2270  , {config_->participant_flags()} // opendds_participant_flags
2272 #ifdef OPENDDS_SECURITY
2274 #endif
2275  },
2276  { // Duration_t (leaseDuration)
2277  static_cast<CORBA::Long>(lease_duration_.value().sec()),
2278  0 // we are not supporting fractional seconds in the lease duration
2279  },
2281  };
2282 
2283  return pdata;
2284 }
const ProtocolVersion_t PROTOCOLVERSION
Definition: MessageTypes.h:67
ACE_CDR::Long Long
#define ACE_ERROR(X)
octet GuidPrefix_t[12]
Definition: DdsDcpsGuid.idl:19
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
Definition: Spdp.h:632
DDS::ParticipantBuiltinTopicData get_part_bit_data(bool secure) const
Definition: Spdp.cpp:4606
key GuidPrefix_t guidPrefix
Definition: DdsDcpsGuid.idl:58
DDS::Security::PermissionsToken permissions_token_
Definition: Spdp.h:629
bool is_application_participant_
Definition: Spdp.h:395
const DDS::DomainId_t domain_
Definition: Spdp.h:392
const DCPS::MonotonicTime_t participant_discovered_at_
Definition: Spdp.h:394
DDS::DomainParticipantQos qos_
Definition: Spdp.h:380
const ACE_Time_Value & value() const
const long LOCATOR_KIND_UDPv4
Definition: RtpsCore.idl:110
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
DDS::Security::IdentityStatusToken identity_status_token_
Definition: Spdp.h:628
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints_
Definition: Spdp.h:617
time_t sec(void) const
DDS::Security::IdentityToken identity_token_
Definition: Spdp.h:627
DCPS::TimeDuration lease_duration_
Definition: Spdp.h:387
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
BuiltinEndpointSet_t available_builtin_endpoints_
Definition: Spdp.h:605
DCPS::GUID_t guid_
Definition: Spdp.h:393
DDS::Security::ParticipantSecurityAttributesMask security_attributes_to_bitmask(const DDS::Security::ParticipantSecurityAttributes &sec_attr)
Definition: MessageUtils.h:177
const VendorId_t VENDORID_OPENDDS
Definition: MessageTypes.h:26
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
PropertyQosPolicy property
PluginParticipantSecurityAttributesMask plugin_participant_attributes
sequence< Locator_t > LocatorSeq

◆ config()

DCPS::RcHandle<RtpsDiscoveryConfig> OpenDDS::RTPS::Spdp::config ( ) const
inline

Definition at line 218 of file Spdp.h.

Referenced by OpenDDS::RTPS::Sedp::add_publication_i(), and OpenDDS::RTPS::Sedp::add_subscription_i().

218 { return config_; }
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ crypto_handle()

DDS::Security::ParticipantCryptoHandle OpenDDS::RTPS::Spdp::crypto_handle ( ) const
inline

Definition at line 129 of file Spdp.h.

Referenced by OpenDDS::RTPS::Sedp::init().

129 { return crypto_handle_; }
DDS::Security::ParticipantCryptoHandle crypto_handle_
Definition: Spdp.h:625

◆ data_received()

void OpenDDS::RTPS::Spdp::data_received ( const DataSubmessage data,
const ParameterList plist,
const ACE_INET_Addr from 
)
private

Definition at line 1045 of file Spdp.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), DDS::Security::ParticipantBuiltinTopicData::base, DDS::Security::ParticipantBuiltinTopicDataSecure::base, OpenDDS::DCPS::BUILTIN_TOPIC_KEY_UNKNOWN, config_, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::Security::SPDPdiscoveredParticipantData::ddsParticipantDataSecure, OpenDDS::Security::SPDPdiscoveredParticipantData::discoveredAt, OpenDDS::DCPS::DISPOSE_INSTANCE, domain_, OpenDDS::RTPS::ParticipantProxy_t::domainId, OpenDDS::RTPS::ParameterListConverter::from_param_list(), guid(), guid_, OpenDDS::RTPS::ParticipantProxy_t::guidPrefix, handle_participant_data(), initialized_flag_, OpenDDS::RTPS::DataSubmessage::inlineQos, OpenDDS::RTPS::ip_in_AgentInfo(), OpenDDS::RTPS::ip_in_locator_list(), is_security_enabled(), LM_ERROR, LM_WARNING, lock_, OpenDDS::DCPS::make_part_guid(), OpenDDS::RTPS::ParticipantProxy_t::metatrafficUnicastLocatorList, OpenDDS::Security::SPDPdiscoveredParticipantData::participantProxy, process_participant_ice(), ACE_Guard< ACE_LOCK >::release(), OpenDDS::DCPS::SAMPLE_DATA, shutdown_flag_, OpenDDS::RTPS::to_opendds_seqnum(), and OpenDDS::RTPS::DataSubmessage::writerSN.

1048 {
1051  return;
1052  }
1053 
1054  const MonotonicTimePoint now = MonotonicTimePoint::now();
1055  ParticipantData_t pdata;
1056 
1058  pdata.discoveredAt = now.to_monotonic_time();
1059 #ifdef OPENDDS_SECURITY
1060  pdata.ddsParticipantDataSecure.base.base.key = DCPS::BUILTIN_TOPIC_KEY_UNKNOWN;
1061 #endif
1062 
1063  if (!ParameterListConverter::from_param_list(plist, pdata)) {
1064  if (DCPS::DCPS_debug_level > 0) {
1065  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::data_received - ")
1066  ACE_TEXT("failed to convert from ParameterList to ")
1067  ACE_TEXT("SPDPdiscoveredParticipantData\n")));
1068  }
1069  return;
1070  }
1071 
1072  // Remote domain ID, if populated, has to match
1073  if (pdata.participantProxy.domainId != domain_) {
1074  return;
1075  }
1076 
1077  const GUID_t guid = DCPS::make_part_guid(pdata.participantProxy.guidPrefix);
1078  if (guid == guid_) {
1079  // About us, stop.
1080  return;
1081  }
1082 
1083  const DCPS::MessageId msg_id = (data.inlineQos.length() && disposed(data.inlineQos)) ? DCPS::DISPOSE_INSTANCE : DCPS::SAMPLE_DATA;
1084 
1085 #ifdef OPENDDS_SECURITY
1086  const bool relay_in_use = (config_->rtps_relay_only() || config_->use_rtps_relay());
1087  const bool from_relay = relay_in_use && (from == config_->spdp_rtps_relay_address());
1088 
1089  if (config_->check_source_ip() && msg_id == DCPS::SAMPLE_DATA && !from_relay && !ip_in_locator_list(from, pdata.participantProxy.metatrafficUnicastLocatorList) && !ip_in_AgentInfo(from, plist)) {
1090  if (DCPS::DCPS_debug_level >= 8) {
1091  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) Spdp::data_received - dropped IP: %C\n"), DCPS::LogAddr(from).c_str()));
1092  }
1093  return;
1094  }
1095 
1096  const bool security_enabled = is_security_enabled();
1097  guard.release();
1098 
1099  if (!security_enabled) {
1100  process_participant_ice(plist, pdata, guid);
1101  }
1102 #elif !defined OPENDDS_SAFETY_PROFILE
1103  const bool relay_in_use = (config_->rtps_relay_only() || config_->use_rtps_relay());
1104  const bool from_relay = relay_in_use && (from == config_->spdp_rtps_relay_address());
1105 
1106  const bool check_source_ip = config_->check_source_ip();
1107  guard.release();
1108 
1109  if (check_source_ip && msg_id == DCPS::SAMPLE_DATA && !from_relay && !ip_in_locator_list(from, pdata.participantProxy.metatrafficUnicastLocatorList)) {
1110  if (DCPS::DCPS_debug_level >= 8) {
1111  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) Spdp::data_received - IP not in locator list: %C\n"), DCPS::LogAddr(from).c_str()));
1112  }
1113  return;
1114  }
1115 #else
1116  guard.release();
1117 #endif
1118 
1119  handle_participant_data(msg_id, pdata, now, to_opendds_seqnum(data.writerSN), from, false);
1120 }
#define ACE_DEBUG(X)
Security::SPDPdiscoveredParticipantData ParticipantData_t
#define ACE_ERROR(X)
const DDS::DomainId_t domain_
Definition: Spdp.h:392
bool ip_in_locator_list(const ACE_INET_Addr &from, const DCPS::LocatorSeq &locators)
Definition: Spdp.cpp:657
DCPS::SequenceNumber to_opendds_seqnum(const RTPS::SequenceNumber_t &rtps_seqnum)
Definition: MessageUtils.h:132
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
bool is_security_enabled() const
Definition: Spdp.h:159
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
void handle_participant_data(DCPS::MessageId id, const ParticipantData_t &pdata, const DCPS::MonotonicTimePoint &now, const DCPS::SequenceNumber &seq, const ACE_INET_Addr &from, bool from_sedp)
Definition: Spdp.cpp:707
MessageId
One byte message id (<256)
bool from_param_list(const ParameterList &param_list, DDS::ParticipantBuiltinTopicData &pbtd)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
const DDS::BuiltinTopicKey_t BUILTIN_TOPIC_KEY_UNKNOWN
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
TimePoint_T< MonotonicClock > MonotonicTimePoint
Definition: TimeTypes.h:51
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
bool ip_in_AgentInfo(const ACE_INET_Addr &from, const ParameterList &plist)
Definition: Spdp.cpp:674
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
DCPS::GUID_t guid_
Definition: Spdp.h:393
OpenDDS::RTPS::ParticipantProxy_t participantProxy
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
void process_participant_ice(const ParameterList &plist, const ParticipantData_t &pdata, const DCPS::GUID_t &guid)
Definition: Spdp.cpp:4351

◆ endpoint_manager()

Sedp& OpenDDS::RTPS::Spdp::endpoint_manager ( )
inlineprotected

Definition at line 354 of file Spdp.h.

References init(), and OpenDDS::RTPS::OPENDDS_MAP_CMP().

Referenced by assert_topic(), ignore_domain_participant(), and purge_discovered_participant().

354 { return *sedp_; }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606

◆ enqueue_location_update_i()

void OpenDDS::RTPS::Spdp::enqueue_location_update_i ( DiscoveredParticipantIter  iter,
DCPS::ParticipantLocation  mask,
const ACE_INET_Addr from,
const char *  reason 
)
protected

Definition at line 457 of file Spdp.cpp.

References ACE_DEBUG, OpenDDS::DCPS::LogGuid::c_str(), LM_DEBUG, OpenDDS::DCPS::log_bits, and OpenDDS::DCPS::TimePoint_T< SystemClock >::now().

Referenced by handle_participant_data(), process_participant_ice(), rtps_relay_only_now(), use_ice_now(), and use_rtps_relay_now().

461 {
462  // We have the global lock.
463  iter->second.location_updates_.push_back(DiscoveredParticipant::LocationUpdate(mask, from, DCPS::SystemTimePoint::now()));
464 
465  if (DCPS::log_bits) {
466  ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: Spdp::enqueue_location_update_i: %@ for %C size=%B reason=%C\n", this, LogGuid(iter->first).c_str(), iter->second.location_updates_.size(), reason));
467  }
468 
469 }
#define ACE_DEBUG(X)
static TimePoint_T< SystemClock > now()
Definition: TimePoint_T.inl:41
bool log_bits
Definition: Logging.cpp:18

◆ find_topic()

DCPS::TopicStatus OpenDDS::RTPS::Spdp::find_topic ( const char *  topicName,
CORBA::String_out  dataTypeName,
DDS::TopicQos_out  qos,
GUID_t topicId 
)
inline

Definition at line 235 of file Spdp.h.

240  {
241  return endpoint_manager().find_topic(topicName, dataTypeName, qos, topicId);
242  }
DCPS::TopicStatus find_topic(const char *topicName, CORBA::String_out dataTypeName, DDS::TopicQos_out qos, GUID_t &topicId)
Definition: Sedp.cpp:6085
Sedp & endpoint_manager()
Definition: Spdp.h:354

◆ fini_bit()

void OpenDDS::RTPS::Spdp::fini_bit ( )

Definition at line 2175 of file Spdp.cpp.

References bit_subscriber_, OpenDDS::RTPS::ParticipantProxy_t::vendorId, and OpenDDS::DCPS::VENDORID_OCI.

2176 {
2177  bit_subscriber_->clear();
2178 }
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
Definition: Spdp.h:379

◆ get_default_locators()

bool OpenDDS::RTPS::Spdp::get_default_locators ( const DCPS::GUID_t part_id,
DCPS::LocatorSeq target,
bool &  inlineQos 
)

Definition at line 3617 of file Spdp.cpp.

References participants_.

Referenced by OpenDDS::RTPS::Sedp::populate_transport_locator_sequence().

3619 {
3620  DiscoveredParticipantIter part_iter = participants_.find(part_id);
3621  if (part_iter == participants_.end()) {
3622  return false;
3623  } else {
3624  inlineQos = part_iter->second.pdata_.participantProxy.expectsInlineQos;
3625  DCPS::LocatorSeq& mc_source =
3626  part_iter->second.pdata_.participantProxy.defaultMulticastLocatorList;
3627  DCPS::LocatorSeq& uc_source =
3628  part_iter->second.pdata_.participantProxy.defaultUnicastLocatorList;
3629  CORBA::ULong mc_source_len = mc_source.length();
3630  CORBA::ULong uc_source_len = uc_source.length();
3631  CORBA::ULong target_len = target.length();
3632  target.length(mc_source_len + uc_source_len + target_len);
3633  // Copy multicast
3634  for (CORBA::ULong mci = 0; mci < mc_source.length(); ++mci) {
3635  target[target_len + mci] = mc_source[mci];
3636  }
3637  // Copy unicast
3638  for (CORBA::ULong uci = 0; uci < uc_source.length(); ++uci) {
3639  target[target_len + mc_source_len + uci] = uc_source[uci];
3640  }
3641  }
3642  return true;
3643 }
ACE_CDR::ULong ULong
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
sequence< Locator_t > LocatorSeq

◆ get_domain_id()

DDS::DomainId_t OpenDDS::RTPS::Spdp::get_domain_id ( ) const
inline

◆ get_ice_endpoint_if_added()

DCPS::WeakRcHandle< ICE::Endpoint > OpenDDS::RTPS::Spdp::get_ice_endpoint_if_added ( )

Definition at line 609 of file Spdp.cpp.

References tport_.

Referenced by OpenDDS::RTPS::Sedp::DiscoveryWriter::write_dcps_participant_secure().

610 {
611  return tport_->ice_endpoint_added_ ? tport_->get_ice_endpoint() : DCPS::WeakRcHandle<ICE::Endpoint>();
612 }
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556

◆ get_last_recv_locator()

bool OpenDDS::RTPS::Spdp::get_last_recv_locator ( const DCPS::GUID_t part_id,
DCPS::LocatorSeq target,
bool &  inlineQos 
)

Definition at line 3646 of file Spdp.cpp.

References OpenDDS::DCPS::address_to_locator(), and participants_.

Referenced by OpenDDS::RTPS::Sedp::populate_origination_locator().

3648 {
3649  DiscoveredParticipantIter pos = participants_.find(part_id);
3650  if (pos != participants_.end() && pos->second.last_recv_address_ != ACE_INET_Addr()) {
3651  inlineQos = pos->second.pdata_.participantProxy.expectsInlineQos;
3652  target.length(1);
3653  DCPS::address_to_locator(target[0], pos->second.last_recv_address_);
3654  return true;
3655  }
3656  return false;
3657 }
OpenDDS_Dcps_Export void address_to_locator(Locator_t &locator, const ACE_INET_Addr &addr)
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ get_part_bit_data()

DDS::ParticipantBuiltinTopicData OpenDDS::RTPS::Spdp::get_part_bit_data ( bool  secure) const
private

Get this participant's BIT data. user_data may be omitting depending on security settings.

Definition at line 4606 of file Spdp.cpp.

References qos_, secure_part_user_data(), and DDS::DomainParticipantQos::user_data.

Referenced by build_local_pdata(), and local_participant_data_as_octets().

4607 {
4608  bool include_user_data = true;
4609 #ifdef OPENDDS_SECURITY
4610  if (secure_part_user_data()) {
4611  include_user_data = secure;
4612  }
4613 #else
4614  ACE_UNUSED_ARG(secure);
4615 #endif
4617  bit_data.key = DDS::BuiltinTopicKey_t();
4618  bit_data.user_data = include_user_data ? qos_.user_data : DDS::UserDataQosPolicy();
4619  return bit_data;
4620 }
UserDataQosPolicy user_data
bool secure_part_user_data() const
Definition: Spdp.cpp:4597
DDS::DomainParticipantQos qos_
Definition: Spdp.h:380

◆ get_participant_data() [1/2]

const ParticipantData_t & OpenDDS::RTPS::Spdp::get_participant_data ( const DCPS::GUID_t guid) const

Definition at line 4427 of file Spdp.cpp.

References OpenDDS::DCPS::make_part_guid(), and participants_.

4428 {
4430  return iter->second.pdata_;
4431 }
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ get_participant_data() [2/2]

ParticipantData_t & OpenDDS::RTPS::Spdp::get_participant_data ( const DCPS::GUID_t guid)

Definition at line 4433 of file Spdp.cpp.

References OpenDDS::DCPS::make_part_guid(), and participants_.

4434 {
4436  return iter->second.pdata_;
4437 }
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ get_participant_discovered_at() [1/2]

DCPS::MonotonicTime_t OpenDDS::RTPS::Spdp::get_participant_discovered_at ( ) const

◆ get_participant_discovered_at() [2/2]

DCPS::MonotonicTime_t OpenDDS::RTPS::Spdp::get_participant_discovered_at ( const DCPS::GUID_t guid) const

Definition at line 4444 of file Spdp.cpp.

References OpenDDS::DCPS::make_part_guid(), and participants_.

4445 {
4447  return iter->second.discovered_at_.to_monotonic_time();
4448 }
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ get_participant_flags()

ACE_CDR::ULong OpenDDS::RTPS::Spdp::get_participant_flags ( const DCPS::GUID_t guid) const

Definition at line 3671 of file Spdp.cpp.

References participants_, and OpenDDS::RTPS::PFLAGS_EMPTY.

Referenced by OpenDDS::RTPS::Sedp::process_discovered_reader_data(), and OpenDDS::RTPS::Sedp::process_discovered_writer_data().

3672 {
3673  const DiscoveredParticipantMap::const_iterator iter = participants_.find(guid);
3674  if (iter == participants_.end()) {
3675  return PFLAGS_EMPTY;
3676  }
3677  return is_opendds(iter->second.pdata_.participantProxy)
3678  ? iter->second.pdata_.participantProxy.opendds_participant_flags.bits : PFLAGS_EMPTY;
3679 }
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
const OpenDDSParticipantFlagsBits_t PFLAGS_EMPTY
Definition: RtpsCore.idl:320
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ get_security_config()

Security::SecurityConfig_rch OpenDDS::RTPS::Spdp::get_security_config ( ) const
inline

◆ get_sedp_port()

u_short OpenDDS::RTPS::Spdp::get_sedp_port ( ) const
inline

Definition at line 187 of file Spdp.h.

187 { return sedp_->local_address().get_port_number(); }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606

◆ get_spdp_port()

u_short OpenDDS::RTPS::Spdp::get_spdp_port ( ) const
inline

Definition at line 185 of file Spdp.h.

185 { return tport_ ? tport_->uni_port_ : 0; }
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556

◆ guid()

const DCPS::GUID_t& OpenDDS::RTPS::Spdp::guid ( ) const
inline

◆ handle_auth_request()

void OpenDDS::RTPS::Spdp::handle_auth_request ( const DDS::Security::ParticipantStatelessMessage msg)

Definition at line 1139 of file Spdp.cpp.

References ACE_DEBUG, ACE_GUARD, ACE_TEXT(), attempt_authentication(), OpenDDS::DCPS::LogGuid::c_str(), DDS::Security::ParticipantGenericMessage::destination_participant_guid, OpenDDS::DCPS::ENTITYID_PARTICIPANT, guid(), OpenDDS::RTPS::Parameter::guid, guid_, initialized_flag_, LM_DEBUG, lock_, OpenDDS::DCPS::make_id(), DDS::Security::ParticipantGenericMessage::message_data, DDS::Security::ParticipantGenericMessage::message_identity, participants_, OpenDDS::RTPS::PID_PARTICIPANT_GUID, OpenDDS::DCPS::security_debug, sedp_, DDS::Security::MessageIdentity::sequence_number, shutdown_flag_, and DDS::Security::MessageIdentity::source_guid.

Referenced by OpenDDS::RTPS::Sedp::received_stateless_message().

1140 {
1142 
1143  if (DCPS::security_debug.auth_debug) {
1144  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_auth_request() - ")
1145  ACE_TEXT("%C -> %C local %C\n"),
1146  DCPS::LogGuid(guid).c_str(),
1147  DCPS::LogGuid(msg.destination_participant_guid).c_str(),
1148  DCPS::LogGuid(guid_).c_str()));
1149  }
1150 
1151  // If this message wasn't intended for us, ignore handshake message
1152  if (msg.destination_participant_guid != guid_) {
1153  if (DCPS::security_debug.auth_debug) {
1154  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_auth_request() - ")
1155  ACE_TEXT("Dropped not recipient\n")));
1156  }
1157  return;
1158  }
1159 
1160  if (msg.message_data.length() == 0) {
1161  if (DCPS::security_debug.auth_debug) {
1162  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_auth_request() - ")
1163  ACE_TEXT("Dropped no data\n")));
1164  }
1165  return;
1166  }
1167 
1169 
1171  return;
1172  }
1173 
1174  if (sedp_->ignoring(guid)) {
1175  // Ignore, this is our domain participant or one that the user has
1176  // asked us to ignore.
1177  if (DCPS::security_debug.auth_debug) {
1178  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_auth_request() - ")
1179  ACE_TEXT("Explicitly ignoring\n")));
1180  }
1181  return;
1182  }
1183 
1184 
1185  DiscoveredParticipantMap::iterator iter = participants_.find(guid);
1186 
1187  if (iter != participants_.end()) {
1188  if (msg.message_identity.sequence_number <= iter->second.auth_req_sequence_number_) {
1189  if (DCPS::security_debug.auth_debug) {
1190  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_auth_request() - ")
1191  ACE_TEXT("Dropped due to old sequence number\n")));
1192  }
1193  return;
1194  }
1195 
1196  iter->second.remote_auth_request_token_ = msg.message_data[0];
1197  iter->second.auth_req_sequence_number_ = msg.message_identity.sequence_number;
1198 
1199  attempt_authentication(iter, false);
1200  }
1201 }
#define ACE_DEBUG(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const EntityId_t ENTITYID_PARTICIPANT
Definition: GuidUtils.h:37
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
void attempt_authentication(const DiscoveredParticipantIter &iter, bool from_discovery)
Definition: Spdp.cpp:1333
DCPS::GUID_t guid_
Definition: Spdp.h:393
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
OpenDDS::DCPS::GUID_t source_guid
OpenDDS::DCPS::GUID_t destination_participant_guid
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ handle_handshake_message()

void OpenDDS::RTPS::Spdp::handle_handshake_message ( const DDS::Security::ParticipantStatelessMessage msg)

Definition at line 1449 of file Spdp.cpp.

References ACE_DEBUG, ACE_GUARD, ACE_TEXT(), OpenDDS::RTPS::DiscoveredParticipant::auth_state_, OpenDDS::RTPS::AUTH_STATE_AUTHENTICATED, OpenDDS::DCPS::LogGuid::c_str(), DDS::Security::SecurityException::code, config_, DDS::Security::ParticipantGenericMessage::destination_endpoint_guid, DDS::Security::ParticipantGenericMessage::destination_participant_guid, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, OpenDDS::DCPS::ENTITYID_PARTICIPANT, DDS::Security::GMCLASSID_SECURITY_AUTH_HANDSHAKE, guid_, OpenDDS::DCPS::GUID_UNKNOWN, DDS::HANDLE_NIL, OpenDDS::RTPS::DiscoveredParticipant::handshake_handle_, OpenDDS::RTPS::DiscoveredParticipant::handshake_msg_, OpenDDS::RTPS::DiscoveredParticipant::handshake_resend_falloff_, OpenDDS::RTPS::DiscoveredParticipant::handshake_state_, OpenDDS::RTPS::HANDSHAKE_STATE_BEGIN_HANDSHAKE_REPLY, OpenDDS::RTPS::HANDSHAKE_STATE_BEGIN_HANDSHAKE_REQUEST, OpenDDS::RTPS::HANDSHAKE_STATE_DONE, OpenDDS::RTPS::HANDSHAKE_STATE_PROCESS_HANDSHAKE, OpenDDS::RTPS::DiscoveredParticipant::have_auth_req_msg_, OpenDDS::RTPS::DiscoveredParticipant::identity_handle_, identity_handle_, initialized_flag_, OpenDDS::RTPS::DiscoveredParticipant::is_requester_, LM_DEBUG, LM_WARNING, local_participant_data_as_octets(), lock_, OpenDDS::DCPS::make_id(), match_authenticated(), DDS::Security::SecurityException::message, DDS::Security::ParticipantGenericMessage::message_class_id, DDS::Security::ParticipantGenericMessage::message_data, DDS::Security::ParticipantGenericMessage::message_identity, DDS::Security::SecurityException::minor_code, participants_, purge_handshake_deadlines(), DDS::Security::ParticipantGenericMessage::related_message_identity, DDS::RETCODE_OK, security_config_, OpenDDS::DCPS::security_debug, sedp_, send_handshake_message(), DDS::Security::MessageIdentity::sequence_number, set_auth_state(), shutdown_flag_, DDS::Security::ParticipantGenericMessage::source_endpoint_guid, DDS::Security::MessageIdentity::source_guid, DDS::Security::VALIDATION_FAILED, DDS::Security::VALIDATION_OK, DDS::Security::VALIDATION_OK_FINAL_MESSAGE, DDS::Security::VALIDATION_PENDING_HANDSHAKE_MESSAGE, DDS::Security::VALIDATION_PENDING_HANDSHAKE_REQUEST, and DDS::Security::VALIDATION_PENDING_RETRY.

Referenced by OpenDDS::RTPS::Sedp::received_stateless_message().

1450 {
1451  DDS::Security::SecurityException se = {"", 0, 0};
1452  Security::Authentication_var auth = security_config_->get_authentication();
1453 
1454  const GUID_t src_participant = make_id(msg.message_identity.source_guid, DCPS::ENTITYID_PARTICIPANT);
1455 
1456  if (DCPS::security_debug.auth_debug) {
1457  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - ")
1458  ACE_TEXT("%C -> %C local %C\n"),
1459  DCPS::LogGuid(src_participant).c_str(),
1460  DCPS::LogGuid(msg.destination_participant_guid).c_str(),
1461  DCPS::LogGuid(guid_).c_str()));
1462  }
1463 
1464  // If this message wasn't intended for us, ignore handshake message
1465  if (msg.destination_participant_guid != guid_) {
1466  if (DCPS::security_debug.auth_debug) {
1467  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - ")
1468  ACE_TEXT("Dropped not recipient\n")));
1469  }
1470  return;
1471  }
1472 
1473  if (msg.message_data.length() == 0) {
1474  if (DCPS::security_debug.auth_debug) {
1475  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - ")
1476  ACE_TEXT("Dropped no data\n")));
1477  }
1478  return;
1479  }
1480 
1482 
1483  if (!initialized_flag_ || shutdown_flag_ ) {
1484  return;
1485  }
1486 
1487  // If discovery hasn't initialized / validated this participant yet, ignore handshake messages
1488  DiscoveredParticipantIter iter = participants_.find(src_participant);
1489  if (iter == participants_.end()) {
1490  if (DCPS::security_debug.auth_warn) {
1491  ACE_DEBUG((LM_WARNING,
1492  ACE_TEXT("(%P|%t) {auth_warn} Spdp::handle_handshake_message() - ")
1493  ACE_TEXT("received handshake for undiscovered participant %C. Ignoring.\n"),
1494  DCPS::LogGuid(src_participant).c_str()));
1495  }
1496  return;
1497  }
1498 
1499  DiscoveredParticipant& dp = iter->second;
1500 
1501  if (DCPS::security_debug.auth_debug) {
1502  ACE_DEBUG((LM_DEBUG, "(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - "
1503  "for %C auth_state=%d handshake_state=%d\n",
1504  DCPS::LogGuid(src_participant).c_str(),
1505  dp.auth_state_, dp.handshake_state_));
1506  }
1507 
1508  // We have received a handshake message from the remote which means
1509  // we don't need to send the auth req.
1510  dp.have_auth_req_msg_ = false;
1511 
1512  dp.handshake_resend_falloff_.set(config_->auth_resend_period());
1513 
1514  if (dp.handshake_state_ == HANDSHAKE_STATE_DONE && !dp.is_requester_) {
1515  // Remote is still sending a reply, so resend the final.
1516  const GUID_t reader = make_id(iter->first, ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER);
1517  if (sedp_->write_stateless_message(dp.handshake_msg_, reader) != DDS::RETCODE_OK) {
1518  if (DCPS::security_debug.auth_debug) {
1519  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} Spdp::handle_handshake_message() - ")
1520  ACE_TEXT("Unable to write handshake message.\n")));
1521  }
1522  } else {
1523  if (DCPS::security_debug.auth_debug) {
1524  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - ")
1525  ACE_TEXT("Sent handshake message for participant: %C\n"),
1526  DCPS::LogGuid(iter->first).c_str()));
1527  }
1528  }
1529  return;
1530  }
1531 
1532  if (msg.message_identity.sequence_number <= iter->second.handshake_sequence_number_) {
1533  return;
1534  }
1535  iter->second.handshake_sequence_number_ = msg.message_identity.sequence_number;
1536 
1537  switch (dp.handshake_state_) {
1538  case HANDSHAKE_STATE_DONE:
1539  // Handled above.
1540  return;
1541 
1543  if (DCPS::security_debug.auth_warn) {
1544  ACE_DEBUG((LM_WARNING,
1545  ACE_TEXT("(%P|%t) {auth_warn} Spdp::handle_handshake_message() - ")
1546  ACE_TEXT("Invalid handshake state\n")));
1547  }
1548  return;
1549  }
1550 
1557  reply.destination_participant_guid = src_participant;
1560  reply.message_data.length(1);
1561  reply.message_data[0] = msg.message_data[0];
1562 
1563  if (dp.handshake_handle_ != DDS::HANDLE_NIL) {
1564  // Return the handle for reauth.
1565  if (!auth->return_handshake_handle(dp.handshake_handle_, se)) {
1566  if (DCPS::security_debug.auth_warn) {
1567  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
1568  ACE_TEXT("Spdp::handke_handshake_message() - ")
1569  ACE_TEXT("Unable to return handshake handle. ")
1570  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
1571  se.code, se.minor_code, se.message.in()));
1572  }
1573  return;
1574  }
1575  dp.handshake_handle_ = DDS::HANDLE_NIL;
1576  }
1577 
1578  const DDS::OctetSeq local_participant = local_participant_data_as_octets();
1579  if (!local_participant.length()) {
1580  return; // already logged in local_participant_data_as_octets()
1581  }
1583  auth->begin_handshake_reply(dp.handshake_handle_, reply.message_data[0], dp.identity_handle_,
1584  identity_handle_, local_participant, se);
1585 
1586  switch (vr) {
1588  // Theoretically, this shouldn't happen unless handshakes can involve fewer than 3 messages
1590  dp.handshake_state_ = HANDSHAKE_STATE_DONE;
1592  match_authenticated(src_participant, iter);
1593  return;
1594  }
1596  if (DCPS::security_debug.auth_warn) {
1597  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} Spdp::handle_handshake_message() - ")
1598  ACE_TEXT("Failed to reply to incoming handshake message. Security Exception[%d.%d]: %C\n"),
1599  se.code, se.minor_code, se.message.in()));
1600  }
1601  return;
1602  }
1604  if (DCPS::security_debug.auth_warn) {
1605  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} WARNING: Spdp::handle_handshake_message() - ")
1606  ACE_TEXT("Unexpected validation pending retry\n")));
1607  }
1608  return;
1609  }
1611  if (DCPS::security_debug.auth_warn) {
1612  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} WARNING: Spdp::handle_handshake_message() - ")
1613  ACE_TEXT("Unexpected validation pending handshake request\n")));
1614  }
1615  return;
1616  }
1618  if (send_handshake_message(src_participant, dp, reply) != DDS::RETCODE_OK) {
1619  if (DCPS::security_debug.auth_warn) {
1620  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} Spdp::handle_handshake_message() - ")
1621  ACE_TEXT("Unable to write stateless message for handshake reply.\n")));
1622  }
1623  return;
1624  } else {
1625  if (DCPS::security_debug.auth_debug) {
1626  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - ")
1627  ACE_TEXT("Sent handshake reply for participant: %C\n"),
1628  DCPS::LogGuid(src_participant).c_str()));
1629  }
1630  }
1631  dp.handshake_state_ = HANDSHAKE_STATE_PROCESS_HANDSHAKE;
1632  return;
1633  }
1635  // Theoretically, this shouldn't happen unless handshakes can involve fewer than 3 messages
1636  if (send_handshake_message(src_participant, dp, reply) != DDS::RETCODE_OK) {
1637  if (DCPS::security_debug.auth_warn) {
1638  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} Spdp::handle_handshake_message() - ")
1639  ACE_TEXT("Unable to write stateless message for final message.\n")));
1640  }
1641  return;
1642  } else {
1643  if (DCPS::security_debug.auth_debug) {
1644  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - ")
1645  ACE_TEXT("Sent handshake final for participant: %C\n"),
1646  DCPS::LogGuid(src_participant).c_str()));
1647  }
1648  }
1650  dp.handshake_state_ = HANDSHAKE_STATE_PROCESS_HANDSHAKE;
1652  match_authenticated(src_participant, iter);
1653  return;
1654  }
1655  }
1656  return;
1657  }
1658 
1665  reply.destination_participant_guid = src_participant;
1668  reply.message_data.length(1);
1669 
1670  DDS::Security::ValidationResult_t vr = auth->process_handshake(reply.message_data[0], msg.message_data[0],
1671  dp.handshake_handle_, se);
1672  switch (vr) {
1674  if (DCPS::security_debug.auth_warn) {
1675  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} WARNING: ")
1676  ACE_TEXT("Spdp::handle_handshake_message() - ")
1677  ACE_TEXT("Failed to process incoming handshake message when ")
1678  ACE_TEXT("expecting %C from %C. Security Exception[%d.%d]: %C\n"),
1679  dp.is_requester_ ? "final" : "reply",
1680  DCPS::LogGuid(src_participant).c_str(),
1681  se.code, se.minor_code, se.message.in()));
1682  }
1683  return;
1684  }
1686  if (DCPS::security_debug.auth_warn) {
1687  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} WARNING: Spdp::handle_handshake_message() - ")
1688  ACE_TEXT("Unexpected validation pending retry\n")));
1689  }
1690  return;
1691  }
1693  if (DCPS::security_debug.auth_warn) {
1694  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} WARNING: Spdp::handle_handshake_message() - ")
1695  ACE_TEXT("Unexpected validation pending handshake request\n")));
1696  }
1697  return;
1698  }
1700  // Theoretically, this shouldn't happen unless handshakes can involve more than 3 messages
1701  if (send_handshake_message(src_participant, dp, reply) != DDS::RETCODE_OK) {
1702  if (DCPS::security_debug.auth_warn) {
1703  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} WARNING: Spdp::handle_handshake_message() - ")
1704  ACE_TEXT("Unable to write stateless message for handshake reply.\n")));
1705  }
1706  return;
1707  } else {
1708  if (DCPS::security_debug.auth_debug) {
1709  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - ")
1710  ACE_TEXT("Sent handshake unknown message for participant: %C\n"),
1711  DCPS::LogGuid(src_participant).c_str()));
1712  }
1713  }
1714  return;
1715  }
1718  dp.handshake_state_ = HANDSHAKE_STATE_DONE;
1719  // Install the shared secret before sending the final so that
1720  // we are prepared to receive the crypto tokens from the
1721  // replier.
1722 
1723  // Send the final first because match_authenticated takes forever.
1724  if (send_handshake_message(src_participant, iter->second, reply) != DDS::RETCODE_OK) {
1725  if (DCPS::security_debug.auth_warn) {
1726  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} WARNING: Spdp::handle_handshake_message() - ")
1727  ACE_TEXT("Unable to write stateless message for final message.\n")));
1728  }
1729  return;
1730  } else {
1731  if (DCPS::security_debug.auth_debug) {
1732  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - ")
1733  ACE_TEXT("Sent handshake final for participant: %C\n"),
1734  DCPS::LogGuid(src_participant).c_str()));
1735  }
1736  }
1737 
1739  match_authenticated(src_participant, iter);
1740  return;
1741  }
1744  dp.handshake_state_ = HANDSHAKE_STATE_DONE;
1746  match_authenticated(src_participant, iter);
1747  return;
1748  }
1749  }
1750  }
1751  }
1752 }
#define ACE_DEBUG(X)
DDS::ReturnCode_t send_handshake_message(const DCPS::GUID_t &guid, DiscoveredParticipant &dp, const DDS::Security::ParticipantStatelessMessage &msg)
Definition: Spdp.cpp:1942
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DDS::Security::IdentityHandle identity_handle_
Definition: Spdp.h:623
const string GMCLASSID_SECURITY_AUTH_HANDSHAKE
const ReturnCode_t RETCODE_OK
void set_auth_state(DiscoveredParticipant &dp, AuthState state)
Definition: Spdp.cpp:4764
void purge_handshake_deadlines(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4315
ParticipantGenericMessage ParticipantStatelessMessage
const InstanceHandle_t HANDLE_NIL
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
Handshake concluded or timed out.
Replier should call begin_handshake_reply.
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const EntityId_t ENTITYID_PARTICIPANT
Definition: GuidUtils.h:37
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
Security::SecurityConfig_rch security_config_
Definition: Spdp.h:618
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
DDS::OctetSeq local_participant_data_as_octets() const
Definition: Spdp.cpp:1214
Requester and replier should call process handshake.
sequence< octet > OctetSeq
Definition: DdsDcpsCore.idl:64
DCPS::GUID_t guid_
Definition: Spdp.h:393
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
Definition: MessageTypes.h:84
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
Requester should call begin_handshake_request.
OpenDDS::DCPS::GUID_t source_guid
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
OpenDDS::DCPS::GUID_t destination_participant_guid
bool match_authenticated(const DCPS::GUID_t &guid, DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:1968
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ handle_participant_crypto_tokens()

bool OpenDDS::RTPS::Spdp::handle_participant_crypto_tokens ( const DDS::Security::ParticipantVolatileMessageSecure msg)

Definition at line 1882 of file Spdp.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_GUARD_RETURN, ACE_TEXT(), DDS::Security::SecurityException::code, crypto_handle_, DDS::Security::ParticipantGenericMessage::destination_participant_guid, OpenDDS::DCPS::ENTITYID_PARTICIPANT, guid_, DDS::HANDLE_NIL, LM_DEBUG, LM_ERROR, LM_WARNING, lock_, OpenDDS::DCPS::log_progress(), OpenDDS::DCPS::make_id(), DDS::Security::SecurityException::message, DDS::Security::ParticipantGenericMessage::message_data, DDS::Security::ParticipantGenericMessage::message_identity, DDS::Security::SecurityException::minor_code, participants_, security_config_, OpenDDS::DCPS::security_debug, sedp_, DDS::Security::MessageIdentity::source_guid, and OpenDDS::DCPS::transport_debug.

Referenced by OpenDDS::RTPS::Sedp::received_volatile_message_secure().

1883 {
1884  const GUID_t src_participant = make_id(msg.message_identity.source_guid, DCPS::ENTITYID_PARTICIPANT);
1885 
1886  if (DCPS::security_debug.auth_debug) {
1887  ACE_DEBUG((LM_DEBUG,
1888  ACE_TEXT("(%P|%t) Spdp::handle_participant_crypto_tokens() from %C\n"),
1889  DCPS::LogGuid(src_participant).c_str()));
1890  }
1891 
1892  DDS::Security::SecurityException se = {"", 0, 0};
1893  Security::CryptoKeyExchange_var key_exchange = security_config_->get_crypto_key_exchange();
1894 
1895  // If this message wasn't intended for us, ignore volatile message
1896  if (msg.destination_participant_guid != guid_ || !msg.message_data.length()) {
1897  return false;
1898  }
1899 
1901 
1903  // not configured for RTPS Protection, therefore doesn't support participant crypto tokens
1904  return false;
1905  }
1906 
1907  // If discovery hasn't initialized / validated this participant yet, ignore volatile message
1908  DiscoveredParticipantIter iter = participants_.find(src_participant);
1909  if (iter == participants_.end()) {
1910  if (DCPS::security_debug.auth_warn) {
1911  ACE_DEBUG((LM_WARNING,
1912  ACE_TEXT("(%P|%t) {auth_warn} Spdp::handle_participant_crypto_tokens() - ")
1913  ACE_TEXT("received tokens for undiscovered participant %C. Ignoring.\n"),
1914  DCPS::LogGuid(src_participant).c_str()));
1915  }
1916  return false;
1917  }
1918 
1920  log_progress("participant crypto token", guid_, src_participant, iter->second.discovered_at_.to_monotonic_time());
1921  }
1922 
1923  const DDS::Security::ParticipantCryptoTokenSeq& inboundTokens =
1924  reinterpret_cast<const DDS::Security::ParticipantCryptoTokenSeq&>(msg.message_data);
1925  const DDS::Security::ParticipantCryptoHandle dp_crypto_handle =
1926  sedp_->get_handle_registry()->get_remote_participant_crypto_handle(iter->first);
1927 
1928  if (!key_exchange->set_remote_participant_crypto_tokens(crypto_handle_, dp_crypto_handle, inboundTokens, se)) {
1929  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::handle_participant_crypto_tokens() - ")
1930  ACE_TEXT("Unable to set remote participant crypto tokens with crypto key exchange plugin. ")
1931  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
1932  se.code, se.minor_code, se.message.in()));
1933  return false;
1934  }
1935 
1936  sedp_->process_association_records_i(iter->second);
1937 
1938  return true;
1939 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
OpenDDS_Dcps_Export TransportDebug transport_debug
Definition: debug.cpp:26
const InstanceHandle_t HANDLE_NIL
void OpenDDS_Dcps_Export log_progress(const char *activity, const GUID_t &local, const GUID_t &remote, const MonotonicTime_t &start_time, const GUID_t &reference)
Definition: Logging.cpp:20
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const EntityId_t ENTITYID_PARTICIPANT
Definition: GuidUtils.h:37
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DDS::Security::ParticipantCryptoHandle crypto_handle_
Definition: Spdp.h:625
Security::SecurityConfig_rch security_config_
Definition: Spdp.h:618
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
CryptoTokenSeq ParticipantCryptoTokenSeq
DCPS::GUID_t guid_
Definition: Spdp.h:393
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
OpenDDS::DCPS::GUID_t source_guid
OpenDDS::DCPS::GUID_t destination_participant_guid
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ handle_participant_data()

void OpenDDS::RTPS::Spdp::handle_participant_data ( DCPS::MessageId  id,
const ParticipantData_t pdata,
const DCPS::MonotonicTimePoint now,
const DCPS::SequenceNumber seq,
const ACE_INET_Addr from,
bool  from_sedp 
)

Definition at line 707 of file Spdp.cpp.

References ACE_DEBUG, ACE_GUARD, ACE_TEXT(), DDS::Security::ParticipantSecurityAttributes::allow_unauthenticated_participants, attempt_authentication(), OpenDDS::RTPS::AUTH_STATE_AUTHENTICATED, OpenDDS::RTPS::AUTH_STATE_UNAUTHENTICATED, DDS::Security::ParticipantBuiltinTopicDataSecure::base, bit_subscriber_, OpenDDS::DCPS::LogAddr::c_str(), config_, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::Security::SPDPdiscoveredParticipantData::ddsParticipantDataSecure, OpenDDS::Security::SPDPdiscoveredParticipantData::discoveredAt, OpenDDS::DCPS::DISPOSE_INSTANCE, OpenDDS::DCPS::DISPOSE_UNREGISTER_INSTANCE, enqueue_location_update_i(), DDS::Security::ParticipantBuiltinTopicData::extended_builtin_endpoints, guid(), guid_, OpenDDS::DCPS::guid_to_bit_key(), OpenDDS::RTPS::ParticipantProxy_t::guidPrefix, DDS::HANDLE_NIL, ice_agent_, DDS::Security::ParticipantBuiltinTopicData::identity_token, initialized_flag_, is_security_enabled(), OpenDDS::Security::SPDPdiscoveredParticipantData::leaseDuration, LM_DEBUG, OpenDDS::RTPS::locators_changed(), lock_, OpenDDS::DCPS::log_progress(), OpenDDS::DCPS::make_part_guid(), match_authenticated(), match_unauthenticated(), n_participants_in_authentication_, DDS::NEW_VIEW_STATE, DDS::NOT_NEW_VIEW_STATE, OpenDDS::RTPS::ParticipantProxy_t::opendds_rtps_relay_application_participant, participant_sec_attr_, OpenDDS::Security::SPDPdiscoveredParticipantData::participantProxy, participants_, DDS::Security::ParticipantBuiltinTopicData::permissions_token, process_location_updates_i(), DDS::Security::ParticipantBuiltinTopicData::property, purge_discovered_participant(), purge_handshake_deadlines(), ACE_Time_Value::sec(), OpenDDS::RTPS::Duration_t::seconds, secure_part_user_data(), OpenDDS::DCPS::security_debug, DDS::Security::ParticipantBuiltinTopicData::security_info, sedp_, OpenDDS::RTPS::Spdp::SpdpTransport::SEND_DIRECT, OpenDDS::RTPS::Spdp::SpdpTransport::SEND_RELAY, set_auth_state(), shutdown_flag_, stop_ice(), OpenDDS::DCPS::TimeDuration::str(), tport_, OpenDDS::DCPS::transport_debug, update_lease_expiration_i(), update_rtps_relay_application_participant_i(), validateSequenceNumber(), OpenDDS::DCPS::TimeDuration::value(), and OpenDDS::DCPS::TimeDuration::zero_value.

Referenced by data_received(), and OpenDDS::RTPS::Sedp::DiscoveryReader::data_received_i().

713 {
714  // Make a (non-const) copy so we can tweak values below
715  ParticipantData_t pdata(cpdata);
716 
717  const GUID_t guid = DCPS::make_part_guid(pdata.participantProxy.guidPrefix);
718 
720 
722  return;
723  }
724 
725  if (sedp_->ignoring(guid)) {
726  // Ignore, this is our domain participant or one that the user has
727  // asked us to ignore.
728  return;
729  }
730 
731  const bool relay_in_use = (config_->rtps_relay_only() || config_->use_rtps_relay());
732  const bool from_relay = relay_in_use && (from == config_->spdp_rtps_relay_address());
733 
734 #ifndef DDS_HAS_MINIMUM_BIT
735  const DCPS::ParticipantLocation location_mask = compute_location_mask(from, from_relay);
736 #endif
737 
738  // Don't trust SPDP for the RtpsRelay application participant.
739  // Otherwise, anyone can reset the application participant.
740 #ifdef OPENDDS_SECURITY
741  if (is_security_enabled() && !from_sedp) {
742  pdata.participantProxy.opendds_rtps_relay_application_participant = false;
743  }
744 #endif
745 
746  // Find the participant - iterator valid only as long as we hold the lock
747  DiscoveredParticipantIter iter = participants_.find(guid);
748 
749  if (iter == participants_.end()) {
750  // Trying to delete something that doesn't exist is a NOOP
752  return;
753  }
754 
755 #ifdef OPENDDS_SECURITY
756  if (config_->max_participants_in_authentication() &&
757  n_participants_in_authentication_ >= config_->max_participants_in_authentication()) {
758  if (DCPS::security_debug.auth_debug) {
759  ACE_DEBUG((LM_DEBUG,
760  "(%P|%t) {auth_debug} DEBUG: Spdp::handle_participant_data - participants_in_authentication: %B >= max: %B\n",
761  n_participants_in_authentication_, config_->max_participants_in_authentication()));
762  }
763  return;
764  }
765 #endif
766 
767  partBitData(pdata).key = guid_to_bit_key(guid);
768 
769  TimeDuration effective_lease(pdata.leaseDuration.seconds);
770 
772  ACE_DEBUG((LM_DEBUG,
773  ACE_TEXT("(%P|%t) Spdp::handle_participant_data - %C discovered %C lease %C from %C (%B)\n"),
774  DCPS::LogGuid(guid_).c_str(), DCPS::LogGuid(guid).c_str(),
775  effective_lease.str(0).c_str(), DCPS::LogAddr(from).c_str(),
776  participants_.size()));
777  }
778 
779  if (!from_sedp) {
780 #ifdef OPENDDS_SECURITY
781  if (is_security_enabled()) {
782  effective_lease = config_->security_unsecure_lease_duration();
783  } else {
784 #endif
785  const TimeDuration maxLeaseDuration = config_->max_lease_duration();
786  if (maxLeaseDuration && effective_lease > maxLeaseDuration) {
787  if (DCPS::DCPS_debug_level >= 2) {
788  ACE_DEBUG((LM_DEBUG,
789  ACE_TEXT("(%P|%t) Spdp::handle_participant_data - overwriting %C lease %C from %C with %C\n"),
790  DCPS::LogGuid(guid).c_str(), effective_lease.str(0).c_str(),
791  DCPS::LogAddr(from).c_str(), maxLeaseDuration.str(0).c_str()));
792  }
793  effective_lease = maxLeaseDuration;
794  }
795 #ifdef OPENDDS_SECURITY
796  }
797 #endif
798  }
799 
800  pdata.leaseDuration.seconds = static_cast<ACE_CDR::Long>(effective_lease.value().sec());
801 
802  if (tport_->directed_send_task_) {
803  if (tport_->directed_guids_.empty()) {
804  tport_->directed_send_task_->schedule(TimeDuration::zero_value);
805  }
806  tport_->directed_guids_.push_back(guid);
807  }
808 
809  // add a new participant
810 
811 #ifdef OPENDDS_SECURITY
812  std::pair<DiscoveredParticipantIter, bool> p = participants_.insert(std::make_pair(guid, DiscoveredParticipant(pdata, seq, config_->auth_resend_period())));
814  if (DCPS::security_debug.auth_debug) {
815  ACE_DEBUG((LM_DEBUG,
816  "(%P|%t) {auth_debug} DEBUG: Spdp::handle_participant_data() %B participants in authentication\n",
818  }
819 #else
820  std::pair<DiscoveredParticipantIter, bool> p = participants_.insert(std::make_pair(guid, DiscoveredParticipant(pdata, seq, TimeDuration())));
821 #endif
822  iter = p.first;
823  iter->second.discovered_at_ = now;
824  update_lease_expiration_i(iter, now);
826 
827  if (!from_relay && from != ACE_INET_Addr()) {
828  iter->second.last_recv_address_ = from;
829  }
830 
832  log_progress("participant discovery", guid_, guid, iter->second.discovered_at_.to_monotonic_time());
833  }
834 
835 #ifndef DDS_HAS_MINIMUM_BIT
836  if (!from_sedp) {
837  enqueue_location_update_i(iter, location_mask, from, "new participant");
838  }
839 #endif
840 
841  sedp_->associate(iter->second
842 #ifdef OPENDDS_SECURITY
844 #endif
845  );
846 
847  // Since we've just seen a new participant, let's send out our
848  // own announcement, so they don't have to wait.
849  if (from != ACE_INET_Addr()) {
850  if (from_relay) {
851  tport_->write_i(guid, iter->second.last_recv_address_, SpdpTransport::SEND_RELAY);
852  } else {
853  tport_->shorten_local_sender_delay_i();
854  }
855  }
856 
857 #ifdef OPENDDS_SECURITY
858  if (is_security_enabled()) {
859  if (!iter->second.has_security_data()) {
861  if (DCPS::security_debug.auth_debug) {
862  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} Spdp::handle_participant_data - ")
863  ACE_TEXT("Incompatible security attributes in discovered participant: %C\n"),
864  DCPS::LogGuid(guid).c_str()));
865  }
866  // FUTURE: This is probably not a good idea since it will just get rediscovered.
868  participants_.erase(iter);
869  iter = participants_.end();
870  } else { // allow_unauthenticated_participants == true
872  match_unauthenticated(iter);
873  }
874  } else {
875  iter->second.identity_token_ = pdata.ddsParticipantDataSecure.base.identity_token;
876  iter->second.permissions_token_ = pdata.ddsParticipantDataSecure.base.permissions_token;
877  iter->second.property_qos_ = pdata.ddsParticipantDataSecure.base.property;
878  iter->second.security_info_ = pdata.ddsParticipantDataSecure.base.security_info;
879  iter->second.extended_builtin_endpoints_ = pdata.ddsParticipantDataSecure.base.extended_builtin_endpoints;
880 
881  // The remote needs to see our SPDP before attempting authentication.
882  tport_->write_i(guid, iter->second.last_recv_address_, from_relay ? SpdpTransport::SEND_RELAY : SpdpTransport::SEND_DIRECT);
883 
884  attempt_authentication(iter, true);
885 
886  if (iter->second.auth_state_ == AUTH_STATE_UNAUTHENTICATED) {
888  if (DCPS::security_debug.auth_debug) {
889  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} Spdp::handle_participant_data - ")
890  ACE_TEXT("Incompatible security attributes in discovered participant: %C\n"),
891  DCPS::LogGuid(guid).c_str()));
892  }
894  participants_.erase(iter);
895  iter = participants_.end();
896  } else { // allow_unauthenticated_participants == true
898  match_unauthenticated(iter);
899  }
900  } else if (iter->second.auth_state_ == AUTH_STATE_AUTHENTICATED) {
901  if (!match_authenticated(guid, iter)) {
903  participants_.erase(iter);
904  iter = participants_.end();
905  }
906  }
907  // otherwise just return, since we're waiting for input to finish authentication
908  }
909  } else {
911  match_unauthenticated(iter);
912  }
913 #else
914  match_unauthenticated(iter);
915 #endif
916 
917  } else { // Existing Participant
918  if (from_sedp && DCPS::transport_debug.log_progress) {
919  log_progress("secure participant discovery", guid_, guid, iter->second.discovered_at_.to_monotonic_time());
920  }
921 
922 #ifndef DDS_HAS_MINIMUM_BIT
923  if (!from_sedp) {
924  enqueue_location_update_i(iter, location_mask, from, "existing participant");
925  }
926 #endif
927 #ifdef OPENDDS_SECURITY
928  // Non-secure updates for authenticated participants are used for liveliness but
929  // are otherwise ignored. Non-secure dispose messages are ignored completely.
930  if (is_security_enabled() && iter->second.auth_state_ == AUTH_STATE_AUTHENTICATED && !from_sedp) {
931  update_lease_expiration_i(iter, now);
932  if (!from_relay && from != ACE_INET_Addr()) {
933  iter->second.last_recv_address_ = from;
934  }
935 #ifndef DDS_HAS_MINIMUM_BIT
936  process_location_updates_i(iter, "non-secure liveliness");
937 #endif
938  return;
939  }
940 #endif
941 
943 #ifdef OPENDDS_SECURITY
944  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
945  if (sedp_endpoint) {
946  stop_ice(sedp_endpoint, iter->first, iter->second.pdata_.participantProxy.availableBuiltinEndpoints,
947  iter->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
948  }
949  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint = tport_->get_ice_endpoint();
950  if (spdp_endpoint) {
951  ice_agent_->stop_ice(spdp_endpoint, guid_, iter->first);
952  }
954 #endif
955 #ifndef DDS_HAS_MINIMUM_BIT
956  process_location_updates_i(iter, "dispose/unregister");
957 #endif
958  if (iter != participants_.end()) {
960  participants_.erase(iter);
961  }
962  return;
963  }
964 
965  // Check if sequence numbers are increasing
966  if (validateSequenceNumber(now, seq, iter)) {
967  // update an existing participant
968  DDS::ParticipantBuiltinTopicData& pdataBit = partBitData(pdata);
969  DDS::ParticipantBuiltinTopicData& discoveredBit = partBitData(iter->second.pdata_);
970  pdataBit.key = discoveredBit.key;
971 
972 #ifndef OPENDDS_SAFETY_PROFILE
973  using DCPS::operator!=;
974 #endif
975  if (discoveredBit.user_data != pdataBit.user_data ||
976  (from_sedp && iter->second.bit_ih_ == DDS::HANDLE_NIL)) {
977  discoveredBit.user_data = pdataBit.user_data;
978 
979  // If secure user data, this is the first time we should be
980  // seeing the real user data.
981  iter->second.bit_ih_ = bit_subscriber_->add_participant(pdataBit, secure_part_user_data() ? DDS::NEW_VIEW_STATE : DDS::NOT_NEW_VIEW_STATE);
982  }
983  if (locators_changed(iter->second.pdata_.participantProxy, pdata.participantProxy)) {
984  sedp_->update_locators(pdata);
985  }
986  const DCPS::MonotonicTime_t da = iter->second.pdata_.discoveredAt;
987  iter->second.pdata_ = pdata;
988  iter->second.pdata_.discoveredAt = da;
989  update_lease_expiration_i(iter, now);
991  if (!from_relay && from != ACE_INET_Addr()) {
992  iter->second.last_recv_address_ = from;
993  }
994 
995 #ifndef DDS_HAS_MINIMUM_BIT
996  /*
997  * If secure user data, force update location bit because we just gave
998  * the first data on the participant. Readers might have been ignoring
999  * location samples on the participant until now.
1000  */
1001  process_location_updates_i(iter, "valid SPDP", secure_part_user_data());
1002 #endif
1003  // Else a reset has occurred and check if we should remove the participant
1004  } else if (iter->second.seq_reset_count_ >= config_->max_spdp_sequence_msg_reset_check()) {
1005 #ifdef OPENDDS_SECURITY
1007 #endif
1008 #ifndef DDS_HAS_MINIMUM_BIT
1009  process_location_updates_i(iter, "reset");
1010 #endif
1011  if (iter != participants_.end()) {
1013  participants_.erase(iter);
1014  }
1015  return;
1016  }
1017  }
1018 
1019 #ifndef DDS_HAS_MINIMUM_BIT
1020  if (iter != participants_.end()) {
1021  process_location_updates_i(iter, "catch all");
1022  }
1023 #endif
1024 }
static const WriteFlags SEND_DIRECT
Definition: Spdp.h:435
#define ACE_DEBUG(X)
Security::SPDPdiscoveredParticipantData ParticipantData_t
#define ACE_GUARD(MUTEX, OBJ, LOCK)
OpenDDS_Dcps_Export TransportDebug transport_debug
Definition: debug.cpp:26
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
Definition: Spdp.h:632
bool validateSequenceNumber(const DCPS::MonotonicTimePoint &now, const DCPS::SequenceNumber &seq, DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:1027
bool secure_part_user_data() const
Definition: Spdp.cpp:4597
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
void set_auth_state(DiscoveredParticipant &dp, AuthState state)
Definition: Spdp.cpp:4764
void purge_handshake_deadlines(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4315
bool locators_changed(const ParticipantProxy_t &x, const ParticipantProxy_t &y)
Definition: Sedp.cpp:5982
const ViewStateKind NEW_VIEW_STATE
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
Definition: Spdp.h:379
const InstanceHandle_t HANDLE_NIL
size_t n_participants_in_authentication_
Definition: Spdp.h:648
static const WriteFlags SEND_RELAY
Definition: Spdp.h:434
static const TimeDuration zero_value
Definition: TimeDuration.h:31
void stop_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
Definition: Spdp.cpp:3987
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4673
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:457
bool is_security_enabled() const
Definition: Spdp.h:159
void update_rtps_relay_application_participant_i(DiscoveredParticipantIter iter, bool new_participant)
Definition: Spdp.cpp:2738
void OpenDDS_Dcps_Export log_progress(const char *activity, const GUID_t &local, const GUID_t &remote, const MonotonicTime_t &start_time, const GUID_t &reference)
Definition: Logging.cpp:20
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
void update_lease_expiration_i(DiscoveredParticipantIter iter, const DCPS::MonotonicTimePoint &now)
Definition: Spdp.cpp:3694
const ViewStateKind NOT_NEW_VIEW_STATE
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
unsigned long ParticipantLocation
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
void match_unauthenticated(const DiscoveredParticipantIter &dp_iter)
Definition: Spdp.cpp:1123
OpenDDS_Dcps_Export DDS::BuiltinTopicKey_t guid_to_bit_key(const GUID_t &guid)
Definition: GuidUtils.h:243
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
ACE_INT32 Long
void attempt_authentication(const DiscoveredParticipantIter &iter, bool from_discovery)
Definition: Spdp.cpp:1333
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:471
DCPS::GUID_t guid_
Definition: Spdp.h:393
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
bool match_authenticated(const DCPS::GUID_t &guid, DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:1968

◆ has_discovered_participant()

bool OpenDDS::RTPS::Spdp::has_discovered_participant ( const DCPS::GUID_t guid) const

Definition at line 3666 of file Spdp.cpp.

References participants_.

Referenced by OpenDDS::RTPS::Sedp::data_received(), has_domain_participant(), and OpenDDS::RTPS::Sedp::received_participant_message_data_secure().

3667 {
3668  return participants_.find(guid) != participants_.end();
3669 }
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ has_domain_participant()

bool OpenDDS::RTPS::Spdp::has_domain_participant ( const GUID_t ignoreId) const

Definition at line 4652 of file Spdp.cpp.

References ACE_GUARD_RETURN, has_discovered_participant(), and lock_.

4653 {
4655  return has_discovered_participant(remote);
4656 }
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
bool has_discovered_participant(const DCPS::GUID_t &guid) const
Definition: Spdp.cpp:3666

◆ ignore_domain_participant()

void OpenDDS::RTPS::Spdp::ignore_domain_participant ( const GUID_t ignoreId)

Definition at line 4622 of file Spdp.cpp.

References ACE_GUARD, endpoint_manager(), OpenDDS::RTPS::Sedp::ignore(), lock_, participants_, and purge_discovered_participant().

4623 {
4625  endpoint_manager().ignore(ignoreId);
4626 
4627  DiscoveredParticipantIter iter = participants_.find(ignoreId);
4628  if (iter != participants_.end()) {
4630  participants_.erase(iter);
4631  }
4632 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4673
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
Sedp & endpoint_manager()
Definition: Spdp.h:354
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
void ignore(const GUID_t &to_ignore)
Definition: Sedp.cpp:5988

◆ ignore_publication()

void OpenDDS::RTPS::Spdp::ignore_publication ( const GUID_t ignoreId)
inline

Definition at line 277 of file Spdp.h.

References ACE_GUARD, and lock_.

278  {
280  return endpoint_manager().ignore(ignoreId);
281  }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
Sedp & endpoint_manager()
Definition: Spdp.h:354
void ignore(const GUID_t &to_ignore)
Definition: Sedp.cpp:5988

◆ ignore_subscription()

void OpenDDS::RTPS::Spdp::ignore_subscription ( const GUID_t ignoreId)
inline

Definition at line 317 of file Spdp.h.

References ACE_GUARD, and lock_.

318  {
320  return endpoint_manager().ignore(ignoreId);
321  }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
Sedp & endpoint_manager()
Definition: Spdp.h:354
void ignore(const GUID_t &to_ignore)
Definition: Sedp.cpp:5988

◆ ignore_topic()

void OpenDDS::RTPS::Spdp::ignore_topic ( const GUID_t ignoreId)
inline

Definition at line 249 of file Spdp.h.

References ACE_GUARD, and lock_.

250  {
252  endpoint_manager().ignore(ignoreId);
253  }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
Sedp & endpoint_manager()
Definition: Spdp.h:354
void ignore(const GUID_t &to_ignore)
Definition: Sedp.cpp:5988

◆ init()

void OpenDDS::RTPS::Spdp::init ( DDS::DomainId_t  domain,
DCPS::GUID_t guid,
const DDS::DomainParticipantQos qos,
XTypes::TypeLookupService_rch  tls 
)
private

Definition at line 132 of file Spdp.cpp.

References available_builtin_endpoints_, available_extended_builtin_endpoints_, OpenDDS::RTPS::BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER, DDS::Security::BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER, DDS::Security::BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER, DDS::Security::BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER, DDS::Security::BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER, DDS::Security::BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER, DDS::Security::BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER, config_, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR, guid_, is_application_participant_, is_security_enabled(), DDS::Property_t::name, OpenDDS::RTPS::PFLAGS_REFLECT_HEARTBEAT_COUNT, DDS::DomainParticipantQos::property, OpenDDS::RTPS::RTPS_DISCOVERY_ENDPOINT_ANNOUNCEMENTS, OpenDDS::RTPS::RTPS_DISCOVERY_TYPE_LOOKUP_SERVICE, OpenDDS::RTPS::RTPS_REFLECT_HEARTBEAT_COUNT, OpenDDS::RTPS::RTPS_RELAY_APPLICATION_PARTICIPANT, sedp_, DDS::Security::SEDP_BUILTIN_PUBLICATIONS_SECURE_READER, DDS::Security::SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER, DDS::Security::SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER, DDS::Security::SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER, DDS::Security::SPDP_BUILTIN_PARTICIPANT_SECURE_READER, DDS::Security::SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER, type_lookup_service_, DDS::Security::TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE, and DDS::PropertyQosPolicy::value.

Referenced by Spdp().

136 {
137  type_lookup_service_ = tls;
138 
139  bool enable_endpoint_announcements = true;
140  bool enable_type_lookup_service = config_->use_xtypes();
141 
142  const DDS::PropertySeq& properties = qos.property.value;
143  for (unsigned int idx = 0; idx != properties.length(); ++idx) {
144  const DDS::Property_t& prop = properties[idx];
145  if (std::strcmp(RTPS_DISCOVERY_ENDPOINT_ANNOUNCEMENTS, prop.name.in()) == 0) {
146  enable_endpoint_announcements = prop_to_bool(prop);
147  } else if (std::strcmp(RTPS_DISCOVERY_TYPE_LOOKUP_SERVICE, prop.name.in()) == 0) {
148  enable_type_lookup_service = prop_to_bool(prop);
149  } else if (std::strcmp(RTPS_RELAY_APPLICATION_PARTICIPANT, prop.name.in()) == 0) {
150  is_application_participant_ = prop_to_bool(prop);
151  } else if (std::strcmp(RTPS_REFLECT_HEARTBEAT_COUNT, prop.name.in()) == 0) {
152  const CORBA::ULong old_flags = config_->participant_flags();
153  const CORBA::ULong new_flags = prop_to_bool(prop) ? (old_flags | PFLAGS_REFLECT_HEARTBEAT_COUNT) : (old_flags & ~PFLAGS_REFLECT_HEARTBEAT_COUNT);
154  config_->participant_flags(new_flags);
155  }
156  }
157 
164 
165  if (enable_endpoint_announcements) {
170  }
171 
172  if (enable_type_lookup_service) {
178  }
179 
180 #ifdef OPENDDS_SECURITY
181  if (is_security_enabled()) {
182  using namespace DDS::Security;
183 
194 
195  if (enable_endpoint_announcements) {
200  }
201 
202  if (enable_type_lookup_service) {
208  }
209  }
210 #endif
211 
212  guid = guid_; // may have changed in SpdpTransport constructor
213  sedp_->ignore(guid);
214 }
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER
Definition: RtpsCore.idl:217
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER
const OpenDDSParticipantFlagsBits_t PFLAGS_REFLECT_HEARTBEAT_COUNT
Definition: RtpsCore.idl:324
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER
bool is_application_participant_
Definition: Spdp.h:395
const char RTPS_RELAY_APPLICATION_PARTICIPANT[]
Definition: RtpsDiscovery.h:42
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE
const char RTPS_DISCOVERY_ENDPOINT_ANNOUNCEMENTS[]
Definition: RtpsDiscovery.h:40
sequence< Property_t > PropertySeq
Definition: DdsDcpsCore.idl:87
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
XTypes::TypeLookupService_rch type_lookup_service_
Definition: Spdp.h:389
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER
Definition: RtpsCore.idl:197
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE
const char RTPS_REFLECT_HEARTBEAT_COUNT[]
Definition: RtpsDiscovery.h:43
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_READER
bool is_security_enabled() const
Definition: Spdp.h:159
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER
Definition: RtpsCore.idl:219
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER
Definition: RtpsCore.idl:226
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER
Definition: RtpsCore.idl:201
const char RTPS_DISCOVERY_TYPE_LOOKUP_SERVICE[]
Definition: RtpsDiscovery.h:41
ACE_CDR::ULong ULong
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR
Definition: RtpsCore.idl:203
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER
Definition: RtpsCore.idl:224
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints_
Definition: Spdp.h:617
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR
Definition: RtpsCore.idl:207
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER
Definition: RtpsCore.idl:205
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER
Definition: RtpsCore.idl:222
BuiltinEndpointSet_t available_builtin_endpoints_
Definition: Spdp.h:605
DCPS::GUID_t guid_
Definition: Spdp.h:393
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR
Definition: RtpsCore.idl:199
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER
Definition: RtpsCore.idl:228
PropertyQosPolicy property
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE

◆ init_bit()

void OpenDDS::RTPS::Spdp::init_bit ( RcHandle< DCPS::BitSubscriber bit_subscriber)

Definition at line 2152 of file Spdp.cpp.

References bit_subscriber_, disco_, domain_, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER, guid_, ice_agent_, initialized_flag_, OpenDDS::DCPS::make_id(), OPENDDS_ASSERT, OpenDDS::DCPS::rchandle_from(), sedp_, tport_, and type_lookup_service_.

2153 {
2154  OPENDDS_ASSERT(bit_subscriber);
2155 
2156  bit_subscriber_ = bit_subscriber;
2157 
2158  // Defer initilization until we have the bit subscriber.
2160  tport_->open(sedp_->reactor_task(), sedp_->job_queue());
2161 
2162 #ifdef OPENDDS_SECURITY
2163  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
2164  if (sedp_endpoint) {
2166  ice_agent_->add_local_agent_info_listener(sedp_endpoint, l, DCPS::static_rchandle_cast<AgentInfoListener>(rchandle_from(this)));
2167  }
2168 #endif
2169 
2170  initialized_flag_ = true;
2171  tport_->enable_periodic_tasks();
2172 }
RtpsDiscovery * disco_
Definition: Spdp.h:383
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
const DDS::DomainId_t domain_
Definition: Spdp.h:392
XTypes::TypeLookupService_rch type_lookup_service_
Definition: Spdp.h:389
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
Definition: Spdp.h:379
#define OPENDDS_ASSERT(C)
Definition: Definitions.h:66
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310
DCPS::GUID_t guid_
Definition: Spdp.h:393
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER
Definition: GuidUtils.h:41
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ initialized()

bool OpenDDS::RTPS::Spdp::initialized ( void  )
inline

Definition at line 110 of file Spdp.h.

References shutdown().

Referenced by OpenDDS::RTPS::Sedp::data_received().

111  {
112  return initialized_flag_;
113  }
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598

◆ is_expectant_opendds()

bool OpenDDS::RTPS::Spdp::is_expectant_opendds ( const GUID_t participant) const

Definition at line 2188 of file Spdp.cpp.

References participants_, and OpenDDS::RTPS::PFLAGS_NO_ASSOCIATED_WRITERS.

Referenced by OpenDDS::RTPS::Sedp::is_expectant_opendds().

2189 {
2190  const DiscoveredParticipantConstIter iter = participants_.find(participant);
2191  if (iter == participants_.end()) {
2192  return false;
2193  }
2194  return is_opendds(iter->second.pdata_.participantProxy) &&
2195  (iter->second.pdata_.participantProxy.opendds_participant_flags.bits & PFLAGS_NO_ASSOCIATED_WRITERS) == 0;
2196 }
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
const OpenDDSParticipantFlagsBits_t PFLAGS_NO_ASSOCIATED_WRITERS
Definition: RtpsCore.idl:321
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ is_security_enabled()

bool OpenDDS::RTPS::Spdp::is_security_enabled ( ) const
inline

◆ local_participant_data_as_octets()

DDS::OctetSeq OpenDDS::RTPS::Spdp::local_participant_data_as_octets ( ) const

Definition at line 1214 of file Spdp.cpp.

References ACE_ERROR, ACE_TEXT(), DDS::Security::ParticipantBuiltinTopicDataSecure::base, OpenDDS::DCPS::DCPS_debug_level, DDS::Security::ParticipantBuiltinTopicData::extended_builtin_endpoints, get_part_bit_data(), guid_, identity_status_token_, identity_token_, DDS::Security::ParticipantSecurityAttributes::is_discovery_protected, DDS::Security::ParticipantSecurityAttributes::is_liveliness_protected, DDS::Security::ParticipantSecurityAttributes::is_rtps_protected, ACE_Message_Block::length(), LM_ERROR, participant_sec_attr_, DDS::Security::ParticipantSecurityInfo::participant_security_attributes, DDS::Security::PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_DISCOVERY_PROTECTED, DDS::Security::PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_PROTECTED, DDS::Security::PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_RTPS_PROTECTED, DDS::Security::PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_VALID, permissions_token_, DDS::Security::ParticipantSecurityAttributes::plugin_participant_attributes, DDS::Security::ParticipantSecurityInfo::plugin_participant_security_attributes, DDS::DomainParticipantQos::property, qos_, ACE_Message_Block::rd_ptr(), DDS::Security::ParticipantBuiltinTopicData::security_info, OpenDDS::DCPS::serialized_size(), OpenDDS::RTPS::ParameterListConverter::to_param_list(), DDS::Security::TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE, and DDS::Security::TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE.

Referenced by handle_handshake_message(), and send_handshake_request().

1215 {
1217  {
1218  get_part_bit_data(false),
1221  qos_.property,
1222  {0, 0},
1223  0
1224  },
1226  };
1227 
1232  }
1238  }
1241  }
1242 
1243  ParameterList plist;
1244  set_participant_guid(guid_, plist);
1245 
1246  if (!ParameterListConverter::to_param_list(pbtds.base, plist)) {
1247  if (DCPS::DCPS_debug_level > 0) {
1248  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::local_participant_data_as_octets() - ")
1249  ACE_TEXT("Failed to convert from ParticipantBuiltinTopicData to ParameterList\n")));
1250  }
1251  return DDS::OctetSeq();
1252  }
1253 
1254  ACE_Message_Block temp_buff(DCPS::serialized_size(encoding_plain_big, plist));
1255  DCPS::Serializer ser(&temp_buff, encoding_plain_big);
1256  if (!(ser << plist)) {
1257  if (DCPS::DCPS_debug_level > 0) {
1258  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::local_participant_data_as_octets() - ")
1259  ACE_TEXT("Failed to serialize parameter list.\n")));
1260  }
1261  return DDS::OctetSeq();
1262  }
1263 
1264  DDS::OctetSeq seq(static_cast<unsigned int>(temp_buff.length()));
1265  seq.length(seq.maximum());
1266  std::memcpy(seq.get_buffer(), temp_buff.rd_ptr(), temp_buff.length());
1267  return seq;
1268 }
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE
#define ACE_ERROR(X)
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
Definition: Spdp.h:632
DDS::ParticipantBuiltinTopicData get_part_bit_data(bool secure) const
Definition: Spdp.cpp:4606
DDS::Security::PermissionsToken permissions_token_
Definition: Spdp.h:629
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE
const ParticipantSecurityAttributesMask PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_RTPS_PROTECTED
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE
ExtendedBuiltinEndpointSet_t extended_builtin_endpoints
bool to_param_list(const DDS::ParticipantBuiltinTopicData &pbtd, ParameterList &param_list)
DDS::DomainParticipantQos qos_
Definition: Spdp.h:380
const ParticipantSecurityAttributesMask PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_PROTECTED
const ParticipantSecurityAttributesMask PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_VALID
DDS::Security::IdentityStatusToken identity_status_token_
Definition: Spdp.h:628
void serialized_size(const Encoding &encoding, size_t &size, const SequenceNumber &)
DDS::Security::IdentityToken identity_token_
Definition: Spdp.h:627
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
sequence< Parameter > ParameterList
ACE_TEXT("TCP_Factory")
PluginParticipantSecurityAttributesMask plugin_participant_security_attributes
sequence< octet > OctetSeq
Definition: DdsDcpsCore.idl:64
DCPS::GUID_t guid_
Definition: Spdp.h:393
ParticipantSecurityAttributesMask participant_security_attributes
const ParticipantSecurityAttributesMask PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_DISCOVERY_PROTECTED
PropertyQosPolicy property
PluginParticipantSecurityAttributesMask plugin_participant_attributes
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE

◆ lookup_participant_auth_state()

AuthState OpenDDS::RTPS::Spdp::lookup_participant_auth_state ( const GUID_t id) const

Definition at line 3833 of file Spdp.cpp.

References OpenDDS::RTPS::AUTH_STATE_HANDSHAKE, lock_, and participants_.

Referenced by OpenDDS::RTPS::Sedp::process_discovered_reader_data(), and OpenDDS::RTPS::Sedp::process_discovered_writer_data().

3834 {
3837  if (pi != participants_.end()) {
3838  return pi->second.auth_state_;
3839  }
3840  return AUTH_STATE_HANDSHAKE;
3841 }
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ lookup_participant_crypto_info()

Spdp::ParticipantCryptoInfoPair OpenDDS::RTPS::Spdp::lookup_participant_crypto_info ( const DCPS::GUID_t id) const

Definition at line 3766 of file Spdp.cpp.

References DDS::HANDLE_NIL, participants_, and sedp_.

Referenced by OpenDDS::RTPS::Sedp::generate_remote_matched_reader_crypto_handle(), and OpenDDS::RTPS::Sedp::generate_remote_matched_writer_crypto_handle().

3767 {
3768  ParticipantCryptoInfoPair result = ParticipantCryptoInfoPair(DDS::HANDLE_NIL, DDS::Security::SharedSecretHandle_var());
3769 
3771  if (pi != participants_.end()) {
3772  result.first = sedp_->get_handle_registry()->get_remote_participant_crypto_handle(id);
3773  result.second = pi->second.shared_secret_handle_;
3774  }
3775  return result;
3776 }
const InstanceHandle_t HANDLE_NIL
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
std::pair< DDS::Security::ParticipantCryptoHandle, DDS::Security::SharedSecretHandle_var > ParticipantCryptoInfoPair
Definition: Spdp.h:165
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ lookup_participant_permissions()

DDS::Security::PermissionsHandle OpenDDS::RTPS::Spdp::lookup_participant_permissions ( const DCPS::GUID_t id) const

Definition at line 3821 of file Spdp.cpp.

References DDS::HANDLE_NIL, lock_, and participants_.

Referenced by OpenDDS::RTPS::Sedp::process_discovered_reader_data(), and OpenDDS::RTPS::Sedp::process_discovered_writer_data().

3822 {
3824 
3827  if (pi != participants_.end()) {
3828  result = pi->second.permissions_handle_;
3829  }
3830  return result;
3831 }
const InstanceHandle_t HANDLE_NIL
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ match_authenticated()

bool OpenDDS::RTPS::Spdp::match_authenticated ( const DCPS::GUID_t guid,
DiscoveredParticipantIter iter 
)
private

Definition at line 1968 of file Spdp.cpp.

References access(), ACE_DEBUG, ACE_TEXT(), DDS::Security::SecurityException::code, crypto_handle_, domain_, guid_, DDS::HANDLE_NIL, identity_handle_, DDS::Security::ParticipantSecurityAttributes::is_access_protected, LM_DEBUG, LM_WARNING, OpenDDS::DCPS::log_progress(), DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, participant_sec_attr_, process_location_updates_i(), security_config_, OpenDDS::DCPS::security_debug, sedp_, and OpenDDS::DCPS::transport_debug.

Referenced by handle_handshake_message(), and handle_participant_data().

1969 {
1970  if (iter->second.handshake_handle_ == DDS::HANDLE_NIL) {
1971  return true;
1972  }
1973 
1974  DDS::Security::SecurityException se = {"", 0, 0};
1975 
1976  Security::Authentication_var auth = security_config_->get_authentication();
1977  Security::AccessControl_var access = security_config_->get_access_control();
1978  Security::CryptoKeyFactory_var key_factory = security_config_->get_crypto_key_factory();
1979  Security::CryptoKeyExchange_var key_exchange = security_config_->get_crypto_key_exchange();
1980  Security::HandleRegistry_rch handle_registry = security_config_->get_handle_registry(guid_);
1981 
1982  if (iter->second.shared_secret_handle_ != 0) {
1983  // Return the shared secret.
1984  if (!auth->return_sharedsecret_handle(iter->second.shared_secret_handle_, se)) {
1985  if (DCPS::security_debug.auth_warn) {
1986  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
1987  ACE_TEXT("Spdp::match_authenticated() - ")
1988  ACE_TEXT("Unable to return shared secret handle. Security Exception[%d.%d]: %C\n"),
1989  se.code, se.minor_code, se.message.in()));
1990  }
1991  return false;
1992  }
1993 
1994  // Get the new shared secret.
1995  iter->second.shared_secret_handle_ = auth->get_shared_secret(iter->second.handshake_handle_, se);
1996  if (iter->second.shared_secret_handle_ == 0) {
1997  if (DCPS::security_debug.auth_warn) {
1998  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
1999  ACE_TEXT("Spdp::match_authenticated() - ")
2000  ACE_TEXT("Unable to get shared secret handle. Security Exception[%d.%d]: %C\n"),
2001  se.code, se.minor_code, se.message.in()));
2002  }
2003  return false;
2004  }
2005 
2006  sedp_->disassociate_volatile(iter->second);
2007  sedp_->cleanup_volatile_crypto(iter->first);
2008  sedp_->associate_volatile(iter->second);
2009  sedp_->generate_remote_matched_crypto_handles(iter->second);
2010  sedp_->process_association_records_i(iter->second);
2011 
2012  if (!auth->return_handshake_handle(iter->second.handshake_handle_, se)) {
2013  if (DCPS::security_debug.auth_warn) {
2014  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
2015  ACE_TEXT("Spdp::send_handshake_request() - ")
2016  ACE_TEXT("Unable to return handshake handle. ")
2017  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
2018  se.code, se.minor_code, se.message.in()));
2019  }
2020  return false;
2021  }
2022 
2023  iter->second.handshake_handle_ = DDS::HANDLE_NIL;
2024  return true;
2025  }
2026 
2027  iter->second.shared_secret_handle_ = auth->get_shared_secret(iter->second.handshake_handle_, se);
2028  if (iter->second.shared_secret_handle_ == 0) {
2029  if (DCPS::security_debug.auth_warn) {
2030  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
2031  ACE_TEXT("Spdp::match_authenticated() - ")
2032  ACE_TEXT("Unable to get shared secret handle. Security Exception[%d.%d]: %C\n"),
2033  se.code, se.minor_code, se.message.in()));
2034  }
2035  return false;
2036  }
2037 
2038  if (!auth->get_authenticated_peer_credential_token(
2039  iter->second.authenticated_peer_credential_token_, iter->second.handshake_handle_, se)) {
2040  if (DCPS::security_debug.auth_warn) {
2041  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
2042  ACE_TEXT("Spdp::match_authenticated() - ")
2043  ACE_TEXT("Unable to get authenticated peer credential token. ")
2044  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
2045  se.code, se.minor_code, se.message.in()));
2046  }
2047  return false;
2048  }
2049 
2050  iter->second.permissions_handle_ = access->validate_remote_permissions(
2051  auth, identity_handle_, iter->second.identity_handle_,
2052  iter->second.permissions_token_, iter->second.authenticated_peer_credential_token_, se);
2053  handle_registry->insert_remote_participant_permissions_handle(guid, iter->second.permissions_handle_);
2054 
2056  iter->second.permissions_handle_ == DDS::HANDLE_NIL) {
2057  if (DCPS::security_debug.auth_warn) {
2058  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
2059  ACE_TEXT("Spdp::match_authenticated() - ")
2060  ACE_TEXT("Unable to validate remote participant with access control plugin. ")
2061  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
2062  se.code, se.minor_code, se.message.in()));
2063  }
2064  return false;
2065  }
2066 
2068  if (!access->check_remote_participant(iter->second.permissions_handle_, domain_,
2069  iter->second.pdata_.ddsParticipantDataSecure, se)) {
2070  if (DCPS::security_debug.auth_warn) {
2071  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
2072  ACE_TEXT("Spdp::match_authenticated() - ")
2073  ACE_TEXT("Remote participant check failed. Security Exception[%d.%d]: %C\n"),
2074  se.code, se.minor_code, se.message.in()));
2075  }
2076  return false;
2077  }
2078  }
2079 
2080  if (DCPS::security_debug.auth_debug) {
2081  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} Spdp::match_authenticated - ")
2082  ACE_TEXT("auth and access control complete for peer %C\n"),
2083  DCPS::LogGuid(guid).c_str()));
2084  }
2085 
2087  log_progress("authentication", guid_, guid, iter->second.discovered_at_.to_monotonic_time());
2088  }
2089 
2090  DDS::Security::ParticipantCryptoHandle dp_crypto_handle =
2091  sedp_->get_handle_registry()->get_remote_participant_crypto_handle(iter->first);
2092 
2093  if (dp_crypto_handle == DDS::HANDLE_NIL) {
2094  dp_crypto_handle = key_factory->register_matched_remote_participant(
2095  crypto_handle_, iter->second.identity_handle_, iter->second.permissions_handle_,
2096  iter->second.shared_secret_handle_, se);
2097  sedp_->get_handle_registry()->insert_remote_participant_crypto_handle(iter->first, dp_crypto_handle);
2098  if (dp_crypto_handle == DDS::HANDLE_NIL) {
2099  if (DCPS::security_debug.auth_warn) {
2100  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
2101  ACE_TEXT("Spdp::match_authenticated() - Unable to register remote ")
2102  ACE_TEXT("participant with crypto key factory plugin. ")
2103  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
2104  se.code, se.minor_code, se.message.in()));
2105  }
2106  return false;
2107  }
2108  }
2109 
2111  if (!key_exchange->create_local_participant_crypto_tokens(
2112  iter->second.crypto_tokens_, crypto_handle_, dp_crypto_handle, se)) {
2113  if (DCPS::security_debug.auth_warn) {
2114  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_debug} ")
2115  ACE_TEXT("Spdp::match_authenticated() - ")
2116  ACE_TEXT("Unable to create local participant crypto ")
2117  ACE_TEXT("tokens with crypto key exchange plugin. ")
2118  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
2119  se.code, se.minor_code, se.message.in()));
2120  }
2121  return false;
2122  }
2123  }
2124 
2125  sedp_->generate_remote_matched_crypto_handles(iter->second);
2126 
2127  // Auth is now complete.
2128  sedp_->process_association_records_i(iter->second);
2129 
2130 #ifndef DDS_HAS_MINIMUM_BIT
2131  process_location_updates_i(iter, "match_authenticated");
2132 #endif
2133  return true;
2134 }
#define ACE_DEBUG(X)
OpenDDS_Dcps_Export TransportDebug transport_debug
Definition: debug.cpp:26
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
Definition: Spdp.h:632
DDS::Security::IdentityHandle identity_handle_
Definition: Spdp.h:623
int access(const char *path, int amode)
const DDS::DomainId_t domain_
Definition: Spdp.h:392
const InstanceHandle_t HANDLE_NIL
DCPS::RcHandle< HandleRegistry > HandleRegistry_rch
void OpenDDS_Dcps_Export log_progress(const char *activity, const GUID_t &local, const GUID_t &remote, const MonotonicTime_t &start_time, const GUID_t &reference)
Definition: Logging.cpp:20
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
DDS::Security::ParticipantCryptoHandle crypto_handle_
Definition: Spdp.h:625
Security::SecurityConfig_rch security_config_
Definition: Spdp.h:618
ACE_TEXT("TCP_Factory")
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:471
DCPS::GUID_t guid_
Definition: Spdp.h:393
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32

◆ match_unauthenticated()

void OpenDDS::RTPS::Spdp::match_unauthenticated ( const DiscoveredParticipantIter dp_iter)
private

Definition at line 1123 of file Spdp.cpp.

References bit_subscriber_, DDS::NEW_VIEW_STATE, process_location_updates_i(), and secure_part_user_data().

Referenced by handle_participant_data(), and process_handshake_deadlines().

1124 {
1125 #ifndef DDS_HAS_MINIMUM_BIT
1126  if (!secure_part_user_data()) { // else the user data is assumed to be blank
1127  dp_iter->second.bit_ih_ = bit_subscriber_->add_participant(partBitData(dp_iter->second.pdata_), DDS::NEW_VIEW_STATE);
1128  }
1129 
1130  process_location_updates_i(dp_iter, "match_unauthenticated");
1131 #else
1132  ACE_UNUSED_ARG(dp_iter);
1133 #endif /* DDS_HAS_MINIMUM_BIT */
1134 }
bool secure_part_user_data() const
Definition: Spdp.cpp:4597
const ViewStateKind NEW_VIEW_STATE
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
Definition: Spdp.h:379
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:471

◆ OPENDDS_MAP_CMP() [1/2]

typedef OpenDDS::RTPS::Spdp::OPENDDS_MAP_CMP ( GUID_t  ,
DiscoveredParticipant  ,
GUID_tKeyLessThan   
)

◆ OPENDDS_MAP_CMP() [2/2]

typedef OpenDDS::RTPS::Spdp::OPENDDS_MAP_CMP ( GUID_t  ,
DDS::Security::AuthRequestMessageToken  ,
GUID_tKeyLessThan   
)
private

◆ OPENDDS_MULTIMAP()

typedef OpenDDS::RTPS::Spdp::OPENDDS_MULTIMAP ( DCPS::MonotonicTimePoint  ,
DCPS::GUID_t   
)
private

◆ process_handshake_deadlines()

void OpenDDS::RTPS::Spdp::process_handshake_deadlines ( const DCPS::MonotonicTimePoint tv)

Definition at line 1755 of file Spdp.cpp.

References ACE_DEBUG, ACE_GUARD, ACE_TEXT(), DDS::Security::ParticipantSecurityAttributes::allow_unauthenticated_participants, OpenDDS::RTPS::AUTH_STATE_UNAUTHENTICATED, OpenDDS::DCPS::LogGuid::c_str(), guid_, handshake_deadlines_, OpenDDS::RTPS::HANDSHAKE_STATE_DONE, ice_agent_, initialized_flag_, LM_DEBUG, lock_, match_unauthenticated(), participant_sec_attr_, participants_, purge_discovered_participant(), purge_handshake_resends(), OpenDDS::DCPS::security_debug, sedp_, set_auth_state(), shutdown_flag_, stop_ice(), and tport_.

1756 {
1758 
1760  return;
1761  }
1762 
1763  for (TimeQueue::iterator pos = handshake_deadlines_.begin(),
1764  limit = handshake_deadlines_.upper_bound(now); pos != limit;) {
1765 
1766  DiscoveredParticipantIter pit = participants_.find(pos->second);
1767  if (pit != participants_.end()) {
1768  if (DCPS::security_debug.auth_debug) {
1769  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} Spdp::process_handshake_deadlines() - ")
1770  ACE_TEXT("Removing discovered participant due to authentication timeout: %C\n"),
1771  DCPS::LogGuid(pos->second).c_str()));
1772  }
1773  const DCPS::MonotonicTimePoint ptime = pos->first;
1775  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
1776  if (sedp_endpoint) {
1777  stop_ice(sedp_endpoint, pit->first, pit->second.pdata_.participantProxy.availableBuiltinEndpoints,
1778  pit->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
1779  }
1780  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint = tport_->get_ice_endpoint();
1781  if (spdp_endpoint) {
1782  ice_agent_->stop_ice(spdp_endpoint, guid_, pit->first);
1783  }
1784  handshake_deadlines_.erase(pos);
1786  participants_.erase(pit);
1787  } else {
1790  pit->second.handshake_state_ = HANDSHAKE_STATE_DONE;
1791  handshake_deadlines_.erase(pos);
1792  match_unauthenticated(pit);
1793  }
1794  pos = handshake_deadlines_.lower_bound(ptime);
1795  limit = handshake_deadlines_.upper_bound(now);
1796  } else {
1797  handshake_deadlines_.erase(pos++);
1798  }
1799  }
1800 
1801  if (!handshake_deadlines_.empty()) {
1802  tport_->handshake_deadline_task_->schedule(handshake_deadlines_.begin()->first - now);
1803  }
1804 }
#define ACE_DEBUG(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
Definition: Spdp.h:632
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
void set_auth_state(DiscoveredParticipant &dp, AuthState state)
Definition: Spdp.cpp:4764
void stop_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
Definition: Spdp.cpp:3987
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4673
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
Handshake concluded or timed out.
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
void match_unauthenticated(const DiscoveredParticipantIter &dp_iter)
Definition: Spdp.cpp:1123
TimePoint_T< MonotonicClock > MonotonicTimePoint
Definition: TimeTypes.h:51
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
TimeQueue handshake_deadlines_
Definition: Spdp.h:643
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
void purge_handshake_resends(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4332
DCPS::GUID_t guid_
Definition: Spdp.h:393
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ process_handshake_resends()

void OpenDDS::RTPS::Spdp::process_handshake_resends ( const DCPS::MonotonicTimePoint tv)

Definition at line 1807 of file Spdp.cpp.

References ACE_DEBUG, ACE_GUARD, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), config_, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER, guid_, handshake_resends_, initialized_flag_, LM_DEBUG, lock_, OpenDDS::DCPS::make_id(), participants_, DDS::RETCODE_OK, OpenDDS::DCPS::security_debug, sedp_, OpenDDS::RTPS::Spdp::SpdpTransport::SEND_DIRECT, OpenDDS::RTPS::Spdp::SpdpTransport::SEND_RELAY, shutdown_flag_, and tport_.

1808 {
1810 
1812  return;
1813  }
1814 
1815  bool processor_needs_cancel = false;
1816  for (TimeQueue::iterator pos = handshake_resends_.begin(), limit = handshake_resends_.end();
1817  pos != limit && pos->first <= now;) {
1818 
1819  DiscoveredParticipantIter pit = participants_.find(pos->second);
1820  if (pit != participants_.end() &&
1821  pit->second.stateless_msg_deadline_ <= now) {
1822  const GUID_t reader = make_id(pit->first, ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER);
1823  pit->second.stateless_msg_deadline_ = now + pit->second.handshake_resend_falloff_.get();
1824 
1825  // Send the auth req first to reset the remote if necessary.
1826  if (pit->second.have_auth_req_msg_) {
1827  // Send the SPDP announcement in case it got lost.
1828  tport_->write_i(pit->first, pit->second.last_recv_address_, SpdpTransport::SEND_RELAY | SpdpTransport::SEND_DIRECT);
1829  if (sedp_->transport_inst()->count_messages()) {
1830  ++tport_->transport_statistics_.writer_resend_count[make_id(guid_, ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER)];
1831  }
1832  if (sedp_->write_stateless_message(pit->second.auth_req_msg_, reader) != DDS::RETCODE_OK) {
1833  if (DCPS::security_debug.auth_debug) {
1834  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} Spdp::process_handshake_resends() - ")
1835  ACE_TEXT("Unable to write auth req message retry.\n")));
1836  }
1837  } else {
1838  if (DCPS::security_debug.auth_debug) {
1839  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::process_handshake_resends() - ")
1840  ACE_TEXT("Sent auth req message for participant: %C\n"),
1841  DCPS::LogGuid(pit->first).c_str()));
1842  }
1843  }
1844  }
1845  if (pit->second.have_handshake_msg_) {
1846  if (sedp_->transport_inst()->count_messages()) {
1847  ++tport_->transport_statistics_.writer_resend_count[make_id(guid_, ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER)];
1848  }
1849  if (sedp_->write_stateless_message(pit->second.handshake_msg_, reader) != DDS::RETCODE_OK) {
1850  if (DCPS::security_debug.auth_debug) {
1851  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} Spdp::process_handshake_resends() - ")
1852  ACE_TEXT("Unable to write handshake message retry.\n")));
1853  }
1854  } else {
1855  if (DCPS::security_debug.auth_debug) {
1856  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::process_handshake_resends() - ")
1857  ACE_TEXT("Sent handshake message for participant: %C\n"),
1858  DCPS::LogGuid(pit->first).c_str()));
1859  }
1860  }
1861  }
1862  pit->second.handshake_resend_falloff_.advance(config_->max_auth_time());
1863 
1864  handshake_resends_.insert(std::make_pair(pit->second.stateless_msg_deadline_, pit->first));
1865  if (pit->second.stateless_msg_deadline_ < handshake_resends_.begin()->first) {
1866  processor_needs_cancel = true;
1867  }
1868  }
1869 
1870  handshake_resends_.erase(pos++);
1871  }
1872 
1873  if (!handshake_resends_.empty()) {
1874  if (processor_needs_cancel) {
1875  tport_->handshake_resend_task_->cancel();
1876  }
1877  tport_->handshake_resend_task_->schedule(handshake_resends_.begin()->first - now);
1878  }
1879 }
static const WriteFlags SEND_DIRECT
Definition: Spdp.h:435
#define ACE_DEBUG(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
const ReturnCode_t RETCODE_OK
static const WriteFlags SEND_RELAY
Definition: Spdp.h:434
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
TimeQueue handshake_resends_
Definition: Spdp.h:646
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER
Definition: MessageTypes.h:83
DCPS::GUID_t guid_
Definition: Spdp.h:393
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
Definition: MessageTypes.h:84
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ process_lease_expirations()

void OpenDDS::RTPS::Spdp::process_lease_expirations ( const DCPS::MonotonicTimePoint now)
private

Definition at line 3722 of file Spdp.cpp.

References ACE_DEBUG, ACE_GUARD, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, guid_, ice_agent_, lease_expirations_, LM_WARNING, lock_, participants_, purge_discovered_participant(), purge_handshake_deadlines(), sedp_, stop_ice(), and tport_.

3723 {
3725 
3726  for (TimeQueue::iterator pos = lease_expirations_.begin(), limit = lease_expirations_.end();
3727  pos != limit && pos->first <= now;) {
3728  DiscoveredParticipantIter part = participants_.find(pos->second);
3729  // Pre-emptively erase so purge_discovered_participant will not modify lease_expirations_.
3730  lease_expirations_.erase(pos++);
3731 
3732  if (part == participants_.end()) {
3733  continue;
3734  }
3735 
3736  if (DCPS::DCPS_debug_level) {
3737  ACE_DEBUG((LM_WARNING,
3738  ACE_TEXT("(%P|%t) Spdp::process_lease_expirations() - ")
3739  ACE_TEXT("participant %C exceeded lease duration, removing\n"),
3740  DCPS::LogGuid(part->first).c_str()));
3741  }
3742 
3743 #ifdef OPENDDS_SECURITY
3744  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
3745  if (sedp_endpoint) {
3746  stop_ice(sedp_endpoint, part->first, part->second.pdata_.participantProxy.availableBuiltinEndpoints,
3747  part->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
3748  }
3749  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint = tport_->get_ice_endpoint();
3750  if (spdp_endpoint) {
3751  ice_agent_->stop_ice(spdp_endpoint, guid_, part->first);
3752  }
3754 #endif
3756  participants_.erase(part);
3757  }
3758 
3759  if (!lease_expirations_.empty()) {
3760  tport_->lease_expiration_task_->schedule(lease_expirations_.begin()->first - now);
3761  }
3762 }
#define ACE_DEBUG(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
void purge_handshake_deadlines(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4315
void stop_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
Definition: Spdp.cpp:3987
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4673
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
TimeQueue lease_expirations_
Definition: Spdp.h:614
DCPS::GUID_t guid_
Definition: Spdp.h:393
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ process_location_updates_i()

void OpenDDS::RTPS::Spdp::process_location_updates_i ( const DiscoveredParticipantIter iter,
const char *  reason,
bool  force_publish = false 
)
protected

Definition at line 471 of file Spdp.cpp.

References ACE_DEBUG, OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::change_mask, DDS::HANDLE_NIL, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::ice6_addr, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::ice6_timestamp, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::ice_addr, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::ice_timestamp, LM_DEBUG, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::local6_addr, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::local6_timestamp, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::local_addr, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::local_timestamp, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::location, OpenDDS::DCPS::LOCATION_ICE, OpenDDS::DCPS::LOCATION_ICE6, OpenDDS::DCPS::LOCATION_LOCAL, OpenDDS::DCPS::LOCATION_LOCAL6, OpenDDS::DCPS::LOCATION_RELAY, OpenDDS::DCPS::LOCATION_RELAY6, OpenDDS::DCPS::log_bits, OPENDDS_STRING, OpenDDS::DCPS::operator<(), participants_, publish_location_update_i(), OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::relay6_addr, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::relay6_timestamp, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::relay_addr, OpenDDS::DCPS::ParticipantLocationBuiltinTopicData::relay_timestamp, OpenDDS::RTPS::rtps_duration_to_time_duration(), OpenDDS::DCPS::LogAddr::str(), and OpenDDS::DCPS::swap().

Referenced by handle_participant_data(), match_authenticated(), match_unauthenticated(), process_participant_ice(), rtps_relay_only_now(), use_ice_now(), and use_rtps_relay_now().

472 {
473  // We have the global lock.
474 
475  if (iter == participants_.end()) {
476  if (DCPS::log_bits) {
477  ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ iterator invalid, returning\n", this));
478  }
479  return;
480  }
481 
482  if (iter->second.bit_ih_ == DDS::HANDLE_NIL) {
483  // Do not process updates until the participant exists in the built-in topics.
484  if (DCPS::log_bits) {
485  ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ %C does not exist in participant bit, returning\n", this, LogGuid(iter->first).c_str()));
486  }
487  return;
488  }
489 
490  DiscoveredParticipant::LocationUpdateList location_updates;
491  std::swap(iter->second.location_updates_, location_updates);
492 
493  if (DCPS::log_bits) {
494  ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ %C has %B location update(s) force_publish=%d reason=%C\n", this, LogGuid(iter->first).c_str(), location_updates.size(), force_publish, reason));
495  }
496 
497  bool published = false;
498  for (DiscoveredParticipant::LocationUpdateList::const_iterator pos = location_updates.begin(),
499  limit = location_updates.end(); iter != participants_.end() && pos != limit; ++pos) {
500  DCPS::ParticipantLocationBuiltinTopicData& location_data = iter->second.location_data_;
501 
502  OPENDDS_STRING addr = "";
503  const DCPS::ParticipantLocation old_mask = location_data.location;
504  if (pos->from_ != ACE_INET_Addr()) {
505  location_data.location |= pos->mask_;
506  addr = DCPS::LogAddr(pos->from_).str();
507  } else {
508  location_data.location &= ~(pos->mask_);
509  }
510 
511  location_data.change_mask = pos->mask_;
512 
513  bool address_change = false;
514  switch (pos->mask_) {
516  address_change = addr.compare(location_data.local_addr.in()) != 0;
517  location_data.local_addr = addr.c_str();
518  location_data.local_timestamp = pos->timestamp_.to_dds_time();
519  break;
520  case DCPS::LOCATION_ICE:
521  address_change = addr.compare(location_data.ice_addr.in()) != 0;
522  location_data.ice_addr = addr.c_str();
523  location_data.ice_timestamp = pos->timestamp_.to_dds_time();
524  break;
526  address_change = addr.compare(location_data.relay_addr.in()) != 0;
527  location_data.relay_addr = addr.c_str();
528  location_data.relay_timestamp = pos->timestamp_.to_dds_time();
529  break;
531  address_change = addr.compare(location_data.local6_addr.in()) != 0;
532  location_data.local6_addr = addr.c_str();
533  location_data.local6_timestamp = pos->timestamp_.to_dds_time();
534  break;
535  case DCPS::LOCATION_ICE6:
536  address_change = addr.compare(location_data.ice6_addr.in()) != 0;
537  location_data.ice6_addr = addr.c_str();
538  location_data.ice6_timestamp = pos->timestamp_.to_dds_time();
539  break;
541  address_change = addr.compare(location_data.relay6_addr.in()) != 0;
542  location_data.relay6_addr = addr.c_str();
543  location_data.relay6_timestamp = pos->timestamp_.to_dds_time();
544  break;
545  }
546 
547  const DDS::Time_t expr =
548  (
549  pos->timestamp_ - rtps_duration_to_time_duration(iter->second.pdata_.leaseDuration,
550  iter->second.pdata_.participantProxy.protocolVersion,
551  iter->second.pdata_.participantProxy.vendorId)
552  ).to_dds_time();
553  if ((location_data.location & DCPS::LOCATION_LOCAL) && DCPS::operator<(location_data.local_timestamp, expr)) {
554  location_data.location &= ~(DCPS::LOCATION_LOCAL);
555  location_data.change_mask |= DCPS::LOCATION_LOCAL;
556  location_data.local_timestamp = pos->timestamp_.to_dds_time();
557  }
558  if ((location_data.location & DCPS::LOCATION_RELAY) && DCPS::operator<(location_data.relay_timestamp, expr)) {
559  location_data.location &= ~(DCPS::LOCATION_RELAY);
560  location_data.change_mask |= DCPS::LOCATION_RELAY;
561  location_data.relay_timestamp = pos->timestamp_.to_dds_time();
562  }
563  if ((location_data.location & DCPS::LOCATION_LOCAL6) && DCPS::operator<(location_data.local6_timestamp, expr)) {
564  location_data.location &= ~(DCPS::LOCATION_LOCAL6);
565  location_data.change_mask |= DCPS::LOCATION_LOCAL6;
566  location_data.local6_timestamp = pos->timestamp_.to_dds_time();
567  }
568  if ((location_data.location & DCPS::LOCATION_RELAY6) && DCPS::operator<(location_data.relay6_timestamp, expr)) {
569  location_data.location &= ~(DCPS::LOCATION_RELAY6);
570  location_data.change_mask |= DCPS::LOCATION_RELAY6;
571  location_data.relay6_timestamp = pos->timestamp_.to_dds_time();
572  }
573 
574  if (old_mask != location_data.location || address_change) {
575  if (DCPS::log_bits) {
576  ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ publishing %C update\n", this, LogGuid(iter->first).c_str()));
577  }
579  published = true;
580  }
581  }
582 
583  if (force_publish && !published) {
584  if (DCPS::log_bits) {
585  ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ publishing %C forced\n", this, LogGuid(iter->first).c_str()));
586  }
588  published = true;
589  }
590 
591  if (!published && DCPS::log_bits) {
592  if (DCPS::log_bits) {
593  ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ not published\n", this, LogGuid(iter->first).c_str()));
594  }
595  }
596 }
#define ACE_DEBUG(X)
DCPS::TimeDuration rtps_duration_to_time_duration(const Duration_t &rtps_duration, const ProtocolVersion_t &version, const VendorId_t &vendor)
void publish_location_update_i(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:599
const InstanceHandle_t HANDLE_NIL
#define OPENDDS_STRING
const ParticipantLocation LOCATION_ICE
unsigned long ParticipantLocation
bool log_bits
Definition: Logging.cpp:18
const ParticipantLocation LOCATION_RELAY
const ParticipantLocation LOCATION_ICE6
const ParticipantLocation LOCATION_RELAY6
bool operator<(const GUID_t &lhs, const GUID_t &rhs)
Definition: GuidUtils.h:80
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
const ParticipantLocation LOCATION_LOCAL
const ParticipantLocation LOCATION_LOCAL6
void swap(MessageBlock &lhs, MessageBlock &rhs)

◆ process_participant_ice()

void OpenDDS::RTPS::Spdp::process_participant_ice ( const ParameterList plist,
const ParticipantData_t pdata,
const DCPS::GUID_t guid 
)

Definition at line 4351 of file Spdp.cpp.

References ACE_ERROR, ACE_GUARD, ACE_TEXT(), OpenDDS::RTPS::ParticipantProxy_t::availableBuiltinEndpoints, OpenDDS::RTPS::ParticipantProxy_t::availableExtendedBuiltinEndpoints, OpenDDS::DCPS::DCPS_debug_level, enqueue_location_update_i(), OpenDDS::RTPS::ParameterListConverter::from_param_list(), guid_, ice_agent_, initialized_flag_, LM_ERROR, OpenDDS::DCPS::LOCATION_ICE, lock_, OpenDDS::Security::SPDPdiscoveredParticipantData::participantProxy, participants_, process_location_updates_i(), sedp_, OpenDDS::RTPS::SEDP_AGENT_INFO_KEY, shutdown_flag_, OpenDDS::RTPS::SPDP_AGENT_INFO_KEY, start_ice(), stop_ice(), and tport_.

Referenced by data_received(), and OpenDDS::RTPS::Sedp::DiscoveryReader::data_received_i().

4354 {
4355  ICE::AgentInfoMap ai_map;
4356  if (!ParameterListConverter::from_param_list(plist, ai_map)) {
4357  if (DCPS::DCPS_debug_level > 0) {
4358  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::process_participant_ice - ")
4359  ACE_TEXT("failed to convert from ParameterList to ")
4360  ACE_TEXT("ICE::AgentInfo\n")));
4361  }
4362  return;
4363  }
4364  ICE::AgentInfoMap::const_iterator sedp_pos = ai_map.find(SEDP_AGENT_INFO_KEY);
4365  ICE::AgentInfoMap::const_iterator spdp_pos = ai_map.find(SPDP_AGENT_INFO_KEY);
4366 
4367  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint;
4368  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint;
4369  {
4372  return;
4373  }
4374  if (sedp_) {
4375  sedp_endpoint = sedp_->get_ice_endpoint();
4376  }
4377  if (tport_) {
4378  spdp_endpoint = tport_->get_ice_endpoint();
4379  }
4381  if (iter != participants_.end()) {
4382  if (sedp_pos != ai_map.end()) {
4383  iter->second.have_sedp_info_ = true;
4384  iter->second.sedp_info_ = sedp_pos->second;
4385  } else {
4386  iter->second.have_sedp_info_ = false;
4387  }
4388 
4389  if (spdp_pos != ai_map.end()) {
4390  iter->second.have_spdp_info_ = true;
4391  iter->second.spdp_info_ = spdp_pos->second;
4392  } else {
4393  iter->second.have_spdp_info_ = false;
4394  }
4395  }
4396  }
4397 
4398  if (sedp_endpoint) {
4399  if (sedp_pos != ai_map.end()) {
4400  start_ice(sedp_endpoint, guid, pdata.participantProxy.availableBuiltinEndpoints,
4401  pdata.participantProxy.availableExtendedBuiltinEndpoints, sedp_pos->second);
4402  } else {
4403  stop_ice(sedp_endpoint, guid, pdata.participantProxy.availableBuiltinEndpoints,
4404  pdata.participantProxy.availableExtendedBuiltinEndpoints);
4405  }
4406  }
4407 
4408  if (spdp_endpoint) {
4409  if (spdp_pos != ai_map.end()) {
4410  ice_agent_->start_ice(spdp_endpoint, guid_, guid, spdp_pos->second);
4411  } else {
4412  ice_agent_->stop_ice(spdp_endpoint, guid_, guid);
4413 #ifndef DDS_HAS_MINIMUM_BIT
4416  if (iter != participants_.end()) {
4418  process_location_updates_i(iter, "stop ice");
4419  }
4420 #endif
4421  }
4422  }
4423 }
#define ACE_ERROR(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
const char SEDP_AGENT_INFO_KEY[]
Definition: Spdp.h:57
void start_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail, const ICE::AgentInfo &agent_info)
Definition: Spdp.cpp:3845
void stop_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
Definition: Spdp.cpp:3987
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:457
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
bool from_param_list(const ParameterList &param_list, DDS::ParticipantBuiltinTopicData &pbtd)
const ParticipantLocation LOCATION_ICE
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
const char SPDP_AGENT_INFO_KEY[]
Definition: Spdp.h:56
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:471
DCPS::GUID_t guid_
Definition: Spdp.h:393
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ publish_location_update_i()

void OpenDDS::RTPS::Spdp::publish_location_update_i ( const DiscoveredParticipantIter iter)
protected

Definition at line 599 of file Spdp.cpp.

References ACE_DEBUG, bit_subscriber_, OpenDDS::DCPS::LogGuid::c_str(), LM_DEBUG, OpenDDS::DCPS::log_bits, and DDS::NEW_VIEW_STATE.

Referenced by process_location_updates_i().

600 {
601  iter->second.location_ih_ = bit_subscriber_->add_participant_location(iter->second.location_data_, DDS::NEW_VIEW_STATE);
602  if (DCPS::log_bits) {
603  ACE_DEBUG((LM_DEBUG, "(%P|%t) DEBUG: Spdp::publish_location_update_i: %@ participant %C has participant location handle %d\n", this, LogGuid(iter->first).c_str(), iter->second.location_ih_));
604  }
605 }
#define ACE_DEBUG(X)
const ViewStateKind NEW_VIEW_STATE
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
Definition: Spdp.h:379
bool log_bits
Definition: Logging.cpp:18

◆ purge_discovered_participant()

void OpenDDS::RTPS::Spdp::purge_discovered_participant ( const DiscoveredParticipantIter iter)
protected

Definition at line 4673 of file Spdp.cpp.

References access(), ACE_DEBUG, ACE_TEXT(), OpenDDS::RTPS::AUTH_STATE_HANDSHAKE, bit_subscriber_, OpenDDS::DCPS::LogGuid::c_str(), DDS::Security::SecurityException::code, OpenDDS::DCPS::DCPS_debug_level, OpenDDS::RTPS::Sedp::disassociate(), endpoint_manager(), DDS::HANDLE_NIL, LM_DEBUG, LM_WARNING, DDS::Security::SecurityException::message, DDS::Security::SecurityException::minor_code, n_participants_in_authentication_, participants_, remove_lease_expiration_i(), security_config_, OpenDDS::DCPS::security_debug, and sedp_.

Referenced by handle_participant_data(), ignore_domain_participant(), process_handshake_deadlines(), process_lease_expirations(), remove_domain_participant(), shutdown(), and update_rtps_relay_application_participant_i().

4674 {
4675  if (iter == participants_.end()) {
4676  return;
4677  }
4678  endpoint_manager().disassociate(iter->second);
4679  bit_subscriber_->remove_participant(iter->second.bit_ih_, iter->second.location_ih_);
4680  if (DCPS_debug_level > 3) {
4681  ACE_DEBUG((LM_DEBUG, "(%P|%t) LocalParticipant::purge_discovered_participant: "
4682  "erasing %C (%B)\n",
4683  DCPS::LogGuid(iter->first).c_str(), participants_.size()));
4684  }
4685 
4687 
4688 #ifdef OPENDDS_SECURITY
4689  if (security_config_) {
4690  DDS::Security::SecurityException se = {"", 0, 0};
4691  DDS::Security::Authentication_var auth = security_config_->get_authentication();
4692  DDS::Security::AccessControl_var access = security_config_->get_access_control();
4693 
4695  sedp_->get_handle_registry()->get_remote_participant_crypto_handle(iter->first);
4696  if (!security_config_->get_crypto_key_factory()->unregister_participant(pch, se)) {
4697  if (DCPS::security_debug.auth_warn) {
4698  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
4699  ACE_TEXT("Spdp::purge_discovered_participant() - ")
4700  ACE_TEXT("Unable to return crypto handle. ")
4701  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
4702  se.code, se.minor_code, se.message.in()));
4703  }
4704  }
4705  sedp_->get_handle_registry()->erase_remote_participant_crypto_handle(iter->first);
4706  sedp_->get_handle_registry()->erase_remote_participant_permissions_handle(iter->first);
4707 
4708  if (iter->second.identity_handle_ != DDS::HANDLE_NIL) {
4709  if (!auth->return_identity_handle(iter->second.identity_handle_, se)) {
4710  if (DCPS::security_debug.auth_warn) {
4711  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
4712  ACE_TEXT("Spdp::purge_discovered_participant() - ")
4713  ACE_TEXT("Unable to return identity handle. ")
4714  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
4715  se.code, se.minor_code, se.message.in()));
4716  }
4717  }
4718  }
4719 
4720  if (iter->second.handshake_handle_ != DDS::HANDLE_NIL) {
4721  if (!auth->return_handshake_handle(iter->second.handshake_handle_, se)) {
4722  if (DCPS::security_debug.auth_warn) {
4723  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
4724  ACE_TEXT("Spdp::purge_discovered_participant() - ")
4725  ACE_TEXT("Unable to return handshake handle. ")
4726  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
4727  se.code, se.minor_code, se.message.in()));
4728  }
4729  }
4730  }
4731 
4732  if (iter->second.shared_secret_handle_ != 0) {
4733  if (!auth->return_sharedsecret_handle(iter->second.shared_secret_handle_, se)) {
4734  if (DCPS::security_debug.auth_warn) {
4735  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
4736  ACE_TEXT("Spdp::purge_discovered_participant() - ")
4737  ACE_TEXT("Unable to return sharedsecret handle. ")
4738  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
4739  se.code, se.minor_code, se.message.in()));
4740  }
4741  }
4742  }
4743 
4744  if (iter->second.permissions_handle_ != DDS::HANDLE_NIL) {
4745  if (!access->return_permissions_handle(iter->second.permissions_handle_, se)) {
4746  if (DCPS::security_debug.auth_warn) {
4747  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
4748  ACE_TEXT("Spdp::purge_discovered_participant() - ")
4749  ACE_TEXT("Unable to return permissions handle. ")
4750  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
4751  se.code, se.minor_code, se.message.in()));
4752  }
4753  }
4754  }
4755  }
4756 
4757  if (iter->second.auth_state_ == AUTH_STATE_HANDSHAKE) {
4759  }
4760 #endif
4761 }
#define ACE_DEBUG(X)
int access(const char *path, int amode)
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
Definition: Spdp.h:379
const InstanceHandle_t HANDLE_NIL
size_t n_participants_in_authentication_
Definition: Spdp.h:648
void disassociate(DiscoveredParticipant &participant)
Definition: Sedp.cpp:1544
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
Sedp & endpoint_manager()
Definition: Spdp.h:354
Security::SecurityConfig_rch security_config_
Definition: Spdp.h:618
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
void remove_lease_expiration_i(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:3682

◆ purge_handshake_deadlines()

void OpenDDS::RTPS::Spdp::purge_handshake_deadlines ( DiscoveredParticipantIter  iter)
private

Definition at line 4315 of file Spdp.cpp.

References handshake_deadlines_, participants_, and purge_handshake_resends().

Referenced by attempt_authentication(), handle_handshake_message(), handle_participant_data(), process_lease_expirations(), and shutdown().

4316 {
4317  if (iter == participants_.end()) {
4318  return;
4319  }
4320 
4322 
4323  std::pair<TimeQueue::iterator, TimeQueue::iterator> range = handshake_deadlines_.equal_range(iter->second.handshake_deadline_);
4324  for (; range.first != range.second; ++range.first) {
4325  if (range.first->second == iter->first) {
4326  handshake_deadlines_.erase(range.first);
4327  break;
4328  }
4329  }
4330 }
TimeQueue handshake_deadlines_
Definition: Spdp.h:643
void purge_handshake_resends(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4332
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ purge_handshake_resends()

void OpenDDS::RTPS::Spdp::purge_handshake_resends ( DiscoveredParticipantIter  iter)
private

Definition at line 4332 of file Spdp.cpp.

References config_, handshake_resends_, and participants_.

Referenced by process_handshake_deadlines(), and purge_handshake_deadlines().

4333 {
4334  if (iter == participants_.end()) {
4335  return;
4336  }
4337 
4338  iter->second.have_auth_req_msg_ = false;
4339  iter->second.have_handshake_msg_ = false;
4340  iter->second.handshake_resend_falloff_.set(config_->auth_resend_period());
4341 
4342  std::pair<TimeQueue::iterator, TimeQueue::iterator> range = handshake_resends_.equal_range(iter->second.stateless_msg_deadline_);
4343  for (; range.first != range.second; ++range.first) {
4344  if (range.first->second == iter->first) {
4345  handshake_resends_.erase(range.first);
4346  break;
4347  }
4348  }
4349 }
TimeQueue handshake_resends_
Definition: Spdp.h:646
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ remote_crypto_handle()

DDS::Security::ParticipantCryptoHandle OpenDDS::RTPS::Spdp::remote_crypto_handle ( const DCPS::GUID_t remote_participant) const

Definition at line 4128 of file Spdp.cpp.

References sedp_.

4129 {
4130  return sedp_->get_handle_registry()->get_remote_participant_crypto_handle(remote_participant);
4131 }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606

◆ remove_agent_info()

void OpenDDS::RTPS::Spdp::remove_agent_info ( const DCPS::GUID_t local_guid)
privatevirtual

Implements OpenDDS::ICE::AgentInfoListener.

Definition at line 2143 of file Spdp.cpp.

References is_security_enabled(), and write_secure_updates().

2144 {
2145  if (is_security_enabled()) {
2147  }
2148 }
bool is_security_enabled() const
Definition: Spdp.h:159
void write_secure_updates()
Definition: Spdp.cpp:425

◆ remove_domain_participant()

void OpenDDS::RTPS::Spdp::remove_domain_participant ( const GUID_t removeId)

Definition at line 4634 of file Spdp.cpp.

References ACE_GUARD, lock_, participants_, and purge_discovered_participant().

4635 {
4637 
4638  DiscoveredParticipantIter iter = participants_.find(removeId);
4639  if (iter != participants_.end()) {
4641  participants_.erase(iter);
4642  }
4643 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4673
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ remove_lease_expiration_i()

void OpenDDS::RTPS::Spdp::remove_lease_expiration_i ( DiscoveredParticipantIter  iter)
private

Definition at line 3682 of file Spdp.cpp.

References lease_expirations_.

Referenced by purge_discovered_participant(), and update_lease_expiration_i().

3683 {
3684  for (std::pair<TimeQueue::iterator, TimeQueue::iterator> x = lease_expirations_.equal_range(iter->second.lease_expiration_);
3685  x.first != x.second; ++x.first) {
3686  if (x.first->second == iter->first) {
3687  lease_expirations_.erase(x.first);
3688  break;
3689  }
3690  }
3691 }
TimeQueue lease_expirations_
Definition: Spdp.h:614

◆ remove_publication()

void OpenDDS::RTPS::Spdp::remove_publication ( const GUID_t publicationId)
inline

Definition at line 272 of file Spdp.h.

273  {
274  endpoint_manager().remove_publication(publicationId);
275  }
void remove_publication(const GUID_t &publicationId)
Definition: Sedp.cpp:6218
Sedp & endpoint_manager()
Definition: Spdp.h:354

◆ remove_subscription()

void OpenDDS::RTPS::Spdp::remove_subscription ( const GUID_t subscriptionId)
inline

Definition at line 312 of file Spdp.h.

313  {
314  endpoint_manager().remove_subscription(subscriptionId);
315  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
void remove_subscription(const GUID_t &subscriptionId)
Definition: Sedp.cpp:6364

◆ remove_topic()

DCPS::TopicStatus OpenDDS::RTPS::Spdp::remove_topic ( const GUID_t topicId)
inline

Definition at line 244 of file Spdp.h.

245  {
246  return endpoint_manager().remove_topic(topicId);
247  }
DCPS::TopicStatus remove_topic(const GUID_t &topicId)
Definition: Sedp.cpp:6105
Sedp & endpoint_manager()
Definition: Spdp.h:354

◆ request_remote_complete_type_objects()

void OpenDDS::RTPS::Spdp::request_remote_complete_type_objects ( const GUID_t remote_entity,
const XTypes::TypeInformation remote_type_info,
DCPS::TypeObjReqCond cond 
)
inline

Definition at line 346 of file Spdp.h.

349  {
350  sedp_->request_remote_complete_type_objects(remote_entity, remote_type_info, cond);
351  }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606

◆ rtps_relay_only_now()

void OpenDDS::RTPS::Spdp::rtps_relay_only_now ( bool  f)

Definition at line 4451 of file Spdp.cpp.

References ACE_GUARD, config_, enqueue_location_update_i(), OpenDDS::DCPS::LOCATION_ICE, OpenDDS::DCPS::LOCATION_ICE6, OpenDDS::DCPS::LOCATION_LOCAL, OpenDDS::DCPS::LOCATION_LOCAL6, lock_, participants_, process_location_updates_i(), sedp_, tport_, and OpenDDS::DCPS::TimeDuration::zero_value.

4452 {
4453  ACE_UNUSED_ARG(flag);
4454 
4455 #ifdef OPENDDS_SECURITY
4456  sedp_->rtps_relay_only_now(flag);
4457 
4458  if (flag) {
4460 
4461  tport_->relay_spdp_task_falloff_.set(config_->sedp_heartbeat_period());
4462  tport_->relay_spdp_task_->schedule(TimeDuration::zero_value);
4463 
4464  tport_->relay_stun_task_falloff_.set(config_->sedp_heartbeat_period());
4465  tport_->relay_stun_task_->schedule(TimeDuration::zero_value);
4466 
4467 #ifndef DDS_HAS_MINIMUM_BIT
4468  const DCPS::ParticipantLocation mask =
4473 
4474  for (DiscoveredParticipantIter iter = participants_.begin();
4475  iter != participants_.end();
4476  ++iter) {
4477  enqueue_location_update_i(iter, mask, ACE_INET_Addr(), "rtps_relay_only_now");
4478  process_location_updates_i(iter, "rtps_relay_only_now");
4479  }
4480 #endif
4481  } else {
4482  if (!config_->use_rtps_relay()) {
4483  if (tport_->relay_spdp_task_) {
4484  tport_->relay_spdp_task_->cancel();
4485  }
4486  if (tport_->relay_stun_task_) {
4487  tport_->disable_relay_stun_task();
4488  }
4489  }
4490  }
4491 #endif
4492 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
static const TimeDuration zero_value
Definition: TimeDuration.h:31
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:457
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const ParticipantLocation LOCATION_ICE
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
unsigned long ParticipantLocation
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
const ParticipantLocation LOCATION_ICE6
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:471
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
const ParticipantLocation LOCATION_LOCAL
const ParticipantLocation LOCATION_LOCAL6
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ schedule_handshake_resend()

MonotonicTimePoint OpenDDS::RTPS::Spdp::schedule_handshake_resend ( const DCPS::TimeDuration time,
const DCPS::GUID_t guid 
)
private

Definition at line 1956 of file Spdp.cpp.

References handshake_resends_, and tport_.

Referenced by attempt_authentication(), and send_handshake_message().

1957 {
1958  const MonotonicTimePoint deadline = MonotonicTimePoint::now() + time;
1959  handshake_resends_.insert(std::make_pair(deadline, guid));
1960  if (deadline < handshake_resends_.begin()->first) {
1961  tport_->handshake_resend_task_->cancel();
1962  }
1963  tport_->handshake_resend_task_->schedule(time);
1964  return deadline;
1965 }
time_t time(time_t *tloc=0)
TimeQueue handshake_resends_
Definition: Spdp.h:646
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
TimePoint_T< MonotonicClock > MonotonicTimePoint
Definition: TimeTypes.h:51

◆ secure_part_user_data()

bool OpenDDS::RTPS::Spdp::secure_part_user_data ( ) const
private

If this is true participant user data should only be sent and received securely, otherwise the user data should be empty and participant bit updates should be withheld from the user.

Definition at line 4597 of file Spdp.cpp.

References config_, and security_enabled_.

Referenced by get_part_bit_data(), handle_participant_data(), and match_unauthenticated().

4598 {
4599 #ifdef OPENDDS_SECURITY
4600  return security_enabled_ && config_->secure_participant_user_data();
4601 #else
4602  return false;
4603 #endif
4604 }
bool security_enabled_
Definition: Spdp.h:619
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ sedp_rtps_relay_address()

void OpenDDS::RTPS::Spdp::sedp_rtps_relay_address ( const ACE_INET_Addr address)
inline

Definition at line 198 of file Spdp.h.

198 { sedp_->rtps_relay_address(address); }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606

◆ sedp_stun_server_address()

void OpenDDS::RTPS::Spdp::sedp_stun_server_address ( const ACE_INET_Addr address)
inline

Definition at line 199 of file Spdp.h.

199 { sedp_->stun_server_address(address); }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606

◆ sedp_transport_inst()

RcHandle<DCPS::TransportInst> OpenDDS::RTPS::Spdp::sedp_transport_inst ( ) const
inline

Definition at line 341 of file Spdp.h.

342  {
343  return sedp_->transport_inst();
344  }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606

◆ send_handshake_message()

DDS::ReturnCode_t OpenDDS::RTPS::Spdp::send_handshake_message ( const DCPS::GUID_t guid,
DiscoveredParticipant dp,
const DDS::Security::ParticipantStatelessMessage msg 
)
private

Definition at line 1942 of file Spdp.cpp.

References OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, guid(), OpenDDS::RTPS::DiscoveredParticipant::handshake_msg_, OpenDDS::RTPS::DiscoveredParticipant::handshake_resend_falloff_, OpenDDS::RTPS::DiscoveredParticipant::have_handshake_msg_, OpenDDS::DCPS::make_id(), DDS::Security::ParticipantGenericMessage::message_identity, schedule_handshake_resend(), sedp_, DDS::Security::MessageIdentity::sequence_number, OpenDDS::RTPS::DiscoveredParticipant::stateless_msg_deadline_, and stateless_sequence_number_.

Referenced by handle_handshake_message(), and send_handshake_request().

1945 {
1946  dp.handshake_msg_ = msg;
1947  dp.handshake_msg_.message_identity.sequence_number = (++stateless_sequence_number_).getValue();
1948 
1949  const DCPS::GUID_t reader = make_id(guid, ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER);
1950  const DDS::ReturnCode_t retval = sedp_->write_stateless_message(dp.handshake_msg_, reader);
1951  dp.have_handshake_msg_ = true;
1952  dp.stateless_msg_deadline_ = schedule_handshake_resend(dp.handshake_resend_falloff_.get(), guid);
1953  return retval;
1954 }
DCPS::MonotonicTimePoint schedule_handshake_resend(const DCPS::TimeDuration &time, const DCPS::GUID_t &guid)
Definition: Spdp.cpp:1956
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
Definition: MessageTypes.h:84
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200
DCPS::SequenceNumber stateless_sequence_number_
Definition: Spdp.h:621

◆ send_handshake_request()

void OpenDDS::RTPS::Spdp::send_handshake_request ( const DCPS::GUID_t guid,
DiscoveredParticipant dp 
)

Definition at line 1271 of file Spdp.cpp.

References ACE_DEBUG, ACE_ERROR, ACE_TEXT(), DDS::Security::SecurityException::code, DDS::Security::ParticipantGenericMessage::destination_endpoint_guid, DDS::Security::ParticipantGenericMessage::destination_participant_guid, DDS::Security::GMCLASSID_SECURITY_AUTH_HANDSHAKE, guid(), guid_, OpenDDS::DCPS::GUID_UNKNOWN, DDS::HANDLE_NIL, OpenDDS::RTPS::DiscoveredParticipant::handshake_handle_, OpenDDS::RTPS::DiscoveredParticipant::handshake_state_, OpenDDS::RTPS::HANDSHAKE_STATE_BEGIN_HANDSHAKE_REQUEST, OpenDDS::RTPS::HANDSHAKE_STATE_PROCESS_HANDSHAKE, OpenDDS::RTPS::DiscoveredParticipant::identity_handle_, identity_handle_, LM_DEBUG, LM_ERROR, LM_WARNING, local_participant_data_as_octets(), DDS::Security::SecurityException::message, DDS::Security::ParticipantGenericMessage::message_class_id, DDS::Security::ParticipantGenericMessage::message_data, DDS::Security::ParticipantGenericMessage::message_identity, DDS::Security::SecurityException::minor_code, OPENDDS_ASSERT, DDS::Security::ParticipantGenericMessage::related_message_identity, DDS::RETCODE_OK, security_config_, OpenDDS::DCPS::security_debug, send_handshake_message(), DDS::Security::MessageIdentity::sequence_number, DDS::Security::ParticipantGenericMessage::source_endpoint_guid, DDS::Security::MessageIdentity::source_guid, and DDS::Security::VALIDATION_PENDING_HANDSHAKE_MESSAGE.

Referenced by attempt_authentication().

1272 {
1274 
1275  Security::Authentication_var auth = security_config_->get_authentication();
1276  DDS::Security::SecurityException se = {"", 0, 0};
1277  if (dp.handshake_handle_ != DDS::HANDLE_NIL) {
1278  // Return the handle for reauth.
1279  if (!auth->return_handshake_handle(dp.handshake_handle_, se)) {
1280  if (DCPS::security_debug.auth_warn) {
1281  ACE_DEBUG((LM_WARNING, ACE_TEXT("(%P|%t) {auth_warn} ")
1282  ACE_TEXT("Spdp::send_handshake_request() - ")
1283  ACE_TEXT("Unable to return handshake handle. ")
1284  ACE_TEXT("Security Exception[%d.%d]: %C\n"),
1285  se.code, se.minor_code, se.message.in()));
1286  }
1287  return;
1288  }
1289  dp.handshake_handle_ = DDS::HANDLE_NIL;
1290  }
1291 
1292  const DDS::OctetSeq local_participant = local_participant_data_as_octets();
1293  if (!local_participant.length()) {
1294  return; // already logged in local_participant_data_as_octets()
1295  }
1296 
1298  if (auth->begin_handshake_request(dp.handshake_handle_, hs_mt, identity_handle_, dp.identity_handle_,
1299  local_participant, se)
1301  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::send_handshake_request() - ")
1302  ACE_TEXT("Failed to begin handshake_request. Security Exception[%d.%d]: %C\n"),
1303  se.code, se.minor_code, se.message.in()));
1304  return;
1305  }
1306 
1307  dp.handshake_state_ = HANDSHAKE_STATE_PROCESS_HANDSHAKE;
1308 
1318  msg.message_data.length(1);
1319  msg.message_data[0] = hs_mt;
1320 
1321  if (send_handshake_message(guid, dp, msg) != DDS::RETCODE_OK) {
1322  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::send_handshake_request() - ")
1323  ACE_TEXT("Unable to write stateless message (handshake).\n")));
1324  return;
1325  } else if (DCPS::security_debug.auth_debug) {
1326  ACE_DEBUG((LM_DEBUG, ACE_TEXT("(%P|%t) {auth_debug} DEBUG: Spdp::send_handshake_request() - ")
1327  ACE_TEXT("Sent handshake request message for participant: %C\n"),
1328  DCPS::LogGuid(guid).c_str()));
1329  }
1330 }
#define ACE_DEBUG(X)
DDS::ReturnCode_t send_handshake_message(const DCPS::GUID_t &guid, DiscoveredParticipant &dp, const DDS::Security::ParticipantStatelessMessage &msg)
Definition: Spdp.cpp:1942
#define ACE_ERROR(X)
DDS::Security::IdentityHandle identity_handle_
Definition: Spdp.h:623
const string GMCLASSID_SECURITY_AUTH_HANDSHAKE
const ReturnCode_t RETCODE_OK
ParticipantGenericMessage ParticipantStatelessMessage
const InstanceHandle_t HANDLE_NIL
#define OPENDDS_ASSERT(C)
Definition: Definitions.h:66
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
Security::SecurityConfig_rch security_config_
Definition: Spdp.h:618
ACE_TEXT("TCP_Factory")
DDS::OctetSeq local_participant_data_as_octets() const
Definition: Spdp.cpp:1214
Requester and replier should call process handshake.
sequence< octet > OctetSeq
Definition: DdsDcpsCore.idl:64
DCPS::GUID_t guid_
Definition: Spdp.h:393
OpenDDS_Dcps_Export SecurityDebug security_debug
Definition: debug.cpp:32
Requester should call begin_handshake_request.
OpenDDS::DCPS::GUID_t source_guid
OpenDDS::DCPS::GUID_t destination_participant_guid

◆ send_participant_crypto_tokens()

void OpenDDS::RTPS::Spdp::send_participant_crypto_tokens ( const DCPS::GUID_t id)

Definition at line 3779 of file Spdp.cpp.

References ACE_ERROR, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), OpenDDS::DCPS::DCPS_debug_level, DDS::Security::ParticipantGenericMessage::destination_endpoint_guid, DDS::Security::ParticipantGenericMessage::destination_participant_guid, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_PARTICIPANT, DDS::Security::GMCLASSID_SECURITY_PARTICIPANT_CRYPTO_TOKENS, guid_, OpenDDS::DCPS::GUID_UNKNOWN, LM_ERROR, OpenDDS::DCPS::make_id(), DDS::Security::ParticipantGenericMessage::message_class_id, DDS::Security::ParticipantGenericMessage::message_data, DDS::Security::ParticipantGenericMessage::message_identity, participants_, DDS::Security::ParticipantGenericMessage::related_message_identity, DDS::RETCODE_OK, sedp_, DDS::Security::ParticipantGenericMessage::source_endpoint_guid, and DDS::Security::MessageIdentity::source_guid.

Referenced by OpenDDS::RTPS::Sedp::association_complete_i().

3780 {
3781  const DCPS::GUID_t peer = make_id(id, ENTITYID_PARTICIPANT);
3782  const DiscoveredParticipantIter iter = participants_.find(peer);
3783  if (iter == participants_.end()) {
3784  if (DCPS::DCPS_debug_level > 0) {
3785  const DCPS::LogGuid logger(peer);
3786  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::send_participant_crypto_tokens() - ")
3787  ACE_TEXT("Discovered participant %C not found.\n"),
3788  logger.c_str()));
3789  }
3790  return;
3791  }
3792 
3793  const DDS::Security::ParticipantCryptoTokenSeq& pcts = iter->second.crypto_tokens_;
3794 
3795  if (pcts.length() != 0) {
3797 
3798  const DCPS::GUID_t reader = make_id(peer, ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER);
3799 
3801  msg.message_identity.source_guid = writer;
3804  msg.destination_participant_guid = peer;
3805  msg.destination_endpoint_guid = GUID_UNKNOWN; // unknown = whole participant
3807  msg.message_data = reinterpret_cast<const DDS::Security::DataHolderSeq&>(pcts);
3808 
3809  if (sedp_->write_volatile_message(msg, reader) != DDS::RETCODE_OK) {
3810  if (DCPS::DCPS_debug_level > 0) {
3811  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::send_participant_crypto_tokens() - ")
3812  ACE_TEXT("Unable to write volatile message.\n")));
3813  }
3814  }
3815  }
3816 
3817  iter->second.participant_tokens_sent_ = true;
3818 }
#define ACE_ERROR(X)
const ReturnCode_t RETCODE_OK
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER
Definition: MessageTypes.h:86
sequence< DataHolder > DataHolderSeq
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const EntityId_t ENTITYID_PARTICIPANT
Definition: GuidUtils.h:37
const string GMCLASSID_SECURITY_PARTICIPANT_CRYPTO_TOKENS
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER
Definition: MessageTypes.h:85
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
CryptoTokenSeq ParticipantCryptoTokenSeq
DCPS::GUID_t guid_
Definition: Spdp.h:393
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
OpenDDS::DCPS::GUID_t source_guid
OpenDDS::DCPS::GUID_t destination_participant_guid
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ set_auth_state()

void OpenDDS::RTPS::Spdp::set_auth_state ( DiscoveredParticipant dp,
AuthState  state 
)
private

◆ shutdown()

void OpenDDS::RTPS::Spdp::shutdown ( void  )

Definition at line 358 of file Spdp.cpp.

References CORBA::Exception::_info(), ACE_DEBUG, ACE_ERROR, ACE_GUARD, ACE_TEXT(), ACE_String_Base< char >::c_str(), OpenDDS::DCPS::DCPS_debug_level, eh_shutdown_, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER, guid_, ice_agent_, LM_ERROR, LM_INFO, lock_, OpenDDS::DCPS::make_id(), participants_, purge_discovered_participant(), purge_handshake_deadlines(), sedp_, shutdown_cond_, shutdown_flag_, stop_ice(), TheServiceParticipant, tport_, OpenDDS::DCPS::ConditionVariable< Mutex >::wait(), and write_secure_disposes().

359 {
360  {
362  shutdown_flag_ = true;
363  if (DCPS::DCPS_debug_level > 3) {
364  ACE_DEBUG((LM_INFO,
365  ACE_TEXT("(%P|%t) Spdp::~Spdp ")
366  ACE_TEXT("remove discovered participants\n")));
367  }
368 
369 #ifdef OPENDDS_SECURITY
370  try {
372  } catch (const CORBA::Exception& e) {
373  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::~Spdp() - from ")
374  ACE_TEXT("write_secure_disposes: %C\n"), e._info().c_str()));
375  }
376 #endif
377 
378  for (DiscoveredParticipantIter part = participants_.begin(); part != participants_.end(); ++part) {
379 #ifdef OPENDDS_SECURITY
380  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
381  if (sedp_endpoint) {
382  stop_ice(sedp_endpoint, part->first, part->second.pdata_.participantProxy.availableBuiltinEndpoints,
383  part->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
384  }
385  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint = tport_->get_ice_endpoint();
386  if (spdp_endpoint) {
387  ice_agent_->stop_ice(spdp_endpoint, guid_, part->first);
388  }
390 #endif
392  }
393  }
394 
395 #ifdef OPENDDS_SECURITY
396  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
397  if (sedp_endpoint) {
399  ice_agent_->remove_local_agent_info_listener(sedp_endpoint, l);
400  }
401 #endif
402 
403  // ensure sedp's task queue is drained before data members are being
404  // deleted
405  sedp_->shutdown();
406 
407  // release lock for reset of event handler, which may delete transport
408  tport_->close(sedp_->reactor_task());
409  tport_.reset();
410  {
412  DCPS::ThreadStatusManager& thread_status_manager = TheServiceParticipant->get_thread_status_manager();
413  while (!eh_shutdown_) {
414  shutdown_cond_.wait(thread_status_manager);
415  }
416  }
417 }
#define ACE_DEBUG(X)
#define ACE_ERROR(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
const char * c_str(void) const
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
void purge_handshake_deadlines(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4315
void stop_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
Definition: Spdp.cpp:3987
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4673
void write_secure_disposes()
Definition: Spdp.cpp:438
bool eh_shutdown_
Definition: Spdp.h:600
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
virtual ACE_CString _info(void) const=0
CvStatus wait(ThreadStatusManager &thread_status_manager)
Block until thread is woken up.
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
DCPS::GUID_t guid_
Definition: Spdp.h:393
DCPS::ConditionVariable< ACE_Thread_Mutex > shutdown_cond_
Definition: Spdp.h:601
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
#define TheServiceParticipant
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER
Definition: GuidUtils.h:41
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ shutting_down()

bool OpenDDS::RTPS::Spdp::shutting_down ( void  )
inline

◆ signal_liveliness()

void OpenDDS::RTPS::Spdp::signal_liveliness ( DDS::LivelinessQosPolicyKind  kind)

Definition at line 3382 of file Spdp.cpp.

References sedp_.

3383 {
3384  sedp_->signal_liveliness(kind);
3385 }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606

◆ spdp_rtps_relay_address_change()

void OpenDDS::RTPS::Spdp::spdp_rtps_relay_address_change ( )

Definition at line 2774 of file Spdp.cpp.

References ACE_GUARD, config_, lock_, tport_, and OpenDDS::DCPS::TimeDuration::zero_value.

2775 {
2776 #ifdef OPENDDS_SECURITY
2778 
2779  tport_->relay_spdp_task_->cancel();
2780  tport_->relay_spdp_task_falloff_.set(config_->sedp_heartbeat_period());
2781  tport_->relay_spdp_task_->schedule(TimeDuration::zero_value);
2782 
2783  tport_->relay_stun_task_->cancel();
2784  tport_->relay_stun_task_falloff_.set(config_->sedp_heartbeat_period());
2785  tport_->relay_stun_task_->schedule(TimeDuration::zero_value);
2786 #endif
2787 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
static const TimeDuration zero_value
Definition: TimeDuration.h:31
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ start_ice()

void OpenDDS::RTPS::Spdp::start_ice ( DCPS::WeakRcHandle< ICE::Endpoint endpoint,
DCPS::GUID_t  remote,
BuiltinEndpointSet_t  avail,
DDS::Security::ExtendedBuiltinEndpointSet_t  extended_avail,
const ICE::AgentInfo agent_info 
)
private

Definition at line 3845 of file Spdp.cpp.

References OpenDDS::RTPS::BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER, DDS::Security::BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER, DDS::Security::BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER, DDS::Security::BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER, DDS::Security::BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER, DDS::Security::BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER, DDS::Security::BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR, OpenDDS::DCPS::GUID_t::entityId, OpenDDS::DCPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER, OpenDDS::RTPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER, OpenDDS::RTPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER, OpenDDS::RTPS::ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER, OpenDDS::RTPS::ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER, OpenDDS::RTPS::ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER, OpenDDS::RTPS::ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_TL_SVC_REPLY_READER, OpenDDS::RTPS::ENTITYID_TL_SVC_REPLY_READER_SECURE, OpenDDS::DCPS::ENTITYID_TL_SVC_REPLY_WRITER, OpenDDS::RTPS::ENTITYID_TL_SVC_REPLY_WRITER_SECURE, OpenDDS::DCPS::ENTITYID_TL_SVC_REQ_READER, OpenDDS::RTPS::ENTITYID_TL_SVC_REQ_READER_SECURE, OpenDDS::DCPS::ENTITYID_TL_SVC_REQ_WRITER, OpenDDS::RTPS::ENTITYID_TL_SVC_REQ_WRITER_SECURE, guid_, ice_agent_, DDS::Security::SEDP_BUILTIN_PUBLICATIONS_SECURE_READER, DDS::Security::SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER, DDS::Security::SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER, DDS::Security::SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER, DDS::Security::SPDP_BUILTIN_PARTICIPANT_SECURE_READER, DDS::Security::SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER, DDS::Security::TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE, and DDS::Security::TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE.

Referenced by process_participant_ice(), and use_ice_now().

3848 {
3849  GUID_t l = guid_;
3850 
3851  // See RTPS v2.1 section 8.5.5.1
3855  ice_agent_->start_ice(endpoint, l, r, agent_info);
3856  }
3860  ice_agent_->start_ice(endpoint, l, r, agent_info);
3861  }
3865  ice_agent_->start_ice(endpoint, l, r, agent_info);
3866  }
3870  ice_agent_->start_ice(endpoint, l, r, agent_info);
3871  }
3875  ice_agent_->start_ice(endpoint, l, r, agent_info);
3876  }
3880  ice_agent_->start_ice(endpoint, l, r, agent_info);
3881  }
3883  l.entityId = ENTITYID_TL_SVC_REQ_READER;
3884  r.entityId = ENTITYID_TL_SVC_REQ_WRITER;
3885  ice_agent_->start_ice(endpoint, l, r, agent_info);
3886  }
3888  l.entityId = ENTITYID_TL_SVC_REQ_WRITER;
3889  r.entityId = ENTITYID_TL_SVC_REQ_READER;
3890  ice_agent_->start_ice(endpoint, l, r, agent_info);
3891  }
3893  l.entityId = ENTITYID_TL_SVC_REPLY_READER;
3894  r.entityId = ENTITYID_TL_SVC_REPLY_WRITER;
3895  ice_agent_->start_ice(endpoint, l, r, agent_info);
3896  }
3898  l.entityId = ENTITYID_TL_SVC_REPLY_WRITER;
3899  r.entityId = ENTITYID_TL_SVC_REPLY_READER;
3900  ice_agent_->start_ice(endpoint, l, r, agent_info);
3901  }
3902 
3903  using namespace DDS::Security;
3904  // See DDS-Security v1.1 section 7.3.7.1
3908  ice_agent_->start_ice(endpoint, l, r, agent_info);
3909  }
3913  ice_agent_->start_ice(endpoint, l, r, agent_info);
3914  }
3918  ice_agent_->start_ice(endpoint, l, r, agent_info);
3919  }
3923  ice_agent_->start_ice(endpoint, l, r, agent_info);
3924  }
3928  ice_agent_->start_ice(endpoint, l, r, agent_info);
3929  }
3933  ice_agent_->start_ice(endpoint, l, r, agent_info);
3934  }
3938  ice_agent_->start_ice(endpoint, l, r, agent_info);
3939  }
3943  ice_agent_->start_ice(endpoint, l, r, agent_info);
3944  }
3948  ice_agent_->start_ice(endpoint, l, r, agent_info);
3949  }
3953  ice_agent_->start_ice(endpoint, l, r, agent_info);
3954  }
3958  ice_agent_->start_ice(endpoint, l, r, agent_info);
3959  }
3963  ice_agent_->start_ice(endpoint, l, r, agent_info);
3964  }
3965  if (extended_avail & TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE) {
3966  l.entityId = ENTITYID_TL_SVC_REQ_READER_SECURE;
3967  r.entityId = ENTITYID_TL_SVC_REQ_WRITER_SECURE;
3968  ice_agent_->start_ice(endpoint, l, r, agent_info);
3969  }
3970  if (extended_avail & TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE) {
3971  l.entityId = ENTITYID_TL_SVC_REQ_WRITER_SECURE;
3972  r.entityId = ENTITYID_TL_SVC_REQ_READER_SECURE;
3973  ice_agent_->start_ice(endpoint, l, r, agent_info);
3974  }
3975  if (extended_avail & TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE) {
3978  ice_agent_->start_ice(endpoint, l, r, agent_info);
3979  }
3980  if (extended_avail & TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE) {
3983  ice_agent_->start_ice(endpoint, l, r, agent_info);
3984  }
3985 }
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER
Definition: RtpsCore.idl:217
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER
const EntityId_t ENTITYID_TL_SVC_REQ_READER_SECURE
Definition: MessageTypes.h:91
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
Definition: MessageTypes.h:78
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE
key EntityId_t entityId
Definition: DdsDcpsGuid.idl:59
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
Definition: MessageTypes.h:80
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER
Definition: GuidUtils.h:43
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE
const EntityId_t ENTITYID_TL_SVC_REPLY_READER_SECURE
Definition: MessageTypes.h:93
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER
Definition: GuidUtils.h:52
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
Definition: MessageTypes.h:81
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_READER
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER
Definition: MessageTypes.h:88
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER
Definition: RtpsCore.idl:219
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER
Definition: RtpsCore.idl:226
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
Definition: MessageTypes.h:77
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER
Definition: RtpsCore.idl:201
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER
Definition: MessageTypes.h:86
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER
Definition: GuidUtils.h:47
const EntityId_t ENTITYID_TL_SVC_REQ_READER
Definition: GuidUtils.h:53
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER
Definition: GuidUtils.h:54
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR
Definition: RtpsCore.idl:203
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER_SECURE
Definition: MessageTypes.h:90
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER
Definition: MessageTypes.h:85
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
Definition: MessageTypes.h:82
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER
Definition: RtpsCore.idl:224
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER_SECURE
Definition: MessageTypes.h:92
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER
Definition: GuidUtils.h:40
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER
Definition: MessageTypes.h:83
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR
Definition: RtpsCore.idl:207
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER
Definition: MessageTypes.h:87
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER
Definition: GuidUtils.h:42
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER
Definition: RtpsCore.idl:205
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
Definition: MessageTypes.h:79
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER
Definition: RtpsCore.idl:222
DCPS::GUID_t guid_
Definition: Spdp.h:393
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
Definition: MessageTypes.h:84
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER
Definition: RtpsCore.idl:228
const EntityId_t ENTITYID_TL_SVC_REPLY_READER
Definition: GuidUtils.h:55
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER
Definition: GuidUtils.h:41
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER
Definition: GuidUtils.h:46

◆ stop_ice()

void OpenDDS::RTPS::Spdp::stop_ice ( DCPS::WeakRcHandle< ICE::Endpoint endpoint,
DCPS::GUID_t  remote,
BuiltinEndpointSet_t  avail,
DDS::Security::ExtendedBuiltinEndpointSet_t  extended_avail 
)
private

Definition at line 3987 of file Spdp.cpp.

References OpenDDS::RTPS::BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER, OpenDDS::RTPS::BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER, DDS::Security::BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER, DDS::Security::BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER, DDS::Security::BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER, DDS::Security::BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER, DDS::Security::BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER, DDS::Security::BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER, OpenDDS::RTPS::DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR, OpenDDS::DCPS::GUID_t::entityId, OpenDDS::DCPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER, OpenDDS::RTPS::ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER, OpenDDS::RTPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER, OpenDDS::RTPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER, OpenDDS::RTPS::ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER, OpenDDS::RTPS::ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER, OpenDDS::RTPS::ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER, OpenDDS::RTPS::ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER, OpenDDS::DCPS::ENTITYID_TL_SVC_REPLY_READER, OpenDDS::RTPS::ENTITYID_TL_SVC_REPLY_READER_SECURE, OpenDDS::DCPS::ENTITYID_TL_SVC_REPLY_WRITER, OpenDDS::RTPS::ENTITYID_TL_SVC_REPLY_WRITER_SECURE, OpenDDS::DCPS::ENTITYID_TL_SVC_REQ_READER, OpenDDS::RTPS::ENTITYID_TL_SVC_REQ_READER_SECURE, OpenDDS::DCPS::ENTITYID_TL_SVC_REQ_WRITER, OpenDDS::RTPS::ENTITYID_TL_SVC_REQ_WRITER_SECURE, guid_, ice_agent_, DDS::Security::SEDP_BUILTIN_PUBLICATIONS_SECURE_READER, DDS::Security::SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER, DDS::Security::SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER, DDS::Security::SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER, DDS::Security::SPDP_BUILTIN_PARTICIPANT_SECURE_READER, DDS::Security::SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER, DDS::Security::TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE, DDS::Security::TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE, and DDS::Security::TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE.

Referenced by handle_participant_data(), process_handshake_deadlines(), process_lease_expirations(), process_participant_ice(), and shutdown().

3988  {
3989  GUID_t l = guid_;
3990 
3991  // See RTPS v2.1 section 8.5.5.1
3995  ice_agent_->stop_ice(endpoint, l, r);
3996  }
4000  ice_agent_->stop_ice(endpoint, l, r);
4001  }
4005  ice_agent_->stop_ice(endpoint, l, r);
4006  }
4010  ice_agent_->stop_ice(endpoint, l, r);
4011  }
4015  ice_agent_->stop_ice(endpoint, l, r);
4016  }
4020  ice_agent_->stop_ice(endpoint, l, r);
4021  }
4023  l.entityId = ENTITYID_TL_SVC_REQ_READER;
4024  r.entityId = ENTITYID_TL_SVC_REQ_WRITER;
4025  ice_agent_->stop_ice(endpoint, l, r);
4026  }
4028  l.entityId = ENTITYID_TL_SVC_REQ_WRITER;
4029  r.entityId = ENTITYID_TL_SVC_REQ_READER;
4030  ice_agent_->stop_ice(endpoint, l, r);
4031  }
4033  l.entityId = ENTITYID_TL_SVC_REPLY_READER;
4034  r.entityId = ENTITYID_TL_SVC_REPLY_WRITER;
4035  ice_agent_->stop_ice(endpoint, l, r);
4036  }
4038  l.entityId = ENTITYID_TL_SVC_REPLY_WRITER;
4039  r.entityId = ENTITYID_TL_SVC_REPLY_READER;
4040  ice_agent_->stop_ice(endpoint, l, r);
4041  }
4042 
4043  using namespace DDS::Security;
4044  // See DDS-Security v1.1 section 7.3.7.1
4048  ice_agent_->stop_ice(endpoint, l, r);
4049  }
4053  ice_agent_->stop_ice(endpoint, l, r);
4054  }
4058  ice_agent_->stop_ice(endpoint, l, r);
4059  }
4063  ice_agent_->stop_ice(endpoint, l, r);
4064  }
4068  ice_agent_->stop_ice(endpoint, l, r);
4069  }
4073  ice_agent_->stop_ice(endpoint, l, r);
4074  }
4078  ice_agent_->stop_ice(endpoint, l, r);
4079  }
4083  ice_agent_->stop_ice(endpoint, l, r);
4084  }
4088  ice_agent_->stop_ice(endpoint, l, r);
4089  }
4093  ice_agent_->stop_ice(endpoint, l, r);
4094  }
4098  ice_agent_->stop_ice(endpoint, l, r);
4099  }
4103  ice_agent_->stop_ice(endpoint, l, r);
4104  }
4105  if (extended_avail & TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE) {
4106  l.entityId = ENTITYID_TL_SVC_REQ_READER_SECURE;
4107  r.entityId = ENTITYID_TL_SVC_REQ_WRITER_SECURE;
4108  ice_agent_->stop_ice(endpoint, l, r);
4109  }
4110  if (extended_avail & TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE) {
4111  l.entityId = ENTITYID_TL_SVC_REQ_WRITER_SECURE;
4112  r.entityId = ENTITYID_TL_SVC_REQ_READER_SECURE;
4113  ice_agent_->stop_ice(endpoint, l, r);
4114  }
4115  if (extended_avail & TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE) {
4118  ice_agent_->stop_ice(endpoint, l, r);
4119  }
4120  if (extended_avail & TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE) {
4123  ice_agent_->stop_ice(endpoint, l, r);
4124  }
4125 }
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER
Definition: RtpsCore.idl:217
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER
const EntityId_t ENTITYID_TL_SVC_REQ_READER_SECURE
Definition: MessageTypes.h:91
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
Definition: MessageTypes.h:78
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE
key EntityId_t entityId
Definition: DdsDcpsGuid.idl:59
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
Definition: MessageTypes.h:80
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER
Definition: GuidUtils.h:43
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE
const EntityId_t ENTITYID_TL_SVC_REPLY_READER_SECURE
Definition: MessageTypes.h:93
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER
Definition: GuidUtils.h:52
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
Definition: MessageTypes.h:81
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_READER
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER
Definition: MessageTypes.h:88
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER
Definition: RtpsCore.idl:219
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER
Definition: RtpsCore.idl:226
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
Definition: MessageTypes.h:77
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER
Definition: RtpsCore.idl:201
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER
Definition: MessageTypes.h:86
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER
Definition: GuidUtils.h:47
const EntityId_t ENTITYID_TL_SVC_REQ_READER
Definition: GuidUtils.h:53
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER
Definition: GuidUtils.h:54
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR
Definition: RtpsCore.idl:203
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER_SECURE
Definition: MessageTypes.h:90
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER
Definition: MessageTypes.h:85
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
Definition: MessageTypes.h:82
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER
Definition: RtpsCore.idl:224
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER_SECURE
Definition: MessageTypes.h:92
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER
Definition: GuidUtils.h:40
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER
Definition: MessageTypes.h:83
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR
Definition: RtpsCore.idl:207
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER
Definition: MessageTypes.h:87
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER
Definition: GuidUtils.h:42
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER
Definition: RtpsCore.idl:205
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
Definition: MessageTypes.h:79
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER
Definition: RtpsCore.idl:222
DCPS::GUID_t guid_
Definition: Spdp.h:393
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
Definition: MessageTypes.h:84
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER
Definition: RtpsCore.idl:228
const EntityId_t ENTITYID_TL_SVC_REPLY_READER
Definition: GuidUtils.h:55
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER
Definition: GuidUtils.h:41
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER
Definition: GuidUtils.h:46

◆ update_agent_info()

void OpenDDS::RTPS::Spdp::update_agent_info ( const DCPS::GUID_t local_guid,
const ICE::AgentInfo agent_info 
)
privatevirtual

Implements OpenDDS::ICE::AgentInfoListener.

Definition at line 2136 of file Spdp.cpp.

References is_security_enabled(), and write_secure_updates().

2137 {
2138  if (is_security_enabled()) {
2140  }
2141 }
bool is_security_enabled() const
Definition: Spdp.h:159
void write_secure_updates()
Definition: Spdp.cpp:425

◆ update_domain_participant_qos()

bool OpenDDS::RTPS::Spdp::update_domain_participant_qos ( const DDS::DomainParticipantQos qos)

Definition at line 4645 of file Spdp.cpp.

References ACE_GUARD_RETURN, announce_domain_participant_qos(), lock_, and qos_.

4646 {
4648  qos_ = qos;
4650 }
DDS::DomainParticipantQos qos_
Definition: Spdp.h:380
bool announce_domain_participant_qos()
Definition: Spdp.cpp:2287
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378

◆ update_lease_expiration_i()

void OpenDDS::RTPS::Spdp::update_lease_expiration_i ( DiscoveredParticipantIter  iter,
const DCPS::MonotonicTimePoint now 
)
private

Definition at line 3694 of file Spdp.cpp.

References lease_expirations_, lease_extension_, remove_lease_expiration_i(), OpenDDS::RTPS::rtps_duration_to_time_duration(), OpenDDS::DCPS::InternalDataReaderListener< DCPS::NetworkInterfaceAddress >::schedule(), and tport_.

Referenced by handle_participant_data().

3696 {
3698 
3699  // Compute new expiration.
3700  const DCPS::TimeDuration d =
3701  rtps_duration_to_time_duration(iter->second.pdata_.leaseDuration,
3702  iter->second.pdata_.participantProxy.protocolVersion,
3703  iter->second.pdata_.participantProxy.vendorId);
3704 
3705  iter->second.lease_expiration_ = now + d + lease_extension_;
3706 
3707  // Insert.
3708  const bool cancel = !lease_expirations_.empty() && iter->second.lease_expiration_ < lease_expirations_.begin()->first;
3709  const bool schedule = lease_expirations_.empty() || iter->second.lease_expiration_ < lease_expirations_.begin()->first;
3710 
3711  lease_expirations_.insert(std::make_pair(iter->second.lease_expiration_, iter->first));
3712 
3713  if (cancel) {
3714  tport_->lease_expiration_task_->cancel();
3715  }
3716  if (schedule) {
3717  tport_->lease_expiration_task_->schedule(d);
3718  }
3719 }
DCPS::TimeDuration rtps_duration_to_time_duration(const Duration_t &rtps_duration, const ProtocolVersion_t &version, const VendorId_t &vendor)
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
TimeQueue lease_expirations_
Definition: Spdp.h:614
DCPS::TimeDuration lease_extension_
Definition: Spdp.h:388
void remove_lease_expiration_i(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:3682

◆ update_publication_locators()

void OpenDDS::RTPS::Spdp::update_publication_locators ( const GUID_t publicationId,
const DCPS::TransportLocatorSeq transInfo 
)
inline

Definition at line 291 of file Spdp.h.

293  {
294  endpoint_manager().update_publication_locators(publicationId, transInfo);
295  }
void update_publication_locators(const GUID_t &publicationId, const DCPS::TransportLocatorSeq &transInfo)
Definition: Sedp.cpp:6245
Sedp & endpoint_manager()
Definition: Spdp.h:354

◆ update_publication_qos()

bool OpenDDS::RTPS::Spdp::update_publication_qos ( const GUID_t publicationId,
const DDS::DataWriterQos qos,
const DDS::PublisherQos publisherQos 
)
inline

Definition at line 283 of file Spdp.h.

287  {
288  return endpoint_manager().update_publication_qos(publicationId, qos, publisherQos);
289  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
bool update_publication_qos(const DCPS::GUID_t &publicationId, const DDS::DataWriterQos &qos, const DDS::PublisherQos &publisherQos)
Definition: Sedp.cpp:1901

◆ update_rtps_relay_application_participant_i()

void OpenDDS::RTPS::Spdp::update_rtps_relay_application_participant_i ( DiscoveredParticipantIter  iter,
bool  new_participant 
)
private

Definition at line 2738 of file Spdp.cpp.

References ACE_DEBUG, ACE_TEXT(), OpenDDS::DCPS::LogGuid::c_str(), config_, OpenDDS::DCPS::DCPS_debug_level, LM_DEBUG, participants_, purge_discovered_participant(), tport_, and OpenDDS::DCPS::TimeDuration::zero_value.

Referenced by handle_participant_data().

2739 {
2740  if (!iter->second.pdata_.participantProxy.opendds_rtps_relay_application_participant) {
2741  return;
2742  }
2743 
2744  if (new_participant) {
2745 #ifdef OPENDDS_SECURITY
2746  tport_->relay_spdp_task_->cancel();
2747  tport_->relay_spdp_task_falloff_.set(config_->sedp_heartbeat_period());
2748  tport_->relay_spdp_task_->schedule(TimeDuration::zero_value);
2749 #endif
2750  }
2751 
2752  if (DCPS::DCPS_debug_level) {
2753  ACE_DEBUG((LM_DEBUG,
2754  ACE_TEXT("(%P|%t) Spdp::update_rtps_relay_application_participant - %C is an RtpsRelay application participant\n"),
2755  DCPS::LogGuid(iter->first).c_str()));
2756  }
2757 
2758  for (DiscoveredParticipantIter pos = participants_.begin(), limit = participants_.end(); pos != limit;) {
2759  if (pos != iter && pos->second.pdata_.participantProxy.opendds_rtps_relay_application_participant) {
2760  if (DCPS::DCPS_debug_level) {
2761  ACE_DEBUG((LM_DEBUG,
2762  ACE_TEXT("(%P|%t) Spdp::update_rtps_relay_application_participant - removing previous RtpsRelay application participant %C\n"),
2763  DCPS::LogGuid(pos->first).c_str()));
2764  }
2766  participants_.erase(pos++);
2767  } else {
2768  ++pos;
2769  }
2770  }
2771 }
#define ACE_DEBUG(X)
static const TimeDuration zero_value
Definition: TimeDuration.h:31
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4673
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
ACE_TEXT("TCP_Factory")
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ update_subscription_locators()

void OpenDDS::RTPS::Spdp::update_subscription_locators ( const GUID_t subId,
const DCPS::TransportLocatorSeq transInfo 
)
inline

Definition at line 336 of file Spdp.h.

337  {
339  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
void update_subscription_locators(const GUID_t &subscriptionId, const DCPS::TransportLocatorSeq &transInfo)
Definition: Sedp.cpp:6391

◆ update_subscription_params()

bool OpenDDS::RTPS::Spdp::update_subscription_params ( const GUID_t subId,
const DDS::StringSeq params 
)
inline

Definition at line 331 of file Spdp.h.

332  {
333  return endpoint_manager().update_subscription_params(subId, params);
334  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
bool update_subscription_params(const DCPS::GUID_t &subId, const DDS::StringSeq &params)
Definition: Sedp.cpp:1977

◆ update_subscription_qos()

bool OpenDDS::RTPS::Spdp::update_subscription_qos ( const GUID_t subscriptionId,
const DDS::DataReaderQos qos,
const DDS::SubscriberQos subscriberQos 
)
inline

Definition at line 323 of file Spdp.h.

327  {
328  return endpoint_manager().update_subscription_qos(subscriptionId, qos, subscriberQos);
329  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
bool update_subscription_qos(const DCPS::GUID_t &subscriptionId, const DDS::DataReaderQos &qos, const DDS::SubscriberQos &subscriberQos)
Definition: Sedp.cpp:1951

◆ update_topic_qos()

bool OpenDDS::RTPS::Spdp::update_topic_qos ( const GUID_t topicId,
const DDS::TopicQos qos 
)
inline

Definition at line 255 of file Spdp.h.

256  {
257  return endpoint_manager().update_topic_qos(topicId, qos);
258  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
bool update_topic_qos(const DCPS::GUID_t &topicId, const DDS::TopicQos &qos)
Definition: Sedp.cpp:1840

◆ use_ice_now()

void OpenDDS::RTPS::Spdp::use_ice_now ( bool  f)

Definition at line 4539 of file Spdp.cpp.

References ACE_GUARD, enqueue_location_update_i(), OpenDDS::DCPS::ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER, guid_, ice_agent_, is_security_enabled(), OpenDDS::DCPS::LOCATION_ICE, OpenDDS::DCPS::LOCATION_ICE6, lock_, OpenDDS::DCPS::make_id(), participants_, process_location_updates_i(), OpenDDS::DCPS::rchandle_from(), sedp_, start_ice(), tport_, and write_secure_updates().

4540 {
4541  ACE_UNUSED_ARG(flag);
4542 
4543 #ifdef OPENDDS_SECURITY
4544  sedp_->use_ice_now(flag);
4545 
4546  if (flag) {
4547  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint = tport_->get_ice_endpoint();
4548  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
4549 
4550  if (sedp_endpoint) {
4552  ice_agent_->add_local_agent_info_listener(sedp_endpoint, l, DCPS::static_rchandle_cast<ICE::AgentInfoListener>(DCPS::rchandle_from(this)));
4553  }
4554 
4555  ice_agent_->add_endpoint(DCPS::static_rchandle_cast<ICE::Endpoint>(tport_));
4557  tport_->ice_endpoint_added_ = true;
4558  if (spdp_endpoint) {
4559  ice_agent_->add_local_agent_info_listener(spdp_endpoint, guid_, DCPS::static_rchandle_cast<ICE::AgentInfoListener>(DCPS::rchandle_from(this)));
4560  }
4561 
4562  for (DiscoveredParticipantConstIter pos = participants_.begin(), limit = participants_.end(); pos != limit; ++pos) {
4563  if (spdp_endpoint && pos->second.have_spdp_info_) {
4564  ice_agent_->start_ice(spdp_endpoint, guid_, pos->first, pos->second.spdp_info_);
4565  }
4566 
4567  if (sedp_endpoint && pos->second.have_sedp_info_) {
4568  start_ice(sedp_endpoint, pos->first, pos->second.pdata_.participantProxy.availableBuiltinEndpoints,
4569  pos->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints, pos->second.sedp_info_);
4570  }
4571  }
4572  } else {
4573  ice_agent_->remove_endpoint(DCPS::static_rchandle_cast<ICE::Endpoint>(tport_));
4575  tport_->ice_endpoint_added_ = false;
4576 
4577 #ifndef DDS_HAS_MINIMUM_BIT
4578  const DCPS::ParticipantLocation mask =
4581 
4582  for (DiscoveredParticipantIter part = participants_.begin();
4583  part != participants_.end();
4584  ++part) {
4585  enqueue_location_update_i(part, mask, ACE_INET_Addr(), "use_ice_now");
4586  process_location_updates_i(part, "use_ice_now");
4587  }
4588 #endif
4589  }
4590 
4591  if (is_security_enabled()) {
4593  }
4594 #endif
4595 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
void start_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail, const ICE::AgentInfo &agent_info)
Definition: Spdp.cpp:3845
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:457
bool is_security_enabled() const
Definition: Spdp.h:159
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const ParticipantLocation LOCATION_ICE
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
unsigned long ParticipantLocation
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
void write_secure_updates()
Definition: Spdp.cpp:425
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310
const ParticipantLocation LOCATION_ICE6
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:471
DCPS::GUID_t guid_
Definition: Spdp.h:393
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER
Definition: GuidUtils.h:41
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200

◆ use_rtps_relay_now()

void OpenDDS::RTPS::Spdp::use_rtps_relay_now ( bool  f)

Definition at line 4495 of file Spdp.cpp.

References ACE_GUARD, config_, enqueue_location_update_i(), OpenDDS::DCPS::LOCATION_RELAY, OpenDDS::DCPS::LOCATION_RELAY6, lock_, participants_, process_location_updates_i(), sedp_, tport_, and OpenDDS::DCPS::TimeDuration::zero_value.

4496 {
4497  ACE_UNUSED_ARG(f);
4498 
4499 #ifdef OPENDDS_SECURITY
4500  sedp_->use_rtps_relay_now(f);
4501 
4502  if (f) {
4504  tport_->relay_spdp_task_falloff_.set(config_->sedp_heartbeat_period());
4505  tport_->relay_spdp_task_->schedule(TimeDuration::zero_value);
4506 
4507  tport_->relay_stun_task_falloff_.set(config_->sedp_heartbeat_period());
4508  tport_->relay_stun_task_->schedule(TimeDuration::zero_value);
4509  } else {
4511 
4512  if (!config_->rtps_relay_only()) {
4513  if (tport_->relay_spdp_task_) {
4514  tport_->relay_spdp_task_->cancel();
4515  }
4516  if (tport_->relay_stun_task_) {
4517  tport_->disable_relay_stun_task();
4518  }
4519  }
4520 
4521 #ifndef DDS_HAS_MINIMUM_BIT
4522  const DCPS::ParticipantLocation mask =
4525 
4526  for (DiscoveredParticipantIter iter = participants_.begin();
4527  iter != participants_.end();
4528  ++iter) {
4529  enqueue_location_update_i(iter, mask, ACE_INET_Addr(), "use_rtps_relay_now");
4530  process_location_updates_i(iter, "use_rtps_relay_now");
4531  }
4532 #endif
4533 
4534  }
4535 #endif
4536 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
static const TimeDuration zero_value
Definition: TimeDuration.h:31
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:457
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
unsigned long ParticipantLocation
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
const ParticipantLocation LOCATION_RELAY
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:471
const ParticipantLocation LOCATION_RELAY6
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384

◆ validateSequenceNumber()

bool OpenDDS::RTPS::Spdp::validateSequenceNumber ( const DCPS::MonotonicTimePoint now,
const DCPS::SequenceNumber seq,
DiscoveredParticipantIter iter 
)

Definition at line 1027 of file Spdp.cpp.

References OpenDDS::DCPS::SequenceNumber::getValue(), OpenDDS::DCPS::SequenceNumber::MAX_VALUE, and min_resend_delay_.

Referenced by handle_participant_data().

1028 {
1029  if (seq.getValue() != 0 && iter->second.max_seq_ != DCPS::SequenceNumber::MAX_VALUE) {
1030  if (seq < iter->second.max_seq_) {
1031  const bool honeymoon_period = now < iter->second.discovered_at_ + min_resend_delay_;
1032  if (!honeymoon_period) {
1033  ++iter->second.seq_reset_count_;
1034  }
1035  return false;
1036  } else if (iter->second.seq_reset_count_ > 0) {
1037  --iter->second.seq_reset_count_;
1038  }
1039  }
1040  iter->second.max_seq_ = std::max(iter->second.max_seq_, seq);
1041  return true;
1042 }
const DCPS::TimeDuration min_resend_delay_
Definition: Spdp.h:386
static const Value MAX_VALUE

◆ write_secure_disposes()

void OpenDDS::RTPS::Spdp::write_secure_disposes ( )

Definition at line 438 of file Spdp.cpp.

References DDS::Security::ParticipantBuiltinTopicData::base, DDS::Security::ParticipantBuiltinTopicDataSecure::base, OpenDDS::Security::SPDPdiscoveredParticipantData::ddsParticipantDataSecure, guid_, and sedp_.

Referenced by shutdown().

439 {
440  sedp_->write_dcps_participant_dispose(guid_);
441 }
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
DCPS::GUID_t guid_
Definition: Spdp.h:393

◆ write_secure_updates()

void OpenDDS::RTPS::Spdp::write_secure_updates ( )

Write Secured Updated DP QOS

lock_ must be acquired before calling this.

Definition at line 425 of file Spdp.cpp.

References build_local_pdata(), OpenDDS::Security::DPDK_SECURE, OpenDDS::DCPS::GUID_UNKNOWN, initialized_flag_, sedp_, and shutdown_flag_.

Referenced by announce_domain_participant_qos(), remove_agent_info(), update_agent_info(), and use_ice_now().

426 {
428  return;
429  }
430 
431  const Security::SPDPdiscoveredParticipantData pdata =
433 
434  sedp_->write_dcps_participant_secure(pdata, GUID_UNKNOWN);
435 }
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
ParticipantData_t build_local_pdata(bool always_in_the_clear, Security::DiscoveredParticipantDataKind kind)
Definition: Spdp.cpp:2198
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603

Friends And Related Function Documentation

◆ ::DDS_TEST

friend class ::DDS_TEST
friend

Definition at line 652 of file Spdp.h.

◆ Sedp

friend class Sedp
friend

Definition at line 381 of file Spdp.h.

Member Data Documentation

◆ available_builtin_endpoints_

BuiltinEndpointSet_t OpenDDS::RTPS::Spdp::available_builtin_endpoints_
private

Definition at line 605 of file Spdp.h.

Referenced by build_local_pdata(), and init().

◆ available_extended_builtin_endpoints_

DDS::Security::ExtendedBuiltinEndpointSet_t OpenDDS::RTPS::Spdp::available_extended_builtin_endpoints_
private

Definition at line 617 of file Spdp.h.

Referenced by build_local_pdata(), and init().

◆ bit_subscriber_

DCPS::RcHandle<DCPS::BitSubscriber> OpenDDS::RTPS::Spdp::bit_subscriber_
private

◆ config_

DCPS::RcHandle<RtpsDiscoveryConfig> OpenDDS::RTPS::Spdp::config_
private

◆ crypto_handle_

DDS::Security::ParticipantCryptoHandle OpenDDS::RTPS::Spdp::crypto_handle_
private

◆ disco_

RtpsDiscovery* OpenDDS::RTPS::Spdp::disco_
private

Definition at line 383 of file Spdp.h.

Referenced by init_bit().

◆ domain_

const DDS::DomainId_t OpenDDS::RTPS::Spdp::domain_
private

Definition at line 392 of file Spdp.h.

Referenced by build_local_pdata(), data_received(), init_bit(), and match_authenticated().

◆ eh_shutdown_

bool OpenDDS::RTPS::Spdp::eh_shutdown_
private

Definition at line 600 of file Spdp.h.

Referenced by shutdown().

◆ guid_

DCPS::GUID_t OpenDDS::RTPS::Spdp::guid_
private

◆ handshake_deadlines_

TimeQueue OpenDDS::RTPS::Spdp::handshake_deadlines_
private

◆ handshake_resends_

TimeQueue OpenDDS::RTPS::Spdp::handshake_resends_
private

◆ ice_agent_

DCPS::RcHandle<ICE::Agent> OpenDDS::RTPS::Spdp::ice_agent_
private

◆ identity_handle_

DDS::Security::IdentityHandle OpenDDS::RTPS::Spdp::identity_handle_
private

◆ identity_status_token_

DDS::Security::IdentityStatusToken OpenDDS::RTPS::Spdp::identity_status_token_
private

Definition at line 628 of file Spdp.h.

Referenced by build_local_pdata(), local_participant_data_as_octets(), and Spdp().

◆ identity_token_

DDS::Security::IdentityToken OpenDDS::RTPS::Spdp::identity_token_
private

Definition at line 627 of file Spdp.h.

Referenced by build_local_pdata(), local_participant_data_as_octets(), and Spdp().

◆ initialized_flag_

AtomicBool OpenDDS::RTPS::Spdp::initialized_flag_
private

◆ is_application_participant_

bool OpenDDS::RTPS::Spdp::is_application_participant_
private

Definition at line 395 of file Spdp.h.

Referenced by build_local_pdata(), and init().

◆ lease_duration_

DCPS::TimeDuration OpenDDS::RTPS::Spdp::lease_duration_
private

Definition at line 387 of file Spdp.h.

Referenced by build_local_pdata().

◆ lease_expirations_

TimeQueue OpenDDS::RTPS::Spdp::lease_expirations_
private

◆ lease_extension_

DCPS::TimeDuration OpenDDS::RTPS::Spdp::lease_extension_
private

Definition at line 388 of file Spdp.h.

Referenced by update_lease_expiration_i().

◆ lock_

ACE_Thread_Mutex OpenDDS::RTPS::Spdp::lock_
mutableprivate

◆ min_resend_delay_

const DCPS::TimeDuration OpenDDS::RTPS::Spdp::min_resend_delay_
private

Definition at line 386 of file Spdp.h.

Referenced by validateSequenceNumber().

◆ n_participants_in_authentication_

size_t OpenDDS::RTPS::Spdp::n_participants_in_authentication_
private

Definition at line 648 of file Spdp.h.

Referenced by handle_participant_data(), purge_discovered_participant(), and set_auth_state().

◆ participant_discovered_at_

const DCPS::MonotonicTime_t OpenDDS::RTPS::Spdp::participant_discovered_at_
private

Definition at line 394 of file Spdp.h.

Referenced by build_local_pdata(), and get_participant_discovered_at().

◆ participant_sec_attr_

DDS::Security::ParticipantSecurityAttributes OpenDDS::RTPS::Spdp::participant_sec_attr_
private

◆ participants_

DiscoveredParticipantMap OpenDDS::RTPS::Spdp::participants_
private

◆ permissions_credential_token_

DDS::Security::PermissionsCredentialToken OpenDDS::RTPS::Spdp::permissions_credential_token_
private

Definition at line 630 of file Spdp.h.

Referenced by Spdp().

◆ permissions_handle_

DDS::Security::PermissionsHandle OpenDDS::RTPS::Spdp::permissions_handle_
private

Definition at line 624 of file Spdp.h.

Referenced by Spdp().

◆ permissions_token_

DDS::Security::PermissionsToken OpenDDS::RTPS::Spdp::permissions_token_
private

Definition at line 629 of file Spdp.h.

Referenced by build_local_pdata(), local_participant_data_as_octets(), and Spdp().

◆ qos_

DDS::DomainParticipantQos OpenDDS::RTPS::Spdp::qos_
private

◆ quick_resend_ratio_

const double OpenDDS::RTPS::Spdp::quick_resend_ratio_
private

Definition at line 385 of file Spdp.h.

◆ security_config_

Security::SecurityConfig_rch OpenDDS::RTPS::Spdp::security_config_
private

◆ security_enabled_

bool OpenDDS::RTPS::Spdp::security_enabled_
private

Definition at line 619 of file Spdp.h.

Referenced by secure_part_user_data().

◆ sedp_

DCPS::RcHandle<Sedp> OpenDDS::RTPS::Spdp::sedp_
private

◆ shutdown_cond_

DCPS::ConditionVariable<ACE_Thread_Mutex> OpenDDS::RTPS::Spdp::shutdown_cond_
private

Definition at line 601 of file Spdp.h.

Referenced by shutdown().

◆ shutdown_flag_

AtomicBool OpenDDS::RTPS::Spdp::shutdown_flag_
private

◆ stateless_sequence_number_

DCPS::SequenceNumber OpenDDS::RTPS::Spdp::stateless_sequence_number_
private

Definition at line 621 of file Spdp.h.

Referenced by attempt_authentication(), and send_handshake_message().

◆ tport_

DCPS::RcHandle<SpdpTransport> OpenDDS::RTPS::Spdp::tport_
private

◆ type_lookup_service_

XTypes::TypeLookupService_rch OpenDDS::RTPS::Spdp::type_lookup_service_
private

Definition at line 389 of file Spdp.h.

Referenced by init(), and init_bit().


The documentation for this class was generated from the following files: