summaryrefslogtreecommitdiff
path: root/implementation/configuration/include/routing.hpp
blob: 4ffc3b9b5ded4f171267a6f87b24211f609dcfb4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
// Copyright (C) 2022 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_CFG_ROUTING_HPP_
#define VSOMEIP_V3_CFG_ROUTING_HPP_

#include <boost/asio/ip/address.hpp>

#include <vsomeip/internal/logger.hpp>
#include <vsomeip/primitive_types.hpp>

#ifdef ANDROID
#include "internal_android.hpp"
#else
#include "internal.hpp"
#endif

namespace vsomeip_v3 {
namespace cfg {

struct routing_host_t {
    std::string name_;
    boost::asio::ip::address unicast_;
    port_t port_;

    routing_host_t() : port_(VSOMEIP_ROUTING_HOST_PORT_DEFAULT) {}

    routing_host_t &operator=(const routing_host_t &_other) {
        name_ = _other.name_;
        unicast_ = _other.unicast_;
        port_ = _other.port_;

        return (*this);
    }
};

struct routing_guests_t {
    boost::asio::ip::address unicast_;
    std::set<std::pair<port_t, port_t> > ports_;

    routing_guests_t &operator=(const routing_guests_t &_other) {
        unicast_ = _other.unicast_;
        ports_ = _other.ports_;

        return (*this);
    }
};

struct routing_t {
	bool is_enabled_;

    routing_host_t host_;
    routing_guests_t guests_;

    routing_t() : is_enabled_(true) {}

    routing_t &operator=(const routing_t &_other) {
    	is_enabled_ = _other.is_enabled_;
        host_ = _other.host_;
        guests_ = _other.guests_;

        return (*this);
    }
};

} // namespace cfg
} // namespace vsomeip_v3

#endif // VSOMEIP_V3_CFG_ROUTING_HPP_