blob: 466ba78d3f2edb39975104c3635fcd28a86c3e67 [file] [log] [blame]
Imre Kis6d36f5c2023-10-17 18:32:16 +02001/*
2 * Copyright (c) 2023, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
7#ifndef RPMB_CLIENT_H_
8#define RPMB_CLIENT_H_
9
10#include "components/service/rpmb/backend/rpmb_backend.h"
11#include "components/rpc/common/caller/rpc_caller_session.h"
12
13#ifdef __cplusplus
14extern "C" {
15#endif
16
17/**
18 * \brief RPMB client
19 *
20 * The RPMB client provides and RPMB backend via accessing a remove backend through RPC.
21 */
22struct rpmb_client {
23 struct rpmb_backend backend;
24 struct rpc_caller_session *session;
25};
26
27/**
28 * \brief Initialize RPMB client
29 *
30 * \param context[in] RPMB client context
31 * \param session[in] RPC caller session
32 * \return struct rpmb_backend* RPMB backend or NULL on error
33 */
34struct rpmb_backend *rpmb_client_init(struct rpmb_client *context,
35 struct rpc_caller_session *session);
36
37/**
38 * \brief Deinitialize RPMB client
39 *
40 * \param context[in] RPMB client context
41 */
42void rpmb_client_deinit(struct rpmb_client *context);
43
44#ifdef __cplusplus
45}
46#endif
47
48#endif /* RPMB_CLIENT_H_ */