1 // Copyright (C) 2014-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_ENDPOINT_HOST_HPP_ 7 #define VSOMEIP_V3_ENDPOINT_HOST_HPP_ 8 9 #include <memory> 10 11 #include <boost/asio/ip/address.hpp> 12 13 #include <vsomeip/primitive_types.hpp> 14 15 #ifdef ANDROID 16 #include "../../configuration/include/internal_android.hpp" 17 #else 18 #include "../../configuration/include/internal.hpp" 19 #endif 20 21 namespace vsomeip_v3 { 22 23 class configuration; 24 class endpoint; 25 26 class endpoint_host { 27 public: 28 virtual ~endpoint_host() = default; 29 30 virtual void on_connect(std::shared_ptr<endpoint> _endpoint) = 0; 31 virtual void on_disconnect(std::shared_ptr<endpoint> _endpoint) = 0; 32 virtual bool on_bind_error(std::shared_ptr<endpoint> _endpoint, uint16_t _remote_port) = 0; 33 virtual void on_error(const byte_t *_data, length_t _length, 34 endpoint* const _receiver, 35 const boost::asio::ip::address &_remote_address, 36 std::uint16_t _remote_port) = 0; 37 virtual void release_port(uint16_t _port, bool _reliable) = 0; 38 virtual client_t get_client() const = 0; 39 }; 40 41 } // namespace vsomeip_v3 42 43 #endif // VSOMEIP_V3_ENDPOINT_HOST_HPP_ 44