1 // Copyright (C) 2016-2017 Bayerische Motoren Werke Aktiengesellschaft (BMW AG) 2 // This Source Code Form is subject to the terms of the Mozilla Public 3 // License, v. 2.0. If a copy of the MPL was not distributed with this 4 // file, You can obtain one at http://mozilla.org/MPL/2.0/. 5 6 #ifndef VSOMEIP_V3_TRACE_HEADER_HPP_ 7 #define VSOMEIP_V3_TRACE_HEADER_HPP_ 8 9 #include <memory> 10 11 #include <vsomeip/primitive_types.hpp> 12 13 #include <boost/asio/ip/address_v4.hpp> 14 15 #define VSOMEIP_TRACE_HEADER_SIZE 10 16 17 namespace vsomeip_v3 { 18 19 class endpoint; 20 21 namespace trace { 22 23 enum class protocol_e : uint8_t { 24 local = 0x0, 25 udp = 0x1, 26 tcp = 0x2, 27 unknown = 0xFF 28 }; 29 30 struct header { 31 bool prepare(const std::shared_ptr<endpoint> &_endpoint, bool _is_sending, 32 instance_t _instance); 33 bool prepare(const endpoint* _endpoint, bool _is_sending, 34 instance_t _instance); 35 void prepare(const boost::asio::ip::address_v4 &_address, 36 std::uint16_t _port, protocol_e _protocol, bool _is_sending, 37 instance_t _instance); 38 39 byte_t data_[VSOMEIP_TRACE_HEADER_SIZE]; 40 }; 41 42 } // namespace trace 43 } // namespace vsomeip_v3 44 45 #endif // VSOMEIP_V3_TRACE_HEADER_HPP_ 46