OpenDDS  Snapshot(2023/04/28-20:55)
DiscoveredEntities.h
Go to the documentation of this file.
1 /*
2  * Distributed under the OpenDDS License.
3  * See: http://www.opendds.org/license.html
4  */
5 #ifndef OPENDDS_DCPS_RTPS_DISCOVERED_ENTITIES_H
6 #define OPENDDS_DCPS_RTPS_DISCOVERED_ENTITIES_H
7 
9 
10 #include "AssociationRecord.h"
11 #include "RtpsCoreC.h"
12 #ifdef OPENDDS_SECURITY
13 # include "RtpsSecurityC.h"
14 #endif
15 #include "ICE/Ice.h"
16 
20 
21 #ifndef ACE_LACKS_PRAGMA_ONCE
22 # pragma once
23 #endif
24 
26 
27 namespace OpenDDS {
28 namespace RTPS {
29 
30 #ifdef OPENDDS_SECURITY
31 enum AuthState {
35 };
36 
38  HANDSHAKE_STATE_BEGIN_HANDSHAKE_REQUEST, //!< Requester should call begin_handshake_request
39  HANDSHAKE_STATE_BEGIN_HANDSHAKE_REPLY, //!< Replier should call begin_handshake_reply
40  HANDSHAKE_STATE_PROCESS_HANDSHAKE, //!< Requester and replier should call process handshake
41  HANDSHAKE_STATE_DONE //!< Handshake concluded or timed out
42 };
43 
45 #else
47 #endif
48 
53  , seq_reset_count_(0)
54 #ifdef OPENDDS_SECURITY
55  , have_spdp_info_(false)
56  , have_sedp_info_(false)
57  , have_auth_req_msg_(false)
58  , have_handshake_msg_(false)
59  , handshake_resend_falloff_(DCPS::TimeDuration::zero_value)
62  , is_requester_(false)
70 #endif
71  {
72 #ifdef OPENDDS_SECURITY
76 #endif
77  }
78 
79  DiscoveredParticipant(const ParticipantData_t& p,
80  const DCPS::SequenceNumber& seq,
81  const DCPS::TimeDuration& resend_period)
82  : pdata_(p)
85  , max_seq_(seq)
86  , seq_reset_count_(0)
87 #ifdef OPENDDS_SECURITY
88  , have_spdp_info_(false)
89  , have_sedp_info_(false)
90  , have_auth_req_msg_(false)
91  , have_handshake_msg_(false)
92  , handshake_resend_falloff_(resend_period)
95  , is_requester_(false)
102  , participant_tokens_sent_(false)
103 #endif
104  {
106  assign(location_data_.guid, guid);
121 
122 #ifdef OPENDDS_SECURITY
125 #else
126  ACE_UNUSED_ARG(resend_period);
127 #endif
128  }
129 
130  ParticipantData_t pdata_;
131 
132  struct LocationUpdate {
138  const ACE_INET_Addr& from,
139  const DCPS::SystemTimePoint& timestamp)
140  : mask_(mask), from_(from), timestamp_(timestamp) {}
141  };
142  typedef OPENDDS_VECTOR(LocationUpdate) LocationUpdateList;
143  LocationUpdateList location_updates_;
146 
152  ACE_UINT16 seq_reset_count_;
153  typedef OPENDDS_LIST(BuiltinAssociationRecord) BuiltinAssociationRecords;
154  BuiltinAssociationRecords builtin_pending_records_;
155  BuiltinAssociationRecords builtin_associated_records_;
156  typedef OPENDDS_LIST(WriterAssociationRecord_rch) WriterAssociationRecords;
157  WriterAssociationRecords writer_pending_records_;
158  WriterAssociationRecords writer_associated_records_;
159  typedef OPENDDS_LIST(ReaderAssociationRecord_rch) ReaderAssociationRecords;
160  ReaderAssociationRecords reader_pending_records_;
161  ReaderAssociationRecords reader_associated_records_;
162 #ifdef OPENDDS_SECURITY
173 
180 
191  DDS::Security::SharedSecretHandle_var shared_secret_handle_;
196 
197  bool has_security_data() const
198  {
199  return pdata_.dataKind == Security::DPDK_ENHANCED || pdata_.dataKind == Security::DPDK_SECURE;
200  }
201 #endif
202 };
203 
207  , participant_discovered_at_(DCPS::monotonic_time_zero())
208  , transport_context_(0)
209 #ifdef OPENDDS_SECURITY
210  , have_ice_agent_info_(false)
211 #endif
212  {
213 #ifdef OPENDDS_SECURITY
214  security_attribs_.base = DDS::Security::TopicSecurityAttributes();
215  security_attribs_.is_key_protected = 0;
216  security_attribs_.is_payload_protected = 0;
217  security_attribs_.is_submessage_protected = 0;
218  security_attribs_.plugin_endpoint_attributes = 0;
219 #endif
220  }
221 
223  : reader_data_(r)
225  , participant_discovered_at_(DCPS::monotonic_time_zero())
226  , transport_context_(0)
227 #ifdef OPENDDS_SECURITY
228  , security_attribs_(DDS::Security::EndpointSecurityAttributes())
229  , have_ice_agent_info_(false)
230 #endif
231  {
232 #ifdef OPENDDS_SECURITY
233  security_attribs_.base = DDS::Security::TopicSecurityAttributes();
234  security_attribs_.is_key_protected = 0;
235  security_attribs_.is_payload_protected = 0;
236  security_attribs_.is_submessage_protected = 0;
237  security_attribs_.plugin_endpoint_attributes = 0;
238 #endif
239  }
240 
247 
248 #ifdef OPENDDS_SECURITY
252 #endif
253 
254  const char* get_topic_name() const
255  {
256  return reader_data_.ddsSubscriptionData.topic_name;
257  }
258 
259  const char* get_type_name() const
260  {
261  return reader_data_.ddsSubscriptionData.type_name;
262  }
263 };
264 
268  , participant_discovered_at_(DCPS::monotonic_time_zero())
269  , transport_context_(0)
270 #ifdef OPENDDS_SECURITY
271  , have_ice_agent_info_(false)
272 #endif
273  {
274 #ifdef OPENDDS_SECURITY
275  security_attribs_.base = DDS::Security::TopicSecurityAttributes();
276  security_attribs_.is_key_protected = 0;
277  security_attribs_.is_payload_protected = 0;
278  security_attribs_.is_submessage_protected = 0;
279  security_attribs_.plugin_endpoint_attributes = 0;
280 #endif
281  }
282 
284  : writer_data_(w)
286  , participant_discovered_at_(DCPS::monotonic_time_zero())
287  , transport_context_(0)
288 #ifdef OPENDDS_SECURITY
289  , have_ice_agent_info_(false)
290 #endif
291  {
292 #ifdef OPENDDS_SECURITY
293  security_attribs_.base = DDS::Security::TopicSecurityAttributes();
294  security_attribs_.is_key_protected = 0;
295  security_attribs_.is_payload_protected = 0;
296  security_attribs_.is_submessage_protected = 0;
297  security_attribs_.plugin_endpoint_attributes = 0;
298 #endif
299  }
300 
307 
308 #ifdef OPENDDS_SECURITY
312 #endif
313 
314  const char* get_topic_name() const
315  {
316  return writer_data_.ddsPublicationData.topic_name;
317  }
318 
319  const char* get_type_name() const
320  {
321  return writer_data_.ddsPublicationData.type_name;
322  }
323 };
324 
325 }
326 }
327 
329 
330 #endif // OPENDDS_DCPS_RTPS_DISCOVERED_ENTITIES_H
DDS::Security::AuthRequestMessageToken remote_auth_request_token_
const InstanceHandle_t HANDLE_NIL
Security::SPDPdiscoveredParticipantData ParticipantData_t
ACE_CDR::LongLong LongLong
DDS::Security::SharedSecretHandle_var shared_secret_handle_
GuidSet RepoIdSet
Definition: GuidUtils.h:113
unsigned long ExtendedBuiltinEndpointSet_t
PluginParticipantSecurityAttributesMask plugin_participant_security_attributes
DDS::PublicationBuiltinTopicData ddsPublicationData
DDS::SubscriptionBuiltinTopicData ddsSubscriptionData
DCPS::DiscoveredWriterData writer_data_
OpenDDS::RTPS::ParticipantProxy_t participantProxy
BuiltinAssociationRecords builtin_associated_records_
LocationUpdate(DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const DCPS::SystemTimePoint &timestamp)
CryptoTokenSeq ParticipantCryptoTokenSeq
DiscoveredSubscription(const DCPS::DiscoveredReaderData &r)
DCPS::MonotonicTime_t participant_discovered_at_
DCPS::MonotonicTimePoint stateless_msg_deadline_
ReaderAssociationRecords reader_pending_records_
typedef OPENDDS_VECTOR(LocationUpdate) LocationUpdateList
ParticipantSecurityAttributesMask participant_security_attributes
DDS::Security::ParticipantSecurityInfo security_info_
Handshake concluded or timed out.
Replier should call begin_handshake_reply.
unsigned long ParticipantLocation
DiscoveredParticipant(const ParticipantData_t &p, const DCPS::SequenceNumber &seq, const DCPS::TimeDuration &resend_period)
DiscoveredPublication(const DCPS::DiscoveredWriterData &w)
typedef OPENDDS_LIST(BuiltinAssociationRecord) BuiltinAssociationRecords
DDS::Security::PermissionsToken permissions_token_
WriterAssociationRecords writer_pending_records_
WriterAssociationRecords writer_associated_records_
ACE_INLINE OpenDDS_Dcps_Export const MonotonicTime_t & monotonic_time_zero()
DCPS::MonotonicTimePoint lease_expiration_
DCPS::DiscoveredReaderData reader_data_
ACE_UINT32 ULong
The End User API.
DCPS::MonotonicTimePoint handshake_deadline_
DDS::Security::EndpointSecurityAttributes security_attribs_
HANDLE_TYPE_NATIVE InstanceHandle_t
Definition: DdsDcpsCore.idl:51
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
Definition: GuidUtils.h:216
DDS::Security::IdentityStatusToken identity_status_token_
unsigned long nanosec
DCPS::GuidPrefix_t guidPrefix
Definition: RtpsCore.idl:606
DDS::Security::AuthenticatedPeerCredentialToken authenticated_peer_credential_token_
DDS::Security::HandshakeHandle handshake_handle_
BUILT_IN_TOPIC_KEY DDS::OctetArray16 guid
DCPS::ParticipantLocationBuiltinTopicData location_data_
DDS::Security::AuthRequestMessageToken local_auth_request_token_
Sequence number abstraction. Only allows positive 64 bit values.
DDS::Security::IdentityToken identity_token_
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
DCPS::MonotonicTime_t participant_discovered_at_
DCPS::FibonacciSequence< DCPS::TimeDuration > handshake_resend_falloff_
Requester and replier should call process handshake.
ReaderAssociationRecords reader_associated_records_
void assign(EntityId_t &dest, const EntityId_t &src)
Definition: GuidUtils.h:157
DDS::Security::EndpointSecurityAttributes security_attribs_
BuiltinAssociationRecords builtin_pending_records_
DDS::Security::IdentityHandle identity_handle_
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
DCPS::MonotonicTimePoint discovered_at_
DDS::Security::PropertyQosPolicy property_qos_
DDS::Security::ExtendedBuiltinEndpointSet_t extended_builtin_endpoints_
DDS::Security::PermissionsHandle permissions_handle_
DDS::Security::ParticipantCryptoTokenSeq crypto_tokens_
DDS::Security::ParticipantStatelessMessage handshake_msg_
DDS::Security::ParticipantStatelessMessage auth_req_msg_
Requester should call begin_handshake_request.