| Fast DDS Version 3.3.0 Fast DDS

Loading...
Searching...
No Matches
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
19
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
52 struct SocketTransportDescriptor : public PortBasedTransportDescriptor
53{
55 FASTDDS_EXPORTED_API SocketTransportDescriptor(
56 uint32_t maximumMessageSize,
57 uint32_t maximumInitialPeersRange)
58 : PortBasedTransportDescriptor(maximumMessageSize, maximumInitialPeersRange)
59 , sendBufferSize(0)
60 , receiveBufferSize(0)
61 , netmask_filter(NetmaskFilterKind::AUTO)
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;
99 uint32_t receiveBufferSize;
101 std::vector<std::string> interfaceWhiteList;
103 NetmaskFilterKind netmask_filter;
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
eprosima::fastdds::rtps::PortBasedTransportDescriptor::PortBasedTransportDescriptor
FASTDDS_EXPORTED_API PortBasedTransportDescriptor(uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange)
Constructor.
eprosima::fastdds::rtps
Contains the RTPS protocol implementation.
eprosima::fastdds::rtps::NetmaskFilterKind
NetmaskFilterKind
Definition NetmaskFilterKind.hpp:31
eprosima::fastdds::rtps::NetmaskFilterKind::AUTO
@ AUTO
Definition NetmaskFilterKind.hpp:33
eprosima::fastdds::rtps::s_defaultTTL
constexpr uint8_t s_defaultTTL
Default time to live (TTL).
Definition SocketTransportDescriptor.hpp:37
eprosima::fastdds
eprosima
eProsima namespace.
eprosima::fastdds::rtps::SocketTransportDescriptor::operator==
bool FASTDDS_EXPORTED_API operator==(const SocketTransportDescriptor &t) const
Comparison operator.
Definition SocketTransportDescriptor.hpp:83
eprosima::fastdds::rtps::SocketTransportDescriptor::~SocketTransportDescriptor
virtual FASTDDS_EXPORTED_API ~SocketTransportDescriptor()=default
Destructor.
eprosima::fastdds::rtps::SocketTransportDescriptor::netmask_filter
NetmaskFilterKind netmask_filter
Transport's netmask filter configuration.
Definition SocketTransportDescriptor.hpp:103
eprosima::fastdds::rtps::SocketTransportDescriptor::interface_allowlist
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
eprosima::fastdds::rtps::SocketTransportDescriptor::min_send_buffer_size
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
eprosima::fastdds::rtps::SocketTransportDescriptor::operator=
FASTDDS_EXPORTED_API SocketTransportDescriptor & operator=(const SocketTransportDescriptor &t)=default
Copy assignment.
eprosima::fastdds::rtps::SocketTransportDescriptor::interfaceWhiteList
std::vector< std::string > interfaceWhiteList
Allowed interfaces in an IP or device name string format.
Definition SocketTransportDescriptor.hpp:101
eprosima::fastdds::rtps::SocketTransportDescriptor::sendBufferSize
uint32_t sendBufferSize
Length of the send buffer.
Definition SocketTransportDescriptor.hpp:97
eprosima::fastdds::rtps::SocketTransportDescriptor::SocketTransportDescriptor
FASTDDS_EXPORTED_API SocketTransportDescriptor(const SocketTransportDescriptor &t)=default
Copy constructor.
eprosima::fastdds::rtps::SocketTransportDescriptor::interface_blocklist
std::vector< BlockedNetworkInterface > interface_blocklist
Blocked interfaces in an IP or device name string format.
Definition SocketTransportDescriptor.hpp:107
eprosima::fastdds::rtps::SocketTransportDescriptor::SocketTransportDescriptor
FASTDDS_EXPORTED_API SocketTransportDescriptor(uint32_t maximumMessageSize, uint32_t maximumInitialPeersRange)
Constructor.
Definition SocketTransportDescriptor.hpp:55
eprosima::fastdds::rtps::SocketTransportDescriptor::TTL
uint8_t TTL
Specified time to live (8bit - 255 max TTL).
Definition SocketTransportDescriptor.hpp:109
eprosima::fastdds::rtps::SocketTransportDescriptor::receiveBufferSize
uint32_t receiveBufferSize
Length of the receive buffer.
Definition SocketTransportDescriptor.hpp:99