OpenDDS  Snapshot(2023/04/28-20:55)
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 219 of file Spdp.cpp.

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

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

◆ 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 264 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_.

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

◆ ~Spdp()

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

Definition at line 422 of file Spdp.cpp.

423 {
424 }

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 2290 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().

2291 {
2292 
2293 #ifdef OPENDDS_SECURITY
2294  if (is_security_enabled()) {
2296  }
2297 #endif
2298 
2299  return true;
2300 }
void write_secure_updates()
Definition: Spdp.cpp:428
bool is_security_enabled() const
Definition: Spdp.h:159

◆ append_transport_statistics()

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

Definition at line 2802 of file Spdp.cpp.

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

2803 {
2804  {
2806  append(seq, tport_->transport_statistics_);
2807  tport_->transport_statistics_.clear();
2808  }
2809  sedp_->append_transport_statistics(seq);
2810 }
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
void append(TransportStatisticsSequence &seq, const InternalTransportStatistics &istats)

◆ 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 4680 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.

4683 {
4684  if (std::strlen(topicName) > 256 || std::strlen(dataTypeName) > 256) {
4685  if (DCPS_debug_level) {
4686  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR LocalParticipant::assert_topic() - ")
4687  ACE_TEXT("topic or type name length limit (256) exceeded\n")));
4688  }
4690  }
4691 
4692  return endpoint_manager().assert_topic(topicId, topicName, dataTypeName, qos, hasDcpsKey, topic_callbacks);
4693 }
#define ACE_ERROR(X)
Sedp & endpoint_manager()
Definition: Spdp.h:354
ACE_TEXT("TCP_Factory")
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
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 1336 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().

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

◆ 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 2201 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().

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

◆ 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 1048 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.

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

◆ 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 460 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().

464 {
465  // We have the global lock.
466  iter->second.location_updates_.push_back(DiscoveredParticipant::LocationUpdate(mask, from, DCPS::SystemTimePoint::now()));
467 
468  if (DCPS::log_bits) {
469  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));
470  }
471 
472 }
#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  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
DCPS::TopicStatus find_topic(const char *topicName, CORBA::String_out dataTypeName, DDS::TopicQos_out qos, GUID_t &topicId)
Definition: Sedp.cpp:6085

◆ fini_bit()

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

Definition at line 2178 of file Spdp.cpp.

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

2179 {
2180  bit_subscriber_->clear();
2181 }
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 3639 of file Spdp.cpp.

References participants_.

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

3641 {
3642  DiscoveredParticipantIter part_iter = participants_.find(part_id);
3643  if (part_iter == participants_.end()) {
3644  return false;
3645  } else {
3646  inlineQos = part_iter->second.pdata_.participantProxy.expectsInlineQos;
3647  DCPS::LocatorSeq& mc_source =
3648  part_iter->second.pdata_.participantProxy.defaultMulticastLocatorList;
3649  DCPS::LocatorSeq& uc_source =
3650  part_iter->second.pdata_.participantProxy.defaultUnicastLocatorList;
3651  CORBA::ULong mc_source_len = mc_source.length();
3652  CORBA::ULong uc_source_len = uc_source.length();
3653  CORBA::ULong target_len = target.length();
3654  target.length(mc_source_len + uc_source_len + target_len);
3655  // Copy multicast
3656  for (CORBA::ULong mci = 0; mci < mc_source.length(); ++mci) {
3657  target[target_len + mci] = mc_source[mci];
3658  }
3659  // Copy unicast
3660  for (CORBA::ULong uci = 0; uci < uc_source.length(); ++uci) {
3661  target[target_len + mc_source_len + uci] = uc_source[uci];
3662  }
3663  }
3664  return true;
3665 }
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
sequence< Locator_t > LocatorSeq
ACE_CDR::ULong ULong
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ 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 612 of file Spdp.cpp.

References tport_.

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

613 {
614  return tport_->ice_endpoint_added_ ? tport_->get_ice_endpoint() : DCPS::WeakRcHandle<ICE::Endpoint>();
615 }
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 3668 of file Spdp.cpp.

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

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

3670 {
3671  DiscoveredParticipantIter pos = participants_.find(part_id);
3672  if (pos != participants_.end() && pos->second.last_recv_address_ != ACE_INET_Addr()) {
3673  inlineQos = pos->second.pdata_.participantProxy.expectsInlineQos;
3674  target.length(1);
3675  DCPS::address_to_locator(target[0], pos->second.last_recv_address_);
3676  return true;
3677  }
3678  return false;
3679 }
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
OpenDDS_Dcps_Export void address_to_locator(Locator_t &locator, const ACE_INET_Addr &addr)
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 4628 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().

4629 {
4630  bool include_user_data = true;
4631 #ifdef OPENDDS_SECURITY
4632  if (secure_part_user_data()) {
4633  include_user_data = secure;
4634  }
4635 #else
4636  ACE_UNUSED_ARG(secure);
4637 #endif
4639  bit_data.key = DDS::BuiltinTopicKey_t();
4640  bit_data.user_data = include_user_data ? qos_.user_data : DDS::UserDataQosPolicy();
4641  return bit_data;
4642 }
UserDataQosPolicy user_data
DDS::DomainParticipantQos qos_
Definition: Spdp.h:380
bool secure_part_user_data() const
Definition: Spdp.cpp:4619

◆ get_participant_data() [1/2]

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

Definition at line 4449 of file Spdp.cpp.

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

4450 {
4452  return iter->second.pdata_;
4453 }
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
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 4455 of file Spdp.cpp.

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

4456 {
4458  return iter->second.pdata_;
4459 }
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
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 4466 of file Spdp.cpp.

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

4467 {
4469  return iter->second.discovered_at_.to_monotonic_time();
4470 }
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
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 3693 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().

3694 {
3695  const DiscoveredParticipantMap::const_iterator iter = participants_.find(guid);
3696  if (iter == participants_.end()) {
3697  return PFLAGS_EMPTY;
3698  }
3699  return is_opendds(iter->second.pdata_.participantProxy)
3700  ? iter->second.pdata_.participantProxy.opendds_participant_flags.bits : PFLAGS_EMPTY;
3701 }
const OpenDDSParticipantFlagsBits_t PFLAGS_EMPTY
Definition: RtpsCore.idl:322
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
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 1142 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().

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

