22 #include <dds/DdsDcpsInfoUtilsC.h> 32 using DCPS::TimeDuration;
61 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
62 ACE_TEXT(
"rtps_discovery sections must have a subsection name\n")),
69 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
70 ACE_TEXT(
"too many nesting layers in the [rtps] section.\n")),
75 for (DCPS::KeyList::const_iterator it = keys.begin();
76 it != keys.end(); ++it) {
88 DCPS::ValueMap values;
90 for (DCPS::ValueMap::const_iterator it = values.begin();
91 it != values.end(); ++it) {
93 if (name ==
"ResendPeriod") {
98 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
99 ACE_TEXT(
"Invalid entry (%C) for ResendPeriod in ")
100 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
101 value.c_str(), rtps_name.c_str()), -1);
104 }
else if (name ==
"QuickResendRatio") {
109 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
110 ACE_TEXT(
"Invalid entry (%C) for QuickResendRatio in ")
111 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
112 value.c_str(), rtps_name.c_str()), -1);
114 config->quick_resend_ratio(ratio);
115 }
else if (name ==
"MinResendDelay") {
120 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
121 ACE_TEXT(
"Invalid entry (%C) for MinResendDelay in ")
122 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
123 value.c_str(), rtps_name.c_str()), -1);
126 }
else if (name ==
"LeaseDuration") {
131 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
132 ACE_TEXT(
"Invalid entry (%C) for LeaseDuration in ")
133 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
134 value.c_str(), rtps_name.c_str()), -1);
137 }
else if (name ==
"MaxLeaseDuration") {
142 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
143 ACE_TEXT(
"Invalid entry (%C) for MaxLeaseDuration in ")
144 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
145 value.c_str(), rtps_name.c_str()), -1);
148 #ifdef OPENDDS_SECURITY 149 }
else if (name ==
"SecurityUnsecureLeaseDuration") {
154 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
155 ACE_TEXT(
"Invalid entry (%C) for SecurityUnsecureLeaseDuration in ")
156 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
157 value.c_str(), rtps_name.c_str()), -1);
159 config->security_unsecure_lease_duration(
TimeDuration(duration));
160 }
else if (name ==
"MaxParticipantsInAuthentication") {
162 unsigned int max_participants = 0;
165 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
166 ACE_TEXT(
"Invalid entry (%C) for MaxParticipantsInAuthentication in ")
167 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
168 value.c_str(), rtps_name.c_str()), -1);
170 config->max_participants_in_authentication(max_participants);
172 }
else if (name ==
"LeaseExtension") {
177 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
178 ACE_TEXT(
"Invalid entry (%C) for LeaseExtension in ")
179 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
180 value.c_str(), rtps_name.c_str()), -1);
183 }
else if (name ==
"PB") {
188 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
189 ACE_TEXT(
"Invalid entry (%C) for PB in ")
190 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
191 value.c_str(), rtps_name.c_str()), -1);
194 }
else if (name ==
"DG") {
199 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
200 ACE_TEXT(
"Invalid entry (%C) for DG in ")
201 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
202 value.c_str(), rtps_name.c_str()), -1);
205 }
else if (name ==
"PG") {
210 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
211 ACE_TEXT(
"Invalid entry (%C) for PG in ")
212 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
213 value.c_str(), rtps_name.c_str()), -1);
216 }
else if (name ==
"D0") {
221 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
222 ACE_TEXT(
"Invalid entry (%C) for D0 in ")
223 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
224 value.c_str(), rtps_name.c_str()), -1);
227 }
else if (name ==
"D1") {
232 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
233 ACE_TEXT(
"Invalid entry (%C) for D1 in ")
234 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
235 value.c_str(), rtps_name.c_str()), -1);
238 }
else if (name ==
"DX") {
243 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
244 ACE_TEXT(
"Invalid entry (%C) for DX in ")
245 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
246 value.c_str(), rtps_name.c_str()), -1);
249 }
else if (name ==
"TTL") {
251 unsigned short ttl_us = 0;
254 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
255 ACE_TEXT(
"Invalid entry (%C) for TTL in ")
256 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
257 value.c_str(), rtps_name.c_str()), -1);
259 config->ttl(static_cast<unsigned char>(ttl_us));
260 }
else if (name ==
"SendBufferSize") {
262 ACE_INT32 send_buffer_size = 0;
265 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
266 ACE_TEXT(
"Invalid entry (%C) for SendBufferSize in ")
267 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
268 value.c_str(), rtps_name.c_str()), -1);
270 config->send_buffer_size(send_buffer_size);
271 }
else if (name ==
"RecvBufferSize") {
273 ACE_INT32 recv_buffer_size = 0;
276 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
277 ACE_TEXT(
"Invalid entry (%C) for RecvBufferSize in ")
278 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
279 value.c_str(), rtps_name.c_str()), -1);
281 config->recv_buffer_size(recv_buffer_size);
282 }
else if (name ==
"SedpMulticast") {
287 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
288 ACE_TEXT(
"Invalid entry (%C) for SedpMulticast in ")
289 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
290 value.c_str(), rtps_name.c_str()), -1);
292 config->sedp_multicast(
bool(smInt));
293 }
else if (name ==
"MulticastInterface") {
294 config->multicast_interface(it->second);
295 }
else if (name ==
"SedpLocalAddress") {
297 if (addr.
set(it->second.c_str())) {
299 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
300 ACE_TEXT(
"failed to parse SedpLocalAddress %C\n"),
304 config->sedp_local_address(addr);
305 }
else if (name ==
"SedpAdvertisedLocalAddress") {
307 if (addr.
set(it->second.c_str())) {
309 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
310 ACE_TEXT(
"failed to parse SedpAdvertisedLocalAddress %C\n"),
314 config->sedp_advertised_address(addr);
315 }
else if (name ==
"SpdpLocalAddress") {
317 if (addr.
set(u_short(0), it->second.c_str())) {
319 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
320 ACE_TEXT(
"failed to parse SpdpLocalAddress %C\n"),
324 config->spdp_local_address(addr);
325 }
else if (name ==
"SpdpRequestRandomPort") {
330 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
331 ACE_TEXT(
"Invalid entry (%C) for SpdpRequestRandomPort in ")
332 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
333 value.c_str(), rtps_name.c_str()), -1);
335 config->spdp_request_random_port(
bool(smInt));
336 }
else if (name ==
"GuidInterface") {
337 config->guid_interface(it->second);
338 }
else if (name ==
"InteropMulticastOverride") {
341 if (addr.
set(u_short(0), it->second.c_str())) {
343 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
344 ACE_TEXT(
"failed to parse InteropMulticastOverride %C\n"),
348 config->default_multicast_group(addr);
349 }
else if (name ==
"SpdpSendAddrs") {
354 i = value.find_first_not_of(
' ', i);
355 const size_t n = value.find_first_of(
", ", i);
356 spdp_send_addrs.push_back(value.substr(i, (n == OPENDDS_STRING::npos) ? n : n - i));
357 i = value.find(
',', i);
358 }
while (i++ != OPENDDS_STRING::npos);
359 config->spdp_send_addrs(spdp_send_addrs);
360 }
else if (name ==
"SpdpRtpsRelayAddress") {
362 if (addr.
set(it->second.c_str())) {
364 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
365 ACE_TEXT(
"failed to parse SpdpRtpsRelayAddress %C\n"),
369 config->spdp_rtps_relay_address(addr);
370 }
else if (name ==
"SpdpRtpsRelayBeaconPeriod") {
372 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
373 ACE_TEXT(
"Entry SpdpRtpsRelayBeaconPeriod is deprecated and will be ignored.\n")));
374 }
else if (name ==
"SpdpRtpsRelaySendPeriod") {
379 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
380 ACE_TEXT(
"Invalid entry (%C) for SpdpRtpsRelaySendPeriod in ")
381 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
382 value.c_str(), rtps_name.c_str()), -1);
384 config->spdp_rtps_relay_send_period(
TimeDuration(period));
385 }
else if (name ==
"SedpRtpsRelayAddress") {
387 if (addr.
set(it->second.c_str())) {
389 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
390 ACE_TEXT(
"failed to parse SedpRtpsRelayAddress %C\n"),
394 config->sedp_rtps_relay_address(addr);
395 }
else if (name ==
"SedpRtpsRelayBeaconPeriod") {
397 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
398 ACE_TEXT(
"Entry SedpRtpsRelayBeaconPeriod is deprecated and will be ignored.\n")));
399 }
else if (name ==
"RtpsRelayOnly") {
404 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
405 ACE_TEXT(
"Invalid entry (%C) for RtpsRelayOnly in ")
406 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
407 value.c_str(), rtps_name.c_str()), -1);
409 config->rtps_relay_only(
bool(smInt));
410 }
else if (name ==
"UseRtpsRelay") {
415 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
416 ACE_TEXT(
"Invalid entry (%C) for UseRtpsRelay in ")
417 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
418 value.c_str(), rtps_name.c_str()), -1);
420 config->use_rtps_relay(
bool(smInt));
421 #ifdef OPENDDS_SECURITY 422 }
else if (name ==
"SpdpStunServerAddress") {
424 if (addr.
set(it->second.c_str())) {
426 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
427 ACE_TEXT(
"failed to parse SpdpStunServerAddress %C\n"),
431 config->spdp_stun_server_address(addr);
432 }
else if (name ==
"SedpStunServerAddress") {
434 if (addr.
set(it->second.c_str())) {
436 ACE_TEXT(
"(%P|%t) ERROR: RtpsDiscovery::Config::discovery_config(): ")
437 ACE_TEXT(
"failed to parse SedpStunServerAddress %C\n"),
441 config->sedp_stun_server_address(addr);
442 }
else if (name ==
"UseIce") {
447 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
448 ACE_TEXT(
"Invalid entry (%C) for UseIce in ")
449 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
450 value.c_str(), rtps_name.c_str()), -1);
452 config->use_ice(
bool(smInt));
456 }
else if (name ==
"IceTa") {
464 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
465 ACE_TEXT(
"Invalid entry (%C) for IceTa in ")
466 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
467 string_value.c_str(), rtps_name.c_str()), -1);
469 }
else if (name ==
"IceConnectivityCheckTTL") {
477 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
478 ACE_TEXT(
"Invalid entry (%C) for IceConnectivityCheckTTL in ")
479 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
480 string_value.c_str(), rtps_name.c_str()), -1);
482 }
else if (name ==
"IceChecklistPeriod") {
490 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
491 ACE_TEXT(
"Invalid entry (%C) for IceChecklistPeriod in ")
492 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
493 string_value.c_str(), rtps_name.c_str()), -1);
495 }
else if (name ==
"IceIndicationPeriod") {
503 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
504 ACE_TEXT(
"Invalid entry (%C) for IceIndicationPeriod in ")
505 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
506 string_value.c_str(), rtps_name.c_str()), -1);
508 }
else if (name ==
"IceNominatedTTL") {
516 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
517 ACE_TEXT(
"Invalid entry (%C) for IceNominatedTTL in ")
518 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
519 string_value.c_str(), rtps_name.c_str()), -1);
521 }
else if (name ==
"IceServerReflexiveAddressPeriod") {
529 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
530 ACE_TEXT(
"Invalid entry (%C) for IceServerReflexiveAddressPeriod in ")
531 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
532 string_value.c_str(), rtps_name.c_str()), -1);
534 }
else if (name ==
"IceServerReflexiveIndicationCount") {
541 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
542 ACE_TEXT(
"Invalid entry (%C) for IceServerReflexiveIndicationCount in ")
543 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
544 string_value.c_str(), rtps_name.c_str()), -1);
546 }
else if (name ==
"IceDeferredTriggeredCheckTTL") {
554 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
555 ACE_TEXT(
"Invalid entry (%C) for IceDeferredTriggeredCheckTTL in ")
556 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
557 string_value.c_str(), rtps_name.c_str()), -1);
559 }
else if (name ==
"IceChangePasswordPeriod") {
567 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
568 ACE_TEXT(
"Invalid entry (%C) for IceChangePasswordPeriod in ")
569 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
570 string_value.c_str(), rtps_name.c_str()), -1);
572 }
else if (name ==
"MaxAuthTime") {
580 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
581 ACE_TEXT(
"Invalid entry (%C) for MaxAuthTime in ")
582 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
583 string_value.c_str(), rtps_name.c_str()), -1);
585 }
else if (name ==
"AuthResendPeriod") {
588 double double_value = 0.0;
593 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
594 ACE_TEXT(
"Invalid entry (%C) for AuthResendPeriod in ")
595 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
596 string_value.c_str(), rtps_name.c_str()), -1);
599 }
else if (name ==
"MaxSpdpSequenceMsgResetChecks") {
603 config->max_spdp_sequence_msg_reset_check(value);
606 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
607 ACE_TEXT(
"Invalid entry (%C) for MaxSpdpSequenceMsgResetChecks in ")
608 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
609 string_value.c_str(), rtps_name.c_str()), -1);
611 }
else if (name ==
"SedpMaxMessageSize") {
615 config->sedp_max_message_size(value);
618 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
619 ACE_TEXT(
"Invalid entry (%C) for SedpMaxMessageSize in ")
620 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
621 string_value.c_str(), rtps_name.c_str()), -1);
623 }
else if (name ==
"SedpHeartbeatPeriod") {
630 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
631 ACE_TEXT(
"Invalid entry (%C) for SedpHeartbeatPeriod in ")
632 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
633 string_value.c_str(), rtps_name.c_str()), -1);
635 }
else if (name ==
"SedpNakResponseDelay") {
642 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
643 ACE_TEXT(
"Invalid entry (%C) for SedpNakResponseDelay in ")
644 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
645 string_value.c_str(), rtps_name.c_str()), -1);
647 }
else if (name ==
"SedpSendDelay") {
654 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
655 ACE_TEXT(
"Invalid entry (%C) for SedpSendDelay in ")
656 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
657 string_value.c_str(), rtps_name.c_str()), -1);
659 }
else if (name ==
"SedpFragmentReassemblyTimeout") {
666 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
667 ACE_TEXT(
"Invalid entry (%C) for SedpFragmentReassemblyTimeout in ")
668 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
669 string_value.c_str(), rtps_name.c_str()), -1);
671 }
else if (name ==
"SedpPassiveConnectDuration") {
678 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
679 ACE_TEXT(
"Invalid entry (%C) for SedpPassiveConnectDuration in ")
680 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
681 string_value.c_str(), rtps_name.c_str()), -1);
683 }
else if (name ==
"SecureParticipantUserData") {
688 ACE_TEXT(
"Invalid entry (%C) for SecureParticipantUserData in ")
689 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
690 string_value.c_str(), rtps_name.c_str()));
693 config->secure_participant_user_data(int_value);
694 }
else if (name ==
"Customization") {
697 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
698 ACE_TEXT(
"%C section has a Customization setting.\n"),
701 }
else if (name ==
"UndirectedSpdp") {
706 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
707 ACE_TEXT(
"Invalid entry (%C) for UndirectedSpdp in ")
708 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
709 value.c_str(), rtps_name.c_str()), -1);
711 config->undirected_spdp(
bool(smInt));
712 }
else if (name ==
"PeriodicDirectedSpdp") {
717 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
718 ACE_TEXT(
"Invalid entry (%C) for PeriodicDirectedSpdp in ")
719 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
720 value.c_str(), rtps_name.c_str()), -1);
722 config->periodic_directed_spdp(
bool(smInt));
723 }
else if (name ==
"TypeLookupServiceReplyTimeout") {
728 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
729 ACE_TEXT(
"Invalid entry (%C) for TypeLookupServiceReplyTimeout in ")
730 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
731 value.c_str(), rtps_name.c_str()), -1);
734 }
else if (name ==
"UseXTypes") {
738 smInt >= 0 && smInt <= 2;
740 config->use_xtypes(static_cast<RtpsDiscoveryConfig::UseXTypes>(smInt));
742 valid = config->use_xtypes(value.c_str());
746 "(%P|%t) RtpsDiscovery::Config::discovery_config: " 747 "Invalid entry (%C) for UseXTypes in " 748 "[rtps_discovery/%C] section.\n",
749 value.c_str(), rtps_name.c_str()));
752 }
else if (name ==
"SedpResponsiveMode") {
757 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
758 ACE_TEXT(
"Invalid entry (%C) for SedpResponsiveMode in ")
759 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
760 value.c_str(), rtps_name.c_str()), -1);
762 config->sedp_responsive_mode(
bool(smInt));
763 }
else if (name ==
"SedpReceivePreallocatedMessageBlocks") {
764 const String& string_value = it->second;
767 config->sedp_receive_preallocated_message_blocks(value);
770 "(%P|%t) RtpsDiscovery::Config::discovery_config(): " 771 "Invalid entry (%C) for SedpReceivePreallocatedMessageBlocks in " 772 "[rtps_discovery/%C] section.\n",
773 string_value.c_str(), rtps_name.c_str()), -1);
775 }
else if (name ==
"SedpReceivePreallocatedDataBlocks") {
776 const String& string_value = it->second;
779 config->sedp_receive_preallocated_data_blocks(value);
782 "(%P|%t) RtpsDiscovery::Config::discovery_config(): " 783 "Invalid entry (%C) for SedpReceivePreallocatedDataBlocks in " 784 "[rtps_discovery/%C] section.\n",
785 string_value.c_str(), rtps_name.c_str()), -1);
787 }
else if (name ==
"CheckSourceIp") {
792 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config ")
793 ACE_TEXT(
"Invalid entry (%C) for CheckSourceIp in ")
794 ACE_TEXT(
"[rtps_discovery/%C] section.\n"),
795 value.c_str(), rtps_name.c_str()), -1);
797 config->check_source_ip(
bool(smInt));
800 ACE_TEXT(
"(%P|%t) RtpsDiscovery::Config::discovery_config(): ")
801 ACE_TEXT(
"Unexpected entry (%C) in [rtps_discovery/%C] section.\n"),
802 name.c_str(), rtps_name.c_str()), -1);
812 const DCPS::Service_Participant::RepoKeyDiscoveryMap& discoveryMap =
TheServiceParticipant->discoveryMap();
813 if (discoveryMap.find(Discovery::DEFAULT_RTPS) == discoveryMap.end()) {
814 TheServiceParticipant->add_discovery(OpenDDS::DCPS::make_rch<RtpsDiscovery>(Discovery::DEFAULT_RTPS));
827 if (!guid_interface.empty()) {
831 " - attempt to use network interface %C MAC addr for" 832 " GUID generation failed.\n", guid_interface.c_str()));
850 if (!guid_interface.empty()) {
854 " - attempt to use specific network interface %C MAC addr for" 855 " GUID generation failed.\n", guid_interface.c_str()));
867 }
catch (
const std::exception& e) {
870 "failed to initialize RTPS Simple Participant Discovery Protocol: %C\n",
876 #if defined(OPENDDS_SECURITY) 891 domain, ads.
id, qos,
this, tls,
id, perm, part_crypto));
894 }
catch (
const std::exception& e) {
897 "failed to initialize RTPS Simple Participant Discovery Protocol: %C\n",
909 get_part(domain_id, part_id)->signal_liveliness(kind);
916 const bool before = config->rtps_relay_only();
917 config->rtps_relay_only(after);
919 if (before != after) {
922 dom_pos != dom_limit; ++dom_pos) {
923 for (ParticipantMap::const_iterator part_pos = dom_pos->second.begin(), part_limit = dom_pos->second.end(); part_pos != part_limit; ++part_pos) {
924 part_pos->second->rtps_relay_only_now(after);
934 const bool before = config->use_rtps_relay();
935 config->use_rtps_relay(after);
937 if (before != after) {
940 dom_pos != dom_limit; ++dom_pos) {
941 for (ParticipantMap::const_iterator part_pos = dom_pos->second.begin(), part_limit = dom_pos->second.end(); part_pos != part_limit; ++part_pos) {
942 part_pos->second->use_rtps_relay_now(after);
952 const bool before = config->use_ice();
953 config->use_ice(after);
955 if (before != after) {
958 dom_pos != dom_limit; ++dom_pos) {
959 for (ParticipantMap::const_iterator part_pos = dom_pos->second.begin(), part_limit = dom_pos->second.end(); part_pos != part_limit; ++part_pos) {
960 part_pos->second->use_ice_now(after);
966 #ifdef OPENDDS_SECURITY 974 if (remote_participant ==
GUID_UNKNOWN || remote_participant == local_participant) {
975 return p->crypto_handle();
977 return p->remote_crypto_handle(remote_participant);
997 return p->get_spdp_port();
1009 return p->get_sedp_port();
1023 return p->get_ipv6_spdp_port();
1035 return p->get_ipv6_sedp_port();
1046 const ACE_INET_Addr prev = config->spdp_rtps_relay_address();
1047 if (prev == address) {
1051 config->spdp_rtps_relay_address(address);
1059 dom_pos != dom_limit; ++dom_pos) {
1060 for (ParticipantMap::const_iterator part_pos = dom_pos->second.begin(), part_limit = dom_pos->second.end(); part_pos != part_limit; ++part_pos) {
1061 part_pos->second->spdp_rtps_relay_address_change();
1070 config->sedp_rtps_relay_address(address);
1074 dom_pos != dom_limit; ++dom_pos) {
1075 for (ParticipantMap::const_iterator part_pos = dom_pos->second.begin(), part_limit = dom_pos->second.end(); part_pos != part_limit; ++part_pos) {
1076 part_pos->second->sedp_rtps_relay_address(address);
1084 get_config()->spdp_stun_server_address(address);
1090 get_config()->sedp_stun_server_address(address);
1094 dom_pos != dom_limit; ++dom_pos) {
1095 for (ParticipantMap::const_iterator part_pos = dom_pos->second.begin(), part_limit = dom_pos->second.end(); part_pos != part_limit; ++part_pos) {
1096 part_pos->second->sedp_stun_server_address(address);
1108 p->append_transport_statistics(seq);
1114 DDS::Subscriber_var bit_subscriber;
1115 #ifndef DDS_HAS_MINIMUM_BIT 1128 DDS::SubscriberListener::_nil(),
1133 ACE_TEXT(
" - Could not cast Subscriber to SubscriberImpl\n")));
1141 dr_qos.reader_data_lifecycle.autopurge_nowriter_samples_delay =
1143 dr_qos.reader_data_lifecycle.autopurge_disposed_samples_delay =
1146 DDS::TopicDescription_var bit_part_topic =
1151 DDS::TopicDescription_var bit_topic_topic =
1156 DDS::TopicDescription_var bit_pub_topic =
1161 DDS::TopicDescription_var bit_sub_topic =
1166 DDS::TopicDescription_var bit_part_loc_topic =
1171 DDS::TopicDescription_var bit_connection_record_topic =
1176 DDS::TopicDescription_var bit_internal_thread_topic =
1185 ACE_TEXT(
" - Error %d enabling subscriber\n"), ret));
1194 return bit_subscriber_rch;
1215 DomainParticipantMap::iterator domain =
participants_.find(domain_id);
1219 ParticipantMap::iterator part = domain->second.find(participantId);
1220 if (part == domain->second.end()) {
1223 participant = part->second;
1224 domain->second.erase(part);
1225 if (domain->second.empty()) {
1230 participant->shutdown();
1237 get_part(domain, myParticipantId)->ignore_domain_participant(ignoreId);
1244 get_part(domain, myParticipantId)->remove_domain_participant(removeId);
1251 return get_part(domain, participant)->update_domain_participant_qos(qos);
1256 return get_part(domain, local)->has_domain_participant(remote);
1262 const GUID_t& participantId,
1263 const char* topicName,
1264 const char* dataTypeName,
1271 return part->assert_topic(topicId, topicName,
1273 hasDcpsKey, topic_callbacks);
1280 const GUID_t& participantId,
1281 const char* topicName,
1283 DDS::TopicQos_out qos,
1288 return part->find_topic(topicName, dataTypeName, qos, topicId);
1295 const GUID_t& participantId,
1300 return part->remove_topic(topicId);
1308 get_part(domainId, myParticipantId)->ignore_topic(ignoreId);
1317 return part->update_topic_qos(topicId, qos);
1324 const GUID_t& participantId,
1332 return get_part(domainId, participantId)->add_publication(
1333 topicId, publication, qos, transInfo, publisherQos, type_info);
1339 get_part(domainId, participantId)->remove_publication(publicationId);
1346 get_part(domainId, participantId)->ignore_publication(ignoreId);
1357 return get_part(domainId, partId)->update_publication_qos(dwId, qos,
1365 get_part(domainId, partId)->update_publication_locators(dwId, transInfo);
1370 const GUID_t& participantId,
1376 const char* filterClassName,
1377 const char* filterExpr,
1381 return get_part(domainId, participantId)->add_subscription(
1382 topicId, subscription, qos, transInfo, subscriberQos, filterClassName,
1383 filterExpr, params, type_info);
1389 get_part(domainId, participantId)->remove_subscription(subscriptionId);
1396 get_part(domainId, participantId)->ignore_subscription(ignoreId);
1407 return get_part(domainId, partId)->update_subscription_qos(drId, qos, subQos);
1413 return get_part(domainId, partId)->update_subscription_params(subId, params);
1420 get_part(domainId, partId)->update_subscription_locators(subId, transInfo);
1424 const GUID_t& partId)
const 1426 return get_part(domainId, partId)->sedp_transport_inst();
1432 const DomainParticipantMap::const_iterator domain =
participants_.find(domain_id);
1436 const ParticipantMap::const_iterator part = domain->second.find(part_id);
1437 if (part == domain->second.end()) {
1440 return part->second;
1454 if (bit_topic_i == 0) {
1456 ACE_TEXT(
"Could not cast TopicDescription to TopicDescriptionImpl\n")));
1463 if (participant_i == 0) {
1465 ACE_TEXT(
"Could not cast DomainParticipant to DomainParticipantImpl\n")));
1469 DCPS::TypeSupport_var type_support =
1472 DDS::DataReader_var dr = type_support->create_datareader();
1476 ACE_TEXT(
"Could not cast DataReader to DataReaderImpl\n")));
1480 dri->
init(bit_topic_i, qos, 0 , 0 , participant_i, sub);
1491 spdp->request_remote_complete_type_objects(remote_entity, remote_type_info, cond);
RtpsDiscoveryConfig_rch config_
const char *const BUILT_IN_SUBSCRIPTION_TOPIC_TYPE
ParticipantHandle get_part(const DDS::DomainId_t domain_id, const GUID_t &part_id) const
int discovery_config(ACE_Configuration_Heap &cf)
bool ignore_subscription(DDS::DomainId_t domainId, const GUID_t &participantId, const GUID_t &ignoreId)
Implements the OpenDDS::DCPS::DomainParticipant interfaces.
#define ACE_GUARD(MUTEX, OBJ, LOCK)
void populate(DCPS::GUID_t &container)
OPENDDS_STRING guid_interface() const
AddrVec spdp_send_addrs() const
const LogLevel::Value value
bool remove_subscription(DDS::DomainId_t domainId, const GUID_t &participantId, const GUID_t &subscriptionId)
GUID_t add_subscription(DDS::DomainId_t domainId, const GUID_t &participantId, const GUID_t &topicId, DCPS::DataReaderCallbacks_rch subscription, const DDS::DataReaderQos &qos, const DCPS::TransportLocatorSeq &transInfo, const DDS::SubscriberQos &subscriberQos, const char *filterClassName, const char *filterExpr, const DDS::StringSeq ¶ms, const XTypes::TypeInformation &type_info)
const InstanceHandle_t HANDLE_NIL
virtual void signal_liveliness(const DDS::DomainId_t domain_id, const OpenDDS::DCPS::GUID_t &part_id, DDS::LivelinessQosPolicyKind kind)
void server_reflexive_address_period(const DCPS::TimeDuration &x)
const char *const BUILT_IN_CONNECTION_RECORD_TOPIC_TYPE
RtpsDiscoveryConfig_rch config() const
bool update_publication_qos(DDS::DomainId_t domainId, const GUID_t &partId, const GUID_t &dwId, const DDS::DataWriterQos &qos, const DDS::PublisherQos &publisherQos)
const char *const BUILT_IN_CONNECTION_RECORD_TOPIC
void server_reflexive_indication_count(size_t x)
const GUID_t GUID_UNKNOWN
Nil value for GUID.
DDS::ReturnCode_t create_bit_topics(DomainParticipantImpl *participant)
bool update_subscription_params(DDS::DomainId_t domainId, const GUID_t &partId, const GUID_t &subId, const DDS::StringSeq ¶ms)
void init(TopicDescriptionImpl *a_topic_desc, const DDS::DataReaderQos &qos, DDS::DataReaderListener_ptr a_listener, const DDS::StatusMask &mask, DomainParticipantImpl *participant, SubscriberImpl *subscriber)
bool has_domain_participant(DDS::DomainId_t domain, const GUID_t &local, const GUID_t &remote) const
bool update_subscription_qos(DDS::DomainId_t domainId, const GUID_t &partId, const GUID_t &drId, const DDS::DataReaderQos &qos, const DDS::SubscriberQos &subQos)
virtual DDS::Subscriber_ptr create_subscriber(const DDS::SubscriberQos &qos, DDS::SubscriberListener_ptr a_listener, DDS::StatusMask mask)
virtual OpenDDS::DCPS::AddDomainStatus add_domain_participant(DDS::DomainId_t domain, const DDS::DomainParticipantQos &qos, XTypes::TypeLookupService_rch tls)
void indication_period(const DCPS::TimeDuration &x)
virtual const ACE_Configuration_Section_Key & root_section(void) const
RtpsDiscovery(const RepoKey &key)
reference_wrapper< T > ref(T &r)
sequence< TransportLocator > TransportLocatorSeq
DDS::Security::ParticipantCryptoHandle get_crypto_handle(DDS::DomainId_t domain, const DCPS::GUID_t &local_participant, const DCPS::GUID_t &remote_participant=GUID_UNKNOWN) const
void use_rtps_relay_now(bool f)
bool ignore_domain_participant(DDS::DomainId_t domain, const GUID_t &myParticipantId, const GUID_t &ignoreId)
GuidGenerator guid_gen_
Guids will be unique within this RTPS configuration.
void deferred_triggered_check_ttl(const DCPS::TimeDuration &x)
void update_publication_locators(DDS::DomainId_t domainId, const GUID_t &partId, const GUID_t &dwId, const DCPS::TransportLocatorSeq &transInfo)
void checklist_period(const DCPS::TimeDuration &x)
virtual DDS::ReturnCode_t get_default_datareader_qos(DDS::DataReaderQos &qos)
int interfaceName(const char *nic)
const DDS::StatusMask DEFAULT_STATUS_MASK
DomainParticipantMap participants_
void T_a(const DCPS::TimeDuration &x)
virtual OpenDDS::DCPS::AddDomainStatus add_domain_participant_secure(DDS::DomainId_t domain, const DDS::DomainParticipantQos &qos, XTypes::TypeLookupService_rch tls, const OpenDDS::DCPS::GUID_t &guid, DDS::Security::IdentityHandle id, DDS::Security::PermissionsHandle perm, DDS::Security::ParticipantCryptoHandle part_crypto) OPENDDS_GCC_PRE53_DISABLE_OPTIMIZATION
void create_bit_dr(DDS::TopicDescription_ptr topic, const char *type, DCPS::SubscriberImpl *sub, const DDS::DataReaderQos &qos)
const char *const BUILT_IN_PUBLICATION_TOPIC
void nominated_ttl(const DCPS::TimeDuration &x)
RcHandle< Spdp > ParticipantHandle
RtpsDiscoveryConfig_rch get_config() const
DOMAINID_TYPE_NATIVE DomainId_t
const EntityId_t ENTITYID_PARTICIPANT
#define Registered_Data_Types
ACE_Thread_Mutex participants_lock_
bool attach_participant(DDS::DomainId_t domainId, const GUID_t &participantId)
void spdp_rtps_relay_address(const ACE_INET_Addr &address)
DCPS::TopicStatus remove_topic(DDS::DomainId_t domainId, const GUID_t &participantId, const GUID_t &topicId)
DCPS::TopicStatus find_topic(DDS::DomainId_t domainId, const GUID_t &participantId, const char *topicName, CORBA::String_out dataTypeName, DDS::TopicQos_out qos, GUID_t &topicId)
static TimeDuration from_msec(const ACE_UINT64 &ms)
void request_remote_complete_type_objects(DDS::DomainId_t domain, const GUID_t &local_participant, const GUID_t &remote_entity, const XTypes::TypeInformation &remote_type_info, DCPS::TypeObjReqCond &cond)
const char *const BUILT_IN_PARTICIPANT_LOCATION_TOPIC_TYPE
sequence< TransportStatistics > TransportStatisticsSequence
long ParticipantCryptoHandle
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
void rtps_relay_only_now(bool f)
void change_password_period(const DCPS::TimeDuration &x)
Implements the DDS::DataReader interface.
void append_transport_statistics(DDS::DomainId_t domain, const DCPS::GUID_t &local_participant, DCPS::TransportStatisticsSequence &seq)
RtpsDiscoveryConfig::AddrVec AddrVec
RcHandle< DCPS::BitSubscriber > init_bit(DCPS::DomainParticipantImpl *participant)
const char *const BUILT_IN_PARTICIPANT_TOPIC
void fini_bit(DCPS::DomainParticipantImpl *participant)
const char *const BUILT_IN_PARTICIPANT_LOCATION_TOPIC
bool ignore_topic(DDS::DomainId_t domainId, const GUID_t &myParticipantId, const GUID_t &ignoreId)
virtual DDS::DomainId_t get_domain_id()
bool remove_domain_participant(DDS::DomainId_t domain_id, const GUID_t &participantId)
static const ACE_TCHAR RTPS_SECTION_NAME[]
int set(const ACE_INET_Addr &)
bool update_domain_participant_qos(DDS::DomainId_t domain, const GUID_t &participant, const DDS::DomainParticipantQos &qos)
bool convertToDouble(const String &s, T &value)
const char *const BUILT_IN_PARTICIPANT_TOPIC_TYPE
const char *const BUILT_IN_SUBSCRIPTION_TOPIC
#define SUBSCRIBER_QOS_DEFAULT
u_short get_sedp_port(DDS::DomainId_t domain, const DCPS::GUID_t &local_participant) const
RcHandle< DCPS::TransportInst > sedp_transport_inst(DDS::DomainId_t domainId, const GUID_t &partId) const
const char *const BUILT_IN_INTERNAL_THREAD_TOPIC
bool ignore_publication(DDS::DomainId_t domainId, const GUID_t &participantId, const GUID_t &ignoreId)
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
virtual DDS::DomainParticipant_ptr get_participant()
Implements the DDS::TopicDescription interface.
const char *const BUILT_IN_TOPIC_TOPIC
virtual int open_section(const ACE_Configuration_Section_Key &base, const ACE_TCHAR *sub_section, bool create, ACE_Configuration_Section_Key &result)
static Configuration * instance()
void connectivity_check_ttl(const DCPS::TimeDuration &x)
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
void sedp_stun_server_address(const ACE_INET_Addr &address)
static TimeDuration from_double(double duration)
virtual DDS::ReturnCode_t enable()
int processSections(ACE_Configuration_Heap &cf, const ACE_Configuration_Section_Key &key, KeyList &subsections)
void update_subscription_locators(DDS::DomainId_t domainId, const GUID_t &partId, const GUID_t &subId, const DCPS::TransportLocatorSeq &transInfo)
const ReturnCode_t RETCODE_OK
bool update_topic_qos(const GUID_t &topicId, DDS::DomainId_t domainId, const GUID_t &participantId, const DDS::TopicQos &qos)
u_short get_spdp_port(DDS::DomainId_t domain, const DCPS::GUID_t &local_participant) const
void sedp_rtps_relay_address(const ACE_INET_Addr &address)
#define ACE_ERROR_RETURN(X, Y)
static const String ip(const ACE_INET_Addr &addr)
int pullValues(ACE_Configuration_Heap &cf, const ACE_Configuration_Section_Key &key, ValueMap &values)
void spdp_stun_server_address(const ACE_INET_Addr &address)
const char *const BUILT_IN_INTERNAL_THREAD_TOPIC_TYPE
Defines the interface for Discovery callbacks into the Topic.
#define TheServiceParticipant
bool remove_publication(DDS::DomainId_t domainId, const GUID_t &participantId, const GUID_t &publicationId)
The Internal API and Implementation of OpenDDS.
virtual DDS::TopicDescription_ptr lookup_topicdescription(const char *name)
DCPS::TopicStatus assert_topic(GUID_t &topicId, DDS::DomainId_t domainId, const GUID_t &participantId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, bool hasDcpsKey, DCPS::TopicCallbacks *topic_callbacks)
GUID_t add_publication(DDS::DomainId_t domainId, const GUID_t &participantId, const GUID_t &topicId, DCPS::DataWriterCallbacks_rch publication, const DDS::DataWriterQos &qos, const DCPS::TransportLocatorSeq &transInfo, const DDS::PublisherQos &publisherQos, const XTypes::TypeInformation &type_info)
const char *const BUILT_IN_TOPIC_TOPIC_TYPE
const char *const BUILT_IN_PUBLICATION_TOPIC_TYPE
sequence< string > StringSeq
bool convertToInteger(const String &s, T &value)
virtual OpenDDS::DCPS::GUID_t generate_participant_guid()