summaryrefslogtreecommitdiff
path: root/implementation/endpoints/include/credentials.hpp
blob: bb4ee448f2a46f891b132cd9cb28a099448bd82c (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
// Copyright (C) 2014-2021 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_ENDPOINTS_INCLUDE_CREDENTIALS_HPP_
#define VSOMEIP_V3_ENDPOINTS_INCLUDE_CREDENTIALS_HPP_

#include <tuple>

#include <boost/optional.hpp>

#include <vsomeip/primitive_types.hpp>

namespace vsomeip_v3 {

class credentials {
public:
    static void activate_credentials(const int _fd);

    static void deactivate_credentials(const int _fd);

    using received_t = std::tuple<client_t, uid_t, gid_t, std::string>;
    static boost::optional<received_t> receive_credentials(const int _fd);

    static void send_credentials(const int _fd, client_t _client, std::string _client_host);
};

} // namespace vsomeip_v3

#endif // VSOMEIP_V3_ENDPOINTS_INCLUDE_CREDENTIALS_HPP_