◆ handle_handshake_message()

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

Definition at line 1452 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().

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

◆ handle_participant_crypto_tokens()

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

Definition at line 1885 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().

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

◆ 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 710 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().

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

◆ has_discovered_participant()

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

Definition at line 3688 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().

3689 {
3690  return participants_.find(guid) != participants_.end();
3691 }
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 4674 of file Spdp.cpp.

References ACE_GUARD_RETURN, has_discovered_participant(), and lock_.

4675 {
4677  return has_discovered_participant(remote);
4678 }
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
bool has_discovered_participant(const DCPS::GUID_t &guid) const
Definition: Spdp.cpp:3688

◆ ignore_domain_participant()

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

Definition at line 4644 of file Spdp.cpp.

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

4645 {
4647  endpoint_manager().ignore(ignoreId);
4648 
4649  DiscoveredParticipantIter iter = participants_.find(ignoreId);
4650  if (iter != participants_.end()) {
4652  participants_.erase(iter);
4653  }
4654 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
Sedp & endpoint_manager()
Definition: Spdp.h:354
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4695
void ignore(const GUID_t &to_ignore)
Definition: Sedp.cpp:5988
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ 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 135 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().

139 {
140  type_lookup_service_ = tls;
141 
142  bool enable_endpoint_announcements = true;
143  bool enable_type_lookup_service = config_->use_xtypes();
144 
145  const DDS::PropertySeq& properties = qos.property.value;
146  for (unsigned int idx = 0; idx != properties.length(); ++idx) {
147  const DDS::Property_t& prop = properties[idx];
148  if (std::strcmp(RTPS_DISCOVERY_ENDPOINT_ANNOUNCEMENTS, prop.name.in()) == 0) {
149  enable_endpoint_announcements = prop_to_bool(prop);
150  } else if (std::strcmp(RTPS_DISCOVERY_TYPE_LOOKUP_SERVICE, prop.name.in()) == 0) {
151  enable_type_lookup_service = prop_to_bool(prop);
152  } else if (std::strcmp(RTPS_RELAY_APPLICATION_PARTICIPANT, prop.name.in()) == 0) {
153  is_application_participant_ = prop_to_bool(prop);
154  } else if (std::strcmp(RTPS_REFLECT_HEARTBEAT_COUNT, prop.name.in()) == 0) {
155  const CORBA::ULong old_flags = config_->participant_flags();
156  const CORBA::ULong new_flags = prop_to_bool(prop) ? (old_flags | PFLAGS_REFLECT_HEARTBEAT_COUNT) : (old_flags & ~PFLAGS_REFLECT_HEARTBEAT_COUNT);
157  config_->participant_flags(new_flags);
158  }
159  }
160 
167 
168  if (enable_endpoint_announcements) {
173  }
174 
175  if (enable_type_lookup_service) {
181  }
182 
183 #ifdef OPENDDS_SECURITY
184  if (is_security_enabled()) {
185  using namespace DDS::Security;
186 
197 
198  if (enable_endpoint_announcements) {
203  }
204 
205  if (enable_type_lookup_service) {
211  }
212  }
213 #endif
214 
215  guid = guid_; // may have changed in SpdpTransport constructor
216  sedp_->ignore(guid);
217 }
const char RTPS_RELAY_APPLICATION_PARTICIPANT[]
Definition: RtpsDiscovery.h:42
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER
Definition: RtpsCore.idl:206
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
const char RTPS_DISCOVERY_ENDPOINT_ANNOUNCEMENTS[]
Definition: RtpsDiscovery.h:40
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER
Definition: RtpsCore.idl:223
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER
Definition: RtpsCore.idl:198
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER
Definition: RtpsCore.idl:202
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER
Definition: RtpsCore.idl:218
const char RTPS_REFLECT_HEARTBEAT_COUNT[]
Definition: RtpsDiscovery.h:43
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
const char RTPS_DISCOVERY_TYPE_LOOKUP_SERVICE[]
Definition: RtpsDiscovery.h:41
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_READER
bool is_application_participant_
Definition: Spdp.h:395
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints_
Definition: Spdp.h:617
ACE_CDR::ULong ULong
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER
Definition: RtpsCore.idl:220
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER
BuiltinEndpointSet_t available_builtin_endpoints_
Definition: Spdp.h:605
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE
DDS::PropertySeq PropertySeq
Definition: RtpsCore.idl:49
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR
Definition: RtpsCore.idl:200
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER
Definition: RtpsCore.idl:229
DCPS::GUID_t guid_
Definition: Spdp.h:393
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER
Definition: RtpsCore.idl:227
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR
Definition: RtpsCore.idl:208
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
bool is_security_enabled() const
Definition: Spdp.h:159
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR
Definition: RtpsCore.idl:204
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER
Definition: RtpsCore.idl:225
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
XTypes::TypeLookupService_rch type_lookup_service_
Definition: Spdp.h:389
PropertyQosPolicy property
const OpenDDSParticipantFlagsBits_t PFLAGS_REFLECT_HEARTBEAT_COUNT
Definition: RtpsCore.idl:326
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER

◆ init_bit()

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

Definition at line 2155 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_.

2156 {
2157  OPENDDS_ASSERT(bit_subscriber);
2158 
2159  bit_subscriber_ = bit_subscriber;
2160 
2161  // Defer initilization until we have the bit subscriber.
2163  tport_->open(sedp_->reactor_task(), sedp_->job_queue());
2164 
2165 #ifdef OPENDDS_SECURITY
2166  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
2167  if (sedp_endpoint) {
2169  ice_agent_->add_local_agent_info_listener(sedp_endpoint, l, DCPS::static_rchandle_cast<AgentInfoListener>(rchandle_from(this)));
2170  }
2171 #endif
2172 
2173  initialized_flag_ = true;
2174  tport_->enable_periodic_tasks();
2175 }
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310
#define OPENDDS_ASSERT(C)
Definition: Definitions.h:72
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
RtpsDiscovery * disco_
Definition: Spdp.h:383
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
DCPS::GUID_t guid_
Definition: Spdp.h:393
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
Definition: Spdp.h:379
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
XTypes::TypeLookupService_rch type_lookup_service_
Definition: Spdp.h:389
const DDS::DomainId_t domain_
Definition: Spdp.h:392

◆ 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 2191 of file Spdp.cpp.

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

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

2192 {
2193  const DiscoveredParticipantConstIter iter = participants_.find(participant);
2194  if (iter == participants_.end()) {
2195  return false;
2196  }
2197  return is_opendds(iter->second.pdata_.participantProxy) &&
2198  (iter->second.pdata_.participantProxy.opendds_participant_flags.bits & PFLAGS_NO_ASSOCIATED_WRITERS) == 0;
2199 }
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
const OpenDDSParticipantFlagsBits_t PFLAGS_NO_ASSOCIATED_WRITERS
Definition: RtpsCore.idl:323
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 1217 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().

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

◆ lookup_participant_auth_state()

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

Definition at line 3855 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().

3856 {
3859  if (pi != participants_.end()) {
3860  return pi->second.auth_state_;
3861  }
3862  return AUTH_STATE_HANDSHAKE;
3863 }
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
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 3788 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().

3789 {
3790  ParticipantCryptoInfoPair result = ParticipantCryptoInfoPair(DDS::HANDLE_NIL, DDS::Security::SharedSecretHandle_var());
3791 
3793  if (pi != participants_.end()) {
3794  result.first = sedp_->get_handle_registry()->get_remote_participant_crypto_handle(id);
3795  result.second = pi->second.shared_secret_handle_;
3796  }
3797  return result;
3798 }
const InstanceHandle_t HANDLE_NIL
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
std::pair< DDS::Security::ParticipantCryptoHandle, DDS::Security::SharedSecretHandle_var > ParticipantCryptoInfoPair
Definition: Spdp.h:165
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 3843 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().

3844 {
3846 
3849  if (pi != participants_.end()) {
3850  result = pi->second.permissions_handle_;
3851  }
3852  return result;
3853 }
const InstanceHandle_t HANDLE_NIL
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
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 1971 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().

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

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

◆ 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 1758 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_.

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

◆ process_handshake_resends()

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

Definition at line 1810 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_.

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

◆ process_lease_expirations()

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

Definition at line 3744 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_.

3745 {
3747 
3748  for (TimeQueue::iterator pos = lease_expirations_.begin(), limit = lease_expirations_.end();
3749  pos != limit && pos->first <= now;) {
3750  DiscoveredParticipantIter part = participants_.find(pos->second);
3751  // Pre-emptively erase so purge_discovered_participant will not modify lease_expirations_.
3752  lease_expirations_.erase(pos++);
3753 
3754  if (part == participants_.end()) {
3755  continue;
3756  }
3757 
3758  if (DCPS::DCPS_debug_level) {
3759  ACE_DEBUG((LM_WARNING,
3760  ACE_TEXT("(%P|%t) Spdp::process_lease_expirations() - ")
3761  ACE_TEXT("participant %C exceeded lease duration, removing\n"),
3762  DCPS::LogGuid(part->first).c_str()));
3763  }
3764 
3765 #ifdef OPENDDS_SECURITY
3766  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
3767  if (sedp_endpoint) {
3768  stop_ice(sedp_endpoint, part->first, part->second.pdata_.participantProxy.availableBuiltinEndpoints,
3769  part->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
3770  }
3771  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint = tport_->get_ice_endpoint();
3772  if (spdp_endpoint) {
3773  ice_agent_->stop_ice(spdp_endpoint, guid_, part->first);
3774  }
3776 #endif
3778  participants_.erase(part);
3779  }
3780 
3781  if (!lease_expirations_.empty()) {
3782  tport_->lease_expiration_task_->schedule(lease_expirations_.begin()->first - now);
3783  }
3784 }
#define ACE_DEBUG(X)
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4695
DCPS::GUID_t guid_
Definition: Spdp.h:393
ACE_TEXT("TCP_Factory")
TimeQueue lease_expirations_
Definition: Spdp.h:614
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
void stop_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
Definition: Spdp.cpp:4009
void purge_handshake_deadlines(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4337
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 474 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().

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

◆ 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 4373 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().

4376 {
4377  ICE::AgentInfoMap ai_map;
4378  if (!ParameterListConverter::from_param_list(plist, ai_map)) {
4379  if (DCPS::DCPS_debug_level > 0) {
4380  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::process_participant_ice - ")
4381  ACE_TEXT("failed to convert from ParameterList to ")
4382  ACE_TEXT("ICE::AgentInfo\n")));
4383  }
4384  return;
4385  }
4386  ICE::AgentInfoMap::const_iterator sedp_pos = ai_map.find(SEDP_AGENT_INFO_KEY);
4387  ICE::AgentInfoMap::const_iterator spdp_pos = ai_map.find(SPDP_AGENT_INFO_KEY);
4388 
4389  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint;
4390  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint;
4391  {
4394  return;
4395  }
4396  if (sedp_) {
4397  sedp_endpoint = sedp_->get_ice_endpoint();
4398  }
4399  if (tport_) {
4400  spdp_endpoint = tport_->get_ice_endpoint();
4401  }
4403  if (iter != participants_.end()) {
4404  if (sedp_pos != ai_map.end()) {
4405  iter->second.have_sedp_info_ = true;
4406  iter->second.sedp_info_ = sedp_pos->second;
4407  } else {
4408  iter->second.have_sedp_info_ = false;
4409  }
4410 
4411  if (spdp_pos != ai_map.end()) {
4412  iter->second.have_spdp_info_ = true;
4413  iter->second.spdp_info_ = spdp_pos->second;
4414  } else {
4415  iter->second.have_spdp_info_ = false;
4416  }
4417  }
4418  }
4419 
4420  if (sedp_endpoint) {
4421  if (sedp_pos != ai_map.end()) {
4422  start_ice(sedp_endpoint, guid, pdata.participantProxy.availableBuiltinEndpoints,
4423  pdata.participantProxy.availableExtendedBuiltinEndpoints, sedp_pos->second);
4424  } else {
4425  stop_ice(sedp_endpoint, guid, pdata.participantProxy.availableBuiltinEndpoints,
4426  pdata.participantProxy.availableExtendedBuiltinEndpoints);
4427  }
4428  }
4429 
4430  if (spdp_endpoint) {
4431  if (spdp_pos != ai_map.end()) {
4432  ice_agent_->start_ice(spdp_endpoint, guid_, guid, spdp_pos->second);
4433  } else {
4434  ice_agent_->stop_ice(spdp_endpoint, guid_, guid);
4435 #ifndef DDS_HAS_MINIMUM_BIT
4438  if (iter != participants_.end()) {
4440  process_location_updates_i(iter, "stop ice");
4441  }
4442 #endif
4443  }
4444  }
4445 }
bool from_param_list(const ParameterList &param_list, DDS::ParticipantBuiltinTopicData &pbtd)
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
#define ACE_ERROR(X)
#define ACE_GUARD(MUTEX, OBJ, LOCK)
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:474
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
const char SEDP_AGENT_INFO_KEY[]
Definition: Spdp.h:57
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
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:3867
const ParticipantLocation LOCATION_ICE
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
DCPS::GUID_t guid_
Definition: Spdp.h:393
ACE_TEXT("TCP_Factory")
const char SPDP_AGENT_INFO_KEY[]
Definition: Spdp.h:56
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
AtomicBool shutdown_flag_
Spdp shutting down.
Definition: Spdp.h:603
void stop_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
Definition: Spdp.cpp:4009
const DCPS::GUID_t & guid() const
Definition: Spdp.h:94
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:460

