RtpsUdpTransport.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008 #ifndef DCPS_RTPSUDPTRANSPORT_H
00009 #define DCPS_RTPSUDPTRANSPORT_H
00010
00011 #include "Rtps_Udp_Export.h"
00012
00013 #include "RtpsUdpDataLink.h"
00014 #include "RtpsUdpDataLink_rch.h"
00015
00016 #include "dds/DCPS/transport/framework/TransportImpl.h"
00017 #include "dds/DCPS/transport/framework/TransportClient.h"
00018
00019 #include "dds/DCPS/PoolAllocator.h"
00020
00021 #include "dds/DCPS/RTPS/RtpsCoreC.h"
00022
00023 OPENDDS_BEGIN_VERSIONED_NAMESPACE_DECL
00024
00025 namespace OpenDDS {
00026 namespace DCPS {
00027
00028 class RtpsUdpInst;
00029
00030 class OpenDDS_Rtps_Udp_Export RtpsUdpTransport : public TransportImpl {
00031 public:
00032 RtpsUdpTransport(RtpsUdpInst& inst);
00033 RtpsUdpInst& config() const;
00034 private:
00035 virtual AcceptConnectResult connect_datalink(const RemoteTransport& remote,
00036 const ConnectionAttribs& attribs,
00037 const TransportClient_rch& client);
00038
00039 virtual AcceptConnectResult accept_datalink(const RemoteTransport& remote,
00040 const ConnectionAttribs& attribs,
00041 const TransportClient_rch& client);
00042
00043 virtual void stop_accepting_or_connecting(const TransportClient_wrch& client,
00044 const RepoId& remote_id);
00045
00046 bool configure_i(RtpsUdpInst& config);
00047
00048 virtual void shutdown_i();
00049
00050 virtual void register_for_reader(const RepoId& participant,
00051 const RepoId& writerid,
00052 const RepoId& readerid,
00053 const TransportLocatorSeq& locators,
00054 OpenDDS::DCPS::DiscoveryListener* listener);
00055
00056 virtual void unregister_for_reader(const RepoId& participant,
00057 const RepoId& writerid,
00058 const RepoId& readerid);
00059
00060 virtual void register_for_writer(const RepoId& ,
00061 const RepoId& ,
00062 const RepoId& ,
00063 const TransportLocatorSeq& ,
00064 DiscoveryListener* );
00065
00066 virtual void unregister_for_writer(const RepoId& ,
00067 const RepoId& ,
00068 const RepoId& );
00069
00070 virtual bool connection_info_i(TransportLocator& info) const;
00071 ACE_INET_Addr get_connection_addr(const TransportBLOB& data,
00072 bool* requires_inline_qos = 0,
00073 unsigned int* blob_bytes_read = 0) const;
00074
00075 virtual void release_datalink(DataLink* link);
00076
00077 virtual OPENDDS_STRING transport_type() const { return "rtps_udp"; }
00078
00079 RtpsUdpDataLink_rch make_datalink(const GuidPrefix_t& local_prefix);
00080
00081 void use_datalink(const RepoId& local_id,
00082 const RepoId& remote_id,
00083 const TransportBLOB& remote_data,
00084 bool local_reliable, bool remote_reliable,
00085 bool local_durable, bool remote_durable);
00086
00087 #if defined(OPENDDS_SECURITY)
00088 void local_crypto_handle(DDS::Security::ParticipantCryptoHandle pch)
00089 {
00090 local_crypto_handle_ = pch;
00091 if (link_) {
00092 link_->local_crypto_handle(pch);
00093 }
00094 }
00095 #endif
00096
00097
00098 typedef ACE_Thread_Mutex ThreadLockType;
00099 typedef ACE_Guard<ThreadLockType> GuardThreadType;
00100 ThreadLockType links_lock_;
00101
00102
00103
00104 typedef ACE_SYNCH_MUTEX LockType;
00105 typedef ACE_Guard<LockType> GuardType;
00106 LockType connections_lock_;
00107
00108
00109
00110
00111
00112
00113 RtpsUdpDataLink_rch link_;
00114 bool map_ipv4_to_ipv6() const;
00115
00116 ACE_SOCK_Dgram unicast_socket_;
00117
00118 TransportClient_wrch default_listener_;
00119
00120 #if defined(OPENDDS_SECURITY)
00121 DDS::Security::ParticipantCryptoHandle local_crypto_handle_;
00122 #endif
00123
00124 };
00125
00126 }
00127 }
00128
00129 OPENDDS_END_VERSIONED_NAMESPACE_DECL
00130
00131 #endif