Fast DDS  Version 3.6.1.0
Fast DDS
SocketTransportDescriptor.hpp
1 // Copyright 2019 Proyectos y Sistemas de Mantenimiento SL (eProsima).
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License");
4 // you may not use this file except in compliance with the License.
5 // You may obtain a copy of the License at
6 //
7 // http://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS,
11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 // See the License for the specific language governing permissions and
13 // limitations under the License.
14 
20 #ifndef FASTDDS_RTPS_TRANSPORT__SOCKETTRANSPORTDESCRIPTOR_HPP
21 #define FASTDDS_RTPS_TRANSPORT__SOCKETTRANSPORTDESCRIPTOR_HPP
22 
23 #include <cstdint>
24 #include <vector>
25 #include <string>
26 
27 #include <fastdds/rtps/transport/network/AllowedNetworkInterface.hpp>
28 #include <fastdds/rtps/transport/network/BlockedNetworkInterface.hpp>
29 #include <fastdds/rtps/transport/network/NetmaskFilterKind.hpp>
30 #include <fastdds/rtps/transport/PortBasedTransportDescriptor.hpp>
31 
32 namespace eprosima {
33 namespace fastdds {
34 namespace rtps {
35 
37 constexpr uint8_t s_defaultTTL = 1;
38 
53 {
55  FASTDDS_EXPORTED_API SocketTransportDescriptor(
56  uint32_t maximumMessageSize,
57  uint32_t maximumInitialPeersRange)
58  : PortBasedTransportDescriptor(maximumMessageSize, maximumInitialPeersRange)
59  , sendBufferSize(0)
62  , TTL(s_defaultTTL)
63  {
64  }
65 
67  FASTDDS_EXPORTED_API SocketTransportDescriptor(
68  const SocketTransportDescriptor& t) = default;
69 
71  FASTDDS_EXPORTED_API SocketTransportDescriptor& operator =(
72  const SocketTransportDescriptor& t) = default;
73 
75  virtual FASTDDS_EXPORTED_API ~SocketTransportDescriptor() = default;
76 
77  virtual FASTDDS_EXPORTED_API uint32_t min_send_buffer_size() const override
78  {
79  return sendBufferSize;
80  }
81 
83  bool FASTDDS_EXPORTED_API operator ==(
84  const SocketTransportDescriptor& t) const
85  {
86  return (this->sendBufferSize == t.min_send_buffer_size() &&
87  this->receiveBufferSize == t.receiveBufferSize &&
88  this->interfaceWhiteList == t.interfaceWhiteList &&
89  this->netmask_filter == t.netmask_filter &&
90  this->interface_allowlist == t.interface_allowlist &&
91  this->interface_blocklist == t.interface_blocklist &&
92  this->TTL == t.TTL &&
93  PortBasedTransportDescriptor::operator ==(t));
94  }
95 
97  uint32_t sendBufferSize;
101  std::vector<std::string> interfaceWhiteList;
105  std::vector<AllowedNetworkInterface> interface_allowlist;
107  std::vector<BlockedNetworkInterface> interface_blocklist;
109  uint8_t TTL;
110 };
111 
112 } // namespace rtps
113 } // namespace fastdds
114 } // namespace eprosima
115 
116 #endif //FASTDDS_RTPS_TRANSPORT__SOCKETTRANSPORTDESCRIPTOR_HPP
Base class for all port based transport descriptors.
Definition: PortBasedTransportDescriptor.hpp:38
NetmaskFilterKind
Definition: NetmaskFilterKind.hpp:31
constexpr uint8_t s_defaultTTL
Default time to live (TTL)
Definition: SocketTransportDescriptor.hpp:37
Virtual base class for the data type used to define configuration of transports using sockets.
Definition: SocketTransportDescriptor.hpp:53
bool FASTDDS_EXPORTED_API operator==(const SocketTransportDescriptor &t) const
Comparison operator.
Definition: SocketTransportDescriptor.hpp:83
virtual FASTDDS_EXPORTED_API ~SocketTransportDescriptor()=default
Destructor.
NetmaskFilterKind netmask_filter
Transport's netmask filter configuration.
Definition: SocketTransportDescriptor.hpp:103
std::vector< AllowedNetworkInterface > interface_allowlist
Allowed interfaces in an IP or device name string format, each with a specific netmask filter configu...
Definition: SocketTransportDescriptor.hpp:105
virtual FASTDDS_EXPORTED_API uint32_t min_send_buffer_size() const override
Returns the minimum size required for a send operation.
Definition: SocketTransportDescriptor.hpp:77
FASTDDS_EXPORTED_API SocketTransportDescriptor & operator=(const SocketTransportDescriptor &t)=default
Copy assignment.
std::vector< std::string > interfaceWhiteList
Allowed interfaces in an IP or device name string format.
Definition: SocketTransportDescriptor.hpp:101
uint32_t sendBufferSize
Length of the send buffer.
Definition: SocketTransportDescriptor.hpp:97
FASTDDS_EXPORTED_API SocketTransportDescriptor(const SocketTransportDescriptor &t)=default
Copy constructor.
std::vector< BlockedNetworkInterface > interface_blocklist
Blocked interfaces in an IP or device name string format.
Definition: SocketTransportDescriptor.hpp:107
FASTDDS_EXPORTED_API SocketTransportDescriptor(uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange)
Constructor.
Definition: SocketTransportDescriptor.hpp:55
uint8_t TTL
Specified time to live (8bit - 255 max TTL)
Definition: SocketTransportDescriptor.hpp:109
uint32_t receiveBufferSize
Length of the receive buffer.
Definition: SocketTransportDescriptor.hpp:99