◆ publish_location_update_i()

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

Definition at line 602 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().

603 {
604  iter->second.location_ih_ = bit_subscriber_->add_participant_location(iter->second.location_data_, DDS::NEW_VIEW_STATE);
605  if (DCPS::log_bits) {
606  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_));
607  }
608 }
#define ACE_DEBUG(X)
const ViewStateKind NEW_VIEW_STATE
bool log_bits
Definition: Logging.cpp:18
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
Definition: Spdp.h:379

◆ purge_discovered_participant()

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

Definition at line 4695 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().

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

◆ purge_handshake_deadlines()

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

Definition at line 4337 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().

4338 {
4339  if (iter == participants_.end()) {
4340  return;
4341  }
4342 
4344 
4345  std::pair<TimeQueue::iterator, TimeQueue::iterator> range = handshake_deadlines_.equal_range(iter->second.handshake_deadline_);
4346  for (; range.first != range.second; ++range.first) {
4347  if (range.first->second == iter->first) {
4348  handshake_deadlines_.erase(range.first);
4349  break;
4350  }
4351  }
4352 }
TimeQueue handshake_deadlines_
Definition: Spdp.h:643
void purge_handshake_resends(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:4354
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ purge_handshake_resends()

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

Definition at line 4354 of file Spdp.cpp.

References config_, handshake_resends_, and participants_.

Referenced by process_handshake_deadlines(), and purge_handshake_deadlines().

4355 {
4356  if (iter == participants_.end()) {
4357  return;
4358  }
4359 
4360  iter->second.have_auth_req_msg_ = false;
4361  iter->second.have_handshake_msg_ = false;
4362  iter->second.handshake_resend_falloff_.set(config_->auth_resend_period());
4363 
4364  std::pair<TimeQueue::iterator, TimeQueue::iterator> range = handshake_resends_.equal_range(iter->second.stateless_msg_deadline_);
4365  for (; range.first != range.second; ++range.first) {
4366  if (range.first->second == iter->first) {
4367  handshake_resends_.erase(range.first);
4368  break;
4369  }
4370  }
4371 }
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
TimeQueue handshake_resends_
Definition: Spdp.h:646
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ remote_crypto_handle()

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

Definition at line 4150 of file Spdp.cpp.

References sedp_.

4151 {
4152  return sedp_->get_handle_registry()->get_remote_participant_crypto_handle(remote_participant);
4153 }
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 2146 of file Spdp.cpp.

References is_security_enabled(), and write_secure_updates().

2147 {
2148  if (is_security_enabled()) {
2150  }
2151 }
void write_secure_updates()
Definition: Spdp.cpp:428
bool is_security_enabled() const
Definition: Spdp.h:159

◆ remove_domain_participant()

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

Definition at line 4656 of file Spdp.cpp.

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

4657 {
4659 
4660  DiscoveredParticipantIter iter = participants_.find(removeId);
4661  if (iter != participants_.end()) {
4663  participants_.erase(iter);
4664  }
4665 }
#define ACE_GUARD(MUTEX, OBJ, LOCK)
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
Definition: Spdp.cpp:4695
DiscoveredParticipantMap participants_
Definition: Spdp.h:382

◆ remove_lease_expiration_i()

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

Definition at line 3704 of file Spdp.cpp.

References lease_expirations_.

Referenced by purge_discovered_participant(), and update_lease_expiration_i().

3705 {
3706  for (std::pair<TimeQueue::iterator, TimeQueue::iterator> x = lease_expirations_.equal_range(iter->second.lease_expiration_);
3707  x.first != x.second; ++x.first) {
3708  if (x.first->second == iter->first) {
3709  lease_expirations_.erase(x.first);
3710  break;
3711  }
3712  }
3713 }
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  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
void remove_publication(const GUID_t &publicationId)
Definition: Sedp.cpp:6218

◆ 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  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
DCPS::TopicStatus remove_topic(const GUID_t &topicId)
Definition: Sedp.cpp:6105

◆ 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 4473 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.

4474 {
4475  ACE_UNUSED_ARG(flag);
4476 
4477 #ifdef OPENDDS_SECURITY
4478  sedp_->rtps_relay_only_now(flag);
4479 
4480  if (flag) {
4482 
4483  tport_->relay_spdp_task_falloff_.set(config_->sedp_heartbeat_period());
4484  tport_->relay_spdp_task_->schedule(TimeDuration::zero_value);
4485 
4486  tport_->relay_stun_task_falloff_.set(config_->sedp_heartbeat_period());
4487  tport_->relay_stun_task_->schedule(TimeDuration::zero_value);
4488 
4489 #ifndef DDS_HAS_MINIMUM_BIT
4490  const DCPS::ParticipantLocation mask =
4495 
4496  for (DiscoveredParticipantIter iter = participants_.begin();
4497  iter != participants_.end();
4498  ++iter) {
4499  enqueue_location_update_i(iter, mask, ACE_INET_Addr(), "rtps_relay_only_now");
4500  process_location_updates_i(iter, "rtps_relay_only_now");
4501  }
4502 #endif
4503  } else {
4504  if (!config_->use_rtps_relay()) {
4505  if (tport_->relay_spdp_task_) {
4506  tport_->relay_spdp_task_->cancel();
4507  }
4508  if (tport_->relay_stun_task_) {
4509  tport_->disable_relay_stun_task();
4510  }
4511  }
4512  }
4513 #endif
4514 }
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
#define ACE_GUARD(MUTEX, OBJ, LOCK)
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:474
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
const ParticipantLocation LOCATION_LOCAL
const ParticipantLocation LOCATION_LOCAL6
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
unsigned long ParticipantLocation
const ParticipantLocation LOCATION_ICE
static const TimeDuration zero_value
Definition: TimeDuration.h:31
const ParticipantLocation LOCATION_ICE6
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:460

◆ schedule_handshake_resend()

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

Definition at line 1959 of file Spdp.cpp.

References handshake_resends_, and tport_.

Referenced by attempt_authentication(), and send_handshake_message().

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

◆ 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 4619 of file Spdp.cpp.

References config_, and security_enabled_.

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

4620 {
4621 #ifdef OPENDDS_SECURITY
4622  return security_enabled_ && config_->secure_participant_user_data();
4623 #else
4624  return false;
4625 #endif
4626 }
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
bool security_enabled_
Definition: Spdp.h:619

◆ 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 1945 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().

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

◆ send_handshake_request()

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

Definition at line 1274 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().

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

◆ send_participant_crypto_tokens()

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

Definition at line 3801 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().

3802 {
3803  const DCPS::GUID_t peer = make_id(id, ENTITYID_PARTICIPANT);
3804  const DiscoveredParticipantIter iter = participants_.find(peer);
3805  if (iter == participants_.end()) {
3806  if (DCPS::DCPS_debug_level > 0) {
3807  const DCPS::LogGuid logger(peer);
3808  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::send_participant_crypto_tokens() - ")
3809  ACE_TEXT("Discovered participant %C not found.\n"),
3810  logger.c_str()));
3811  }
3812  return;
3813  }
3814 
3815  const DDS::Security::ParticipantCryptoTokenSeq& pcts = iter->second.crypto_tokens_;
3816 
3817  if (pcts.length() != 0) {
3819 
3820  const DCPS::GUID_t reader = make_id(peer, ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER);
3821 
3823  msg.message_identity.source_guid = writer;
3826  msg.destination_participant_guid = peer;
3827  msg.destination_endpoint_guid = GUID_UNKNOWN; // unknown = whole participant
3829  msg.message_data = reinterpret_cast<const DDS::Security::DataHolderSeq&>(pcts);
3830 
3831  if (sedp_->write_volatile_message(msg, reader) != DDS::RETCODE_OK) {
3832  if (DCPS::DCPS_debug_level > 0) {
3833  ACE_ERROR((LM_ERROR, ACE_TEXT("(%P|%t) ERROR: Spdp::send_participant_crypto_tokens() - ")
3834  ACE_TEXT("Unable to write volatile message.\n")));
3835  }
3836  }
3837  }
3838 
3839  iter->second.participant_tokens_sent_ = true;
3840 }
#define ACE_ERROR(X)
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
OpenDDS::DCPS::GUID_t destination_participant_guid
sequence< DataHolder > DataHolderSeq
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
CryptoTokenSeq ParticipantCryptoTokenSeq
const EntityId_t ENTITYID_PARTICIPANT
Definition: GuidUtils.h:37
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER
Definition: MessageTypes.h:85
DCPS::GUID_t guid_
Definition: Spdp.h:393
ACE_TEXT("TCP_Factory")
OpenDDS::DCPS::GUID_t source_guid
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
Definition: debug.cpp:30
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER
Definition: MessageTypes.h:86
const ReturnCode_t RETCODE_OK
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
Definition: GuidUtils.h:200
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
const string GMCLASSID_SECURITY_PARTICIPANT_CRYPTO_TOKENS

