OpenDDS  Snapshot(2023/04/28-20:55)
HandleRegistry.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 
6 #ifdef OPENDDS_SECURITY
7 
8 #ifndef OPENDDS_DCPS_SECURITY_FRAMEWORK_HANDLEREGISTRY_H
9 #define OPENDDS_DCPS_SECURITY_FRAMEWORK_HANDLEREGISTRY_H
10 
11 #include <dds/DCPS/dcps_export.h>
12 #include <dds/DCPS/GuidUtils.h>
13 #include <dds/DCPS/RcObject.h>
14 
15 #include <dds/DdsSecurityCoreC.h>
16 
17 #include <ace/config.h>
18 #if !defined (ACE_LACKS_PRAGMA_ONCE)
19 #pragma once
20 #endif /* ACE_LACKS_PRAGMA_ONCE */
21 
23 
24 namespace OpenDDS {
25 namespace Security {
26 
28 public:
29  typedef std::pair<DCPS::GUID_t, DDS::Security::DatareaderCryptoHandle> GUID_tDrch;
30  typedef OPENDDS_VECTOR(GUID_tDrch) DatareaderCryptoHandleList;
31  typedef std::pair<DCPS::GUID_t, DDS::Security::DatawriterCryptoHandle> GUID_tDwch;
32  typedef OPENDDS_VECTOR(GUID_tDwch) DatawriterCryptoHandleList;
33 
35  ~HandleRegistry();
36 
38  {
39  return default_endpoint_security_attributes_;
40  }
41 
42  void insert_local_datareader_crypto_handle(const DCPS::GUID_t& id,
45  DDS::Security::DatareaderCryptoHandle get_local_datareader_crypto_handle(const DCPS::GUID_t& id) const;
46  const DDS::Security::EndpointSecurityAttributes& get_local_datareader_security_attributes(const DCPS::GUID_t& id) const;
47  void erase_local_datareader_crypto_handle(const DCPS::GUID_t& id);
48 
49  void insert_local_datawriter_crypto_handle(const DCPS::GUID_t& id,
52  DDS::Security::DatawriterCryptoHandle get_local_datawriter_crypto_handle(const DCPS::GUID_t& id) const;
53  const DDS::Security::EndpointSecurityAttributes& get_local_datawriter_security_attributes(const DCPS::GUID_t& id) const;
54  void erase_local_datawriter_crypto_handle(const DCPS::GUID_t& id);
55 
56  void insert_remote_participant_crypto_handle(const DCPS::GUID_t& id,
58  DDS::Security::ParticipantCryptoHandle get_remote_participant_crypto_handle(const DCPS::GUID_t& id) const;
59  void erase_remote_participant_crypto_handle(const DCPS::GUID_t& id);
60 
61  void insert_remote_participant_permissions_handle(const DCPS::GUID_t& id,
63  DDS::Security::PermissionsHandle get_remote_participant_permissions_handle(const DCPS::GUID_t& id) const;
64  void erase_remote_participant_permissions_handle(const DCPS::GUID_t& id);
65 
66  void insert_remote_datareader_crypto_handle(const DCPS::GUID_t& id,
69  DDS::Security::DatareaderCryptoHandle get_remote_datareader_crypto_handle(const DCPS::GUID_t& id) const;
70  const DDS::Security::EndpointSecurityAttributes& get_remote_datareader_security_attributes(const DCPS::GUID_t& id) const;
71  DatareaderCryptoHandleList get_all_remote_datareaders(const DCPS::GUID_t& prefix) const;
72  void erase_remote_datareader_crypto_handle(const DCPS::GUID_t& id);
73 
74  void insert_remote_datawriter_crypto_handle(const DCPS::GUID_t& id,
77  DDS::Security::DatawriterCryptoHandle get_remote_datawriter_crypto_handle(const DCPS::GUID_t& id) const;
78  const DDS::Security::EndpointSecurityAttributes& get_remote_datawriter_security_attributes(const DCPS::GUID_t& id) const;
79  DatawriterCryptoHandleList get_all_remote_datawriters(const DCPS::GUID_t& prefix) const;
80  void erase_remote_datawriter_crypto_handle(const DCPS::GUID_t& id);
81 
82 private:
84  ParticipantCryptoHandleMap;
86  PermissionsHandleMap;
87  typedef std::pair<DDS::Security::DatareaderCryptoHandle, DDS::Security::EndpointSecurityAttributes> P1;
89  DatareaderCryptoHandleMap;
90  typedef std::pair<DDS::Security::DatawriterCryptoHandle, DDS::Security::EndpointSecurityAttributes> P2;
92  DatawriterCryptoHandleMap;
93 
95 
97  ParticipantCryptoHandleMap remote_participant_crypto_handles_;
99 
100  DatareaderCryptoHandleMap local_datareader_crypto_handles_;
101  DatawriterCryptoHandleMap local_datawriter_crypto_handles_;
102 
103  DatareaderCryptoHandleMap remote_datareader_crypto_handles_;
104  DatawriterCryptoHandleMap remote_datawriter_crypto_handles_;
105 };
106 
108 
109 
110 } // namespace Security
111 } // namespace OpenDDS
112 
114 
115 #endif // OPENDDS_DCPS_SECURITY_FRAMEWORK_HANDLEREGISTRY_H
116 #endif // OPENDDS_SECURITY
DDS::Security::EndpointSecurityAttributes default_endpoint_security_attributes_
#define OpenDDS_Dcps_Export
Definition: dcps_export.h:24
PermissionsHandleMap remote_participant_permissions_handles_
DCPS::RcHandle< HandleRegistry > HandleRegistry_rch
std::pair< DDS::Security::DatareaderCryptoHandle, DDS::Security::EndpointSecurityAttributes > P1
NativeCryptoHandle DatawriterCryptoHandle
DatawriterCryptoHandleMap local_datawriter_crypto_handles_
NativeCryptoHandle DatareaderCryptoHandle
#define OPENDDS_MAP_CMP(K, V, C)
std::pair< DCPS::GUID_t, DDS::Security::DatareaderCryptoHandle > GUID_tDrch
typedef OPENDDS_VECTOR(ConfigProperty) ConfigPropertyList
DatawriterCryptoHandleMap remote_datawriter_crypto_handles_
DatareaderCryptoHandleMap remote_datareader_crypto_handles_
std::pair< DDS::Security::DatawriterCryptoHandle, DDS::Security::EndpointSecurityAttributes > P2
DatareaderCryptoHandleMap local_datareader_crypto_handles_
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
ParticipantCryptoHandleMap remote_participant_crypto_handles_
const DDS::Security::EndpointSecurityAttributes & default_endpoint_security_attributes() const
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
std::pair< DCPS::GUID_t, DDS::Security::DatawriterCryptoHandle > GUID_tDwch