MCPcopy Create free account
hub / github.com/COVESA/vsomeip / register_application

Method register_application

implementation/routing/src/routing_manager_client.cpp:1636–1670  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1634}
1635
1636void routing_manager_client::register_application(client_t _client) {
1637 auto its_configuration = get_configuration();
1638 auto const its_routing_host_address = its_configuration->get_routing_host_address();
1639 // UDS is used only when local routing is configured, or when uds-preferred is on and the routing manager has the same IP.
1640 // Otherwise TCP is used.
1641 bool const via_uds = (routing_mode_ == routing_mode_e::UDS_ONLY)
1642 || (routing_mode_ == routing_mode_e::UDS_AND_TCP && its_routing_host_address == its_configuration->get_routing_guest_address());
1643 if (via_uds) {
1644 VSOMEIP_INFO_P << "Client 0x" << hex4(get_client()) << " Registering to routing manager @ " << its_configuration->get_network()
1645 << "-0";
1646 } else {
1647 VSOMEIP_INFO_P << "Client 0x" << hex4(get_client()) << " Registering to routing manager @ " << its_routing_host_address.to_string()
1648 << ":" << its_configuration->get_routing_host_port();
1649 }
1650
1651#if defined(__linux__) || defined(__QNX__)
1652 auto const sec_client = get_sec_client();
1653 if (!configuration_->get_policy_manager()->check_credentials(get_client(), &sec_client)) {
1654 VSOMEIP_ERROR << "vSomeIP Security: Client 0x" << hex4(get_client())
1655 << "isn't allowed to use the client endpoint due to credential check failed!";
1656 state_machine_->deregistered();
1657 return;
1658 }
1659#endif
1660 // when changing the state we need to ensure that the debounce timer is not dispatching + altering the request set
1661 if (std::scoped_lock its_lock{consumer_mutex_}; state_machine_->registered(_client)) {
1662 VSOMEIP_INFO << "Application/Client " << hex4(get_client()) << " (" << host_->get_name() << ") is registered.";
1663
1664 if (!send_pending_commands(its_lock)) {
1665 VSOMEIP_WARNING_P << ": Application/Client 0x" << hex4(get_client()) << " (" << host_->get_name()
1666 << ") could not send pending offers";
1667 }
1668 host_->on_state(state_type_e::ST_REGISTERED);
1669 }
1670}
1671
1672void routing_manager_client::send_pong() const {
1673

Callers

nothing calls this directly

Calls 9

hex4Function · 0.85
get_routing_host_portMethod · 0.80
check_credentialsMethod · 0.80
deregisteredMethod · 0.80
registeredMethod · 0.80
to_stringMethod · 0.45
get_policy_managerMethod · 0.45
get_nameMethod · 0.45
on_stateMethod · 0.45

Tested by

no test coverage detected