◆ 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 361 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().

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

◆ shutting_down()

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

◆ signal_liveliness()

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

Definition at line 3394 of file Spdp.cpp.

References sedp_.

3395 {
3396  sedp_->signal_liveliness(kind);
3397 }
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 2786 of file Spdp.cpp.

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

2787 {
2788 #ifdef OPENDDS_SECURITY
2790 
2791  tport_->relay_spdp_task_->cancel();
2792  tport_->relay_spdp_task_falloff_.set(config_->sedp_heartbeat_period());
2793  tport_->relay_spdp_task_->schedule(TimeDuration::zero_value);
2794 
2795  tport_->relay_stun_task_->cancel();
2796  tport_->relay_stun_task_falloff_.set(config_->sedp_heartbeat_period());
2797  tport_->relay_stun_task_->schedule(TimeDuration::zero_value);
2798 #endif
2799 }
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
#define ACE_GUARD(MUTEX, OBJ, LOCK)
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
static const TimeDuration zero_value
Definition: TimeDuration.h:31

◆ 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 3867 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().

3870 {
3871  GUID_t l = guid_;
3872 
3873  // See RTPS v2.1 section 8.5.5.1
3877  ice_agent_->start_ice(endpoint, l, r, agent_info);
3878  }
3882  ice_agent_->start_ice(endpoint, l, r, agent_info);
3883  }
3887  ice_agent_->start_ice(endpoint, l, r, agent_info);
3888  }
3892  ice_agent_->start_ice(endpoint, l, r, agent_info);
3893  }
3897  ice_agent_->start_ice(endpoint, l, r, agent_info);
3898  }
3902  ice_agent_->start_ice(endpoint, l, r, agent_info);
3903  }
3905  l.entityId = ENTITYID_TL_SVC_REQ_READER;
3906  r.entityId = ENTITYID_TL_SVC_REQ_WRITER;
3907  ice_agent_->start_ice(endpoint, l, r, agent_info);
3908  }
3910  l.entityId = ENTITYID_TL_SVC_REQ_WRITER;
3911  r.entityId = ENTITYID_TL_SVC_REQ_READER;
3912  ice_agent_->start_ice(endpoint, l, r, agent_info);
3913  }
3915  l.entityId = ENTITYID_TL_SVC_REPLY_READER;
3916  r.entityId = ENTITYID_TL_SVC_REPLY_WRITER;
3917  ice_agent_->start_ice(endpoint, l, r, agent_info);
3918  }
3920  l.entityId = ENTITYID_TL_SVC_REPLY_WRITER;
3921  r.entityId = ENTITYID_TL_SVC_REPLY_READER;
3922  ice_agent_->start_ice(endpoint, l, r, agent_info);
3923  }
3924 
3925  using namespace DDS::Security;
3926  // See DDS-Security v1.1 section 7.3.7.1
3930  ice_agent_->start_ice(endpoint, l, r, agent_info);
3931  }
3935  ice_agent_->start_ice(endpoint, l, r, agent_info);
3936  }
3940  ice_agent_->start_ice(endpoint, l, r, agent_info);
3941  }
3945  ice_agent_->start_ice(endpoint, l, r, agent_info);
3946  }
3950  ice_agent_->start_ice(endpoint, l, r, agent_info);
3951  }
3955  ice_agent_->start_ice(endpoint, l, r, agent_info);
3956  }
3960  ice_agent_->start_ice(endpoint, l, r, agent_info);
3961  }
3965  ice_agent_->start_ice(endpoint, l, r, agent_info);
3966  }
3970  ice_agent_->start_ice(endpoint, l, r, agent_info);
3971  }
3975  ice_agent_->start_ice(endpoint, l, r, agent_info);
3976  }
3980  ice_agent_->start_ice(endpoint, l, r, agent_info);
3981  }
3985  ice_agent_->start_ice(endpoint, l, r, agent_info);
3986  }
3987  if (extended_avail & TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE) {
3988  l.entityId = ENTITYID_TL_SVC_REQ_READER_SECURE;
3989  r.entityId = ENTITYID_TL_SVC_REQ_WRITER_SECURE;
3990  ice_agent_->start_ice(endpoint, l, r, agent_info);
3991  }
3992  if (extended_avail & TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE) {
3993  l.entityId = ENTITYID_TL_SVC_REQ_WRITER_SECURE;
3994  r.entityId = ENTITYID_TL_SVC_REQ_READER_SECURE;
3995  ice_agent_->start_ice(endpoint, l, r, agent_info);
3996  }
3997  if (extended_avail & TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE) {
4000  ice_agent_->start_ice(endpoint, l, r, agent_info);
4001  }
4002  if (extended_avail & TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE) {
4005  ice_agent_->start_ice(endpoint, l, r, agent_info);
4006  }
4007 }
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
Definition: MessageTypes.h:81
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER
Definition: RtpsCore.idl:206
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER
Definition: RtpsCore.idl:223
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER
Definition: GuidUtils.h:43
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER
Definition: RtpsCore.idl:202
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
Definition: MessageTypes.h:78
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER
Definition: GuidUtils.h:47
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER
Definition: GuidUtils.h:52
const EntityId_t ENTITYID_TL_SVC_REPLY_READER
Definition: GuidUtils.h:55
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER_SECURE
Definition: MessageTypes.h:90
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER
Definition: MessageTypes.h:88
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER
Definition: RtpsCore.idl:218
const EntityId_t ENTITYID_TL_SVC_REPLY_READER_SECURE
Definition: MessageTypes.h:93
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER
Definition: RtpsCore.idl:220
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
Definition: MessageTypes.h:79
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER_SECURE
Definition: MessageTypes.h:92
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER
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 ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE
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 BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER
Definition: RtpsCore.idl:229
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
DCPS::GUID_t guid_
Definition: Spdp.h:393
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER
Definition: RtpsCore.idl:227
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
Definition: MessageTypes.h:77
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR
Definition: RtpsCore.idl:208
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER
Definition: GuidUtils.h:42
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER
Definition: MessageTypes.h:86
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
Definition: MessageTypes.h:84
const EntityId_t ENTITYID_TL_SVC_REQ_READER_SECURE
Definition: MessageTypes.h:91
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR
Definition: RtpsCore.idl:204
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER
Definition: MessageTypes.h:87
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER
Definition: RtpsCore.idl:225
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER
Definition: GuidUtils.h:41
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER
Definition: GuidUtils.h:46
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
Definition: MessageTypes.h:80
key EntityId_t entityId
Definition: DdsDcpsGuid.idl:59
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER

