Skip to content

Commit

Permalink
vSomeIP 2.7.0
Browse files Browse the repository at this point in the history
  • Loading branch information
juergengehring committed Jun 20, 2017
1 parent 2769830 commit fdf8623
Show file tree
Hide file tree
Showing 95 changed files with 4,114 additions and 1,031 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@
/test/subscribe_notify_tests/subscribe_notify_test_same_client_ids_diff_ports_slave.json
/test/subscribe_notify_tests/subscribe_notify_test_same_client_ids_same_ports_master.json
/test/subscribe_notify_tests/subscribe_notify_test_same_client_ids_same_ports_slave.json
/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_master.json
/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_udp_slave.json
/test/subscribe_notify_tests/subscribe_notify_test_one_event_two_eventgroups_tcp_slave.json
/test/subscribe_notify_one_tests/subscribe_notify_one_test_diff_client_ids_diff_ports_master.json
/test/subscribe_notify_one_tests/subscribe_notify_one_test_diff_client_ids_diff_ports_slave.json
/test/subscribe_notify_tests/subscribe_notify_test_diff_client_ids_diff_ports_same_service_id_master.json
Expand Down
23 changes: 23 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -306,3 +306,26 @@ v2.6.3
v2.6.4
- Fix bug in reboot detection of other nodes
- Improve restarting of TCP connections

v2.7.0
- Add possibility to register a subscription status handler via
application interface. The handler will be called if a subscription
is acknowledged / not acknowledged by the application hosting the
target service instance of the subscription
- The default subscription type of application::subscribe method was
changed from RELIABLE_AND_UNRELIABLE to PREFER_RELIABLE to harmonize
initial event behaviour
- Add generic plug-in concept
- Fix bug which caused sending out subscription messages containing
endpoint options with port set to zero
- Make magic cookie detection TCP connection based
- Avoid sending unneeded SIGKILLs to current routing manager
- Forward service's instance IDs to DLT
- Fixed performance loss on "client ID" lookup needed for ingoing
remote subscriptions
- Add signal handling for starting stopping the service discovery to
vsomeipd
- The message object can now be asked for CRC check state:
is_valid_crc()
- Incoming remote responses where the CRC check fails will trigger:
set_is_valid_crc(false)
20 changes: 16 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ cmake_minimum_required (VERSION 2.8.12)
project (vsomeip)

set (VSOMEIP_MAJOR_VERSION 2)
set (VSOMEIP_MINOR_VERSION 6)
set (VSOMEIP_PATCH_VERSION 4)
set (VSOMEIP_MINOR_VERSION 7)
set (VSOMEIP_PATCH_VERSION 0)
set (VSOMEIP_VERSION ${VSOMEIP_MAJOR_VERSION}.${VSOMEIP_MINOR_VERSION}.${VSOMEIP_PATCH_VERSION})
set (PACKAGE_VERSION ${VSOMEIP_VERSION}) # Used in documentatin/doxygen.in
set (CMAKE_VERBOSE_MAKEFILE off)
Expand Down Expand Up @@ -122,6 +122,7 @@ file(GLOB vsomeip_SRC
"implementation/routing/src/*.cpp"
"implementation/runtime/src/*.cpp"
"implementation/utility/src/*.cpp"
"implementation/plugin/src/*.cpp"
)

