feat():initial version
This commit is contained in:
1127
install/vsomeip-3.7.3/include/vsomeip/application.hpp
Normal file
1127
install/vsomeip-3.7.3/include/vsomeip/application.hpp
Normal file
File diff suppressed because it is too large
Load Diff
60
install/vsomeip-3.7.3/include/vsomeip/constants.hpp
Normal file
60
install/vsomeip-3.7.3/include/vsomeip/constants.hpp
Normal file
@@ -0,0 +1,60 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
#include <vsomeip/enumeration_types.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
inline constexpr major_version_t DEFAULT_MAJOR = 0x00;
|
||||
inline constexpr minor_version_t DEFAULT_MINOR = 0x00000000;
|
||||
inline constexpr ttl_t DEFAULT_TTL = 0xFFFFFF; // "until next reboot"
|
||||
|
||||
const std::string DEFAULT_MULTICAST = "224.0.0.0";
|
||||
inline constexpr uint16_t DEFAULT_PORT = 30500;
|
||||
inline constexpr uint16_t ILLEGAL_PORT = 0xFFFF;
|
||||
inline constexpr uint16_t ANY_PORT = 0;
|
||||
|
||||
inline constexpr uint16_t NO_TRACE_FILTER_EXPRESSION = 0x0000;
|
||||
|
||||
inline constexpr service_t ANY_SERVICE = 0xFFFF;
|
||||
inline constexpr instance_t ANY_INSTANCE = 0xFFFF;
|
||||
inline constexpr eventgroup_t ANY_EVENTGROUP = 0xFFFF;
|
||||
inline constexpr method_t ANY_METHOD = 0xFFFF;
|
||||
inline constexpr major_version_t ANY_MAJOR = 0xFF;
|
||||
inline constexpr minor_version_t ANY_MINOR = 0xFFFFFFFF;
|
||||
|
||||
inline constexpr eventgroup_t DEFAULT_EVENTGROUP = 0x0001;
|
||||
|
||||
inline constexpr client_t ILLEGAL_CLIENT = 0x0000;
|
||||
inline constexpr method_t INVALID_METHOD = 0x0000;
|
||||
|
||||
inline constexpr byte_t MAGIC_COOKIE_CLIENT_MESSAGE = 0x00;
|
||||
inline constexpr byte_t MAGIC_COOKIE_SERVICE_MESSAGE = 0x80;
|
||||
inline constexpr length_t MAGIC_COOKIE_SIZE = 0x00000008;
|
||||
inline constexpr request_t MAGIC_COOKIE_REQUEST = 0xDEADBEEF;
|
||||
inline constexpr client_t MAGIC_COOKIE_CLIENT = 0xDEAD;
|
||||
inline constexpr protocol_version_t MAGIC_COOKIE_PROTOCOL_VERSION = 0x01;
|
||||
inline constexpr interface_version_t MAGIC_COOKIE_INTERFACE_VERSION = 0x01;
|
||||
inline constexpr message_type_e MAGIC_COOKIE_CLIENT_MESSAGE_TYPE = message_type_e::MT_REQUEST_NO_RETURN;
|
||||
inline constexpr message_type_e MAGIC_COOKIE_SERVICE_MESSAGE_TYPE = message_type_e::MT_NOTIFICATION;
|
||||
inline constexpr return_code_e MAGIC_COOKIE_RETURN_CODE = return_code_e::E_OK;
|
||||
|
||||
inline constexpr byte_t CLIENT_COOKIE[] = {0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0xDE, 0xAD, 0xBE, 0xEF, 0x01, 0x01, 0x01, 0x00};
|
||||
|
||||
inline constexpr byte_t SERVICE_COOKIE[] = {0xFF, 0xFF, 0x80, 0x00, 0x00, 0x00, 0x00, 0x08, 0xDE, 0xAD, 0xBE, 0xEF, 0x01, 0x01, 0x02, 0x00};
|
||||
|
||||
inline constexpr event_t ANY_EVENT = 0xFFFF;
|
||||
inline constexpr client_t ANY_CLIENT = 0xFFFF;
|
||||
|
||||
inline constexpr int VSOMEIP_ALL = -1;
|
||||
|
||||
inline constexpr pending_security_update_id_t DEFAULT_SECURITY_UPDATE_ID = 0x0;
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
41
install/vsomeip-3.7.3/include/vsomeip/defines.hpp
Normal file
41
install/vsomeip-3.7.3/include/vsomeip/defines.hpp
Normal file
@@ -0,0 +1,41 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdint>
|
||||
|
||||
constexpr std::uint8_t VSOMEIP_PROTOCOL_VERSION = 0x1;
|
||||
|
||||
// 0 = unlimited, if not specified otherwise via configuration file
|
||||
constexpr std::size_t VSOMEIP_MAX_LOCAL_MESSAGE_SIZE = 0;
|
||||
// 0 = unlimited, if not specified otherwise via configuration file
|
||||
constexpr std::size_t VSOMEIP_MAX_TCP_MESSAGE_SIZE = 0;
|
||||
constexpr std::size_t VSOMEIP_MAX_UDP_MESSAGE_SIZE = 1416;
|
||||
|
||||
constexpr std::size_t VSOMEIP_PACKET_SIZE = VSOMEIP_MAX_UDP_MESSAGE_SIZE;
|
||||
|
||||
constexpr std::size_t VSOMEIP_SOMEIP_MAGIC_COOKIE_SIZE = 8;
|
||||
constexpr std::uint32_t VSOMEIP_SOMEIP_HEADER_SIZE = 8;
|
||||
constexpr std::uint32_t VSOMEIP_FULL_HEADER_SIZE = 16;
|
||||
|
||||
constexpr std::size_t VSOMEIP_SERVICE_POS_MIN = 0;
|
||||
constexpr std::size_t VSOMEIP_SERVICE_POS_MAX = 1;
|
||||
constexpr std::size_t VSOMEIP_METHOD_POS_MIN = 2;
|
||||
constexpr std::size_t VSOMEIP_METHOD_POS_MAX = 3;
|
||||
constexpr std::size_t VSOMEIP_EVENT_POS_MIN = 2;
|
||||
constexpr std::size_t VSOMEIP_EVENT_POS_MAX = 3;
|
||||
constexpr std::size_t VSOMEIP_LENGTH_POS_MIN = 4;
|
||||
constexpr std::size_t VSOMEIP_LENGTH_POS_MAX = 7;
|
||||
constexpr std::size_t VSOMEIP_CLIENT_POS_MIN = 8;
|
||||
constexpr std::size_t VSOMEIP_CLIENT_POS_MAX = 9;
|
||||
constexpr std::size_t VSOMEIP_SESSION_POS_MIN = 10;
|
||||
constexpr std::size_t VSOMEIP_SESSION_POS_MAX = 11;
|
||||
constexpr std::size_t VSOMEIP_PROTOCOL_VERSION_POS = 12;
|
||||
constexpr std::size_t VSOMEIP_INTERFACE_VERSION_POS = 13;
|
||||
constexpr std::size_t VSOMEIP_MESSAGE_TYPE_POS = 14;
|
||||
constexpr std::size_t VSOMEIP_RETURN_CODE_POS = 15;
|
||||
constexpr std::size_t VSOMEIP_PAYLOAD_POS = 16;
|
||||
12
install/vsomeip-3.7.3/include/vsomeip/deprecated.hpp
Normal file
12
install/vsomeip-3.7.3/include/vsomeip/deprecated.hpp
Normal file
@@ -0,0 +1,12 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef VSOMEIP_INTERNAL_SUPPRESS_DEPRECATED
|
||||
#define VSOMEIP_DEPRECATED_UID_GID
|
||||
#else
|
||||
#define VSOMEIP_DEPRECATED_UID_GID [[deprecated("Use vsomeip_sec_client_t-aware functions and types instead.")]]
|
||||
#endif
|
||||
97
install/vsomeip-3.7.3/include/vsomeip/enumeration_types.hpp
Normal file
97
install/vsomeip-3.7.3/include/vsomeip/enumeration_types.hpp
Normal file
@@ -0,0 +1,97 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
enum class state_type_e : uint8_t { ST_REGISTERED = 0x0, ST_DEREGISTERED = 0x1 };
|
||||
|
||||
// SIP_RPC_684
|
||||
enum class message_type_e : uint8_t {
|
||||
MT_REQUEST = 0x00,
|
||||
MT_REQUEST_NO_RETURN = 0x01,
|
||||
MT_NOTIFICATION = 0x02,
|
||||
MT_REQUEST_ACK = 0x40,
|
||||
MT_REQUEST_NO_RETURN_ACK = 0x41,
|
||||
MT_NOTIFICATION_ACK = 0x42,
|
||||
MT_RESPONSE = 0x80,
|
||||
MT_ERROR = 0x81,
|
||||
MT_RESPONSE_ACK = 0xC0,
|
||||
MT_ERROR_ACK = 0xC1,
|
||||
MT_UNKNOWN = 0xFF
|
||||
};
|
||||
|
||||
// SIP_RPC_371
|
||||
enum class return_code_e : uint8_t {
|
||||
E_OK = 0x00,
|
||||
E_NOT_OK = 0x01,
|
||||
E_UNKNOWN_SERVICE = 0x02,
|
||||
E_UNKNOWN_METHOD = 0x03,
|
||||
E_NOT_READY = 0x04,
|
||||
E_NOT_REACHABLE = 0x05,
|
||||
E_TIMEOUT = 0x06,
|
||||
E_WRONG_PROTOCOL_VERSION = 0x07,
|
||||
E_WRONG_INTERFACE_VERSION = 0x08,
|
||||
E_MALFORMED_MESSAGE = 0x09,
|
||||
E_WRONG_MESSAGE_TYPE = 0x0A,
|
||||
E_UNKNOWN = 0xFF
|
||||
};
|
||||
|
||||
enum class routing_state_e : uint8_t {
|
||||
RS_RUNNING = 0x00, // (not supported since 3.7.3)
|
||||
RS_SUSPENDED = 0x01,
|
||||
RS_RESUMED = 0x02,
|
||||
RS_SHUTDOWN = 0x03,
|
||||
RS_DIAGNOSIS = 0x04, // (not supported since 3.7.2)
|
||||
RS_DELAYED_RESUME = 0x05,
|
||||
RS_UNKNOWN = 0xFF
|
||||
};
|
||||
|
||||
enum class offer_type_e : uint8_t {
|
||||
OT_LOCAL = 0x00,
|
||||
OT_REMOTE = 0x01,
|
||||
OT_ALL = 0x02,
|
||||
};
|
||||
|
||||
enum class event_type_e : uint8_t { ET_EVENT = 0x00, ET_SELECTIVE_EVENT = 0x01, ET_FIELD = 0x02, ET_UNKNOWN = 0xFF };
|
||||
|
||||
enum class security_mode_e : uint8_t { SM_OFF = 0x00, SM_ON = 0x01, SM_AUDIT = 0x02 };
|
||||
|
||||
enum class security_update_state_e : uint8_t {
|
||||
SU_SUCCESS = 0x00,
|
||||
SU_NOT_ALLOWED = 0x01,
|
||||
SU_UNKNOWN_USER_ID = 0x02,
|
||||
SU_INVALID_FORMAT = 0x03
|
||||
};
|
||||
|
||||
enum class reliability_type_e : uint8_t {
|
||||
RT_RELIABLE = 0x01,
|
||||
RT_UNRELIABLE = 0x02,
|
||||
RT_BOTH = 0x3, // RT_RELIABLE | RT_UNRELIABLE
|
||||
RT_UNKNOWN = 0xFF
|
||||
};
|
||||
|
||||
enum class availability_state_e : uint8_t {
|
||||
AS_UNAVAILABLE = 0x00, // unseen
|
||||
AS_OFFERED = 0x01, // seen, but not requested/not yet usable
|
||||
AS_AVAILABLE = 0x02, // seen and usable
|
||||
AS_UNKNOWN = 0xFF
|
||||
};
|
||||
|
||||
enum class handler_registration_type_e : uint8_t { HRT_REPLACE = 0x00, HRT_PREPEND = 0x01, HRT_APPEND = 0x02, HRT_UNKNOWN = 0xFF };
|
||||
|
||||
enum class endianess_e {
|
||||
be, // big-endian
|
||||
le // little-endian
|
||||
};
|
||||
|
||||
enum class connection_control_request_e : uint8_t { CCR_ACCEPT = 0, CCR_RESET_AND_BLOCK = 1 };
|
||||
|
||||
enum class connection_control_response_e : uint8_t { CCR_OK = 0, CCR_ERROR_INVALID_PARAMETER = 255 };
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
20
install/vsomeip-3.7.3/include/vsomeip/error.hpp
Normal file
20
install/vsomeip-3.7.3/include/vsomeip/error.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
enum class error_code_e : uint8_t {
|
||||
CONFIGURATION_MISSING,
|
||||
PORT_CONFIGURATION_MISSING,
|
||||
CLIENT_ENDPOINT_CREATION_FAILED,
|
||||
SERVER_ENDPOINT_CREATION_FAILED,
|
||||
SERVICE_PROPERTY_MISMATCH
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
27
install/vsomeip-3.7.3/include/vsomeip/export.hpp
Normal file
27
install/vsomeip-3.7.3/include/vsomeip/export.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#if _WIN32
|
||||
#define VSOMEIP_EXPORT __declspec(dllexport)
|
||||
#define VSOMEIP_EXPORT_CLASS_EXPLICIT
|
||||
|
||||
#if VSOMEIP_DLL_COMPILATION
|
||||
#define VSOMEIP_IMPORT_EXPORT __declspec(dllexport)
|
||||
#else
|
||||
#define VSOMEIP_IMPORT_EXPORT __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
#if VSOMEIP_DLL_COMPILATION_CONFIG
|
||||
#define VSOMEIP_IMPORT_EXPORT_CONFIG __declspec(dllexport)
|
||||
#else
|
||||
#define VSOMEIP_IMPORT_EXPORT_CONFIG __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define VSOMEIP_EXPORT
|
||||
#define VSOMEIP_IMPORT_EXPORT
|
||||
#define VSOMEIP_IMPORT_EXPORT_CONFIG
|
||||
#endif
|
||||
17
install/vsomeip-3.7.3/include/vsomeip/function_types.hpp
Normal file
17
install/vsomeip-3.7.3/include/vsomeip/function_types.hpp
Normal file
@@ -0,0 +1,17 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class payload;
|
||||
|
||||
typedef std::function<bool(const std::shared_ptr<payload>&, const std::shared_ptr<payload>&)> epsilon_change_func_t;
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
104
install/vsomeip-3.7.3/include/vsomeip/handler.hpp
Normal file
104
install/vsomeip-3.7.3/include/vsomeip/handler.hpp
Normal file
@@ -0,0 +1,104 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <functional>
|
||||
#include <memory>
|
||||
#include <tuple>
|
||||
|
||||
#include <vsomeip/deprecated.hpp>
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
#include <vsomeip/vsomeip_sec.h>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class message;
|
||||
|
||||
typedef std::function<void(state_type_e)> state_handler_t;
|
||||
typedef std::function<void(const std::shared_ptr<message>&)> message_handler_t;
|
||||
typedef std::function<void(service_t, instance_t, bool)> availability_handler_t;
|
||||
typedef std::function<void(service_t, instance_t, availability_state_e)> availability_state_handler_t;
|
||||
VSOMEIP_DEPRECATED_UID_GID typedef std::function<bool(client_t, uid_t, gid_t, bool)> subscription_handler_t;
|
||||
VSOMEIP_DEPRECATED_UID_GID typedef std::function<bool(client_t, uid_t, gid_t, const std::string&, bool)> subscription_handler_ext_t;
|
||||
typedef std::function<void(const uint16_t)> error_handler_t;
|
||||
typedef std::function<void(const service_t, const instance_t, const eventgroup_t, const event_t, const uint16_t)>
|
||||
subscription_status_handler_t;
|
||||
VSOMEIP_DEPRECATED_UID_GID typedef std::function<void(client_t, uid_t, gid_t, bool, std::function<void(const bool)>)>
|
||||
async_subscription_handler_t;
|
||||
VSOMEIP_DEPRECATED_UID_GID typedef std::function<void(client_t, uid_t, gid_t, const std::string&, bool, std::function<void(const bool)>)>
|
||||
async_subscription_handler_ext_t;
|
||||
|
||||
typedef std::function<void(const std::vector<std::pair<service_t, instance_t>>& _services)> offered_services_handler_t;
|
||||
typedef std::function<void()> watchdog_handler_t;
|
||||
|
||||
/*
|
||||
* vsomeip_sec_client_t-aware subscription handlers
|
||||
*/
|
||||
using subscription_handler_sec_t = std::function<bool(client_t, const vsomeip_sec_client_t*, const std::string&, bool)>;
|
||||
using async_subscription_handler_sec_t =
|
||||
std::function<void(client_t, const vsomeip_sec_client_t*, const std::string&, bool, std::function<void(bool)>)>;
|
||||
|
||||
struct ip_address_t {
|
||||
union {
|
||||
ipv4_address_t v4_;
|
||||
ipv6_address_t v6_;
|
||||
} address_;
|
||||
bool is_v4_;
|
||||
|
||||
bool operator<(const ip_address_t& _other) const {
|
||||
if (is_v4_ && _other.is_v4_) {
|
||||
return address_.v4_ < _other.address_.v4_;
|
||||
} else if (!is_v4_ && !_other.is_v4_) {
|
||||
return address_.v6_ < _other.address_.v6_;
|
||||
} else if (is_v4_ && !_other.is_v4_) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool operator==(const ip_address_t& _other) const {
|
||||
if (is_v4_ && _other.is_v4_) {
|
||||
return address_.v4_ == _other.address_.v4_;
|
||||
} else if (!is_v4_ && !_other.is_v4_) {
|
||||
return address_.v6_ == _other.address_.v6_;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool operator!=(const ip_address_t& _other) const { return !(*this == _other); }
|
||||
};
|
||||
|
||||
struct remote_info_t {
|
||||
ip_address_t ip_;
|
||||
std::uint16_t first_;
|
||||
std::uint16_t last_;
|
||||
bool is_range_;
|
||||
bool is_reliable_;
|
||||
|
||||
bool operator<(const remote_info_t& _other) const {
|
||||
return std::tie(ip_, first_, last_, is_range_, is_reliable_)
|
||||
< std::tie(_other.ip_, _other.first_, _other.last_, _other.is_range_, _other.is_reliable_);
|
||||
}
|
||||
};
|
||||
|
||||
struct message_acceptance_t {
|
||||
std::uint32_t remote_address_;
|
||||
std::uint16_t local_port_;
|
||||
bool is_local_;
|
||||
service_t service_;
|
||||
instance_t instance_;
|
||||
};
|
||||
|
||||
typedef std::function<bool(const remote_info_t&)> sd_acceptance_handler_t;
|
||||
typedef std::function<void(const ip_address_t&)> reboot_notification_handler_t;
|
||||
typedef std::function<void()> routing_ready_handler_t;
|
||||
typedef std::function<void(routing_state_e)> routing_state_handler_t;
|
||||
typedef std::function<void(security_update_state_e)> security_update_handler_t;
|
||||
typedef std::function<bool(const message_acceptance_t&)> message_acceptance_handler_t;
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
@@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class deserializer;
|
||||
|
||||
class deserializable {
|
||||
public:
|
||||
VSOMEIP_EXPORT virtual ~deserializable() { }
|
||||
VSOMEIP_EXPORT virtual bool deserialize(deserializer* _from) = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
75
install/vsomeip-3.7.3/include/vsomeip/internal/logger.hpp
Normal file
75
install/vsomeip-3.7.3/include/vsomeip/internal/logger.hpp
Normal file
@@ -0,0 +1,75 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <cstdint>
|
||||
#include <ostream>
|
||||
#include <streambuf>
|
||||
#include <string_view>
|
||||
#include <vector>
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
namespace logger {
|
||||
|
||||
enum class VSOMEIP_IMPORT_EXPORT level_e : std::uint8_t {
|
||||
LL_NONE = 0,
|
||||
LL_FATAL = 1,
|
||||
LL_ERROR = 2,
|
||||
LL_WARNING = 3,
|
||||
LL_INFO = 4,
|
||||
LL_DEBUG = 5,
|
||||
LL_VERBOSE = 6
|
||||
};
|
||||
|
||||
class message : public std::ostream {
|
||||
public:
|
||||
VSOMEIP_IMPORT_EXPORT explicit message(level_e _level);
|
||||
VSOMEIP_IMPORT_EXPORT ~message() override;
|
||||
|
||||
private:
|
||||
std::string_view timestamp() const;
|
||||
std::string_view app_name() const;
|
||||
std::string_view level_as_view() const;
|
||||
std::string_view buffer_as_view() const;
|
||||
|
||||
struct buffer : public std::streambuf {
|
||||
void activate();
|
||||
bool is_active() const;
|
||||
|
||||
std::streambuf::int_type overflow(std::streambuf::int_type c) override;
|
||||
std::streamsize xsputn(const char* s, std::streamsize n) override;
|
||||
|
||||
// The internal storage for the streambuffer. We use this for being able to access data
|
||||
// directly as a string_view. This saving having to allocate a new std::string. The
|
||||
// main use-case is being able to pass data to DLT without unnecessary copying.
|
||||
std::vector<char> data_;
|
||||
bool active_{false};
|
||||
};
|
||||
|
||||
buffer buffer_;
|
||||
const level_e level_;
|
||||
bool console_enabled_{false};
|
||||
bool dlt_enabled_{false};
|
||||
bool file_enabled_{false};
|
||||
std::chrono::system_clock::time_point when_;
|
||||
mutable std::string timestamp_;
|
||||
};
|
||||
|
||||
} // namespace logger
|
||||
} // namespace vsomeip_v3
|
||||
|
||||
#define VSOMEIP_FATAL vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_FATAL)
|
||||
#define VSOMEIP_ERROR vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_ERROR)
|
||||
#define VSOMEIP_WARNING vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_WARNING)
|
||||
#define VSOMEIP_INFO vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_INFO)
|
||||
#define VSOMEIP_DEBUG vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_DEBUG)
|
||||
#define VSOMEIP_TRACE vsomeip_v3::logger::message(vsomeip_v3::logger::level_e::LL_VERBOSE)
|
||||
|
||||
#define VSOMEIP_LOG_DEFAULT_APPLICATION_ID "VSIP"
|
||||
#define VSOMEIP_LOG_DEFAULT_APPLICATION_NAME "vSomeIP application|SysInfra|IPC"
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
#include <vsomeip/plugin.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class plugin_manager {
|
||||
public:
|
||||
VSOMEIP_EXPORT virtual ~plugin_manager(){};
|
||||
VSOMEIP_EXPORT static std::shared_ptr<plugin_manager> get();
|
||||
VSOMEIP_EXPORT virtual std::shared_ptr<plugin> get_plugin(plugin_type_e _type, const std::string& _name) = 0;
|
||||
VSOMEIP_EXPORT virtual void* load_library(const std::string& _path) = 0;
|
||||
VSOMEIP_EXPORT virtual void* load_symbol(void* _handle, const std::string& _symbol) = 0;
|
||||
VSOMEIP_EXPORT virtual void unload_library(void* _handle) = 0;
|
||||
VSOMEIP_EXPORT virtual bool unload_plugin(plugin_type_e _type) = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
@@ -0,0 +1,32 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <vsomeip/deprecated.hpp>
|
||||
#include <vsomeip/export.hpp>
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
struct policy;
|
||||
|
||||
class VSOMEIP_IMPORT_EXPORT policy_manager {
|
||||
public:
|
||||
virtual ~policy_manager() { }
|
||||
virtual std::shared_ptr<policy> create_policy() const = 0;
|
||||
virtual void print_policy(const std::shared_ptr<policy>& _policy) const = 0;
|
||||
|
||||
virtual bool parse_uid_gid(const byte_t*& _buffer, uint32_t& _buffer_size, uid_t& _uid, gid_t& _gid) const = 0;
|
||||
virtual bool parse_policy(const byte_t*& _buffer, uint32_t& _buffer_size, uid_t& _uid, gid_t& _gid,
|
||||
const std::shared_ptr<policy>& _policy) const = 0;
|
||||
|
||||
virtual bool is_policy_update_allowed(uid_t _uid, std::shared_ptr<policy>& _policy) const = 0;
|
||||
virtual bool is_policy_removal_allowed(uid_t _uid) const = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class serializer;
|
||||
|
||||
/**
|
||||
* Abstract base class for element that can be serialized.
|
||||
*/
|
||||
class serializable {
|
||||
public:
|
||||
VSOMEIP_EXPORT virtual ~serializable() { }
|
||||
|
||||
/**
|
||||
* \brief serialize the content of the object
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual bool serialize(serializer* _to) const = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
86
install/vsomeip-3.7.3/include/vsomeip/message.hpp
Normal file
86
install/vsomeip-3.7.3/include/vsomeip/message.hpp
Normal file
@@ -0,0 +1,86 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include <vsomeip/deprecated.hpp>
|
||||
#include <vsomeip/message_base.hpp>
|
||||
#include <vsomeip/vsomeip_sec.h>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class payload;
|
||||
|
||||
/**
|
||||
*
|
||||
* \defgroup vsomeip
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Implements regular SOME/IP messages.
|
||||
*
|
||||
* This class extends @ref message_base by an unstructured payload. Except
|
||||
* SOME/IP Service Discovery messages, all SOME/IP messages within vsomeip
|
||||
* are represented by message objects.
|
||||
*/
|
||||
|
||||
class message : virtual public message_base {
|
||||
public:
|
||||
virtual ~message() { }
|
||||
|
||||
/**
|
||||
* \brief Returns a pointer to the message payload.
|
||||
*/
|
||||
virtual std::shared_ptr<payload> get_payload() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the message payload.
|
||||
*/
|
||||
virtual void set_payload(std::shared_ptr<payload> _payload) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get e2e protection check result.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual uint8_t get_check_result() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set e2e protection check result.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_check_result(uint8_t _check_result) = 0;
|
||||
|
||||
/**
|
||||
* \brief Return whether or not the CRC value received is valid.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual bool is_valid_crc() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Return uid of the message sender.
|
||||
*/
|
||||
VSOMEIP_DEPRECATED_UID_GID VSOMEIP_EXPORT virtual uid_t get_uid() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Return gid of the message sender.
|
||||
*/
|
||||
VSOMEIP_DEPRECATED_UID_GID VSOMEIP_EXPORT virtual gid_t get_gid() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Return environment (hostname) of the message sender.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual std::string get_env() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Return security client of the message sender.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual vsomeip_sec_client_t get_sec_client() const = 0;
|
||||
};
|
||||
|
||||
/** @} */
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
194
install/vsomeip-3.7.3/include/vsomeip/message_base.hpp
Normal file
194
install/vsomeip-3.7.3/include/vsomeip/message_base.hpp
Normal file
@@ -0,0 +1,194 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
#include <vsomeip/enumeration_types.hpp>
|
||||
|
||||
#include <vsomeip/internal/deserializable.hpp>
|
||||
#include <vsomeip/internal/serializable.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
/**
|
||||
*
|
||||
* \defgroup vsomeip
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* \brief Base class to implement SOME/IP messages.
|
||||
*
|
||||
* This class implements the SOME/IP message header and connects to the
|
||||
* serialzing/deserializing functionalities. The class is inherited by
|
||||
* the message classes within ::vsomeip and vsomeip::sd that add the
|
||||
* payload representations for regular and Service Discovery messages.
|
||||
*/
|
||||
class message_base : public serializable, public deserializable {
|
||||
public:
|
||||
VSOMEIP_EXPORT virtual ~message_base(){};
|
||||
|
||||
/**
|
||||
* \brief Returns the message identifier.
|
||||
*
|
||||
* The method returns the message identifier that consists of
|
||||
* service identifier and method identifier.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual message_t get_message() const = 0;
|
||||
/**
|
||||
* \brief Set the message identifier.
|
||||
*
|
||||
* The methods sets service identifier and method identifier in
|
||||
* a single call.
|
||||
*
|
||||
* \param _message The new message identifier.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_message(message_t _message) = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the service identifier from the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual service_t get_service() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the service identifier in the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_service(service_t _service) = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the instance identifier.
|
||||
*
|
||||
* The instance identifier is _not_ part of the SOME/IP header. It is
|
||||
* either derived from the incoming message (local) or from the port
|
||||
* that was used to send a message (external).
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual instance_t get_instance() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the instance identifier in the message header.
|
||||
*
|
||||
* To address the correct service instance, vsomeip uses the instance
|
||||
* identifier. For external services it is mapped to a IP address and port
|
||||
* combination before the message is sent. For internal messages is
|
||||
* transferred as additional data appended to the SOME/IP messages.
|
||||
* Therefore, before sending a message, a user application must set the
|
||||
* instance identifier.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_instance(instance_t _instance) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the method/event identifier from the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual method_t get_method() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the method/event identifier in the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_method(method_t _method) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the payload length from the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual length_t get_length() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the request identifier from the message header.
|
||||
*
|
||||
* The request identifier consists of the client identifier and the
|
||||
* session identifier. As it does really make sense to set it as
|
||||
* a whole, setting is not supported.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual request_t get_request() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the client identifier in the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual client_t get_client() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the client identifier in the message header.
|
||||
*
|
||||
* For requests this is automatically done by @ref application::send.
|
||||
* For notications this is not needed.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_client(client_t _client) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the session identifier from the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual session_t get_session() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the session identifier in the message header.
|
||||
*
|
||||
* For requests this is automatically done by @ref application::send
|
||||
* For notifications it is not needed to set the session identifier.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_session(session_t _session) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the protocol version from the message header.
|
||||
*
|
||||
* As the protocol version is a fixed value for a vsomeip implementation,
|
||||
* it cannot be set.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual protocol_version_t get_protocol_version() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the interface version from the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual interface_version_t get_interface_version() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the interface version in the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_interface_version(interface_version_t _version) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the message type from the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual message_type_e get_message_type() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the message type in the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_message_type(message_type_e _type) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the return code from the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual return_code_e get_return_code() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the return code in the message header.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_return_code(return_code_e _code) = 0;
|
||||
|
||||
/**
|
||||
* \brief Return the transport mode that was/will be used to send the message.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual bool is_reliable() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the transport mode that will be used to send the message.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_reliable(bool _is_reliable) = 0;
|
||||
|
||||
/**
|
||||
* \brief Return whether or not the message is an initial event.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual bool is_initial() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set whether or not the message is an initial event.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_initial(bool _is_initial) = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
100
install/vsomeip-3.7.3/include/vsomeip/payload.hpp
Normal file
100
install/vsomeip-3.7.3/include/vsomeip/payload.hpp
Normal file
@@ -0,0 +1,100 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
|
||||
#include <vsomeip/internal/deserializable.hpp>
|
||||
#include <vsomeip/internal/serializable.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
/**
|
||||
*
|
||||
* \defgroup vsomeip
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief This class implements an array of bytes to be used as
|
||||
* payload for SOME/IP messages.
|
||||
*
|
||||
*/
|
||||
class payload : public serializable, public deserializable {
|
||||
public:
|
||||
VSOMEIP_EXPORT virtual ~payload() { }
|
||||
|
||||
/**
|
||||
* \brief Returns true if the given payload is equal to this one.
|
||||
*
|
||||
* \param _other Payload that shall be compared to this payload.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual bool operator==(const payload& _other) const = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns pointer to the payload content
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual byte_t* get_data() = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns constant pointer to the payload content
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual const byte_t* get_data() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Copies the given data array to the payload object.
|
||||
*
|
||||
* The current payload content is replaced by the data provided.
|
||||
* The given buffer remains untouched.
|
||||
*
|
||||
* \param _data Pointer to a data buffer.
|
||||
* \param _length Length of the data buffer.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_data(const byte_t* _data, length_t _length) = 0;
|
||||
|
||||
/**
|
||||
* \brief Copies the given data array to the payload object.
|
||||
*
|
||||
* The current payload content is replaced by the data provided.
|
||||
* The given buffer remains untouched.
|
||||
*
|
||||
* \param _data Vector containing the data
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_data(const std::vector<byte_t>& _data) = 0;
|
||||
|
||||
/**
|
||||
* \brief Returns the length of the payload content.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual length_t get_length() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Set the maximum length of the payload content.
|
||||
*
|
||||
* This function must be called before directly copying data using the
|
||||
* pointer to the internal buffer.
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_capacity(length_t _length) = 0;
|
||||
|
||||
/**
|
||||
* \brief Moves the given data array to the payload object.
|
||||
*
|
||||
* The current payload content is replaced by the data provided.
|
||||
* The given buffer is owned by the payload object afterwards.
|
||||
*
|
||||
* \param _data Vector containing the data
|
||||
*/
|
||||
VSOMEIP_EXPORT virtual void set_data(std::vector<byte_t>&& _data) = 0;
|
||||
};
|
||||
|
||||
/** @} */
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
75
install/vsomeip-3.7.3/include/vsomeip/plugin.hpp
Normal file
75
install/vsomeip-3.7.3/include/vsomeip/plugin.hpp
Normal file
@@ -0,0 +1,75 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <cstdint>
|
||||
|
||||
#if _WIN32
|
||||
#if VSOMEIP_DLL_COMPILATION_PLUGIN
|
||||
#define VSOMEIP_IMPORT_EXPORT_PLUGIN __declspec(dllexport)
|
||||
#else
|
||||
#define VSOMEIP_IMPORT_EXPORT_PLUGIN __declspec(dllimport)
|
||||
#endif
|
||||
#else
|
||||
#define VSOMEIP_IMPORT_EXPORT_PLUGIN
|
||||
#endif
|
||||
|
||||
#define VSOMEIP_PLUGIN_INIT_SYMBOL "vsomeip_plugin_init"
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
enum class plugin_type_e : uint8_t { APPLICATION_PLUGIN, PRE_CONFIGURATION_PLUGIN, CONFIGURATION_PLUGIN, SD_RUNTIME_PLUGIN };
|
||||
|
||||
class plugin;
|
||||
typedef std::shared_ptr<plugin> (*create_plugin_func)();
|
||||
typedef create_plugin_func (*plugin_init_func)();
|
||||
|
||||
/**
|
||||
* Base class for all plug-ins
|
||||
*/
|
||||
class VSOMEIP_IMPORT_EXPORT_PLUGIN plugin {
|
||||
public:
|
||||
virtual ~plugin() { }
|
||||
|
||||
virtual uint32_t get_plugin_version() const = 0;
|
||||
virtual const std::string& get_plugin_name() const = 0;
|
||||
virtual plugin_type_e get_plugin_type() const = 0;
|
||||
};
|
||||
|
||||
template<class Plugin_>
|
||||
class plugin_impl : public plugin {
|
||||
public:
|
||||
static std::shared_ptr<plugin> get_plugin() { return std::make_shared<Plugin_>(); }
|
||||
|
||||
plugin_impl(const std::string& _name, uint32_t _version, plugin_type_e _type) {
|
||||
name_ = _name;
|
||||
version_ = _version;
|
||||
type_ = _type;
|
||||
}
|
||||
|
||||
const std::string& get_plugin_name() const { return name_; }
|
||||
|
||||
uint32_t get_plugin_version() const { return version_; }
|
||||
|
||||
plugin_type_e get_plugin_type() const { return type_; }
|
||||
|
||||
private:
|
||||
uint32_t version_;
|
||||
std::string name_;
|
||||
plugin_type_e type_;
|
||||
};
|
||||
|
||||
#define VSOMEIP_PLUGIN(class_name) \
|
||||
extern "C" { \
|
||||
VSOMEIP_EXPORT vsomeip_v3::create_plugin_func vsomeip_plugin_init() { \
|
||||
return class_name::get_plugin; \
|
||||
} \
|
||||
}
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
@@ -0,0 +1,36 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
#include <memory>
|
||||
#include <cstdint>
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
|
||||
// Version should be incremented on breaking API change
|
||||
#define VSOMEIP_APPLICATION_PLUGIN_VERSION 1
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
enum class application_plugin_state_e : uint8_t { STATE_INITIALIZED, STATE_STARTED, STATE_STOPPED };
|
||||
|
||||
/**
|
||||
* The application plug-in can be used to extend application behavior
|
||||
* via an module/plug-in.
|
||||
*/
|
||||
class application_plugin {
|
||||
public:
|
||||
virtual ~application_plugin() { }
|
||||
|
||||
// Called by vSomeIP to inform an application plug-in about its actual state
|
||||
// Call should not be blocked from plug-in as there is no threading.
|
||||
// The caller thread of "application::init/::start/::stop" will inform the plug-in.
|
||||
virtual void on_application_state_change(const std::string _application_name, const application_plugin_state_e _app_state) = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
@@ -0,0 +1,27 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
|
||||
// Version should be incremented on breaking API change
|
||||
#define VSOMEIP_PRE_CONFIGURATION_PLUGIN_VERSION 1
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
/**
|
||||
* The pre configuration plug-in can be used to extend configuration load behavior
|
||||
* via an module/plug-in.
|
||||
*/
|
||||
class pre_configuration_plugin {
|
||||
public:
|
||||
virtual ~pre_configuration_plugin() { }
|
||||
|
||||
// Plug-In should return a valid path to a vSomeIP configuration.
|
||||
// vSomeIP will use this path for config loading if such a plug-in is availablel.
|
||||
virtual std::string get_configuration_path() = 0;
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
64
install/vsomeip-3.7.3/include/vsomeip/primitive_types.hpp
Normal file
64
install/vsomeip-3.7.3/include/vsomeip/primitive_types.hpp
Normal file
@@ -0,0 +1,64 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <array>
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#if defined(__linux__) || defined(__QNX__)
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
typedef uint32_t message_t;
|
||||
typedef uint16_t service_t;
|
||||
typedef uint16_t method_t;
|
||||
typedef uint16_t event_t;
|
||||
|
||||
typedef uint16_t instance_t;
|
||||
typedef uint16_t eventgroup_t;
|
||||
|
||||
typedef uint8_t major_version_t;
|
||||
typedef uint32_t minor_version_t;
|
||||
|
||||
typedef uint32_t ttl_t;
|
||||
|
||||
typedef uint32_t request_t;
|
||||
typedef uint16_t client_t;
|
||||
typedef uint16_t session_t;
|
||||
|
||||
typedef uint32_t length_t;
|
||||
|
||||
typedef uint8_t protocol_version_t;
|
||||
typedef uint8_t interface_version_t;
|
||||
|
||||
typedef uint8_t byte_t;
|
||||
typedef uint16_t diagnosis_t;
|
||||
|
||||
// Addresses
|
||||
typedef std::array<byte_t, 4> ipv4_address_t;
|
||||
typedef std::array<byte_t, 16> ipv6_address_t;
|
||||
typedef std::uint16_t port_t;
|
||||
|
||||
typedef std::string trace_channel_t;
|
||||
|
||||
typedef std::string trace_filter_type_t;
|
||||
|
||||
typedef std::uint32_t pending_remote_offer_id_t;
|
||||
|
||||
typedef std::uint32_t pending_security_update_id_t;
|
||||
|
||||
#if defined(_WIN32)
|
||||
typedef std::uint32_t uid_t;
|
||||
typedef std::uint32_t gid_t;
|
||||
#else
|
||||
typedef ::uid_t uid_t;
|
||||
typedef ::uid_t gid_t;
|
||||
#endif
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
222
install/vsomeip-3.7.3/include/vsomeip/runtime.hpp
Normal file
222
install/vsomeip-3.7.3/include/vsomeip/runtime.hpp
Normal file
@@ -0,0 +1,222 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <vsomeip/export.hpp>
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
class application;
|
||||
class message;
|
||||
class payload;
|
||||
|
||||
/**
|
||||
*
|
||||
* \defgroup vsomeip
|
||||
*
|
||||
* The vsomeip module contains all elements a user applications needs to:
|
||||
*
|
||||
* - offer SOME/IP service instances
|
||||
* - request SOME/IP service instances
|
||||
* - offer SOME/IP eventgroups
|
||||
* - subscribe to SOME/IP eventgroups
|
||||
* - send and receive SOME/IP messages (request/response)
|
||||
* - implement SOME/IP events and fields
|
||||
*
|
||||
* @{
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Singleton class containing all public resource management
|
||||
* facilities of vsomeip.
|
||||
*
|
||||
* The methods of this class shall be used to create instances of all the
|
||||
* classes needed to facilitate SOME/IP communication. In particular, it is
|
||||
* the entry point to create instances of the @ref application class that
|
||||
* contains the main public API of vsomeip.
|
||||
*
|
||||
*/
|
||||
class VSOMEIP_IMPORT_EXPORT runtime {
|
||||
public:
|
||||
static std::string get_property(const std::string& _name);
|
||||
static void set_property(const std::string& _name, const std::string& _value);
|
||||
|
||||
static std::shared_ptr<runtime> get();
|
||||
|
||||
virtual ~runtime() { }
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Creates a vsomeip application object.
|
||||
*
|
||||
* An application object manages service offers and requests as well as
|
||||
* event subscriptions. It allows to register user application functions
|
||||
* as callbacks that are called on specific events during runtime, e.g
|
||||
* to react on incoming SOME/IP messages.
|
||||
* An application object is identified by a unique name that is also used
|
||||
* in (and therefore has to match) the configuration files of vsomeip. If
|
||||
* the name is left empty, the application name is taken from the
|
||||
* environment variable "VSOMEIP_APPLICATION_NAME"
|
||||
*
|
||||
* \param _name Name of the application on the system.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<application> create_application(const std::string& _name = "") = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Constructs an empty message object.
|
||||
*
|
||||
* The message can then be used to call @application::send to send a
|
||||
* SOME/IP message. The user application is responsible for setting
|
||||
* the message type, the service instance and the message payload
|
||||
* after this call and before calling @application::send.
|
||||
*
|
||||
* \param _reliable Determines whether this message shall be sent
|
||||
* over a reliable connection (TCP) or not (UDP).
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<message> create_message(bool _reliable = false) const = 0;
|
||||
/**
|
||||
*
|
||||
* \brief Constructs an empty request message.
|
||||
*
|
||||
* The message can then be used to call @ref application::send to send a
|
||||
* SOME/IP message. The message type is set to REQUEST after the
|
||||
* call and the request identifier is automatically set during the
|
||||
* @ref application::send call.
|
||||
*
|
||||
* The user application is responsible for setting the service instance
|
||||
* and the payload.
|
||||
*
|
||||
* \param _reliable Determines whether this message shall be sent
|
||||
* over a reliable connection (TCP) or not (UDP).
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<message> create_request(bool _reliable = false) const = 0;
|
||||
|
||||
/*
|
||||
* \brief Constructs an empty response message from a given request
|
||||
* message.
|
||||
*
|
||||
* The message can then be used to call @ref application::send to send a
|
||||
* SOME/IP message. The message type is set to RESPONSE after the
|
||||
* call and the request identifier is automatically set from the
|
||||
* request message.
|
||||
*
|
||||
* The user application is responsible for setting the service instance
|
||||
* and the payload.
|
||||
*
|
||||
* \param _request The request message that shall be answered by
|
||||
* the response message.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<message> create_response(const std::shared_ptr<message>& _request) const = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Creates an empty notification message.
|
||||
*
|
||||
* The message can then be used to call @ref application::send to send a
|
||||
* SOME/IP message. The message type is set to NOTIFICATION after the
|
||||
* call.
|
||||
*
|
||||
* The user application is responsible for setting the service instance
|
||||
* and the payload.
|
||||
*
|
||||
* \param _reliable Determines whether this message shall be sent
|
||||
* over a reliable connection (TCP) or not (UDP).
|
||||
*
|
||||
* Note: Creating notification messages and sending them using
|
||||
* @ref application::send is possible but not the standard way of sending
|
||||
* notification with vsomeip. The standard way is calling
|
||||
* @ref application::offer_event and setting the value using the
|
||||
* @ref application::notify / @ref application::notify_one methods.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<message> create_notification(bool _reliable = false) const = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Creates an empty payload object.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<payload> create_payload() const = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Creates a payload object filled with the given data.
|
||||
*
|
||||
* \param _data Bytes to be copied into the payload object.
|
||||
* \param _size Number of bytes to be copied into the payload object.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<payload> create_payload(const byte_t* _data, uint32_t _size) const = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Creates a payload object filled with the given data.
|
||||
*
|
||||
* \param _data Bytes to be copied into the payload object.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<payload> create_payload(const std::vector<byte_t>& _data) const = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Retrieves the application object for the application with the
|
||||
* given name.
|
||||
*
|
||||
* If no such application is found, an empty shared_ptr is returned
|
||||
* (nullptr).
|
||||
*
|
||||
* \param _name Name of the application to be found.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<application> get_application(const std::string& _name) const = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Removes the application object for the application with the
|
||||
* given name.
|
||||
*
|
||||
* If no such application is found, this is a null operation.
|
||||
*
|
||||
* \param _name Name of the application to be removed.
|
||||
*
|
||||
*/
|
||||
virtual void remove_application(const std::string& _name) = 0;
|
||||
|
||||
/**
|
||||
*
|
||||
* \brief Creates a vsomeip application object.
|
||||
*
|
||||
* An application object manages service offers and requests as well as
|
||||
* event subscriptions. It allows to register user application functions
|
||||
* as callbacks that are called on specific events during runtime, e.g
|
||||
* to react on incoming SOME/IP messages.
|
||||
* An application object is identified by a unique name that is also used
|
||||
* in (and therefore has to match) the configuration files of vsomeip. If
|
||||
* the name is left empty, the application name is taken from the
|
||||
* environment variable "VSOMEIP_APPLICATION_NAME"
|
||||
*
|
||||
* \param _name Name of the application on the system.
|
||||
* \param _path Path to the configuration file or folder.
|
||||
*
|
||||
*/
|
||||
virtual std::shared_ptr<application> create_application(const std::string& _name, const std::string& _path) = 0;
|
||||
};
|
||||
|
||||
/** @} */
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
50
install/vsomeip-3.7.3/include/vsomeip/structured_types.hpp
Normal file
50
install/vsomeip-3.7.3/include/vsomeip/structured_types.hpp
Normal file
@@ -0,0 +1,50 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <chrono>
|
||||
#include <map>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
|
||||
// Messages are forwarded either because their value differs from the
|
||||
// last received message (on_change) or because the specified time
|
||||
// (interval) between two messages has elapsed. A message that is forwarded
|
||||
// because of a changed value may reset the time until the next unchanged
|
||||
// message is forwarded or not (on_change_resets_interval). By specifiying
|
||||
// indexes and bit masks, the comparison that is carried out to decide whether
|
||||
// or not two message values differ is configurable (ignore).
|
||||
struct debounce_filter_t {
|
||||
debounce_filter_t() : on_change_(false), on_change_resets_interval_(false), interval_(-1), send_current_value_after_(false) { }
|
||||
|
||||
debounce_filter_t(const debounce_filter_t& _source) :
|
||||
on_change_(_source.on_change_), on_change_resets_interval_(_source.on_change_resets_interval_), interval_(_source.interval_),
|
||||
ignore_(_source.ignore_), send_current_value_after_(_source.send_current_value_after_) { }
|
||||
|
||||
inline void operator=(const debounce_filter_t& _other) {
|
||||
on_change_ = _other.on_change_;
|
||||
on_change_resets_interval_ = _other.on_change_resets_interval_;
|
||||
interval_ = _other.interval_;
|
||||
ignore_ = _other.ignore_;
|
||||
send_current_value_after_ = _other.send_current_value_after_;
|
||||
}
|
||||
|
||||
inline bool operator==(const debounce_filter_t& _other) const {
|
||||
return (on_change_ == _other.on_change_ && on_change_resets_interval_ == _other.on_change_resets_interval_
|
||||
&& interval_ == _other.interval_ && ignore_ == _other.ignore_
|
||||
&& send_current_value_after_ == _other.send_current_value_after_);
|
||||
}
|
||||
|
||||
inline bool operator!=(const debounce_filter_t& _other) const { return !(*this == _other); }
|
||||
|
||||
bool on_change_;
|
||||
bool on_change_resets_interval_;
|
||||
int64_t interval_;
|
||||
std::map<std::size_t, byte_t> ignore_;
|
||||
bool send_current_value_after_; // ignored, does nothing
|
||||
};
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
205
install/vsomeip-3.7.3/include/vsomeip/trace.hpp
Normal file
205
install/vsomeip-3.7.3/include/vsomeip/trace.hpp
Normal file
@@ -0,0 +1,205 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
|
||||
#include <vsomeip/constants.hpp>
|
||||
#include <vsomeip/primitive_types.hpp>
|
||||
|
||||
namespace vsomeip_v3 {
|
||||
/**
|
||||
* \defgroup vsomeip
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
namespace trace {
|
||||
|
||||
/**
|
||||
* \brief Unique identifier for trace filters.
|
||||
*/
|
||||
typedef uint32_t filter_id_t;
|
||||
|
||||
/**
|
||||
* \brief Error value.
|
||||
*/
|
||||
extern const filter_id_t FILTER_ID_ERROR;
|
||||
|
||||
/**
|
||||
* \brief The default channel id "TC".
|
||||
*/
|
||||
extern const char* VSOMEIP_TC_DEFAULT_CHANNEL_ID;
|
||||
|
||||
/**
|
||||
* \brief Filters contain at least one match that specified
|
||||
* which messages are filtered.
|
||||
*/
|
||||
typedef std::tuple<service_t, instance_t, method_t> match_t;
|
||||
|
||||
/**
|
||||
* \brief Representation of a DLT trace channel.
|
||||
*
|
||||
* A trace channel contains one or more filters that specify the
|
||||
* messages that are forwarded to the trace.
|
||||
*/
|
||||
class channel {
|
||||
public:
|
||||
virtual ~channel() {};
|
||||
|
||||
/**
|
||||
* \brief Get the identifier of the channel.
|
||||
*
|
||||
* \return Channel identifier.
|
||||
*/
|
||||
virtual std::string get_id() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Get the name of the channel.
|
||||
*
|
||||
* \return Channel name.
|
||||
*/
|
||||
virtual std::string get_name() const = 0;
|
||||
|
||||
/**
|
||||
* \brief Add a filter to the channel.
|
||||
*
|
||||
* Add a simple filter containing a single match.
|
||||
*
|
||||
* Note: The match is allowed to contain wildcards
|
||||
* (ANY_INSTANCE, ANY_SERVICE, ANY_METHOD).
|
||||
*
|
||||
* \param _match The tuple specifying the matching messages.
|
||||
* \param _is_positive True for positive filters,
|
||||
* false for negative filters. Default value is true.
|
||||
*
|
||||
* \return Filter identifier of the added filter or
|
||||
* FILTER_ID_ERROR if adding failed.
|
||||
*/
|
||||
virtual filter_id_t add_filter(const match_t& _match, bool _is_positive = true) = 0;
|
||||
|
||||
/**
|
||||
* \brief Add a filter to the channel.
|
||||
*
|
||||
* Add a filter containing a list of matches to the
|
||||
* channel. The filter matches if at least on of the
|
||||
* matches corresponds to a message.
|
||||
*
|
||||
* Note: The matches are allowed to contain wildcards
|
||||
* (ANY_INSTANCE, ANY_SERVICE, ANY_METHOD).
|
||||
*
|
||||
* \param _matches List of tuples specifying the matching messages.
|
||||
* \param _is_positive True for positive filters,
|
||||
* false for negative filters. Default value is true.
|
||||
*
|
||||
* \return Filter identifier of the added filter or
|
||||
* FILTER_ID_ERROR if adding failed.
|
||||
*/
|
||||
virtual filter_id_t add_filter(const std::vector<match_t>& _matches, bool _is_positive = true) = 0;
|
||||
|
||||
/**
|
||||
* \brief Add a filter to the channel.
|
||||
*
|
||||
* Add a filter containing a matches range to the
|
||||
* channel. The filter matches if the message identifiers
|
||||
* lie within the range specified by from and to. Thus,
|
||||
* the messages service identifier is greater equal than
|
||||
* the service identifier specified in from and less equal
|
||||
* than the service identifier specified in to.
|
||||
*
|
||||
* Note: from and to must not contain wildcards
|
||||
* (ANY_INSTANCE, ANY_SERVICE, ANY_METHOD).
|
||||
*
|
||||
* \param _from Tuples specifying the matching message with
|
||||
* the smallest identifiers.
|
||||
* \param _from Tuples specifying the matching message with
|
||||
* the greatest identifiers.
|
||||
* \param _is_positive True for positive filters,
|
||||
* false for negative filters. Default value is true.
|
||||
*
|
||||
* \return Filter identifier of the added filter or
|
||||
* FILTER_ID_ERROR if adding failed.
|
||||
*/
|
||||
virtual filter_id_t add_filter(const match_t& _from, const match_t& _to, bool _is_positive = true) = 0;
|
||||
|
||||
/**
|
||||
* \brief Remove a filter from the channel.
|
||||
*
|
||||
* Remove the filter with the given filter identifier
|
||||
* from the channel.
|
||||
*
|
||||
* \param _id Filter identifier of the filter that shall
|
||||
* be removed.
|
||||
*/
|
||||
virtual void remove_filter(filter_id_t _id) = 0;
|
||||
};
|
||||
|
||||
/**
|
||||
* \brief Singleton class to connect to the DLT tracing.
|
||||
*
|
||||
* The main configuration class of the DLT tracing. It holds
|
||||
* the trace channels which determine the messages that are
|
||||
* forwarded to the trace.
|
||||
*/
|
||||
class connector {
|
||||
public:
|
||||
/**
|
||||
* \brief Get access to the connector.
|
||||
*
|
||||
* \return Shared pointer to the singleton object.
|
||||
*/
|
||||
static std::shared_ptr<connector> get();
|
||||
|
||||
virtual ~connector() {};
|
||||
|
||||
/**
|
||||
* \brief Add a trace channel to the connector.
|
||||
*
|
||||
* Creates a trace channel with the given identifier and name
|
||||
* and adds it to the connector.
|
||||
*
|
||||
* \param _id Id of the trace channel.
|
||||
* \param _name Name of the trace channel
|
||||
*
|
||||
* \return Shared pointer to the created trace channel or
|
||||
* nullptr if the trace channel could not be created because
|
||||
* another trace channel with the given identifier does
|
||||
* already exist.
|
||||
*/
|
||||
virtual std::shared_ptr<channel> add_channel(const std::string& _id, const std::string& _name) = 0;
|
||||
|
||||
/**
|
||||
* \brief Remove a trace channel from the connector.
|
||||
*
|
||||
* Removes the trace channel with the given identifier from
|
||||
* the connector.
|
||||
*
|
||||
* \param _id Identifier of a trace channel.
|
||||
*
|
||||
* \return True of the trace channel was removed, False if
|
||||
* it could not be removed, because it is the default trace
|
||||
* channel.
|
||||
*/
|
||||
virtual bool remove_channel(const std::string& _id) = 0;
|
||||
|
||||
/**
|
||||
* \brief Get a trace channel from the connector.
|
||||
*
|
||||
* \param _id Identifier of the trace channel to be returned.
|
||||
* Optional argument that is predefined with the identifier
|
||||
* of the default trace channel.
|
||||
*
|
||||
* \return Shared pointer to the created trace channel or
|
||||
* nullptr if the trace channel does not exist.
|
||||
*/
|
||||
virtual std::shared_ptr<channel> get_channel(const std::string& _id = VSOMEIP_TC_DEFAULT_CHANNEL_ID) const = 0;
|
||||
};
|
||||
|
||||
} // namespace trace
|
||||
|
||||
/** @} */
|
||||
|
||||
} // namespace vsomeip_v3
|
||||
20
install/vsomeip-3.7.3/include/vsomeip/vsomeip.hpp
Normal file
20
install/vsomeip-3.7.3/include/vsomeip/vsomeip.hpp
Normal file
@@ -0,0 +1,20 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* \brief The central vsomeip header. Include this to use vsomeip.
|
||||
*/
|
||||
|
||||
#include <vsomeip/constants.hpp>
|
||||
#include <vsomeip/defines.hpp>
|
||||
#include <vsomeip/application.hpp>
|
||||
#include <vsomeip/message.hpp>
|
||||
#include <vsomeip/payload.hpp>
|
||||
#include <vsomeip/runtime.hpp>
|
||||
#include <vsomeip/trace.hpp>
|
||||
|
||||
namespace vsomeip = vsomeip_v3;
|
||||
141
install/vsomeip-3.7.3/include/vsomeip/vsomeip_sec.h
Normal file
141
install/vsomeip-3.7.3/include/vsomeip/vsomeip_sec.h
Normal file
@@ -0,0 +1,141 @@
|
||||
// Copyright (C) 2014-2026 Bayerische Motoren Werke Aktiengesellschaft (BMW AG)
|
||||
// This Source Code Form is subject to the terms of the Mozilla Public
|
||||
// License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
|
||||
#ifndef VSOMEIP_V3_SECURITY_VSOMEIP_SEC_H_
|
||||
#define VSOMEIP_V3_SECURITY_VSOMEIP_SEC_H_
|
||||
|
||||
#define VSOMEIP_SEC_PORT_UNUSED 0
|
||||
#define VSOMEIP_SEC_PORT_UNSET 0xFFFF
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef uint16_t vsomeip_sec_service_id_t;
|
||||
typedef uint16_t vsomeip_sec_instance_id_t;
|
||||
typedef uint16_t vsomeip_sec_member_id_t; // SOME/IP method or event
|
||||
|
||||
typedef uint32_t vsomeip_sec_ip_addr_t; // ip address in network byte order
|
||||
typedef uint16_t vsomeip_sec_network_port_t; // network port in network byte order
|
||||
|
||||
#ifndef __unix__
|
||||
typedef uint32_t uid_t;
|
||||
typedef uint32_t gid_t;
|
||||
#endif
|
||||
|
||||
typedef struct {
|
||||
uid_t user;
|
||||
gid_t group;
|
||||
|
||||
vsomeip_sec_ip_addr_t host;
|
||||
vsomeip_sec_network_port_t port; // VSOMEIP_SEC_PORT_UNUSED --> UDS; ]0, VSOMEIP_SEC_PORT_UNSET] --> TCP
|
||||
} vsomeip_sec_client_t;
|
||||
|
||||
typedef enum { VSOMEIP_SEC_OK, VSOMEIP_SEC_PERM_DENIED } vsomeip_sec_acl_result_t;
|
||||
|
||||
typedef enum { VSOMEIP_SEC_POLICY_OK, VSOMEIP_SEC_POLICY_NOT_FOUND, VSOMEIP_SEC_POLICY_INVALID } vsomeip_sec_policy_result_t;
|
||||
|
||||
/**
|
||||
* Load the policy and initialize policy plugin functionality.
|
||||
* This function MUST be called before any other function in this library can be called.
|
||||
* It will return whether loading the policy was successful or if there was some problem
|
||||
* during initialization.
|
||||
*
|
||||
* Please note that the policy initializer does not take any additional arguments. It is assumed
|
||||
* here tha the policy plugin libraries have some out-of-bounds methods to, e.g., find the policy
|
||||
* file.
|
||||
*
|
||||
* The function may be called multiple times (even from multiple threads) without problems.
|
||||
*/
|
||||
vsomeip_sec_policy_result_t vsomeip_sec_policy_initialize();
|
||||
|
||||
/**
|
||||
* Authenticate connection with vSomeIP router.
|
||||
*
|
||||
* vSomeIP router (vsomeipd) has by definition unlimited access to other vSomeIP applications.
|
||||
* Therefore, EVERY connection with the router must be authenticated and then any command from/to
|
||||
* vsomeipd is implicitly allowed.
|
||||
*
|
||||
* This method MUST be called to ensure that the remote end is supposed to act as
|
||||
* vSomeIP routing manager.
|
||||
*
|
||||
*/
|
||||
vsomeip_sec_acl_result_t vsomeip_sec_policy_authenticate_router(const vsomeip_sec_client_t* router);
|
||||
|
||||
/*
|
||||
* ### RPC
|
||||
*/
|
||||
|
||||
/**
|
||||
* Check if a server is authorised to offer a specific service / instance
|
||||
*
|
||||
* vsomeip_sec_policy_is_client_allowed_to_offer checks if \p server is allowed to offer a \p
|
||||
* service by the security policy.
|
||||
*
|
||||
* This API MUST be called by vSomeIP clients before sending requests and before
|
||||
* processing responses. It and SHOULD be called at the router for every service offer before
|
||||
* distributing it among the clients.
|
||||
*
|
||||
* @note
|
||||
* Both, method calls and subscribe-notify communications are end-to-end
|
||||
* authenticated. Therefore, authentication of the server at the router side is optional but
|
||||
* recommended. Doing so would help to detect system missconfiguration and simplify
|
||||
* application debugging.
|
||||
*
|
||||
* @note
|
||||
* Due to asynchronous nature of SOME/IP method calls, to deliver a method response, server
|
||||
* establishes a separate socket which destination client must be authenticated. This method
|
||||
* does exactly that.
|
||||
*
|
||||
* @note
|
||||
* While client access may be restricted to certain methods or events, servers are always
|
||||
* allowed to offer.
|
||||
*/
|
||||
vsomeip_sec_acl_result_t vsomeip_sec_policy_is_client_allowed_to_offer(const vsomeip_sec_client_t* server, vsomeip_sec_service_id_t service,
|
||||
vsomeip_sec_instance_id_t instance);
|
||||
|
||||
/**
|
||||
* Check if client is allowed to request a service.
|
||||
*
|
||||
* This method MUST be called at the server/stub side before serving a client request. It may
|
||||
* additionally be used by vsomeipd when servicing service discovery so that clients that do not
|
||||
* have the permission to request a certain service cannot (even) successfully discover it.
|
||||
*
|
||||
*/
|
||||
vsomeip_sec_acl_result_t vsomeip_sec_policy_is_client_allowed_to_request(const vsomeip_sec_client_t* client,
|
||||
vsomeip_sec_service_id_t service,
|
||||
vsomeip_sec_instance_id_t instance);
|
||||
|
||||
/**
|
||||
* Check if client is allowed to access a specific SOME/IP method.
|
||||
*
|
||||
* SOME/IP does not really distinguish between methods and events. It just handles everything
|
||||
* via a uint16 member identifier. The identifiers below 0x7FFF are used for methods, identifier
|
||||
* starting at 0x8000 are used for events. So we just have one method to check if the client is
|
||||
* allowed to interact with a specific member.
|
||||
*
|
||||
* This method MUST be called at the server/stub side before processing a request that triggers
|
||||
* a specific method or completes event registration.
|
||||
*/
|
||||
vsomeip_sec_acl_result_t vsomeip_sec_policy_is_client_allowed_to_access_member(const vsomeip_sec_client_t* client,
|
||||
vsomeip_sec_service_id_t service,
|
||||
vsomeip_sec_instance_id_t instance,
|
||||
vsomeip_sec_member_id_t member);
|
||||
|
||||
/**
|
||||
* Provides user and group identifiers for a given host address / port combination.
|
||||
*
|
||||
* Note: For UDS (aka port=0), calling this function is a no-op.
|
||||
*/
|
||||
void vsomeip_sec_sync_client(vsomeip_sec_client_t* client);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif
|
||||
|
||||
#endif // VSOMEIP_V3_SECURITY_VSOMEIP_SEC_H_
|
||||
Reference in New Issue
Block a user