OpenDDS  Snapshot(2023/04/28-20:55)
RtpsDiscoveryConfig.cpp
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 #include "RtpsDiscoveryConfig.h"
7 
8 namespace {
9  u_short get_default_d0(u_short fallback)
10  {
11 #if !defined ACE_LACKS_GETENV && !defined ACE_LACKS_ENV
12  const char* from_env = std::getenv("OPENDDS_RTPS_DEFAULT_D0");
13  if (from_env) {
14  return static_cast<u_short>(std::atoi(from_env));
15  }
16 #endif
17  return fallback;
18  }
19 }
20 
22 
23 namespace OpenDDS {
24 namespace RTPS {
25 
26 using DCPS::TimeDuration;
27 
29  : resend_period_(30 /*seconds*/) // see RTPS v2.1 9.6.1.4.2
30  , quick_resend_ratio_(0.1)
31  , min_resend_delay_(TimeDuration::from_msec(100))
32  , lease_duration_(300)
33  , max_lease_duration_(300)
34 #ifdef OPENDDS_SECURITY
35  , security_unsecure_lease_duration_(30)
36  , max_participants_in_authentication_(0)
37 #endif
38  , lease_extension_(0)
39  , pb_(7400) // see RTPS v2.1 9.6.1.3 for PB, DG, PG, D0, D1 defaults
40  , dg_(250)
41  , pg_(2)
42  , d0_(get_default_d0(0))
43  , d1_(10)
44  , dx_(2)
45  , ttl_(1)
47  , send_buffer_size_(ACE_DEFAULT_MAX_SOCKET_BUFSIZ)
48  , recv_buffer_size_(ACE_DEFAULT_MAX_SOCKET_BUFSIZ)
49 #else
50  , send_buffer_size_(0)
51  , recv_buffer_size_(0)
52 #endif
53  , sedp_multicast_(true)
54  , sedp_local_address_(u_short(0), "0.0.0.0")
55  , spdp_local_address_(u_short(0), "0.0.0.0")
56  , default_multicast_group_(u_short(0), "239.255.0.1") /*RTPS v2.1 9.6.1.4.1*/
57 #ifdef ACE_HAS_IPV6
58  , ipv6_sedp_local_address_(u_short(0), "::")
59  , ipv6_spdp_local_address_(u_short(0), "::")
60  , ipv6_default_multicast_group_(u_short(0), "FF03::1")
61 #endif
62  , spdp_request_random_port_(false)
63  , max_auth_time_(300, 0)
64  , auth_resend_period_(1, 0)
65  , max_spdp_sequence_msg_reset_check_(3)
66  , spdp_rtps_relay_send_period_(30, 0)
67  , use_rtps_relay_(false)
68  , rtps_relay_only_(false)
69  , use_ice_(false)
70  , sedp_max_message_size_(DCPS::TransportSendStrategy::UDP_MAX_MESSAGE_SIZE)
71  , undirected_spdp_(true)
72  , periodic_directed_spdp_(false)
73  , secure_participant_user_data_(false)
74  , max_type_lookup_service_reply_period_(5, 0)
75  , use_xtypes_(XTYPES_MINIMAL)
76  , sedp_heartbeat_period_(0, 200*1000 /*microseconds*/)
77  , sedp_nak_response_delay_(0, 100*1000 /*microseconds*/)
78  , sedp_send_delay_(0, 10 * 1000)
79  , sedp_passive_connect_duration_(TimeDuration::from_msec(DCPS::TransportConfig::DEFAULT_PASSIVE_CONNECT_DURATION))
80  , participant_flags_(PFLAGS_THIS_VERSION)
81  , sedp_responsive_mode_(false)
82  , sedp_receive_preallocated_message_blocks_(0)
83  , sedp_receive_preallocated_data_blocks_(0)
84  , check_source_ip_(true)
85 {}
86 
87 } // namespace DCPS
88 } // namespace OpenDDS
89 
if(!(yy_init))
#define ACE_DEFAULT_MAX_SOCKET_BUFSIZ
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
The Internal API and Implementation of OpenDDS.
Definition: AddressCache.h:28
const OpenDDSParticipantFlagsBits_t PFLAGS_THIS_VERSION
Definition: RtpsCore.idl:327