Skip to content

Commit

Permalink
Syncing network and COVESA changes
Browse files Browse the repository at this point in the history
  • Loading branch information
Duarte Fonseca authored and Duarte Fonseca committed Oct 4, 2024
1 parent 0b83e24 commit 23f71e2
Show file tree
Hide file tree
Showing 9 changed files with 150 additions and 128 deletions.
33 changes: 18 additions & 15 deletions implementation/endpoints/src/client_endpoint_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,10 +565,11 @@ void client_endpoint_impl<Protocol>::send_cbk(
<< _error.value() << ") " << get_remote_information()
<< " " << std::dec << queue_.size()
<< " " << std::dec << queue_size_ << " ("
<< std::hex << std::setw(4) << std::setfill('0') << its_client <<"): ["
<< std::hex << std::setw(4) << std::setfill('0') << its_service << "."
<< std::hex << std::setw(4) << std::setfill('0') << its_method << "."
<< std::hex << std::setw(4) << std::setfill('0') << its_session << "]"
<< std::hex << std::setfill('0')
<< std::setw(4) << its_client << "): ["
<< std::setw(4) << its_service << "."
<< std::setw(4) << its_method << "."
<< std::setw(4) << its_session << "]";
<< " endpoint > " << this << " socket state > " << static_cast<int>(state_.load());
}
}
Expand Down Expand Up @@ -622,12 +623,13 @@ void client_endpoint_impl<Protocol>::send_cbk(
VSOMEIP_WARNING << "cei::send_cbk received error: " << _error.message()
<< " (" << std::dec << _error.value() << ") "
<< get_remote_information() << " "
<< " " << std::dec << queue_.size()
<< " " << std::dec << queue_size_ << " ("
<< std::hex << std::setw(4) << std::setfill('0') << its_client <<"): ["
<< std::hex << std::setw(4) << std::setfill('0') << its_service << "."
<< std::hex << std::setw(4) << std::setfill('0') << its_method << "."
<< std::hex << std::setw(4) << std::setfill('0') << its_session << "]"
<< " " << queue_.size()
<< " " << queue_size_ << " ("
<< std::hex << std::setfill('0')
<< std::setw(4) << its_client << "): ["
<< std::setw(4) << its_service << "."
<< std::setw(4) << its_method << "."
<< std::setw(4) << its_session << "]";
<< " endpoint > " << this << " socket state > " << static_cast<int>(state_.load());
print_status();
}
Expand Down Expand Up @@ -801,12 +803,13 @@ bool client_endpoint_impl<Protocol>::check_queue_limit(const uint8_t *_data, std
VSOMEIP_ERROR << "cei::check_queue_limit: queue size limit (" << std::dec
<< endpoint_impl<Protocol>::queue_limit_
<< ") reached. Dropping message ("
<< std::hex << std::setw(4) << std::setfill('0') << its_client <<"): ["
<< std::hex << std::setw(4) << std::setfill('0') << its_service << "."
<< std::hex << std::setw(4) << std::setfill('0') << its_method << "."
<< std::hex << std::setw(4) << std::setfill('0') << its_session << "] "
<< std::hex << std::setfill('0')
<< std::setw(4) << its_client << "): ["
<< std::setw(4) << its_service << "."
<< std::setw(4) << its_method << "."
<< std::setw(4) << its_session << "] "
<< "queue_size: " << std::dec << queue_size_
<< " data size: " << std::dec << _size;
<< " data size: " << _size;
return false;
}
return true;
Expand Down
9 changes: 5 additions & 4 deletions implementation/endpoints/src/server_endpoint_impl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -715,10 +715,11 @@ void server_endpoint_impl<Protocol>::send_cbk(const endpoint_type _key,
parse_message_ids(its_buffer, its_service, its_method, its_client, its_session);
VSOMEIP_WARNING << __func__ << ": prevented queue_size underflow. queue_size: "
<< its_data.queue_size_ << " payload_size: " << payload_size << " payload: ("
<< std::hex << std::setw(4) << std::setfill('0') << its_client <<"): ["
<< std::hex << std::setw(4) << std::setfill('0') << its_service << "."
<< std::hex << std::setw(4) << std::setfill('0') << its_method << "."
<< std::hex << std::setw(4) << std::setfill('0') << its_session << "]";
<< std::hex << std::setfill('0')
<< std::setw(4) << its_client <<"): ["
<< std::setw(4) << its_service << "."
<< std::setw(4) << its_method << "."
<< std::setw(4) << its_session << "]";
its_data.queue_.pop_front();
recalculate_queue_size(its_data);
}
Expand Down
22 changes: 13 additions & 9 deletions implementation/logger/src/message.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -125,15 +125,19 @@ message::~message() try {
#ifndef ANDROID
{
std::unique_lock<std::mutex> app_name_lock = its_logger->get_app_name_lock();
std::cout << std::dec << std::setw(4) << its_time.tm_year + 1900 << "-" << std::dec
<< std::setw(2) << std::setfill('0') << its_time.tm_mon + 1 << "-"
<< std::dec << std::setw(2) << std::setfill('0') << its_time.tm_mday
<< " " << std::dec << std::setw(2) << std::setfill('0')
<< its_time.tm_hour << ":" << std::dec << std::setw(2)
<< std::setfill('0') << its_time.tm_min << ":" << std::dec << std::setw(2)
<< std::setfill('0') << its_time.tm_sec << "." << std::dec << std::setw(6)
<< std::setfill('0') << its_ms << " " << its_logger->get_app_name()
<< " [" << its_level << "] " << buffer_.data_.str() << std::endl;
std::cout
<< std::dec
<< std::setw(4) << its_time.tm_year + 1900 << "-"
<< std::setfill('0')
<< std::setw(2) << its_time.tm_mon + 1 << "-"
<< std::setw(2) << its_time.tm_mday << " "
<< std::setw(2) << its_time.tm_hour << ":"
<< std::setw(2) << its_time.tm_min << ":"
<< std::setw(2) << its_time.tm_sec << "."
<< std::setw(6) << its_ms << " ["
<< its_level << "] "
<< buffer_.data_.str()
<< std::endl;
}
#else
std::string app = runtime::get_property("LogApplication");
Expand Down
10 changes: 4 additions & 6 deletions implementation/routing/src/routing_manager_base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -470,12 +470,10 @@ void routing_manager_base::register_event(client_t _client,

VSOMEIP_WARNING << "Using debounce configuration for "
<< " SOME/IP event "
<< std::hex << std::setw(4) << std::setfill('0')
<< _service << "."
<< std::hex << std::setw(4) << std::setfill('0')
<< _instance << "."
<< std::hex << std::setw(4) << std::setfill('0')
<< _notifier << "."
<< std::hex << std::setfill('0')
<< std::setw(4) << _service << "."
<< std::setw(4) << _instance << "."
<< std::setw(4) << _notifier << "."
<< " Debounce parameters: "
<< its_debounce_parameters.str();

Expand Down
68 changes: 34 additions & 34 deletions implementation/routing/src/routing_manager_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1079,11 +1079,13 @@ void routing_manager_client::on_message(
if (configuration_->is_security_enabled()
&& configuration_->is_local_routing()
&& !is_from_routing && _bound_client != its_client) {
VSOMEIP_WARNING << "Client " << std::hex << std::setw(4) << std::setfill('0')
<< get_client() << " received a message with command " << int(its_id)
<< " from " << std::hex << std::setw(4) << std::setfill('0')
<< its_client << " which doesn't match the bound client " << std::hex
<< std::setw(4) << std::setfill('0') << _bound_client
VSOMEIP_WARNING << "Client "
<< std::hex << std::setfill('0')
<< std::setw(4) << get_client()
<< " received a message with command " << int(its_id)
<< " from " << std::setw(4) << its_client
<< " which doesn't match the bound client "
<< std::setw(4) << _bound_client
<< " ~> skip message!";
return;
}
Expand Down Expand Up @@ -1142,15 +1144,14 @@ void routing_manager_client::on_message(
if (configuration_->is_security_enabled()
&& configuration_->is_local_routing()
&& its_message->get_client() != _bound_client) {
VSOMEIP_WARNING << std::hex << "vSomeIP Security: Client 0x"
<< std::hex << std::setw(4) << std::setfill('0') << get_client()
<< " received a request from client 0x"
<< std::hex << std::setw(4) << std::setfill('0') << its_message->get_client()
<< " to service/instance/method " << its_message->get_service()
<< "/" << its_message->get_instance() << "/" << its_message->get_method()
<< " which doesn't match the bound client 0x"
<< std::hex << std::setw(4) << std::setfill('0') << _bound_client
<< " ~> skip message!";
VSOMEIP_WARNING << std::hex << std::setfill('0')
<< "vSomeIP Security: Client 0x" << std::setw(4) << get_client()
<< " received a request from client 0x" << std::setw(4) << its_message->get_client()
<< " to service/instance/method "
<< its_message->get_service() << "/" << its_message->get_instance()
<< "/" << its_message->get_method()
<< " which doesn't match the bound client 0x" << std::setw(4) << _bound_client
<< " ~> skip message!";
return;
}
if (VSOMEIP_SEC_OK != configuration_->get_security()->is_client_allowed_to_access_member(
Expand Down Expand Up @@ -1353,20 +1354,18 @@ void routing_manager_client::on_message(
its_eventgroup, its_event,
its_pending_id);
}
VSOMEIP_INFO
<< "SUBSCRIBE(" << std::hex << std::setw(4)
<< std::setfill('0') << its_client << "): [" << std::hex
<< std::setw(4) << std::setfill('0') << its_service
<< "." << std::hex << std::setw(4) << std::setfill('0')
<< its_instance << "." << std::hex << std::setw(4)
<< std::setfill('0') << its_eventgroup << ":"
<< std::hex << std::setw(4) << std::setfill('0')
<< its_event << ":" << std::dec << (uint16_t)its_major
<< "] " << std::boolalpha
<< (its_pending_id != PENDING_SUBSCRIPTION_ID) << " "
<< (_subscription_accepted
? std::to_string(its_count) + " accepted."
: "not accepted.");
VSOMEIP_INFO << "SUBSCRIBE("
<< std::hex << std::setfill('0')
<< std::setw(4) << its_client << "): ["
<< std::setw(4) << its_service << "."
<< std::setw(4) << its_instance << "."
<< std::setw(4) << its_eventgroup << ":"
<< std::setw(4) << its_event << ":"
<< std::dec << (uint16_t)its_major << "] "
<< std::boolalpha << (its_pending_id != PENDING_SUBSCRIPTION_ID)
<< " "
<< (_subscription_accepted ?
std::to_string(its_count) + " accepted." : "not accepted.");
});
} else {
send_subscribe_nack(its_client, its_service, its_instance, its_eventgroup,
Expand Down Expand Up @@ -2113,7 +2112,7 @@ void routing_manager_client::reconnect(const std::map<client_t, std::string> &_c
}
}

VSOMEIP_INFO << std::hex << "Application/Client "
VSOMEIP_INFO << "Application/Client "
<< std::hex << std::setw(4) << std::setfill('0') << get_client()
<<": Reconnecting to routing manager.";

Expand Down Expand Up @@ -2424,12 +2423,13 @@ void routing_manager_client::on_subscribe_ack(client_t _client,
(void)_client;
#if 0
VSOMEIP_ERROR << "routing_manager_client::" << __func__
<< "(" << std::hex << std::setw(4) << std::setfill('0') << host_->get_client() << "):"
<< std::hex << std::setfill('0')
<< "(" << std::setw(4) << host_->get_client() << "):"
<< "event="
<< std::hex << std::setw(4) << std::setfill('0') << _service << "."
<< std::hex << std::setw(4) << std::setfill('0') << _instance << "."
<< std::hex << std::setw(4) << std::setfill('0') << _eventgroup << "."
<< std::hex << std::setw(4) << std::setfill('0') << _event;
<< std::setw(4) << _service << "."
<< std::setw(4) << _instance << "."
<< std::setw(4) << _eventgroup << "."
<< std::setw(4) << _event;
#endif
if (_event == ANY_EVENT) {
auto its_eventgroup = find_eventgroup(_service, _instance, _eventgroup);
Expand Down
Loading

0 comments on commit 23f71e2

Please sign in to comment.