◆ 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 4009 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().

4010  {
4011  GUID_t l = guid_;
4012 
4013  // See RTPS v2.1 section 8.5.5.1
4017  ice_agent_->stop_ice(endpoint, l, r);
4018  }
4022  ice_agent_->stop_ice(endpoint, l, r);
4023  }
4027  ice_agent_->stop_ice(endpoint, l, r);
4028  }
4032  ice_agent_->stop_ice(endpoint, l, r);
4033  }
4037  ice_agent_->stop_ice(endpoint, l, r);
4038  }
4042  ice_agent_->stop_ice(endpoint, l, r);
4043  }
4045  l.entityId = ENTITYID_TL_SVC_REQ_READER;
4046  r.entityId = ENTITYID_TL_SVC_REQ_WRITER;
4047  ice_agent_->stop_ice(endpoint, l, r);
4048  }
4050  l.entityId = ENTITYID_TL_SVC_REQ_WRITER;
4051  r.entityId = ENTITYID_TL_SVC_REQ_READER;
4052  ice_agent_->stop_ice(endpoint, l, r);
4053  }
4055  l.entityId = ENTITYID_TL_SVC_REPLY_READER;
4056  r.entityId = ENTITYID_TL_SVC_REPLY_WRITER;
4057  ice_agent_->stop_ice(endpoint, l, r);
4058  }
4060  l.entityId = ENTITYID_TL_SVC_REPLY_WRITER;
4061  r.entityId = ENTITYID_TL_SVC_REPLY_READER;
4062  ice_agent_->stop_ice(endpoint, l, r);
4063  }
4064 
4065  using namespace DDS::Security;
4066  // See DDS-Security v1.1 section 7.3.7.1
4070  ice_agent_->stop_ice(endpoint, l, r);
4071  }
4075  ice_agent_->stop_ice(endpoint, l, r);
4076  }
4080  ice_agent_->stop_ice(endpoint, l, r);
4081  }
4085  ice_agent_->stop_ice(endpoint, l, r);
4086  }
4090  ice_agent_->stop_ice(endpoint, l, r);
4091  }
4095  ice_agent_->stop_ice(endpoint, l, r);
4096  }
4100  ice_agent_->stop_ice(endpoint, l, r);
4101  }
4105  ice_agent_->stop_ice(endpoint, l, r);
4106  }
4110  ice_agent_->stop_ice(endpoint, l, r);
4111  }
4115  ice_agent_->stop_ice(endpoint, l, r);
4116  }
4120  ice_agent_->stop_ice(endpoint, l, r);
4121  }
4125  ice_agent_->stop_ice(endpoint, l, r);
4126  }
4127  if (extended_avail & TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE) {
4128  l.entityId = ENTITYID_TL_SVC_REQ_READER_SECURE;
4129  r.entityId = ENTITYID_TL_SVC_REQ_WRITER_SECURE;
4130  ice_agent_->stop_ice(endpoint, l, r);
4131  }
4132  if (extended_avail & TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE) {
4133  l.entityId = ENTITYID_TL_SVC_REQ_WRITER_SECURE;
4134  r.entityId = ENTITYID_TL_SVC_REQ_READER_SECURE;
4135  ice_agent_->stop_ice(endpoint, l, r);
4136  }
4137  if (extended_avail & TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE) {
4140  ice_agent_->stop_ice(endpoint, l, r);
4141  }
4142  if (extended_avail & TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE) {
4145  ice_agent_->stop_ice(endpoint, l, r);
4146  }
4147 }
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
Definition: MessageTypes.h:81
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER
Definition: RtpsCore.idl:206
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER
Definition: RtpsCore.idl:223
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER
Definition: GuidUtils.h:43
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER
Definition: RtpsCore.idl:202
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
Definition: MessageTypes.h:78
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER
Definition: GuidUtils.h:47
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER
Definition: GuidUtils.h:52
const EntityId_t ENTITYID_TL_SVC_REPLY_READER
Definition: GuidUtils.h:55
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER_SECURE
Definition: MessageTypes.h:90
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER
Definition: MessageTypes.h:88
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER
Definition: RtpsCore.idl:218
const EntityId_t ENTITYID_TL_SVC_REPLY_READER_SECURE
Definition: MessageTypes.h:93
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER
Definition: RtpsCore.idl:220
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
Definition: MessageTypes.h:79
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER_SECURE
Definition: MessageTypes.h:92
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER
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 ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE
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 BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER
Definition: RtpsCore.idl:229
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
DCPS::GUID_t guid_
Definition: Spdp.h:393
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER
Definition: RtpsCore.idl:227
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
Definition: MessageTypes.h:77
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR
Definition: RtpsCore.idl:208
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER
Definition: GuidUtils.h:42
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER
Definition: MessageTypes.h:86
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
Definition: MessageTypes.h:84
const EntityId_t ENTITYID_TL_SVC_REQ_READER_SECURE
Definition: MessageTypes.h:91
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR
Definition: RtpsCore.idl:204
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER
Definition: MessageTypes.h:87
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER
Definition: RtpsCore.idl:225
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER
Definition: GuidUtils.h:41
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER
Definition: GuidUtils.h:46
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
Definition: MessageTypes.h:80
key EntityId_t entityId
Definition: DdsDcpsGuid.idl:59
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER

◆ 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 2139 of file Spdp.cpp.

References is_security_enabled(), and write_secure_updates().

2140 {
2141  if (is_security_enabled()) {
2143  }
2144 }
void write_secure_updates()
Definition: Spdp.cpp:428
bool is_security_enabled() const
Definition: Spdp.h:159

◆ update_domain_participant_qos()

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

Definition at line 4667 of file Spdp.cpp.

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

4668 {
4670  qos_ = qos;
4672 }
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DDS::DomainParticipantQos qos_
Definition: Spdp.h:380
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
bool announce_domain_participant_qos()
Definition: Spdp.cpp:2290

◆ update_lease_expiration_i()

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

Definition at line 3716 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().

3718 {
3720 
3721  // Compute new expiration.
3722  const DCPS::TimeDuration d =
3723  rtps_duration_to_time_duration(iter->second.pdata_.leaseDuration,
3724  iter->second.pdata_.participantProxy.protocolVersion,
3725  iter->second.pdata_.participantProxy.vendorId);
3726 
3727  iter->second.lease_expiration_ = now + d + lease_extension_;
3728 
3729  // Insert.
3730  const bool cancel = !lease_expirations_.empty() && iter->second.lease_expiration_ < lease_expirations_.begin()->first;
3731  const bool schedule = lease_expirations_.empty() || iter->second.lease_expiration_ < lease_expirations_.begin()->first;
3732 
3733  lease_expirations_.insert(std::make_pair(iter->second.lease_expiration_, iter->first));
3734 
3735  if (cancel) {
3736  tport_->lease_expiration_task_->cancel();
3737  }
3738  if (schedule) {
3739  tport_->lease_expiration_task_->schedule(d);
3740  }
3741 }
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
void remove_lease_expiration_i(DiscoveredParticipantIter iter)
Definition: Spdp.cpp:3704
DCPS::TimeDuration rtps_duration_to_time_duration(const Duration_t &rtps_duration, const ProtocolVersion_t &version, const VendorId_t &vendor)
DCPS::TimeDuration lease_extension_
Definition: Spdp.h:388
TimeQueue lease_expirations_
Definition: Spdp.h:614

