Gabor Ambrus | 7ccab79 | 2023-08-14 22:56:56 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: BSD-3-Clause */ |
| 2 | /* |
| 3 | * Copyright (c) 2023, Arm Limited and Contributors. All rights reserved. |
| 4 | */ |
| 5 | |
| 6 | #ifndef LOG_CLIENT_H |
| 7 | #define LOG_CLIENT_H |
| 8 | |
| 9 | #include <service/common/client/service_client.h> |
| 10 | #include <stdbool.h> |
| 11 | |
| 12 | #include "components/service/log/backend/log_backend.h" |
| 13 | #include "components/service/log/common/log_status.h" |
| 14 | |
| 15 | #ifdef __cplusplus |
| 16 | extern "C" { |
| 17 | #endif |
| 18 | |
| 19 | /** |
| 20 | * @brief Log client instance |
| 21 | */ |
| 22 | struct log_client { |
| 23 | struct log_backend backend; |
| 24 | struct service_client client; |
| 25 | }; |
| 26 | |
| 27 | /** |
| 28 | * @brief Initialize a log client |
| 29 | * |
| 30 | * A log client is a log backend that makes RPC calls |
| 31 | * to a remote log provider. |
| 32 | * |
| 33 | * @param[in] context Instance data |
| 34 | * @param[in] rpc_caller RPC caller instance |
| 35 | * |
| 36 | * |
| 37 | * @return Pointer to inialized log backend or NULL on failure |
| 38 | */ |
| 39 | struct log_backend *log_client_init(struct log_client *context, struct rpc_caller_session *session); |
| 40 | |
| 41 | /** |
| 42 | * @brief Deinitialize a log client |
| 43 | * |
| 44 | * @param[in] context Instance data |
| 45 | */ |
| 46 | void log_client_deinit(struct log_client *context); |
| 47 | |
| 48 | #ifdef __cplusplus |
| 49 | } |
| 50 | #endif |
| 51 | |
| 52 | #endif /* LOG_CLIENT_H */ |