diff options
author | Lutz Bichler <Lutz.Bichler@bmw.de> | 2020-11-30 09:44:44 +0100 |
---|---|---|
committer | Lutz Bichler <Lutz.Bichler@bmw.de> | 2020-11-30 09:44:44 +0100 |
commit | 710a8613ee5bd9eb490addecd7f2ee8049c4fd0c (patch) | |
tree | 49215269c551ac7eba482b3d9f6f084f56bf2fd3 /implementation/e2e_protection/include/e2e/profile/profile01 | |
parent | 46e6856a1a61f4b24e29c1f2d3ed0b4ee7da0ede (diff) | |
download | vSomeIP-710a8613ee5bd9eb490addecd7f2ee8049c4fd0c.tar.gz |
vsomeip 3.1.20.13.1.20.1
Diffstat (limited to 'implementation/e2e_protection/include/e2e/profile/profile01')
3 files changed, 25 insertions, 18 deletions
diff --git a/implementation/e2e_protection/include/e2e/profile/profile01/checker.hpp b/implementation/e2e_protection/include/e2e/profile/profile01/checker.hpp index 3010949..4184996 100644 --- a/implementation/e2e_protection/include/e2e/profile/profile01/checker.hpp +++ b/implementation/e2e_protection/include/e2e/profile/profile01/checker.hpp @@ -15,15 +15,15 @@ namespace profile01 { class profile_01_checker final : public e2e::profile_interface::checker { - public: +public: profile_01_checker(void) = delete; // [SWS_E2E_00389] initialize state explicit profile_01_checker(const profile_config &_config) : config_(_config) {} - virtual void check(const e2e_buffer &_buffer, - e2e::profile_interface::check_status_t &_generic_check_status) override final; + void check(const e2e_buffer &_buffer, instance_t _instance, + e2e::profile_interface::check_status_t &_generic_check_status) override final; private: profile_config config_; diff --git a/implementation/e2e_protection/include/e2e/profile/profile01/profile_01.hpp b/implementation/e2e_protection/include/e2e/profile/profile01/profile_01.hpp index c6cd5cf..54b2d5c 100644 --- a/implementation/e2e_protection/include/e2e/profile/profile01/profile_01.hpp +++ b/implementation/e2e_protection/include/e2e/profile/profile01/profile_01.hpp @@ -7,6 +7,9 @@ #define VSOMEIP_V3_E2E_PROFILE01_PROFILE01_HPP #include <cstdint> + +#include <vsomeip/defines.hpp> + #include "../../../buffer/buffer.hpp" namespace vsomeip_v3 { @@ -26,14 +29,6 @@ class profile_01 { enum class p01_data_id_mode : uint8_t {E2E_P01_DATAID_BOTH, E2E_P01_DATAID_ALT, E2E_P01_DATAID_LOW, E2E_P01_DATAID_NIBBLE}; struct profile_config { - // [SWS_E2E_00018] - uint16_t crc_offset_; - uint16_t data_id_; - p01_data_id_mode data_id_mode_; - uint16_t data_length_; - uint16_t counter_offset_; - uint16_t data_id_nibble_offset_; - profile_config() = delete; profile_config(uint16_t _crc_offset, uint16_t _data_id, @@ -43,10 +38,22 @@ struct profile_config { : crc_offset_(_crc_offset), data_id_(_data_id), data_id_mode_(_data_id_mode), data_length_(_data_length), counter_offset_(_counter_offset), - data_id_nibble_offset_(_data_id_nibble_offset) { + data_id_nibble_offset_(_data_id_nibble_offset), + base_(VSOMEIP_FULL_HEADER_SIZE) { } profile_config(const profile_config &_config) = default; profile_config &operator=(const profile_config &_config) = default; + + // [SWS_E2E_00018] + uint16_t crc_offset_; + uint16_t data_id_; + p01_data_id_mode data_id_mode_; + uint16_t data_length_; + uint16_t counter_offset_; + uint16_t data_id_nibble_offset_; + + // SOME/IP base + size_t base_; }; } // namespace profile01 diff --git a/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp b/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp index fe8b603..13bd524 100644 --- a/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp +++ b/implementation/e2e_protection/include/e2e/profile/profile01/protector.hpp @@ -7,6 +7,7 @@ #define VSOMEIP_V3_E2E_PROFILE01_PROTECTOR_HPP #include <mutex> + #include "../profile01/profile_01.hpp" #include "../profile_interface/protector.hpp" @@ -15,14 +16,14 @@ namespace e2e { namespace profile01 { class protector final : public e2e::profile_interface::protector { - public: +public: protector(void) = delete; - explicit protector(const profile_config &_config) : config_(_config), counter_(0){}; + explicit protector(const profile_config &_config) : config_(_config), counter_(0) {}; - void protect(e2e_buffer &_buffer) override final; + void protect(e2e_buffer &_buffer, instance_t _instance) override final; - private: +private: void write_counter(e2e_buffer &_buffer); @@ -32,8 +33,7 @@ class protector final : public e2e::profile_interface::protector { void increment_counter(void); - - private: +private: profile_config config_; uint8_t counter_; std::mutex protect_mutex_; |