◆ 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  }
Sedp & endpoint_manager()
Definition: Spdp.h:354
void update_publication_locators(const GUID_t &publicationId, const DCPS::TransportLocatorSeq &transInfo)
Definition: Sedp.cpp:6245

◆ 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 2750 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().

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

◆ 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 4561 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().

4562 {
4563  ACE_UNUSED_ARG(flag);
4564 
4565 #ifdef OPENDDS_SECURITY
4566  sedp_->use_ice_now(flag);
4567 
4568  if (flag) {
4569  DCPS::WeakRcHandle<ICE::Endpoint> spdp_endpoint = tport_->get_ice_endpoint();
4570  DCPS::WeakRcHandle<ICE::Endpoint> sedp_endpoint = sedp_->get_ice_endpoint();
4571 
4572  if (sedp_endpoint) {
4574  ice_agent_->add_local_agent_info_listener(sedp_endpoint, l, DCPS::static_rchandle_cast<ICE::AgentInfoListener>(DCPS::rchandle_from(this)));
4575  }
4576 
4577  ice_agent_->add_endpoint(DCPS::static_rchandle_cast<ICE::Endpoint>(tport_));
4579  tport_->ice_endpoint_added_ = true;
4580  if (spdp_endpoint) {
4581  ice_agent_->add_local_agent_info_listener(spdp_endpoint, guid_, DCPS::static_rchandle_cast<ICE::AgentInfoListener>(DCPS::rchandle_from(this)));
4582  }
4583 
4584  for (DiscoveredParticipantConstIter pos = participants_.begin(), limit = participants_.end(); pos != limit; ++pos) {
4585  if (spdp_endpoint && pos->second.have_spdp_info_) {
4586  ice_agent_->start_ice(spdp_endpoint, guid_, pos->first, pos->second.spdp_info_);
4587  }
4588 
4589  if (sedp_endpoint && pos->second.have_sedp_info_) {
4590  start_ice(sedp_endpoint, pos->first, pos->second.pdata_.participantProxy.availableBuiltinEndpoints,
4591  pos->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints, pos->second.sedp_info_);
4592  }
4593  }
4594  } else {
4595  ice_agent_->remove_endpoint(DCPS::static_rchandle_cast<ICE::Endpoint>(tport_));
4597  tport_->ice_endpoint_added_ = false;
4598 
4599 #ifndef DDS_HAS_MINIMUM_BIT
4600  const DCPS::ParticipantLocation mask =
4603 
4604  for (DiscoveredParticipantIter part = participants_.begin();
4605  part != participants_.end();
4606  ++part) {
4607  enqueue_location_update_i(part, mask, ACE_INET_Addr(), "use_ice_now");
4608  process_location_updates_i(part, "use_ice_now");
4609  }
4610 #endif
4611  }
4612 
4613  if (is_security_enabled()) {
4615  }
4616 #endif
4617 }
void write_secure_updates()
Definition: Spdp.cpp:428
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
RcHandle< T > rchandle_from(T *pointer)
Definition: RcHandle_T.h:310
#define ACE_GUARD(MUTEX, OBJ, LOCK)
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:474
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DCPS::RcHandle< ICE::Agent > ice_agent_
Definition: Spdp.h:634
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
Definition: Spdp.h:71
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:3867
unsigned long ParticipantLocation
const ParticipantLocation LOCATION_ICE
DCPS::GUID_t guid_
Definition: Spdp.h:393
bool is_security_enabled() const
Definition: Spdp.h:159
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
const ParticipantLocation LOCATION_ICE6
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:460