file(GLOB_RECURSE vsomeip_e2e_SRC
Expand Down Expand Up @@ -167,6 +168,7 @@ add_library(vsomeip-cfg SHARED ${vsomeip-cfg_SRC})
set_target_properties (vsomeip-cfg PROPERTIES VERSION ${VSOMEIP_VERSION} SOVERSION ${VSOMEIP_MAJOR_VERSION})
target_link_libraries(vsomeip-cfg vsomeip ${Boost_LIBRARIES} ${USE_RT} ${DL_LIBRARY} ${SystemD_LIBRARIES})

# Service-Discovery library
file(GLOB vsomeip-sd_SRC
"implementation/service_discovery/src/*.cpp"
)
Expand All @@ -177,8 +179,8 @@ set_target_properties (vsomeip-sd PROPERTIES VERSION ${VSOMEIP_VERSION} SOVERSIO
target_link_libraries(vsomeip-sd vsomeip ${Boost_LIBRARIES} ${USE_RT} ${DL_LIBRARY} ${SystemD_LIBRARIES} ${CMAKE_THREAD_LIBS_INIT})

if (MSVC)
set_target_properties(vsomeip-cfg PROPERTIES COMPILE_DEFINITIONS "VSOMEIP_DLL_COMPILATION_CONFIG")
set_target_properties(vsomeip-sd PROPERTIES COMPILE_DEFINITIONS "VSOMEIP_DLL_COMPILATION")
set_target_properties(vsomeip-cfg PROPERTIES COMPILE_DEFINITIONS "VSOMEIP_DLL_COMPILATION_PLUGIN")
set_target_properties(vsomeip-sd PROPERTIES COMPILE_DEFINITIONS "VSOMEIP_DLL_COMPILATION_PLUGIN")
set_target_properties(vsomeip PROPERTIES COMPILE_DEFINITIONS "VSOMEIP_DLL_COMPILATION")
endif()

Expand Down Expand Up @@ -378,6 +380,16 @@ add_subdirectory( tools )
add_custom_target( examples )
add_subdirectory( examples EXCLUDE_FROM_ALL )

# build plugins located directly in the build tree
# (Non-Windows only)
if (NOT MSVC)
if(EXISTS "${PROJECT_SOURCE_DIR}/plugins/CMakeLists.txt")
# build plugins if available
message("Plugins CMakeList.txt found: Build plugins")
add_subdirectory( plugins )
endif()
endif()


##############################################################################
# Test section
Expand Down
15 changes: 13 additions & 2 deletions daemon/vsomeipd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,22 @@ static std::shared_ptr<vsomeip::application> its_application;
* Handle signal to stop the daemon
*/
void vsomeipd_stop(int _signal) {
if (_signal == SIGINT || _signal == SIGTERM)
if (_signal == SIGINT || _signal == SIGTERM) {
its_application->stop();
}
if (_signal == SIGABRT) {
VSOMEIP_INFO << "Suspending service discovery";
VSOMEIP_INFO << "Stopping service discovery";
its_application->set_routing_state(vsomeip::routing_state_e::RS_SUSPENDED);
its_application->stop();
}
if (_signal == SIGUSR1) {
VSOMEIP_INFO << "Suspending service discovery";
its_application->set_routing_state(vsomeip::routing_state_e::RS_SUSPENDED);
}
if (_signal == SIGUSR2) {
VSOMEIP_INFO << "Resuming service discovery";
its_application->set_routing_state(vsomeip::routing_state_e::RS_RESUMED);
}
}
#endif

Expand Down Expand Up @@ -61,6 +70,8 @@ int vsomeipd_process(bool _is_quiet) {
signal(SIGINT, vsomeipd_stop);
signal(SIGTERM, vsomeipd_stop);
signal(SIGABRT, vsomeipd_stop);
signal(SIGUSR1, vsomeipd_stop);
signal(SIGUSR2, vsomeipd_stop);
#endif
if (its_application->init()) {
if (its_application->is_routing()) {
Expand Down
21 changes: 21 additions & 0 deletions documentation/vsomeipUserGuide
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,14 @@ The netmask to specify the subnet of the host system.
+
The diagnosis address (byte) that will be used to build client identifiers.
+
* 'network'
+
Network identifier used to support multiple routing managers on one host. This
setting changes the name of the shared memory segment in `/dev/shm` and the name
of the unix domain sockets in `/tmp/`. Defaults to `vsomeip` meaning the shared
memory will be named `/dev/shm/vsomeip` and the unix domain sockets will be
named `/tmp/vsomeip-$CLIENTID`
+
//Logging
* 'logging'
+
Expand Down Expand Up @@ -312,6 +320,19 @@ The absolute path of the log file.
Specifies whether Diagnostic Log and Trace (DLT) is enabled (valid values:
_true, false_).
+
** 'version'
+
Configures logging of the vSomeIP version
+
*** 'enable'
+
Enable or disable cyclic logging of vSomeIP version, defaults to true (valid
values: _true, false_)
+
*** 'interval'
+
Configures interval in seconds to log the vSomeIP version. Default value is 10.
+
//Tracing
* anchor:config-tracing[]'tracing' (optional)
+
Expand Down
5 changes: 3 additions & 2 deletions exportmap.gcc
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@ global:
vsomeip::sd::runtime::*;
*vsomeip::utility;
vsomeip::utility::is*;
*vsomeip::plugin_manager;
vsomeip::plugin_manager::*;
};
VSOMEIP_CFG_RUNTIME;
VSOMEIP_SD_RUNTIME;
vsomeip_plugin_init;
local:
*;
};
14 changes: 12 additions & 2 deletions implementation/configuration/include/configuration.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

#include <vsomeip/export.hpp>
#include <vsomeip/defines.hpp>
#include <vsomeip/plugin.hpp>
#include <vsomeip/primitive_types.hpp>

#include "internal.hpp"
Expand All @@ -24,17 +25,20 @@
#include "../../e2e_protection/include/e2exf/config.hpp"
#include "e2e.hpp"

#define VSOMEIP_CONFIG_PLUGIN_VERSION 1

namespace vsomeip {

class event;

class VSOMEIP_IMPORT_EXPORT_CONFIG configuration {
class configuration {
public:
static std::shared_ptr<configuration> get();
virtual ~configuration() {}

virtual bool load(const std::string &_name) = 0;

virtual const std::string &get_network() const = 0;

virtual const boost::asio::ip::address & get_unicast_address() const = 0;
virtual unsigned short get_diagnosis_address() const = 0;
virtual bool is_v4() const = 0;
Expand Down Expand Up @@ -129,6 +133,12 @@ class VSOMEIP_IMPORT_EXPORT_CONFIG configuration {
instance_t _instance) const = 0;
virtual bool check_credentials(client_t _client, uint32_t _uid, uint32_t _gid) const = 0;

// Plugins
virtual std::map<plugin_type_e, std::string> get_plugins(
const std::string &_name) const = 0;

virtual void set_configuration_path(const std::string &_path) = 0;

//E2E
virtual std::map<e2exf::data_identifier, std::shared_ptr<cfg::e2e>> get_e2e_configuration() const = 0;
virtual bool is_e2e_enabled() const = 0;
Expand Down
28 changes: 21 additions & 7 deletions implementation/configuration/include/configuration_impl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,21 @@ struct element {
}
};

class configuration_impl: public configuration, public std::enable_shared_from_this<configuration_impl> {
class configuration_impl:
public configuration,
public plugin_impl<configuration_impl>,
public std::enable_shared_from_this<configuration_impl> {
public:
VSOMEIP_EXPORT static std::shared_ptr<configuration> get();

VSOMEIP_EXPORT configuration_impl();
VSOMEIP_EXPORT configuration_impl(const configuration_impl &_cfg);
VSOMEIP_EXPORT virtual ~configuration_impl();

VSOMEIP_EXPORT bool load(const std::string &_name);

VSOMEIP_EXPORT const std::string &get_network() const;

VSOMEIP_EXPORT void set_configuration_path(const std::string &_path);

VSOMEIP_EXPORT const boost::asio::ip::address & get_unicast_address() const;
VSOMEIP_EXPORT unsigned short get_diagnosis_address() const;
VSOMEIP_EXPORT bool is_v4() const;
Expand Down Expand Up @@ -139,8 +144,10 @@ class configuration_impl: public configuration, public std::enable_shared_from_t
VSOMEIP_EXPORT bool is_offer_allowed(client_t _client, service_t _service,
instance_t _instance) const;
VSOMEIP_EXPORT bool check_credentials(client_t _client, uint32_t _uid, uint32_t _gid) const;

//E2E

VSOMEIP_EXPORT std::map<plugin_type_e, std::string> get_plugins(
const std::string &_name) const;
// E2E
VSOMEIP_EXPORT std::map<e2exf::data_identifier, std::shared_ptr<cfg::e2e>> get_e2e_configuration() const;
VSOMEIP_EXPORT bool is_e2e_enabled() const;

Expand Down Expand Up @@ -171,6 +178,8 @@ class configuration_impl: public configuration, public std::enable_shared_from_t
std::string &_criteria,
std::shared_ptr<trace_filter_rule> &_filter_rule);

void load_network(const element &_element);

void load_unicast_address(const element &_element);
void load_diagnosis_address(const element &_element);

Expand Down Expand Up @@ -237,7 +246,8 @@ class configuration_impl: public configuration, public std::enable_shared_from_t
std::string logfile_;
boost::log::trivial::severity_level loglevel_;

std::map<std::string, std::tuple<client_t, std::size_t, std::size_t, std::size_t, std::size_t>> applications_;
std::map<std::string, std::tuple<client_t, std::size_t, std::size_t,
size_t, size_t, std::map<plugin_type_e, std::string>>> applications_;
std::set<client_t> client_identifiers_;

std::map<service_t,
Expand Down Expand Up @@ -284,6 +294,7 @@ class configuration_impl: public configuration, public std::enable_shared_from_t
uint32_t log_version_interval_;

enum element_type_e {
ET_NETWORK,
ET_UNICAST,
ET_DIAGNOSIS,
ET_LOGGING_CONSOLE,
Expand All @@ -308,7 +319,7 @@ class configuration_impl: public configuration, public std::enable_shared_from_t
ET_TRACING_ENABLE,
ET_TRACING_SD_ENABLE,
ET_SERVICE_DISCOVERY_OFFER_DEBOUNCE_TIME,
ET_MAX = 24
ET_MAX = 25
};

bool is_configured_[ET_MAX];
Expand All @@ -319,6 +330,9 @@ class configuration_impl: public configuration, public std::enable_shared_from_t
bool policy_enabled_;
bool check_credentials_;

std::string network_;
std::string configuration_path_;

bool e2e_enabled_;
std::map<e2exf::data_identifier, std::shared_ptr<cfg::e2e>> e2e_configuration_;
};
Expand Down
12 changes: 9 additions & 3 deletions implementation/configuration/include/e2e.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ struct e2e {
event_id(0),
crc_offset(0),
data_id_mode(0),
data_length(0) {
data_length(0),
data_id_nibble_offset(0),
counter_offset(0) {
}


e2e(uint16_t _data_id, std::string _variant, std::string _profile, uint16_t _service_id,
uint16_t _event_id,uint16_t _crc_offset,
uint8_t _data_id_mode, uint16_t _data_length) :
uint8_t _data_id_mode, uint16_t _data_length, uint16_t _data_id_nibble_offset, uint16_t _counter_offset) :

data_id(_data_id),
variant(_variant),
Expand All @@ -40,7 +42,9 @@ struct e2e {
event_id(_event_id),
crc_offset(_crc_offset),
data_id_mode(_data_id_mode),
data_length(_data_length) {
data_length(_data_length),
data_id_nibble_offset(_data_id_nibble_offset),
counter_offset(_counter_offset) {

}

Expand All @@ -56,6 +60,8 @@ struct e2e {
uint16_t crc_offset;
uint8_t data_id_mode;
uint16_t data_length;
uint16_t data_id_nibble_offset;
uint16_t counter_offset;
};


Expand Down
22 changes: 16 additions & 6 deletions implementation/configuration/include/internal.hpp.in
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#define VSOMEIP_ENV_CONFIGURATION "VSOMEIP_CONFIGURATION"
#define VSOMEIP_ENV_CONFIGURATION_MODULE "VSOMEIP_CONFIGURATION_MODULE"
#define VSOMEIP_ENV_MANDATORY_CONFIGURATION_FILES "VSOMEIP_MANDATORY_CONFIGURATION_FILES"
#define VSOMEIP_ENV_LOAD_PLUGINS "VSOMEIP_LOAD_PLUGINS"

#define VSOMEIP_DEFAULT_CONFIGURATION_FILE "/etc/vsomeip.json"
#define VSOMEIP_LOCAL_CONFIGURATION_FILE "./vsomeip.json"
Expand All @@ -22,15 +23,19 @@
#define VSOMEIP_DEFAULT_CONFIGURATION_FOLDER "/etc/vsomeip"
#define VSOMEIP_LOCAL_CONFIGURATION_FOLDER "./vsomeip"

#define VSOMEIP_BASE_PATH "/tmp/vsomeip-"
#define VSOMEIP_BASE_PATH "/tmp/"

#ifdef WIN32
#define VSOMEIP_CFG_LIBRARY "vsomeip-cfg.dll"
#else
#define VSOMEIP_CFG_LIBRARY "libvsomeip-cfg.so.@VSOMEIP_MAJOR_VERSION@"
#define VSOMEIP_CFG_RUNTIME_SYMBOL VSOMEIP_CFG_RUNTIME
#define VSOMEIP_CFG_RUNTIME_SYMBOL_STRING "VSOMEIP_CFG_RUNTIME"
#endif

#ifdef WIN32
#define VSOMEIP_SD_LIBRARY "vsomeip-sd.dll"
#else
#define VSOMEIP_SD_LIBRARY "libvsomeip-sd.so.@VSOMEIP_MAJOR_VERSION@"
#define VSOMEIP_SD_RUNTIME_SYMBOL VSOMEIP_SD_RUNTIME
#define VSOMEIP_SD_RUNTIME_SYMBOL_STRING "VSOMEIP_SD_RUNTIME"
#endif

#define VSOMEIP_ROUTING "@VSOMEIP_ROUTING@"
#define VSOMEIP_ROUTING_CLIENT 0
Expand Down Expand Up @@ -112,7 +117,6 @@
#endif

#define VSOMEIP_DATA_ID 0x677D
#define VSOMEIP_SHM_NAME "/vsomeip"
#define VSOMEIP_DIAGNOSIS_ADDRESS @VSOMEIP_DIAGNOSIS_ADDRESS@

#define VSOMEIP_DEFAULT_SHM_PERMISSION 0666
Expand Down Expand Up @@ -145,6 +149,12 @@ struct service_data_t {
}
};

typedef enum {
SUBSCRIPTION_ACKNOWLEDGED,
SUBSCRIPTION_NOT_ACKNOWLEDGED,
IS_SUBSCRIBING
} subscription_state_e;

struct configuration_data_t {
#ifndef _WIN32
volatile char initialized_;
Expand Down
Loading

0 comments on commit fdf8623

Please sign in to comment.