22 #ifdef OPENDDS_SECURITY 26 #include <dds/DdsDcpsGuidC.h> 42 using DCPS::TimeDuration;
43 using DCPS::Serializer;
59 return inlineQos[i].status_info().value[3] & 1;
65 #ifndef DDS_HAS_MINIMUM_BIT 68 if (address.
get_type() == AF_INET6) {
75 #ifdef OPENDDS_SECURITY 77 #ifndef DDS_HAS_MINIMUM_BIT 80 if (address.
get_type() == AF_INET6) {
96 bool result = (rhs.length() == lhs.length());
97 for (
unsigned int i = 0; result && i < rhs.length(); ++i) {
98 result = (rhs[i] == lhs[i]);
104 bool result = (rhs.length() == lhs.length());
105 for (
unsigned int i = 0; result && i < rhs.length(); ++i) {
106 result = (rhs[i] == lhs[i]);
142 bool enable_endpoint_announcements =
true;
143 bool enable_type_lookup_service =
config_->use_xtypes();
146 for (
unsigned int idx = 0; idx != properties.length(); ++idx) {
149 enable_endpoint_announcements = prop_to_bool(prop);
151 enable_type_lookup_service = prop_to_bool(prop);
157 config_->participant_flags(new_flags);
168 if (enable_endpoint_announcements) {
175 if (enable_type_lookup_service) {
183 #ifdef OPENDDS_SECURITY 198 if (enable_endpoint_announcements) {
205 if (enable_type_lookup_service) {
242 #ifdef OPENDDS_SECURITY
255 init(domain, guid, qos, tls);
257 #ifdef OPENDDS_SECURITY 263 #ifdef OPENDDS_SECURITY 265 const DCPS::GUID_t&
guid,
304 DDS::Security::Authentication_var auth =
security_config_->get_authentication();
312 ACE_TEXT(
"unable to get identity token. Security Exception[%d.%d]: %C\n"),
314 throw std::runtime_error(
"unable to get identity token");
319 ACE_TEXT(
"unable to get identity status token. Security Exception[%d.%d]: %C\n"),
321 throw std::runtime_error(
"unable to get identity status token");
326 ACE_TEXT(
"unable to get permissions handle. Security Exception[%d.%d]: %C\n"),
328 throw std::runtime_error(
"unable to get permissions token");
333 ACE_TEXT(
"unable to get permissions credential handle. Security Exception[%d.%d]: %C\n"),
335 throw std::runtime_error(
"unable to get permissions credential token");
341 ACE_TEXT(
"unable to set permissions credential and token. Security Exception[%d.%d]: %C\n"),
343 throw std::runtime_error(
"unable to set permissions credential and token");
351 ACE_TEXT(
"failed to retrieve participant security attributes. Security Exception[%d.%d]: %C\n"),
353 throw std::runtime_error(
"unable to retrieve participant security attributes");
356 sedp_->init_security(identity_handle, perm_handle, crypto_handle);
369 ACE_TEXT(
"remove discovered participants\n")));
372 #ifdef OPENDDS_SECURITY 382 #ifdef OPENDDS_SECURITY 385 stop_ice(sedp_endpoint, part->first, part->second.pdata_.participantProxy.availableBuiltinEndpoints,
386 part->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
398 #ifdef OPENDDS_SECURITY 402 ice_agent_->remove_local_agent_info_listener(sedp_endpoint, l);
426 #ifdef OPENDDS_SECURITY 450 #ifdef OPENDDS_SECURITY 453 return pdata.ddsParticipantData;
458 #ifndef DDS_HAS_MINIMUM_BIT 469 ACE_DEBUG((
LM_DEBUG,
"(%P|%t) DEBUG: Spdp::enqueue_location_update_i: %@ for %C size=%B reason=%C\n",
this,
LogGuid(iter->first).
c_str(), iter->second.location_updates_.size(), reason));
480 ACE_DEBUG((
LM_DEBUG,
"(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ iterator invalid, returning\n",
this));
488 ACE_DEBUG((
LM_DEBUG,
"(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ %C does not exist in participant bit, returning\n",
this,
LogGuid(iter->first).
c_str()));
493 DiscoveredParticipant::LocationUpdateList location_updates;
494 std::swap(iter->second.location_updates_, location_updates);
497 ACE_DEBUG((
LM_DEBUG,
"(%P|%t) DEBUG: Spdp::process_location_updates_i: %@ %C has %B location update(s) force_publish=%d reason=%C\n",
this,
LogGuid(iter->first).
c_str(), location_updates.size(), force_publish, reason));
500 bool published =
false;
501 for (DiscoveredParticipant::LocationUpdateList::const_iterator pos = location_updates.begin(),
502 limit = location_updates.end(); iter !=
participants_.end() && pos != limit; ++pos) {
508 location_data.
location |= pos->mask_;
511 location_data.
location &= ~(pos->mask_);
516 bool address_change =
false;
517 switch (pos->mask_) {
519 address_change = addr.compare(location_data.
local_addr.in()) != 0;
524 address_change = addr.compare(location_data.
ice_addr.in()) != 0;
525 location_data.
ice_addr = addr.c_str();
529 address_change = addr.compare(location_data.
relay_addr.in()) != 0;
534 address_change = addr.compare(location_data.
local6_addr.in()) != 0;
539 address_change = addr.compare(location_data.
ice6_addr.in()) != 0;
544 address_change = addr.compare(location_data.
relay6_addr.in()) != 0;
553 iter->second.pdata_.participantProxy.protocolVersion,
554 iter->second.pdata_.participantProxy.vendorId)
577 if (old_mask != location_data.
location || address_change) {
586 if (force_publish && !published) {
606 ACE_DEBUG((
LM_DEBUG,
"(%P|%t) DEBUG: Spdp::publish_location_update_i: %@ participant %C has participant location handle %d\n",
this,
LogGuid(iter->first).
c_str(), iter->second.location_ih_));
619 struct sockaddr_in* sa =
static_cast<struct sockaddr_in*
>(a.
get_addr());
621 const unsigned char*
ip =
reinterpret_cast<const unsigned char*
>(&sa->sin_addr);
622 const unsigned char* la =
reinterpret_cast<const unsigned char*
>(locator.
address) + 12;
628 #if defined (ACE_HAS_IPV6) 631 struct sockaddr_in6* in6 =
static_cast<struct sockaddr_in6*
>(a.
get_addr());
633 const unsigned char*
ip =
reinterpret_cast<const unsigned char*
>(&in6->sin6_addr);
634 const unsigned char* la =
reinterpret_cast<const unsigned char*
>(locator.
address);
639 #endif // ACE_HAS_IPV6 645 return cmp_ip6(a, locator);
652 const unsigned char* a =
reinterpret_cast<const unsigned char*
>(o.
address);
655 ACE_DEBUG((
LM_DEBUG,
ACE_TEXT(
"locator%d(kind:%d)[%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d.%d] locator_to_address:%C\n"),
656 i, o.
kind, a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15],
676 #ifdef OPENDDS_SECURITY 680 ICE::AgentInfoMap ai_map;
686 if (sedp_i != ai_map.end()) {
687 const ICE::AgentInfo::CandidatesType& cs = sedp_i->second.candidates;
696 if (!found && spdp_i != ai_map.end()) {
697 const ICE::AgentInfo::CandidatesType& cs = spdp_i->second.candidates;
728 if (
sedp_->ignoring(guid)) {
734 const bool relay_in_use = (
config_->rtps_relay_only() ||
config_->use_rtps_relay());
735 const bool from_relay = relay_in_use && (from ==
config_->spdp_rtps_relay_address());
737 #ifndef DDS_HAS_MINIMUM_BIT 743 #ifdef OPENDDS_SECURITY 758 #ifdef OPENDDS_SECURITY 759 if (
config_->max_participants_in_authentication() &&
763 "(%P|%t) {auth_debug} DEBUG: Spdp::handle_participant_data - participants_in_authentication: %B >= max: %B\n",
776 ACE_TEXT(
"(%P|%t) Spdp::handle_participant_data - %C discovered %C lease %C from %C (%B)\n"),
783 #ifdef OPENDDS_SECURITY 785 effective_lease =
config_->security_unsecure_lease_duration();
789 if (maxLeaseDuration && effective_lease > maxLeaseDuration) {
792 ACE_TEXT(
"(%P|%t) Spdp::handle_participant_data - overwriting %C lease %C from %C with %C\n"),
796 effective_lease = maxLeaseDuration;
798 #ifdef OPENDDS_SECURITY 805 if (
tport_->directed_send_task_) {
806 if (
tport_->directed_guids_.empty()) {
809 tport_->directed_guids_.push_back(guid);
814 #ifdef OPENDDS_SECURITY 819 "(%P|%t) {auth_debug} DEBUG: Spdp::handle_participant_data() %B participants in authentication\n",
826 iter->second.discovered_at_ = now;
831 iter->second.last_recv_address_ = from;
835 log_progress(
"participant discovery",
guid_, guid, iter->second.discovered_at_.to_monotonic_time());
838 #ifndef DDS_HAS_MINIMUM_BIT 844 sedp_->associate(iter->second
845 #ifdef OPENDDS_SECURITY
856 tport_->shorten_local_sender_delay_i();
860 #ifdef OPENDDS_SECURITY 862 if (!iter->second.has_security_data()) {
866 ACE_TEXT(
"Incompatible security attributes in discovered participant: %C\n"),
893 ACE_TEXT(
"Incompatible security attributes in discovered participant: %C\n"),
922 log_progress(
"secure participant discovery",
guid_, guid, iter->second.discovered_at_.to_monotonic_time());
925 #ifndef DDS_HAS_MINIMUM_BIT 930 #ifdef OPENDDS_SECURITY 936 iter->second.last_recv_address_ = from;
938 #ifndef DDS_HAS_MINIMUM_BIT 946 #ifdef OPENDDS_SECURITY 949 stop_ice(sedp_endpoint, iter->first, iter->second.pdata_.participantProxy.availableBuiltinEndpoints,
950 iter->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
958 #ifndef DDS_HAS_MINIMUM_BIT 973 pdataBit.key = discoveredBit.key;
975 #ifndef OPENDDS_SAFETY_PROFILE 976 using DCPS::operator!=;
978 if (discoveredBit.user_data != pdataBit.user_data ||
980 discoveredBit.user_data = pdataBit.user_data;
987 sedp_->update_locators(pdata);
990 iter->second.pdata_ = pdata;
995 iter->second.last_recv_address_ = from;
998 #ifndef DDS_HAS_MINIMUM_BIT 1007 }
else if (iter->second.seq_reset_count_ >=
config_->max_spdp_sequence_msg_reset_check()) {
1008 #ifdef OPENDDS_SECURITY 1011 #ifndef DDS_HAS_MINIMUM_BIT 1022 #ifndef DDS_HAS_MINIMUM_BIT 1033 if (seq < iter->second.max_seq_) {
1034 const bool honeymoon_period = now < iter->second.discovered_at_ +
min_resend_delay_;
1035 if (!honeymoon_period) {
1036 ++iter->second.seq_reset_count_;
1039 }
else if (iter->second.seq_reset_count_ > 0) {
1040 --iter->second.seq_reset_count_;
1043 iter->second.max_seq_ = std::max(iter->second.max_seq_, seq);
1062 #ifdef OPENDDS_SECURITY 1069 ACE_TEXT(
"failed to convert from ParameterList to ")
1070 ACE_TEXT(
"SPDPdiscoveredParticipantData\n")));
1081 if (guid ==
guid_) {
1088 #ifdef OPENDDS_SECURITY 1089 const bool relay_in_use = (
config_->rtps_relay_only() ||
config_->use_rtps_relay());
1090 const bool from_relay = relay_in_use && (from ==
config_->spdp_rtps_relay_address());
1102 if (!security_enabled) {
1105 #elif !defined OPENDDS_SAFETY_PROFILE 1106 const bool relay_in_use = (
config_->rtps_relay_only() ||
config_->use_rtps_relay());
1107 const bool from_relay = relay_in_use && (from ==
config_->spdp_rtps_relay_address());
1109 const bool check_source_ip =
config_->check_source_ip();
1128 #ifndef DDS_HAS_MINIMUM_BIT 1135 ACE_UNUSED_ARG(dp_iter);
1139 #ifdef OPENDDS_SECURITY 1158 ACE_TEXT(
"Dropped not recipient\n")));
1177 if (
sedp_->ignoring(guid)) {
1182 ACE_TEXT(
"Explicitly ignoring\n")));
1188 DiscoveredParticipantMap::iterator iter =
participants_.find(guid);
1194 ACE_TEXT(
"Dropped due to old sequence number\n")));
1199 iter->second.remote_auth_request_token_ = msg.
message_data[0];
1210 gp_param.
guid(guid);
1212 param_list.length(param_list.length() + 1);
1213 param_list[param_list.length() - 1] = gp_param;
1247 set_participant_guid(
guid_, plist);
1252 ACE_TEXT(
"Failed to convert from ParticipantBuiltinTopicData to ParameterList\n")));
1259 if (!(ser << plist)) {
1262 ACE_TEXT(
"Failed to serialize parameter list.\n")));
1268 seq.length(seq.maximum());
1269 std::memcpy(seq.get_buffer(), temp_buff.
rd_ptr(), temp_buff.
length());
1278 Security::Authentication_var auth =
security_config_->get_authentication();
1285 ACE_TEXT(
"Spdp::send_handshake_request() - ")
1286 ACE_TEXT(
"Unable to return handshake handle. ")
1287 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
1296 if (!local_participant.length()) {
1302 local_participant, se)
1305 ACE_TEXT(
"Failed to begin handshake_request. Security Exception[%d.%d]: %C\n"),
1326 ACE_TEXT(
"Unable to write stateless message (handshake).\n")));
1330 ACE_TEXT(
"Sent handshake request message for participant: %C\n"),
1338 const DCPS::GUID_t&
guid = iter->first;
1342 ACE_DEBUG((
LM_DEBUG,
"(%P|%t) {auth_debug} DEBUG: Spdp::attempt_authentication " 1343 "for %C from_discovery=%d have_remote_token=%d auth_state=%d handshake_state=%d\n",
1361 tport_->handshake_deadline_task_->schedule(
config_->max_auth_time());
1363 DDS::Security::Authentication_var auth =
security_config_->get_authentication();
1387 ACE_TEXT(
"Unable to write auth req message.\n")));
1392 ACE_TEXT(
"Sent auth req message for participant: %C\n"),
1409 ACE_TEXT(
"Attempting authentication (expecting request) for participant: %C\n"),
1419 ACE_TEXT(
"Attempting authentication (sending request/expecting reply) for participant: %C\n"),
1429 ACE_TEXT(
"Remote participant identity is invalid. Security Exception[%d.%d]: %C\n"),
1440 ACE_TEXT(
"Unexpected return value while validating remote identity. Security Exception[%d.%d]: %C\n"),
1455 Security::Authentication_var auth =
security_config_->get_authentication();
1471 ACE_TEXT(
"Dropped not recipient\n")));
1495 ACE_TEXT(
"(%P|%t) {auth_warn} Spdp::handle_handshake_message() - ")
1496 ACE_TEXT(
"received handshake for undiscovered participant %C. Ignoring.\n"),
1505 ACE_DEBUG((
LM_DEBUG,
"(%P|%t) {auth_debug} DEBUG: Spdp::handle_handshake_message() - " 1506 "for %C auth_state=%d handshake_state=%d\n",
1523 ACE_TEXT(
"Unable to write handshake message.\n")));
1528 ACE_TEXT(
"Sent handshake message for participant: %C\n"),
1548 ACE_TEXT(
"(%P|%t) {auth_warn} Spdp::handle_handshake_message() - ")
1549 ACE_TEXT(
"Invalid handshake state\n")));
1571 ACE_TEXT(
"Spdp::handke_handshake_message() - ")
1572 ACE_TEXT(
"Unable to return handshake handle. ")
1573 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
1582 if (!local_participant.length()) {
1601 ACE_TEXT(
"Failed to reply to incoming handshake message. Security Exception[%d.%d]: %C\n"),
1609 ACE_TEXT(
"Unexpected validation pending retry\n")));
1616 ACE_TEXT(
"Unexpected validation pending handshake request\n")));
1624 ACE_TEXT(
"Unable to write stateless message for handshake reply.\n")));
1630 ACE_TEXT(
"Sent handshake reply for participant: %C\n"),
1642 ACE_TEXT(
"Unable to write stateless message for final message.\n")));
1648 ACE_TEXT(
"Sent handshake final for participant: %C\n"),
1679 ACE_TEXT(
"Spdp::handle_handshake_message() - ")
1680 ACE_TEXT(
"Failed to process incoming handshake message when ")
1681 ACE_TEXT(
"expecting %C from %C. Security Exception[%d.%d]: %C\n"),
1691 ACE_TEXT(
"Unexpected validation pending retry\n")));
1698 ACE_TEXT(
"Unexpected validation pending handshake request\n")));
1707 ACE_TEXT(
"Unable to write stateless message for handshake reply.\n")));
1713 ACE_TEXT(
"Sent handshake unknown message for participant: %C\n"),
1730 ACE_TEXT(
"Unable to write stateless message for final message.\n")));
1736 ACE_TEXT(
"Sent handshake final for participant: %C\n"),
1773 ACE_TEXT(
"Removing discovered participant due to authentication timeout: %C\n"),
1779 if (sedp_endpoint) {
1780 stop_ice(sedp_endpoint, pit->first, pit->second.pdata_.participantProxy.availableBuiltinEndpoints,
1781 pit->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
1784 if (spdp_endpoint) {
1818 bool processor_needs_cancel =
false;
1820 pos != limit && pos->first <= now;) {
1824 pit->second.stateless_msg_deadline_ <= now) {
1826 pit->second.stateless_msg_deadline_ = now + pit->second.handshake_resend_falloff_.get();
1829 if (pit->second.have_auth_req_msg_) {
1832 if (
sedp_->transport_inst()->count_messages()) {
1838 ACE_TEXT(
"Unable to write auth req message retry.\n")));
1843 ACE_TEXT(
"Sent auth req message for participant: %C\n"),
1848 if (pit->second.have_handshake_msg_) {
1849 if (
sedp_->transport_inst()->count_messages()) {
1855 ACE_TEXT(
"Unable to write handshake message retry.\n")));
1860 ACE_TEXT(
"Sent handshake message for participant: %C\n"),
1865 pit->second.handshake_resend_falloff_.advance(
config_->max_auth_time());
1867 handshake_resends_.insert(std::make_pair(pit->second.stateless_msg_deadline_, pit->first));
1869 processor_needs_cancel =
true;
1877 if (processor_needs_cancel) {
1878 tport_->handshake_resend_task_->cancel();
1891 ACE_TEXT(
"(%P|%t) Spdp::handle_participant_crypto_tokens() from %C\n"),
1896 Security::CryptoKeyExchange_var key_exchange =
security_config_->get_crypto_key_exchange();
1915 ACE_TEXT(
"(%P|%t) {auth_warn} Spdp::handle_participant_crypto_tokens() - ")
1916 ACE_TEXT(
"received tokens for undiscovered participant %C. Ignoring.\n"),
1923 log_progress(
"participant crypto token",
guid_, src_participant, iter->second.discovered_at_.to_monotonic_time());
1929 sedp_->get_handle_registry()->get_remote_participant_crypto_handle(iter->first);
1931 if (!key_exchange->set_remote_participant_crypto_tokens(
crypto_handle_, dp_crypto_handle, inboundTokens, se)) {
1933 ACE_TEXT(
"Unable to set remote participant crypto tokens with crypto key exchange plugin. ")
1934 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
1939 sedp_->process_association_records_i(iter->second);
1964 tport_->handshake_resend_task_->cancel();
1966 tport_->handshake_resend_task_->schedule(time);
1979 Security::Authentication_var auth =
security_config_->get_authentication();
1981 Security::CryptoKeyFactory_var key_factory =
security_config_->get_crypto_key_factory();
1982 Security::CryptoKeyExchange_var key_exchange =
security_config_->get_crypto_key_exchange();
1985 if (iter->second.shared_secret_handle_ != 0) {
1987 if (!auth->return_sharedsecret_handle(iter->second.shared_secret_handle_, se)) {
1990 ACE_TEXT(
"Spdp::match_authenticated() - ")
1991 ACE_TEXT(
"Unable to return shared secret handle. Security Exception[%d.%d]: %C\n"),
1998 iter->second.shared_secret_handle_ = auth->get_shared_secret(iter->second.handshake_handle_, se);
1999 if (iter->second.shared_secret_handle_ == 0) {
2002 ACE_TEXT(
"Spdp::match_authenticated() - ")
2003 ACE_TEXT(
"Unable to get shared secret handle. Security Exception[%d.%d]: %C\n"),
2009 sedp_->disassociate_volatile(iter->second);
2010 sedp_->cleanup_volatile_crypto(iter->first);
2011 sedp_->associate_volatile(iter->second);
2012 sedp_->generate_remote_matched_crypto_handles(iter->second);
2013 sedp_->process_association_records_i(iter->second);
2015 if (!auth->return_handshake_handle(iter->second.handshake_handle_, se)) {
2018 ACE_TEXT(
"Spdp::send_handshake_request() - ")
2019 ACE_TEXT(
"Unable to return handshake handle. ")
2020 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
2030 iter->second.shared_secret_handle_ = auth->get_shared_secret(iter->second.handshake_handle_, se);
2031 if (iter->second.shared_secret_handle_ == 0) {
2034 ACE_TEXT(
"Spdp::match_authenticated() - ")
2035 ACE_TEXT(
"Unable to get shared secret handle. Security Exception[%d.%d]: %C\n"),
2041 if (!auth->get_authenticated_peer_credential_token(
2042 iter->second.authenticated_peer_credential_token_, iter->second.handshake_handle_, se)) {
2045 ACE_TEXT(
"Spdp::match_authenticated() - ")
2046 ACE_TEXT(
"Unable to get authenticated peer credential token. ")
2047 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
2053 iter->second.permissions_handle_ = access->validate_remote_permissions(
2055 iter->second.permissions_token_, iter->second.authenticated_peer_credential_token_, se);
2056 handle_registry->insert_remote_participant_permissions_handle(guid, iter->second.permissions_handle_);
2062 ACE_TEXT(
"Spdp::match_authenticated() - ")
2063 ACE_TEXT(
"Unable to validate remote participant with access control plugin. ")
2064 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
2071 if (!access->check_remote_participant(iter->second.permissions_handle_,
domain_,
2072 iter->second.pdata_.ddsParticipantDataSecure, se)) {
2075 ACE_TEXT(
"Spdp::match_authenticated() - ")
2076 ACE_TEXT(
"Remote participant check failed. Security Exception[%d.%d]: %C\n"),
2085 ACE_TEXT(
"auth and access control complete for peer %C\n"),
2090 log_progress(
"authentication",
guid_, guid, iter->second.discovered_at_.to_monotonic_time());
2094 sedp_->get_handle_registry()->get_remote_participant_crypto_handle(iter->first);
2097 dp_crypto_handle = key_factory->register_matched_remote_participant(
2098 crypto_handle_, iter->second.identity_handle_, iter->second.permissions_handle_,
2099 iter->second.shared_secret_handle_, se);
2100 sedp_->get_handle_registry()->insert_remote_participant_crypto_handle(iter->first, dp_crypto_handle);
2104 ACE_TEXT(
"Spdp::match_authenticated() - Unable to register remote ")
2105 ACE_TEXT(
"participant with crypto key factory plugin. ")
2106 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
2114 if (!key_exchange->create_local_participant_crypto_tokens(
2115 iter->second.crypto_tokens_,
crypto_handle_, dp_crypto_handle, se)) {
2118 ACE_TEXT(
"Spdp::match_authenticated() - ")
2119 ACE_TEXT(
"Unable to create local participant crypto ")
2120 ACE_TEXT(
"tokens with crypto key exchange plugin. ")
2121 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
2128 sedp_->generate_remote_matched_crypto_handles(iter->second);
2131 sedp_->process_association_records_i(iter->second);
2133 #ifndef DDS_HAS_MINIMUM_BIT 2165 #ifdef OPENDDS_SECURITY 2167 if (sedp_endpoint) {
2169 ice_agent_->add_local_agent_info_listener(sedp_endpoint, l, DCPS::static_rchandle_cast<AgentInfoListener>(
rchandle_from(
this)));
2174 tport_->enable_periodic_tasks();
2197 return is_opendds(iter->second.pdata_.participantProxy) &&
2202 #ifdef OPENDDS_SECURITY
2203 bool always_in_the_clear,
2213 nonEmptyList.length(1);
2215 nonEmptyList[0].port = 12345;
2216 std::memset(nonEmptyList[0].address, 0, 12);
2217 nonEmptyList[0].address[12] = 127;
2218 nonEmptyList[0].address[13] = 0;
2219 nonEmptyList[0].address[14] = 0;
2220 nonEmptyList[0].address[15] = 1;
2227 if (unicast_locators.length() == 0 && multicast_locators.length() == 0) {
2231 ACE_TEXT(
"Spdp::build_local_pdata: ")
2236 #ifdef OPENDDS_SECURITY 2261 , {gp[0], gp[1], gp[2], gp[3], gp[4], gp[5],
2262 gp[6], gp[7], gp[8], gp[9], gp[10], gp[11]}
2268 , multicast_locators
2273 , {
config_->participant_flags()}
2275 #ifdef OPENDDS_SECURITY 2293 #ifdef OPENDDS_SECURITY 2302 #if !defined _MSC_VER || _MSC_VER >= 1900 2312 #ifdef OPENDDS_SECURITY
2313 , relay_spdp_task_falloff_(outer->
config()->sedp_heartbeat_period())
2314 , relay_stun_task_falloff_(outer->
config()->sedp_heartbeat_period())
2316 , network_is_unreachable_(false)
2317 , ice_endpoint_added_(false)
2318 , transport_statistics_(DCPS::TransportRegistry::DEFAULT_INST_PREFIX +
2320 DCPS::GuidConverter(outer->
guid_).uniqueParticipantId() +
2340 #ifdef ACE_HAS_MAC_OSX 2351 const u_short port_common = outer->config_->port_common(outer->domain_);
2355 multicast_ipv6_address_ = outer->config_->ipv6_multicast_address(port_common);
2360 send_addrs_.insert(multicast_ipv6_address_);
2363 typedef RtpsDiscovery::AddrVec::const_iterator iter;
2365 for (iter it = addrs.begin(),
2366 end = addrs.end(); it != end; ++it) {
2370 u_short participantId = 0;
2372 #ifdef OPENDDS_SAFETY_PROFILE 2373 const u_short startingParticipantId = participantId;
2376 const u_short max_part_id = 119;
2380 "participant id is going above max %u allowed by RTPS spec\n", max_part_id));
2391 while (!open_unicast_ipv6_socket(port)) {
2396 #ifdef OPENDDS_SAFETY_PROFILE 2397 if (participantId > startingParticipantId &&
ACE_OS::getpid() == -1) {
2417 #ifdef OPENDDS_SECURITY 2421 outer->ice_agent_->add_endpoint(endpoint);
2423 outer->ice_agent_->add_local_agent_info_listener(endpoint, outer->guid_, DCPS::static_rchandle_cast<ICE::AgentInfoListener>(outer));
2430 #ifdef OPENDDS_SECURITY 2432 if (outer->is_security_enabled()) {
2433 outer->write_secure_updates();
2439 if (outer->config_->periodic_directed_spdp()) {
2449 #ifdef OPENDDS_SECURITY 2465 #ifndef DDS_HAS_MINIMUM_BIT 2489 }
catch (
const CORBA::BAD_PARAM&) {}
2490 outer->eh_shutdown_ =
true;
2491 outer->shutdown_cond_.notify_all();
2497 unicast_ipv6_socket_.close();
2498 multicast_ipv6_socket_.close();
2512 BOOL recv_udp_connreset = FALSE;
2513 socket.
control(SIO_UDP_CONNRESET, &recv_udp_connreset);
2519 throw std::runtime_error(
2520 (
DCPS::String(
"failed to register ") + what +
" unicast input handler").c_str());
2532 if (outer->shutdown_flag_) {
2550 #ifdef OPENDDS_SECURITY 2561 #ifndef DDS_HAS_MINIMUM_BIT 2584 plist[0].guid(outer->guid_);
2590 if (!(ser <<
hdr_) || !(ser <<
data_) || !(ser << encap) || !(ser << plist)) {
2593 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::dispose_unregister() - ")
2594 ACE_TEXT(
"failed to serialize headers for dispose/unregister\n")));
2614 #ifdef OPENDDS_SECURITY 2617 outer->ice_agent_->remove_endpoint(endpoint);
2653 reactor->
remove_handler(multicast_ipv6_socket_.get_handle(), mask);
2654 reactor->
remove_handler(unicast_ipv6_socket_.get_handle(), mask);
2665 const TimeDuration quick_resend = outer->config_->resend_period() * outer->quick_resend_ratio_;
2666 local_send_task_->enable(std::max(quick_resend, outer->min_resend_delay_));
2686 if (!outer->config_->undirected_spdp()) {
2691 #ifdef OPENDDS_SECURITY
2703 ACE_TEXT(
"Spdp::SpdpTransport::write() - ")
2704 ACE_TEXT(
"failed to convert from SPDPdiscoveredParticipantData ")
2710 #ifdef OPENDDS_SECURITY 2711 if (!outer->is_security_enabled()) {
2712 ICE::AgentInfoMap ai_map;
2714 if (sedp_endpoint) {
2718 if (spdp_endpoint) {
2725 ACE_TEXT(
"Spdp::SpdpTransport::write() - ")
2726 ACE_TEXT(
"failed to convert from ICE::AgentInfo ")
2737 if (!(ser <<
hdr_) || !(ser <<
data_) || !(ser << encap) || !(ser << plist)) {
2740 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::write() - ")
2741 ACE_TEXT(
"failed to serialize headers for SPDP\n")));
2752 if (!iter->second.pdata_.participantProxy.opendds_rtps_relay_application_participant) {
2756 if (new_participant) {
2757 #ifdef OPENDDS_SECURITY 2758 tport_->relay_spdp_task_->cancel();
2759 tport_->relay_spdp_task_falloff_.set(
config_->sedp_heartbeat_period());
2766 ACE_TEXT(
"(%P|%t) Spdp::update_rtps_relay_application_participant - %C is an RtpsRelay application participant\n"),
2771 if (pos != iter && pos->second.pdata_.participantProxy.opendds_rtps_relay_application_participant) {
2774 ACE_TEXT(
"(%P|%t) Spdp::update_rtps_relay_application_participant - removing previous RtpsRelay application participant %C\n"),
2788 #ifdef OPENDDS_SECURITY 2791 tport_->relay_spdp_task_->cancel();
2792 tport_->relay_spdp_task_falloff_.set(
config_->sedp_heartbeat_period());
2795 tport_->relay_stun_task_->cancel();
2796 tport_->relay_stun_task_falloff_.set(
config_->sedp_heartbeat_period());
2807 tport_->transport_statistics_.clear();
2809 sedp_->append_transport_statistics(seq);
2819 #ifdef OPENDDS_SECURITY
2831 ACE_TEXT(
"Spdp::SpdpTransport::write_i() - ")
2832 ACE_TEXT(
"failed to convert from SPDPdiscoveredParticipantData ")
2838 #ifdef OPENDDS_SECURITY 2839 if (!outer->is_security_enabled()) {
2840 ICE::AgentInfoMap ai_map;
2842 if (sedp_endpoint) {
2846 if (spdp_endpoint) {
2852 ACE_TEXT(
"Spdp::SpdpTransport::write_i() - ")
2853 ACE_TEXT(
"failed to convert from ICE::AgentInfo ")
2869 if (!(ser <<
hdr_) || !(ser << info_dst) || !(ser <<
data_) || !(ser << encap)
2870 || !(ser << plist)) {
2873 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::write_i() - ")
2874 ACE_TEXT(
"failed to serialize headers for SPDP\n")));
2879 send(flags, local_address);
2888 if ((flags &
SEND_MULTICAST) && !outer->config_->rtps_relay_only()) {
2890 for (iter_t iter = send_addrs_.begin(); iter != send_addrs_.end(); ++iter) {
2895 if (((flags &
SEND_DIRECT) && !outer->config_->rtps_relay_only()) &&
2897 send(local_address,
false);
2900 if ((flags &
SEND_RELAY) || outer->config_->rtps_relay_only()) {
2901 const ACE_INET_Addr relay_address = outer->config_->spdp_rtps_relay_address();
2903 send(relay_address,
true);
2913 return unicast_ipv6_socket_;
2916 ACE_UNUSED_ARG(addr);
2924 if (!outer)
return -1;
2926 #ifdef OPENDDS_TESTING_FEATURES 2927 if (outer->sedp_->transport_inst()->should_drop(
wbuff_.
length())) {
2934 if (outer->sedp_->transport_inst()->count_messages()) {
2938 if (outer->sedp_->transport_inst()->count_messages()) {
2942 const int err = errno;
2947 ACE_TEXT(
"(%P|%t) WARNING: Spdp::SpdpTransport::send() - ")
2955 if (outer->sedp_->transport_inst()->count_messages()) {
2969 if (h == unicast_ipv6_socket_.get_handle()) {
2970 return unicast_ipv6_socket_;
2972 if (h == multicast_ipv6_socket_.get_handle()) {
2973 return multicast_ipv6_socket_;
2997 #ifdef ACE_LACKS_SENDMSG 3005 #pragma warning(push) 3008 #pragma warning(disable : 4267) 3012 #pragma warning(pop) 3014 const ssize_t bytes = socket.recv(iov, 1, remote, 0
3015 #
if defined(ACE_RECVPKTINFO) || defined(ACE_RECVPKTINFO6)
3028 }
else if (bytes == 0) {
3033 ACE_TEXT(
"(%P|%t) WARNING: Spdp::SpdpTransport::handle_input() - ")
3034 ACE_TEXT(
"error reading from %C socket %p\n")
3036 ACE_TEXT(
"ACE_SOCK_Dgram::recv")));
3046 const bool relay_in_use = (outer->config_->rtps_relay_only() || outer->config_->use_rtps_relay());
3047 const bool remote_matches_relay_addr = (remote == outer->config_->spdp_rtps_relay_address());
3048 const bool from_relay = relay_in_use && remote_matches_relay_addr;
3051 if (!relay_in_use && remote_matches_relay_addr) {
3060 if (!(ser >> header)) {
3063 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::handle_input() - ")
3064 ACE_TEXT(
"failed to deserialize RTPS header for SPDP\n")));
3069 if (outer->sedp_->transport_inst()->count_messages()) {
3087 if (!(ser >> data)) {
3090 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::handle_input() - ")
3091 ACE_TEXT(
"failed to deserialize DATA header for SPDP\n")));
3114 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::handle_input() - ")
3115 ACE_TEXT(
"failed to deserialize encapsulation header for SPDP\n")));
3120 if (!(ser >> plist)) {
3124 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::handle_input() - ")
3125 ACE_TEXT(
"failed to deserialize data payload for SPDP\n")));
3132 plist[0].guid(guid);
3138 outer->data_received(data, plist, remote);
3148 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::handle_input() - ")
3149 ACE_TEXT(
"failed to deserialize INFO_DST header for SPDP\n")));
3161 if (!(ser >> smHeader)) {
3164 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::handle_input() - ")
3165 ACE_TEXT(
"failed to deserialize SubmessageHeader for SPDP\n")));
3174 if (read < static_cast<size_t>(submessageLength +
SMHDR_SZ)) {
3175 if (!ser.
skip(static_cast<CORBA::UShort>(submessageLength +
SMHDR_SZ 3179 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::handle_input() - ")
3180 ACE_TEXT(
"failed to skip sub message length\n")));
3185 }
else if (!submessageLength) {
3195 #ifdef OPENDDS_SECURITY 3197 if (!outer->initialized() || outer->shutting_down()) {
3201 #ifndef ACE_RECVPKTINFO 3203 ACE_TEXT(
"potential STUN message received but this version of the ACE ")
3204 ACE_TEXT(
"library doesn't support the local_address extension in ")
3205 ACE_TEXT(
"ACE_SOCK_Dgram::recv\n")));
3212 if (serializer >> message) {
3213 if (outer->sedp_->transport_inst()->count_messages()) {
3224 outer->ice_agent_->receive(endpoint, local, remote, message);
3237 #ifdef OPENDDS_SECURITY 3245 #ifdef OPENDDS_SECURITY 3246 ICE::AddressListType
3249 ICE::AddressListType addresses;
3255 ICE::AddressListType addrs;
3257 for (ICE::AddressListType::iterator pos = addrs.begin(), limit = addrs.end(); pos != limit; ++pos) {
3258 if (pos->get_type() ==
AF_INET) {
3260 addresses.push_back(*pos);
3264 addresses.push_back(addr);
3269 unicast_ipv6_socket_.get_local_addr(addr);
3272 ICE::AddressListType addrs;
3274 for (ICE::AddressListType::iterator pos = addrs.begin(), limit = addrs.end(); pos != limit; ++pos) {
3275 if (pos->get_type() == AF_INET6) {
3277 addresses.push_back(*pos);
3281 addresses.push_back(addr);
3297 job_queue->enqueue(DCPS::make_rch<SendStun>(
rchandle_from(
this), address, message));
3311 tport->wbuff_.
reset();
3313 const_cast<STUN::Message&
>(message_).block = &tport->wbuff_;
3314 serializer << message_;
3316 #ifdef OPENDDS_TESTING_FEATURES
3317 if (outer->sedp_->transport_inst()->should_drop(tport->wbuff_.length())) {
3323 const ssize_t res = socket.
send(tport->wbuff_.rd_ptr(), tport->wbuff_.length(), address_);
3325 if (outer->sedp_->transport_inst()->count_messages()) {
3328 tport->transport_statistics_.message_count[
key].send_fail(tport->wbuff_.length());
3330 const int err = errno;
3331 if (err !=
ENETUNREACH || !tport->network_is_unreachable_) {
3335 ACE_TEXT(
"(%P|%t) WARNING: Spdp::SendStun::execute() - ")
3340 tport->network_is_unreachable_ =
true;
3343 if (outer->sedp_->transport_inst()->count_messages()) {
3346 tport->transport_statistics_.message_count[
key].send(tport->wbuff_.length());
3348 tport->network_is_unreachable_ =
false;
3356 return outer ? outer->config_->spdp_stun_server_address() :
ACE_INET_Addr();
3359 #ifndef DDS_HAS_MINIMUM_BIT 3366 outer->sedp_->job_queue()->enqueue(DCPS::make_rch<IceConnect>(outer, guids, addr,
true));
3373 for (ICE::GuidSetType::const_iterator pos = guids_.begin(), limit = guids_.end(); pos != limit; ++pos) {
3375 if (iter != spdp_->participants_.end()) {
3376 spdp_->enqueue_location_update_i(iter, compute_ice_location_mask(addr_), connect_ ? addr_ :
ACE_INET_Addr(),
"ICE connect");
3377 spdp_->process_location_updates_i(iter,
"ICE connect");
3388 outer->sedp_->job_queue()->enqueue(DCPS::make_rch<IceConnect>(outer, guids, addr,
false));
3396 sedp_->signal_liveliness(kind);
3401 u_short participant_id)
3405 throw std::runtime_error(
"couldn't get Spdp");
3408 ACE_INET_Addr local_addr = outer->config_->spdp_local_address();
3413 }
else if (!outer->config_->spdp_request_random_port()) {
3414 const ACE_UINT32 port =
static_cast<ACE_UINT32
>(port_common) + outer->config_->d1() +
3415 outer->config_->pg() * participant_id;
3418 ACE_ERROR((
LM_ERROR,
"(%P|%t) ERROR: Spdp::SpdpTransport::open_unicast_socket: " 3419 "port %u is too high\n", port));
3421 throw std::runtime_error(
"failed to open unicast port for SPDP (port too high)");
3423 uni_port_ =
static_cast<unsigned short>(port);
3430 ACE_ERROR((
LM_ERROR,
"(%P|%t) ERROR: Spdp::SpdpTransport::open_unicast_socket: " 3431 "failed to open %C %p.\n",
3434 throw std::runtime_error(
"failed to open unicast port for SPDP");
3438 ACE_TEXT(
"(%P|%t) Spdp::SpdpTransport::open_unicast_socket() - ")
3440 ACE_TEXT(
"Trying next participantId...\n"),
3446 if (!fixed_port && outer->config_->spdp_request_random_port()) {
3455 ACE_TEXT(
"(%P|%t) Spdp::SpdpTransport::open_unicast_socket() - ")
3456 ACE_TEXT(
"opened unicast socket on port %d\n"),
3463 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::open_unicast_socket() - ")
3464 ACE_TEXT(
"failed to set TTL value to %d ")
3466 outer->config_->ttl(),
uni_port_,
ACE_TEXT(
"DCPS::set_socket_multicast_ttl:")));
3468 throw std::runtime_error(
"failed to set TTL");
3471 const int send_buffer_size = outer->config()->send_buffer_size();
3472 if (send_buffer_size > 0) {
3475 (
void *) &send_buffer_size,
3476 sizeof(send_buffer_size)) < 0
3479 ACE_ERROR((
LM_ERROR,
ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::open_unicast_socket() - failed to set the send buffer size to %d errno %m\n"), send_buffer_size));
3481 throw std::runtime_error(
"failed to set send buffer size");
3485 const int recv_buffer_size = outer->config()->recv_buffer_size();
3486 if (recv_buffer_size > 0) {
3489 (
void *) &recv_buffer_size,
3490 sizeof(recv_buffer_size)) < 0
3493 ACE_ERROR((
LM_ERROR,
ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::open_unicast_socket() - failed to set the recv buffer size to %d errno %m\n"), recv_buffer_size));
3495 throw std::runtime_error(
"failed to set recv buffer size");
3499 #ifdef ACE_RECVPKTINFO 3511 Spdp::SpdpTransport::open_unicast_ipv6_socket(u_short port)
3514 if (!outer)
return false;
3516 ACE_INET_Addr local_addr = outer->config_->ipv6_spdp_local_address();
3522 ipv6_uni_port_ = port;
3526 if (unicast_ipv6_socket_.open(local_addr, PF_INET6) != 0) {
3530 ACE_TEXT(
"(%P|%t) Spdp::SpdpTransport::open_unicast_ipv6_socket() - ")
3531 ACE_TEXT(
"failed to open %C %p.\n"),
3534 throw std::runtime_error(
"failed to open ipv6 unicast port for SPDP");
3538 ACE_TEXT(
"(%P|%t) Spdp::SpdpTransport::open_unicast_ipv6_socket() - ")
3548 ACE_TEXT(
"(%P|%t) Spdp::SpdpTransport::open_unicast_ipv6_socket() - ")
3549 ACE_TEXT(
"opened unicast ipv6 socket on port %d\n"),
3556 ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::open_unicast_ipv6_socket() - ")
3557 ACE_TEXT(
"failed to set TTL value to %d ")
3559 outer->config_->ttl(), ipv6_uni_port_,
ACE_TEXT(
"DCPS::set_socket_multicast_ttl:")));
3561 throw std::runtime_error(
"failed to set TTL");
3564 const int send_buffer_size = outer->config()->send_buffer_size();
3565 if (send_buffer_size > 0) {
3566 if (unicast_ipv6_socket_.set_option(
SOL_SOCKET,
3568 (
void *) &send_buffer_size,
3569 sizeof(send_buffer_size)) < 0
3572 ACE_ERROR((
LM_ERROR,
ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::open_unicast_ipv6_socket() - failed to set the send buffer size to %d errno %m\n"), send_buffer_size));
3574 throw std::runtime_error(
"failed to set send buffer size");
3578 const int recv_buffer_size = outer->config()->recv_buffer_size();
3579 if (recv_buffer_size > 0) {
3580 if (unicast_ipv6_socket_.set_option(
SOL_SOCKET,
3582 (
void *) &recv_buffer_size,
3583 sizeof(recv_buffer_size)) < 0
3586 ACE_ERROR((
LM_ERROR,
ACE_TEXT(
"(%P|%t) ERROR: Spdp::SpdpTransport::open_unicast_ipv6_socket() - failed to set the recv buffer size to %d errno %m\n"), recv_buffer_size));
3588 throw std::runtime_error(
"failed to set recv buffer size");
3592 #ifdef ACE_RECVPKTINFO6 3594 if (unicast_ipv6_socket_.set_option(IPPROTO_IPV6, ACE_RECVPKTINFO6, &sockopt,
sizeof sockopt) == -1) {
3609 if (outer->shutting_down()) {
3613 if (outer->shutdown_flag_) {
3618 DCPS::InternalSampleInfoSequence infos;
3631 multicast_ipv6_socket_
3646 inlineQos = part_iter->second.pdata_.participantProxy.expectsInlineQos;
3648 part_iter->second.pdata_.participantProxy.defaultMulticastLocatorList;
3650 part_iter->second.pdata_.participantProxy.defaultUnicastLocatorList;
3654 target.length(mc_source_len + uc_source_len + target_len);
3656 for (
CORBA::ULong mci = 0; mci < mc_source.length(); ++mci) {
3657 target[target_len + mci] = mc_source[mci];
3660 for (
CORBA::ULong uci = 0; uci < uc_source.length(); ++uci) {
3661 target[target_len + mc_source_len + uci] = uc_source[uci];
3673 inlineQos = pos->second.pdata_.participantProxy.expectsInlineQos;
3695 const DiscoveredParticipantMap::const_iterator iter =
participants_.find(guid);
3699 return is_opendds(iter->second.pdata_.participantProxy)
3700 ? iter->second.pdata_.participantProxy.opendds_participant_flags.bits :
PFLAGS_EMPTY;
3706 for (std::pair<TimeQueue::iterator, TimeQueue::iterator> x =
lease_expirations_.equal_range(iter->second.lease_expiration_);
3707 x.first != x.second; ++x.first) {
3708 if (x.first->second == iter->first) {
3724 iter->second.pdata_.participantProxy.protocolVersion,
3725 iter->second.pdata_.participantProxy.vendorId);
3733 lease_expirations_.insert(std::make_pair(iter->second.lease_expiration_, iter->first));
3736 tport_->lease_expiration_task_->cancel();
3739 tport_->lease_expiration_task_->schedule(d);
3749 pos != limit && pos->first <= now;) {
3760 ACE_TEXT(
"(%P|%t) Spdp::process_lease_expirations() - ")
3761 ACE_TEXT(
"participant %C exceeded lease duration, removing\n"),
3765 #ifdef OPENDDS_SECURITY 3767 if (sedp_endpoint) {
3768 stop_ice(sedp_endpoint, part->first, part->second.pdata_.participantProxy.availableBuiltinEndpoints,
3769 part->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints);
3772 if (spdp_endpoint) {
3786 #ifdef OPENDDS_SECURITY 3794 result.first =
sedp_->get_handle_registry()->get_remote_participant_crypto_handle(
id);
3795 result.second = pi->second.shared_secret_handle_;
3809 ACE_TEXT(
"Discovered participant %C not found.\n"),
3817 if (pcts.length() != 0) {
3834 ACE_TEXT(
"Unable to write volatile message.\n")));
3839 iter->second.participant_tokens_sent_ =
true;
3850 result = pi->second.permissions_handle_;
3860 return pi->second.auth_state_;
3866 #ifdef OPENDDS_SECURITY 3877 ice_agent_->start_ice(endpoint, l, r, agent_info);
3882 ice_agent_->start_ice(endpoint, l, r, agent_info);
3887 ice_agent_->start_ice(endpoint, l, r, agent_info);
3892 ice_agent_->start_ice(endpoint, l, r, agent_info);
3897 ice_agent_->start_ice(endpoint, l, r, agent_info);
3902 ice_agent_->start_ice(endpoint, l, r, agent_info);
3907 ice_agent_->start_ice(endpoint, l, r, agent_info);
3912 ice_agent_->start_ice(endpoint, l, r, agent_info);
3917 ice_agent_->start_ice(endpoint, l, r, agent_info);
3922 ice_agent_->start_ice(endpoint, l, r, agent_info);
3930 ice_agent_->start_ice(endpoint, l, r, agent_info);
3935 ice_agent_->start_ice(endpoint, l, r, agent_info);
3940 ice_agent_->start_ice(endpoint, l, r, agent_info);
3945 ice_agent_->start_ice(endpoint, l, r, agent_info);
3950 ice_agent_->start_ice(endpoint, l, r, agent_info);
3955 ice_agent_->start_ice(endpoint, l, r, agent_info);
3960 ice_agent_->start_ice(endpoint, l, r, agent_info);
3965 ice_agent_->start_ice(endpoint, l, r, agent_info);
3970 ice_agent_->start_ice(endpoint, l, r, agent_info);
3975 ice_agent_->start_ice(endpoint, l, r, agent_info);
3980 ice_agent_->start_ice(endpoint, l, r, agent_info);
3985 ice_agent_->start_ice(endpoint, l, r, agent_info);
3990 ice_agent_->start_ice(endpoint, l, r, agent_info);
3995 ice_agent_->start_ice(endpoint, l, r, agent_info);
4000 ice_agent_->start_ice(endpoint, l, r, agent_info);
4005 ice_agent_->start_ice(endpoint, l, r, agent_info);
4152 return sedp_->get_handle_registry()->get_remote_participant_crypto_handle(remote_participant);
4161 if (outer->config_->use_rtps_relay() || outer->config_->rtps_relay_only()) {
4162 const ACE_INET_Addr relay_address = outer->config_->spdp_rtps_relay_address();
4174 #ifndef DDS_HAS_MINIMUM_BIT 4179 std::memset(connection_record.
guid, 0,
sizeof(connection_record.
guid));
4189 outer->sedp_->job_queue()->enqueue(DCPS::make_rch<DCPS::WriteConnectionRecords>(outer->bit_subscriber_,
true, connection_record));
4199 outer->sedp_->job_queue()->enqueue(DCPS::make_rch<DCPS::WriteConnectionRecords>(outer->bit_subscriber_,
true, connection_record));
4203 outer->sedp_->job_queue()->enqueue(DCPS::make_rch<DCPS::WriteConnectionRecords>(outer->bit_subscriber_,
false, connection_record));
4213 #ifndef DDS_HAS_MINIMUM_BIT 4220 std::memset(connection_record.
guid, 0,
sizeof(connection_record.
guid));
4226 outer->sedp_->job_queue()->enqueue(DCPS::make_rch<DCPS::WriteConnectionRecords>(outer->bit_subscriber_,
false, connection_record));
4238 if (outer->config_->use_rtps_relay() || outer->config_->rtps_relay_only()) {
4239 const ACE_INET_Addr relay_address = outer->config_->spdp_rtps_relay_address();
4261 while (!directed_guids_.empty()) {
4262 const DCPS::GUID_t
id = directed_guids_.front();
4263 directed_guids_.pop_front();
4266 if (pos == outer->participants_.end()) {
4271 directed_guids_.push_back(
id);
4272 directed_send_task_->schedule(outer->config_->resend_period() * (1.0 / directed_guids_.size()));
4283 outer->process_lease_expirations(now);
4288 ACE_UNUSED_ARG(now);
4289 #ifndef DDS_HAS_MINIMUM_BIT 4295 "(%P|%t) Spdp::SpdpTransport::thread_status_task(): Updating internal thread status BIT.\n"));
4300 typedef DCPS::ThreadStatusManager::List List;
4305 for (List::const_iterator i = removed.begin(); i != removed.end(); ++i) {
4308 outer->bit_subscriber_->remove_thread_status(data);
4310 for (List::const_iterator i = running.begin(); i != running.end(); ++i) {
4320 #ifdef OPENDDS_SECURITY 4326 outer->process_handshake_deadlines(now);
4334 outer->process_handshake_resends(now);
4345 std::pair<TimeQueue::iterator, TimeQueue::iterator> range =
handshake_deadlines_.equal_range(iter->second.handshake_deadline_);
4346 for (; range.first != range.second; ++range.first) {
4347 if (range.first->second == iter->first) {
4360 iter->second.have_auth_req_msg_ =
false;
4361 iter->second.have_handshake_msg_ =
false;
4362 iter->second.handshake_resend_falloff_.set(
config_->auth_resend_period());
4364 std::pair<TimeQueue::iterator, TimeQueue::iterator> range =
handshake_resends_.equal_range(iter->second.stateless_msg_deadline_);
4365 for (; range.first != range.second; ++range.first) {
4366 if (range.first->second == iter->first) {
4375 const DCPS::GUID_t&
guid)
4377 ICE::AgentInfoMap ai_map;
4381 ACE_TEXT(
"failed to convert from ParameterList to ")
4397 sedp_endpoint =
sedp_->get_ice_endpoint();
4400 spdp_endpoint =
tport_->get_ice_endpoint();
4404 if (sedp_pos != ai_map.end()) {
4405 iter->second.have_sedp_info_ =
true;
4406 iter->second.sedp_info_ = sedp_pos->second;
4408 iter->second.have_sedp_info_ =
false;
4411 if (spdp_pos != ai_map.end()) {
4412 iter->second.have_spdp_info_ =
true;
4413 iter->second.spdp_info_ = spdp_pos->second;
4415 iter->second.have_spdp_info_ =
false;
4420 if (sedp_endpoint) {
4421 if (sedp_pos != ai_map.end()) {
4430 if (spdp_endpoint) {
4431 if (spdp_pos != ai_map.end()) {
4435 #ifndef DDS_HAS_MINIMUM_BIT 4452 return iter->second.pdata_;
4458 return iter->second.pdata_;
4469 return iter->second.discovered_at_.to_monotonic_time();
4475 ACE_UNUSED_ARG(flag);
4477 #ifdef OPENDDS_SECURITY 4478 sedp_->rtps_relay_only_now(flag);
4483 tport_->relay_spdp_task_falloff_.set(
config_->sedp_heartbeat_period());
4486 tport_->relay_stun_task_falloff_.set(
config_->sedp_heartbeat_period());
4489 #ifndef DDS_HAS_MINIMUM_BIT 4504 if (!
config_->use_rtps_relay()) {
4505 if (
tport_->relay_spdp_task_) {
4506 tport_->relay_spdp_task_->cancel();
4508 if (
tport_->relay_stun_task_) {
4509 tport_->disable_relay_stun_task();
4521 #ifdef OPENDDS_SECURITY 4522 sedp_->use_rtps_relay_now(f);
4526 tport_->relay_spdp_task_falloff_.set(
config_->sedp_heartbeat_period());
4529 tport_->relay_stun_task_falloff_.set(
config_->sedp_heartbeat_period());
4534 if (!
config_->rtps_relay_only()) {
4535 if (
tport_->relay_spdp_task_) {
4536 tport_->relay_spdp_task_->cancel();
4538 if (
tport_->relay_stun_task_) {
4539 tport_->disable_relay_stun_task();
4543 #ifndef DDS_HAS_MINIMUM_BIT 4563 ACE_UNUSED_ARG(flag);
4565 #ifdef OPENDDS_SECURITY 4566 sedp_->use_ice_now(flag);
4572 if (sedp_endpoint) {
4577 ice_agent_->add_endpoint(DCPS::static_rchandle_cast<ICE::Endpoint>(
tport_));
4579 tport_->ice_endpoint_added_ =
true;
4580 if (spdp_endpoint) {
4585 if (spdp_endpoint && pos->second.have_spdp_info_) {
4586 ice_agent_->start_ice(spdp_endpoint,
guid_, pos->first, pos->second.spdp_info_);
4589 if (sedp_endpoint && pos->second.have_sedp_info_) {
4590 start_ice(sedp_endpoint, pos->first, pos->second.pdata_.participantProxy.availableBuiltinEndpoints,
4591 pos->second.pdata_.participantProxy.availableExtendedBuiltinEndpoints, pos->second.sedp_info_);
4595 ice_agent_->remove_endpoint(DCPS::static_rchandle_cast<ICE::Endpoint>(
tport_));
4597 tport_->ice_endpoint_added_ =
false;
4599 #ifndef DDS_HAS_MINIMUM_BIT 4621 #ifdef OPENDDS_SECURITY 4630 bool include_user_data =
true;
4631 #ifdef OPENDDS_SECURITY 4633 include_user_data = secure;
4636 ACE_UNUSED_ARG(secure);
4684 if (std::strlen(topicName) > 256 || std::strlen(dataTypeName) > 256) {
4687 ACE_TEXT(
"topic or type name length limit (256) exceeded\n")));
4701 bit_subscriber_->remove_participant(iter->second.bit_ih_, iter->second.location_ih_);
4704 "erasing %C (%B)\n",
4710 #ifdef OPENDDS_SECURITY 4713 DDS::Security::Authentication_var auth =
security_config_->get_authentication();
4717 sedp_->get_handle_registry()->get_remote_participant_crypto_handle(iter->first);
4718 if (!
security_config_->get_crypto_key_factory()->unregister_participant(pch, se)) {
4721 ACE_TEXT(
"Spdp::purge_discovered_participant() - ")
4722 ACE_TEXT(
"Unable to return crypto handle. ")
4723 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
4727 sedp_->get_handle_registry()->erase_remote_participant_crypto_handle(iter->first);
4728 sedp_->get_handle_registry()->erase_remote_participant_permissions_handle(iter->first);
4731 if (!auth->return_identity_handle(iter->second.identity_handle_, se)) {
4734 ACE_TEXT(
"Spdp::purge_discovered_participant() - ")
4735 ACE_TEXT(
"Unable to return identity handle. ")
4736 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
4743 if (!auth->return_handshake_handle(iter->second.handshake_handle_, se)) {
4746 ACE_TEXT(
"Spdp::purge_discovered_participant() - ")
4747 ACE_TEXT(
"Unable to return handshake handle. ")
4748 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
4754 if (iter->second.shared_secret_handle_ != 0) {
4755 if (!auth->return_sharedsecret_handle(iter->second.shared_secret_handle_, se)) {
4758 ACE_TEXT(
"Spdp::purge_discovered_participant() - ")
4759 ACE_TEXT(
"Unable to return sharedsecret handle. ")
4760 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
4767 if (!access->return_permissions_handle(iter->second.permissions_handle_, se)) {
4770 ACE_TEXT(
"Spdp::purge_discovered_participant() - ")
4771 ACE_TEXT(
"Unable to return permissions handle. ")
4772 ACE_TEXT(
"Security Exception[%d.%d]: %C\n"),
4785 #ifdef OPENDDS_SECURITY void signal_liveliness(DDS::LivelinessQosPolicyKind kind)
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
UserDataQosPolicy user_data
DDS::Security::AuthRequestMessageToken remote_auth_request_token_
void write_secure_updates()
bool from_param_list(const ParameterList ¶m_list, DDS::ParticipantBuiltinTopicData &pbtd)
void swap(MessageBlock &lhs, MessageBlock &rhs)
DCPS::RcHandle< SpdpTransport > tport_
RcHandle< T > rchandle_from(T *pointer)
void process_participant_ice(const ParameterList &plist, const ParticipantData_t &pdata, const DCPS::GUID_t &guid)
ICE::ServerReflexiveStateMachine relay_srsm_
void thread_status_interval(const TimeDuration &thread_status_interval)
DCPS::MonotonicTime_t discoveredAt
#define ACE_GUARD(MUTEX, OBJ, LOCK)
const char * c_str(void) const
void register_handlers(const DCPS::ReactorTask_rch &reactor_task)
void process_location_updates_i(const DiscoveredParticipantIter &iter, const char *reason, bool force_publish=false)
const char RTPS_RELAY_APPLICATION_PARTICIPANT[]
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_ANNOUNCER
BinaryPropertySeq binary_properties
const LogLevel::Value value
DCPS::RcHandle< RtpsDiscoveryConfig > config_
const char RTPS_DISCOVERY_ENDPOINT_ANNOUNCEMENTS[]
const InstanceHandle_t HANDLE_NIL
void close(const DCPS::ReactorTask_rch &reactor_task)
void ice_connect(const ICE::GuidSetType &guids, const ACE_INET_Addr &addr)
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_READER_SECURE
DDS::Time_t local_timestamp
BUILT_IN_TOPIC_KEY string protocol
bool is_expectant_opendds(const GUID_t &participant) const
const ParticipantSecurityAttributesMask PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_LIVELINESS_PROTECTED
bool update_domain_participant_qos(const DDS::DomainParticipantQos &qos)
IdentityToken identity_token
const ParticipantSecurityAttributesMask PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_RTPS_PROTECTED
bool is_ip_equal(const ACE_INET_Addr &SAP) const
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_WRITER
SubmessageHeader smHeader
size_t length(void) const
void disable_relay_stun_task()
unsigned long ACE_Reactor_Mask
bool locators_changed(const ParticipantProxy_t &x, const ParticipantProxy_t &y)
int access(const char *path, int amode)
SubmessageHeader smHeader
OpenDDS_Dcps_Export TransportDebug transport_debug
DCPS::FibonacciSequence< TimeDuration > relay_spdp_task_falloff_
PropertySeq ac_endpoint_properties
DDS::PropertySeq PropertySeq
const long LOCATOR_KIND_UDPv4
void server_reflexive_indication_count(size_t x)
DCPS::ConditionVariable< ACE_Thread_Mutex > shutdown_cond_
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_ANNOUNCER
bool skip(size_t n, int size=1)
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_READER
const GUID_t GUID_UNKNOWN
Nil value for GUID.
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_ANNOUNCER
const ParameterId_t PID_PARTICIPANT_GUID
void handle_auth_request(const DDS::Security::ParticipantStatelessMessage &msg)
Sedp & endpoint_manager()
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
void relay_stun_task(const DCPS::MonotonicTimePoint &now)
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER
DDS::Security::PermissionsCredentialToken permissions_credential_token_
DDS::Security::IdentityToken identity_token_
DCPS::MulticastManager multicast_manager_
boolean allow_unauthenticated_participants
void process_handshake_deadlines(const DCPS::MonotonicTimePoint &tv)
void match_unauthenticated(const DiscoveredParticipantIter &dp_iter)
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER
String to_dds_string(unsigned short to_convert)
bool is_response(const STUN::Message &message) const
void write(WriteFlags flags)
const VendorId_t VENDORID_OPENDDS
int locator_to_address(ACE_INET_Addr &dest, const DCPS::Locator_t &locator, bool map)
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER
const ParticipantLocation LOCATION_LOCAL
const char SEDP_AGENT_INFO_KEY[]
TimeQueue handshake_deadlines_
const ParticipantLocation LOCATION_LOCAL6
DiscoveredParticipantMap::iterator DiscoveredParticipantIter
OpenDDS::DCPS::GUID_t destination_participant_guid
const char * c_str() const
void data_received(const DataSubmessage &data, const ParameterList &plist, const ACE_INET_Addr &from)
virtual int handle_input(ACE_HANDLE h)
const EntityId_t ENTITYID_TL_SVC_REPLY_READER
CommandPtr execute_or_enqueue(CommandPtr command)
#define OPENDDS_ASSERT(C)
ACE_CDR::ULong get_participant_flags(const DCPS::GUID_t &guid) const
sequence< Locator_t > LocatorSeq
const SampleStateMask ANY_SAMPLE_STATE
unsigned long ExtendedBuiltinEndpointSet_t
PluginParticipantSecurityAttributesMask plugin_participant_security_attributes
boolean is_liveliness_protected
const ACE_Time_Value & value() const
const ACE_CDR::UShort DATA_OCTETS_TO_IQOS
const EntityId_t ENTITYID_TL_SVC_REQ_WRITER_SECURE
key GuidPrefix_t guidPrefix
const DDS::BuiltinTopicKey_t BUILTIN_TOPIC_KEY_UNKNOWN
reference_wrapper< T > ref(T &r)
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER
SpdpTransport(DCPS::RcHandle< Spdp > outer)
ACE_SOCK_Dgram unicast_socket_
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REPLY_WRITER_SECURE
DCPS::RcHandle< ICE::Agent > ice_agent_
DCPS::TimeDuration lease_duration_
DCPS::WeakRcHandle< Spdp > outer_
DDS::OctetSeq local_participant_data_as_octets() const
#define ACE_CDR_BYTE_ORDER
boolean opendds_rtps_relay_application_participant
MessageCountMap message_count
int set_option(int level, int option, void *optval, int optlen) const
const ProtocolVersion_t PROTOCOLVERSION
sequence< DataHolder > DataHolderSeq
DCPS::FibonacciSequence< TimeDuration > relay_stun_task_falloff_
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_WRITER
DCPS::RcHandle< SpdpMulti > local_send_task_
void serialized_size(const Encoding &encoding, size_t &size, const SequenceNumber &)
bool update_thread_status() const
DDS::DomainParticipantQos qos_
const MessageCountKind MCK_STUN
const char RTPS_REFLECT_HEARTBEAT_COUNT[]
char * rd_ptr(void) const
const ParticipantSecurityAttributesMask PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_VALID
DCPS::WeakRcHandle< ICE::Endpoint > get_ice_endpoint()
void ice_disconnect(const ICE::GuidSetType &guids, const ACE_INET_Addr &addr)
DDS::Security::IdentityHandle identity_handle_
void purge_handshake_resends(DiscoveredParticipantIter iter)
void OpenDDS_Dcps_Export log_progress(const char *activity, const GUID_t &local, const GUID_t &remote, const MonotonicTime_t &start_time, const GUID_t &reference)
const ACE_SOCK_Dgram & choose_recv_socket(ACE_HANDLE h) const
bool get_last_recv_locator(const DCPS::GUID_t &part_id, DCPS::LocatorSeq &target, bool &inlineQos)
OpenDDS::RTPS::ParticipantProxy_t participantProxy
DCPS::RcHandle< Sedp > sedp_
unsigned short octetsToInlineQos
const EntityId_t ENTITYID_TL_SVC_REPLY_READER_SECURE
AuthState lookup_participant_auth_state(const GUID_t &id) const
bool is_ip_equal(const ACE_INET_Addr &a, const DCPS::Locator_t &locator)
void remove_lease_expiration_i(DiscoveredParticipantIter iter)
const ACE_CDR::UShort SMHDR_SZ
OpenDDS_Dcps_Export void address_to_locator(Locator_t &locator, const ACE_INET_Addr &addr)
const ParticipantData_t & get_participant_data(const DCPS::GUID_t &guid) const
const char RTPS_DISCOVERY_TYPE_LOOKUP_SERVICE[]
DCPS::SequenceNumber seq_
ACE_HANDLE socket(int protocol_family, int type, int proto)
CryptoTokenSeq ParticipantCryptoTokenSeq
MessageId
One byte message id (<256)
static TimePoint_T< SystemClock > now()
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_READER
BUILT_IN_TOPIC_KEY string address
ParticipantLocation location
void process_handshake_deadlines(const DCPS::MonotonicTimePoint &now)
void send_directed(const DCPS::MonotonicTimePoint &now)
DiscoveredParticipantMap::const_iterator DiscoveredParticipantConstIter
DCPS::MonotonicTimePoint stateless_msg_deadline_
int register_handler(ACE_Event_Handler *event_handler, ACE_Reactor_Mask mask)
DDS::Security::ParticipantBuiltinTopicDataSecure ddsParticipantDataSecure
MessageIdentity message_identity
BUILT_IN_TOPIC_KEY string thread_id
bool is_application_participant_
ProtocolVersion_t version
int remove_handler(ACE_HANDLE handle, ACE_Reactor_Mask masks)
DCPS::RcHandle< SpdpSporadic > relay_spdp_task_
ParticipantLocation change_mask
PluginParticipantSecurityAttributesMask plugin_participant_attributes
DCPS::InternalTransportStatistics transport_statistics_
DOMAINID_TYPE_NATIVE DomainId_t
const EntityId_t ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER
DDS::Security::ParticipantCryptoHandle crypto_handle_
const EntityId_t ENTITYID_PARTICIPANT
const double quick_resend_ratio_
void enable_periodic_tasks()
bool validateSequenceNumber(const DCPS::MonotonicTimePoint &now, const DCPS::SequenceNumber &seq, DiscoveredParticipantIter &iter)
bool get_default_locators(const DCPS::GUID_t &part_id, DCPS::LocatorSeq &target, bool &inlineQos)
DCPS::TimeDuration rtps_duration_to_time_duration(const Duration_t &rtps_duration, const ProtocolVersion_t &version, const VendorId_t &vendor)
ParticipantSecurityAttributesMask participant_security_attributes
const ACE_SOCK_Dgram & choose_send_socket(const ACE_INET_Addr &addr) const
DDS::Security::ExtendedBuiltinEndpointSet_t available_extended_builtin_endpoints_
OpenDDS::DCPS::GUID_t destination_endpoint_guid
const ViewStateKind NOT_NEW_VIEW_STATE
StateChange send(const ACE_INET_Addr &address, size_t indication_count_limit, const DCPS::GuidPrefix_t &guid_prefix)
void shorten_local_sender_delay_i()
DCPS::WeakRcHandle< ICE::Endpoint > get_ice_endpoint_if_added()
void remove_domain_participant(const GUID_t &removeId)
DCPS::GuidPrefix_t guidPrefix
const ParameterId_t PID_STATUS_INFO
void update_lease_expiration_i(DiscoveredParticipantIter iter, const DCPS::MonotonicTimePoint &now)
Handshake concluded or timed out.
bool ip_in_AgentInfo(const ACE_INET_Addr &from, const ParameterList &plist)
const ACE_INET_Addr & stun_server_address() const
Class to serialize and deserialize data for DDS.
Replier should call begin_handshake_reply.
ParticipantCryptoInfoPair lookup_participant_crypto_info(const DCPS::GUID_t &id) const
void append_transport_statistics(DCPS::TransportStatisticsSequence &seq)
CandidatesType::const_iterator const_iterator
bool set_socket_multicast_ttl(const ACE_SOCK_Dgram &socket, const unsigned char &ttl)
bool network_is_unreachable_
void start_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail, const ICE::AgentInfo &agent_info)
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_PARTICIPANT_MESSAGE_DATA_READER
const DCPS::TimeDuration min_resend_delay_
boolean is_discovery_protected
ExtendedBuiltinEndpointSet_t extended_builtin_endpoints
void set_auth_state(DiscoveredParticipant &dp, AuthState state)
unsigned long ParticipantLocation
DDS::Time_t ice_timestamp
MessageIdentity related_message_identity
unsigned short submessageLength
void thread_status_task(const DCPS::MonotonicTimePoint &now)
Christopher Diggins *renamed files *fixing compilation errors *adding Visual C project file *removed make Max Lybbert *removed references to missing and unused header
SequenceNumber_t writerSN
sequence< TransportStatistics > TransportStatisticsSequence
void register_unicast_socket(ACE_Reactor *reactor, ACE_SOCK_Dgram &socket, const char *what)
bool operator==(const Duration_t &x, const Duration_t &y)
DCPS::RcHandle< SpdpSporadic > directed_send_task_
long ParticipantCryptoHandle
bool match_authenticated(const DCPS::GUID_t &guid, DiscoveredParticipantIter &iter)
#define ACE_GUARD_RETURN(MUTEX, OBJ, LOCK, RETURN)
void send_local(const DCPS::MonotonicTimePoint &now)
bool has_domain_participant(const GUID_t &ignoreId) const
Spdp(DDS::DomainId_t domain, DCPS::GUID_t &guid, const DDS::DomainParticipantQos &qos, RtpsDiscovery *disco, XTypes::TypeLookupService_rch tls)
virtual void * get_addr(void) const
ParticipantGenericMessage ParticipantStatelessMessage
GuidCountMap writer_resend_count
HandshakeState handshake_state_
const InstanceStateMask ANY_INSTANCE_STATE
ParticipantData_t build_local_pdata(bool always_in_the_clear, Security::DiscoveredParticipantDataKind kind)
bool cmp_ip4(const ACE_INET_Addr &a, const DCPS::Locator_t &locator)
bool handle_participant_crypto_tokens(const DDS::Security::ParticipantVolatileMessageSecure &msg)
GenericMessageClassId message_class_id
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
int control(int cmd, void *) const
void spdp_rtps_relay_address_change()
unsigned short extraFlags
DDS::Duration_t to_dds_duration() const
const ViewStateKind NEW_VIEW_STATE
ACE_Message_Block * block
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_WRITER
DataHolderSeq message_data
DDS::Security::PermissionsHandle lookup_participant_permissions(const DCPS::GUID_t &id) const
DDS::Security::ExtendedBuiltinEndpointSet_t availableExtendedBuiltinEndpoints
ParticipantSecurityInfo security_info
void send_handshake_request(const DCPS::GUID_t &guid, DiscoveredParticipant &dp)
void get_interface_addrs(OPENDDS_VECTOR(ACE_INET_Addr)&addrs)
RtpsDiscoveryConfig::AddrVec AddrVec
const ViewStateMask ANY_VIEW_STATE
DDS::Security::PermissionsToken permissions_token_
DCPS::SequenceNumber stateless_sequence_number_
OpenDDS::RTPS::Duration_t leaseDuration
const char * c_str() const
DCPS::LocatorSeq metatrafficUnicastLocatorList
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER_SECURE
void disassociate(DiscoveredParticipant &participant)
void send_participant_crypto_tokens(const DCPS::GUID_t &id)
DCPS::TimeDuration lease_extension_
TimePoint_T< MonotonicClock > MonotonicTimePoint
const OpenDDSParticipantFlagsBits_t PFLAGS_EMPTY
const long LOCATOR_KIND_UDPv6
virtual ACE_CString _info(void) const=0
ssize_t read(ACE_HANDLE handle, void *buf, size_t len)
int get_local_addr(ACE_Addr &) const
void process_handshake_resends(const DCPS::MonotonicTimePoint &now)
void process_handshake_resends(const DCPS::MonotonicTimePoint &tv)
DCPS::EntityId_t writerId
BuiltinEndpointSet_t available_builtin_endpoints_
const ParticipantLocation LOCATION_ICE
DDS::BinaryPropertySeq BinaryPropertySeq
DCPS::TopicStatus assert_topic(GUID_t &topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, bool hasDcpsKey, DCPS::TopicCallbacks *topic_callbacks)
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_WRITER
const EntityId_t ENTITYID_TL_SVC_REQ_READER
const EntityId_t ENTITYID_TL_SVC_REPLY_WRITER
DDS::Security::PermissionsHandle permissions_handle_
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_READER_SECURE
DDS::PropertySeq PropertySeq
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER
DDS::Security::ParticipantSecurityAttributes participant_sec_attr_
char * wr_ptr(void) const
ACE_HANDLE get_handle(void) const
sequence< octet > OctetSeq
AtomicBool initialized_flag_
Spdp initialized.
void init(DDS::DomainId_t domain, DCPS::GUID_t &guid, const DDS::DomainParticipantQos &qos, XTypes::TypeLookupService_rch tls)
DCPS::RcHandle< SpdpSporadic > handshake_deadline_task_
std::pair< DDS::Security::ParticipantCryptoHandle, DDS::Security::SharedSecretHandle_var > ParticipantCryptoInfoPair
void append(TransportStatisticsSequence &seq, const InternalTransportStatistics &istats)
const STUN::Message & message() const
DCPS::RcHandle< DCPS::InternalDataReader< DCPS::NetworkInterfaceAddress > > network_interface_address_reader_
DDS::Time_t local6_timestamp
DCPS::MonotonicTime_t get_participant_discovered_at() const
DCPS::MonotonicTimePoint handshake_deadline_
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER
StateChange receive(const STUN::Message &message)
DDS::ParticipantBuiltinTopicData base
virtual ACE_Reactor * reactor(void) const
void open(const DCPS::ReactorTask_rch &reactor_task, const DCPS::JobQueue_rch &job_queue)
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PARTICIPANT_DETECTOR
bool open_unicast_socket(u_short port_common, u_short participant_id)
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_READER
void update_agent_info(const DCPS::GUID_t &local_guid, const ICE::AgentInfo &agent_info)
DCPS::RcHandle< SpdpPeriodic > thread_status_task_
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
DCPS::EntityId_t readerId
void purge_discovered_participant(const DiscoveredParticipantIter &iter)
sequence< Parameter > ParameterList
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REPLY_DATA_WRITER
void append_submessage(RTPS::Message &message, const RTPS::InfoDestinationSubmessage &submessage)
OpenDDS_Dcps_Export GUID_t make_part_guid(const GuidPrefix_t &prefix)
void remove_agent_info(const DCPS::GUID_t &local_guid)
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
void process_lease_expirations(const DCPS::MonotonicTimePoint &now)
static const TimeDuration zero_value
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_SUBSCRIPTION_DETECTOR
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER
void write_i(WriteFlags flags)
const char SPDP_AGENT_INFO_KEY[]
ACE_SOCK_Dgram_Mcast multicast_socket_
const BuiltinEndpointSet_t SPDP_BUILTIN_PARTICIPANT_SECURE_WRITER
DDS::ParticipantBuiltinTopicData get_part_bit_data(bool secure) const
BuiltinEndpointSet_t availableBuiltinEndpoints
void on_data_available(DCPS::RcHandle< DCPS::InternalDataReader< DCPS::NetworkInterfaceAddress > > reader)
TimeQueue lease_expirations_
DCPS::RcHandle< SpdpSporadic > relay_stun_task_
DCPS::RcHandle< SpdpSporadic > lease_expiration_task_
void swap_bytes(bool do_swap)
const BuiltinEndpointSet_t SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER
CvStatus wait(ThreadStatusManager &thread_status_manager)
Block until thread is woken up.
OpenDDS::DCPS::GUID_t source_guid
static const WriteFlags SEND_RELAY
void send(WriteFlags flags, const ACE_INET_Addr &local_address=ACE_INET_Addr())
OpenDDS_Dcps_Export unsigned int DCPS_debug_level
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER
const DCPS::MonotonicTime_t participant_discovered_at_
void schedule(InternalDataReader_rch reader)
const OpenDDSParticipantFlagsBits_t PFLAGS_NO_ASSOCIATED_WRITERS
OpenDDS_Dcps_Export LogLevel log_level
DCPS::GuidPrefix_t guidPrefix
u_short get_port_number(void) const
AtomicBool shutdown_flag_
Spdp shutting down.
static const WriteFlags SEND_DIRECT
DDS::Security::HandshakeHandle handshake_handle_
PropertyQosPolicy property
int strcasecmp(const char *s, const char *t)
void stop_ice(DCPS::WeakRcHandle< ICE::Endpoint > endpoint, DCPS::GUID_t remote, BuiltinEndpointSet_t avail, DDS::Security::ExtendedBuiltinEndpointSet_t extended_avail)
void publish_location_update_i(const DiscoveredParticipantIter &iter)
int memcmp(const void *t, const void *s, size_t len)
bool is_security_enabled() const
bool valid_size(const ACE_INET_Addr &a)
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
DDS::Security::AuthRequestMessageToken local_auth_request_token_
const string GMCLASSID_SECURITY_AUTH_HANDSHAKE
String str(unsigned decimal_places=3, bool just_sec=false) const
const String & str() const
DDS::ReturnCode_t send_handshake_message(const DCPS::GUID_t &guid, DiscoveredParticipant &dp, const DDS::Security::ParticipantStatelessMessage &msg)
Sequence number abstraction. Only allows positive 64 bit values.
DCPS::TimeDuration latency() const
void ignore(const GUID_t &to_ignore)
ReactorInterceptor_rch interceptor() const
void handle_handshake_message(const DDS::Security::ParticipantStatelessMessage &msg)
void print_locator(const CORBA::ULong i, const DCPS::Locator_t &o)
void rtps_relay_only_now(bool f)
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER
const EntityId_t ENTITYID_TL_SVC_REQ_READER_SECURE
const string GMCLASSID_SECURITY_AUTH_REQUEST
ACE_INET_Addr stun_server_address() const
RcHandle< T > static_rchandle_cast(const RcHandle< U > &h)
size_t n_participants_in_authentication_
static Configuration * instance()
const DCPS::GUID_t & guid() const
const ExtendedBuiltinEndpointSet_t TYPE_LOOKUP_SERVICE_REQUEST_WRITER_SECURE
DDS::Time_t relay6_timestamp
const Encoding & encoding() const
static const Value MAX_VALUE
bool announce_domain_participant_qos()
DDS::Security::IdentityToken identity_token_
int get_addr_size(void) const
long long sequence_number
#define OPENDDS_END_VERSIONED_NAMESPACE_DECL
bool to_param_list(const DDS::ParticipantBuiltinTopicData &pbtd, ParameterList ¶m_list)
const ACE_INET_Addr & unset_stun_server_address() const
Security::SecurityConfig_rch security_config_
void use_rtps_relay_now(bool f)
DCPS::TopicStatus assert_topic(GUID_t &topicId, const char *topicName, const char *dataTypeName, const DDS::TopicQos &qos, bool hasDcpsKey, DCPS::TopicCallbacks *topic_callbacks)
void purge_handshake_deadlines(DiscoveredParticipantIter iter)
int open(const ACE_Addr &local, int protocol_family=ACE_PROTOCOL_FAMILY_INET, int protocol=0, int reuse_addr=0, int ipv6_only=0)
DCPS::RcHandle< SpdpSporadic > handshake_resend_task_
const MessageCountKind MCK_RTPS
DCPS::RcHandle< RtpsDiscoveryConfig > config() const
void set_port_number(u_short, int encode=1)
boolean is_access_protected
DataReaderQosBuilder & durability_transient_local()
const BuiltinEndpointSet_t DISC_BUILTIN_ENDPOINT_PUBLICATION_DETECTOR
DCPS::FibonacciSequence< DCPS::TimeDuration > handshake_resend_falloff_
ACE_Reactor * get_reactor()
const ReturnCode_t RETCODE_OK
Requester and replier should call process handshake.
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_VOLATILE_MESSAGE_SECURE_READER
void update_rtps_relay_application_participant_i(DiscoveredParticipantIter iter, bool new_participant)
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_STATELESS_MESSAGE_READER
void dispose_unregister()
PermissionsToken permissions_token
DCPS::RcHandle< DCPS::BitSubscriber > bit_subscriber_
void process_lease_expirations(const DCPS::MonotonicTimePoint &now)
void assign(EntityId_t &dest, const EntityId_t &src)
boolean is_rtps_protected
const EntityId_t ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER
ACE_INET_Addr multicast_address_
DDS::Security::ParticipantCryptoHandle remote_crypto_handle(const DCPS::GUID_t &remote_participant) const
bool secure_part_user_data() const
const BuiltinEndpointSet_t BUILTIN_ENDPOINT_TYPE_LOOKUP_REQUEST_DATA_READER
const ParticipantLocation LOCATION_RELAY
const EntityId_t ENTITYID_SEDP_BUILTIN_PUBLICATIONS_READER
const long LENGTH_UNLIMITED
#define ACE_ERROR_RETURN(X, Y)
OpenDDS::DCPS::GUID_t source_endpoint_guid
const string RTPS_RELAY_STUN_PROTOCOL
TimeQueue handshake_resends_
GUID_t make_id(const GuidPrefix_t &prefix, const EntityId_t &entity)
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER
const EntityId_t ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER
OPENDDS_STRING multicast_interface_
RTPS::SequenceNumber_t to_rtps_seqnum(const DCPS::SequenceNumber &opendds_seqnum)
DCPS::MonotonicTimePoint last_harvest
const EntityId_t ENTITYID_UNKNOWN
DCPS::MonotonicTimePoint schedule_handshake_resend(const DCPS::TimeDuration &time, const DCPS::GUID_t &guid)
DDS::Time_t ice6_timestamp
const GuidVendorId_t VENDORID_OCI
Vendor Id value specified for OCI is used for OpenDDS.
DiscoveredParticipantDataKind
const DCPS::Encoding encoding(DCPS::Encoding::KIND_UNALIGNED_CDR, DCPS::ENDIAN_BIG)
void job_queue(JobQueue_rch job_queue)
Defines the interface for Discovery callbacks into the Topic.
const ParticipantLocation LOCATION_ICE6
#define TheServiceParticipant
ssize_t send(const void *buf, size_t n, const ACE_Addr &addr, int flags=0) const
const BuiltinEndpointSet_t SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER
void send_relay(const DCPS::MonotonicTimePoint &now)
void attempt_authentication(const DiscoveredParticipantIter &iter, bool from_discovery)
DDS::Time_t relay_timestamp
DDS::Security::IdentityHandle identity_handle_
void process_relay_sra(ICE::ServerReflexiveStateMachine::StateChange)
DataReaderQosBuilder & reliability_reliable()
OpenDDS_Dcps_Export DDS::BuiltinTopicKey_t guid_to_bit_key(const GUID_t &guid)
bool ip_in_locator_list(const ACE_INET_Addr &from, const DCPS::LocatorSeq &locators)
bool has_discovered_participant(const DCPS::GUID_t &guid) const
The Internal API and Implementation of OpenDDS.
const octet FLAG_K_IN_DATA
const ParticipantSecurityAttributesMask PARTICIPANT_SECURITY_ATTRIBUTES_FLAG_IS_DISCOVERY_PROTECTED
DiscoveredParticipantMap participants_
ICE::AddressListType host_addresses() const
OPENDDS_SET(ACE_INET_Addr) send_addrs_
void init_bit(RcHandle< DCPS::BitSubscriber > bit_subscriber)
DCPS::GuidPrefix_t guidPrefix
DCPS::SequenceNumber to_opendds_seqnum(const RTPS::SequenceNumber_t &rtps_seqnum)
XTypes::TypeLookupService_rch type_lookup_service_
const DDS::DomainId_t domain_
#define ACE_NOTSUP_RETURN(FAILVALUE)
ParticipantBuiltinTopicData base
DDS::OctetArray16 address
const EntityId_t ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER
OpenDDS_Dcps_Export SecurityDebug security_debug
bool latency_available() const
const ParticipantLocation LOCATION_RELAY6
BUILT_IN_TOPIC_KEY DDS::OctetArray16 guid
bool operator<(const GUID_t &lhs, const GUID_t &rhs)
std::set< GuidPair > GuidSetType
PropertyQosPolicy property
static const WriteFlags SEND_MULTICAST
unsigned long BuiltinEndpointSet_t
void handle_participant_data(DCPS::MessageId id, const ParticipantData_t &pdata, const DCPS::MonotonicTimePoint &now, const DCPS::SequenceNumber &seq, const ACE_INET_Addr &from, bool from_sedp)
Discovery Strategy class that implements RTPS discovery.
DDS::Security::ParticipantCryptoHandle crypto_handle() const
DDS::Security::IdentityStatusToken identity_status_token_
DDS::Security::ParticipantStatelessMessage handshake_msg_
DDS::Security::ParticipantStatelessMessage auth_req_msg_
DDS::Security::ParticipantSecurityAttributesMask security_attributes_to_bitmask(const DDS::Security::ParticipantSecurityAttributes &sec_attr)
const OpenDDSParticipantFlagsBits_t PFLAGS_REFLECT_HEARTBEAT_COUNT
const string GMCLASSID_SECURITY_PARTICIPANT_CRYPTO_TOKENS
Requester should call begin_handshake_request.
void write_secure_disposes()
const BuiltinEndpointSet_t BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER
bool process(InternalDataReader< NetworkInterfaceAddress >::SampleSequence &samples, InternalSampleInfoSequence &infos, const OPENDDS_STRING &multicast_interface, ACE_Reactor *reactor, ACE_Event_Handler *event_handler, const NetworkAddress &multicast_group_address, ACE_SOCK_Dgram_Mcast &multicast_socket)
Returns true if at least one group was joined.
void enqueue_location_update_i(DiscoveredParticipantIter iter, DCPS::ParticipantLocation mask, const ACE_INET_Addr &from, const char *reason)
bool to_encoding(Encoding &encoding, Extensibility expected_extensibility)
void ignore_domain_participant(const GUID_t &ignoreId)