◆ use_rtps_relay_now()

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

Definition at line 4517 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.

4518 {
4519  ACE_UNUSED_ARG(f);
4520 
4521 #ifdef OPENDDS_SECURITY
4522  sedp_->use_rtps_relay_now(f);
4523 
4524  if (f) {
4526  tport_->relay_spdp_task_falloff_.set(config_->sedp_heartbeat_period());
4527  tport_->relay_spdp_task_->schedule(TimeDuration::zero_value);
4528 
4529  tport_->relay_stun_task_falloff_.set(config_->sedp_heartbeat_period());
4530  tport_->relay_stun_task_->schedule(TimeDuration::zero_value);
4531  } else {
4533 
4534  if (!config_->rtps_relay_only()) {
4535  if (tport_->relay_spdp_task_) {
4536  tport_->relay_spdp_task_->cancel();
4537  }
4538  if (tport_->relay_stun_task_) {
4539  tport_->disable_relay_stun_task();
4540  }
4541  }
4542 
4543 #ifndef DDS_HAS_MINIMUM_BIT
4544  const DCPS::ParticipantLocation mask =
4547 
4548  for (DiscoveredParticipantIter iter = participants_.begin();
4549  iter != participants_.end();
4550  ++iter) {
4551  enqueue_location_update_i(iter, mask, ACE_INET_Addr(), "use_rtps_relay_now");
4552  process_location_updates_i(iter, "use_rtps_relay_now");
4553  }
4554 #endif
4555 
4556  }
4557 #endif
4558 }
DCPS::RcHandle< SpdpTransport > tport_
Definition: Spdp.h:556
#define ACE_GUARD(MUTEX, OBJ, LOCK)
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
Definition: Spdp.cpp:474
DCPS::RcHandle< RtpsDiscoveryConfig > config_
Definition: Spdp.h:384
ACE_Thread_Mutex lock_
Definition: Spdp.h:378
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
Definition: Spdp.h:70
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
unsigned long ParticipantLocation
static const TimeDuration zero_value
Definition: TimeDuration.h:31
const ParticipantLocation LOCATION_RELAY
DiscoveredParticipantMap participants_
Definition: Spdp.h:382
const ParticipantLocation LOCATION_RELAY6
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
Definition: Spdp.cpp:460

◆ validateSequenceNumber()

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

Definition at line 1030 of file Spdp.cpp.

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

Referenced by handle_participant_data().

1031 {
1032  if (seq.getValue() != 0 && iter->second.max_seq_ != DCPS::SequenceNumber::MAX_VALUE) {
1033  if (seq < iter->second.max_seq_) {
1034  const bool honeymoon_period = now < iter->second.discovered_at_ + min_resend_delay_;
1035  if (!honeymoon_period) {
1036  ++iter->second.seq_reset_count_;
1037  }
1038  return false;
1039  } else if (iter->second.seq_reset_count_ > 0) {
1040  --iter->second.seq_reset_count_;
1041  }
1042  }
1043  iter->second.max_seq_ = std::max(iter->second.max_seq_, seq);
1044  return true;
1045 }
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 441 of file Spdp.cpp.

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

Referenced by shutdown().

442 {
443  sedp_->write_dcps_participant_dispose(guid_);
444 }
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 428 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().

429 {
431  return;
432  }
433 
434  const Security::SPDPdiscoveredParticipantData pdata =
436 
437  sedp_->write_dcps_participant_secure(pdata, GUID_UNKNOWN);
438 }
const GUID_t GUID_UNKNOWN
Nil value for GUID.
Definition: GuidUtils.h:59
DCPS::RcHandle< Sedp > sedp_
Definition: Spdp.h:606
ParticipantData_t build_local_pdata(bool always_in_the_clear, Security::DiscoveredParticipantDataKind kind)
Definition: Spdp.cpp:2201
AtomicBool initialized_flag_
Spdp initialized.
Definition: Spdp.h:598
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: