blob: b7ac7210c0f8c8a1b9a7330c488b9434e112e5be [file] [log] [blame]
Jamie Foxab30e712023-03-30 17:48:36 +01001/*
2 * Copyright (c) 2023, Arm Limited. All rights reserved.
3 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 *
6 */
7
8#ifndef __DPE_CMD_DECODE_H__
9#define __DPE_CMD_DECODE_H__
10
11#include <stddef.h>
12#include <stdint.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18/**
19 * \brief Call the DPE service with a CBOR-encoded DPE command.
20 *
21 * \param[in] client_id Identifier of the client calling the service.
22 * \param[in] cmd_input Pointer to buffer containing the input
23 * CBOR-encoded DPE command.
24 * \param[in] cmd_input_size Size of the input command, in bytes.
25 * \param[out] cmd_output Pointer to buffer to write the CBOR-encoded
26 * DPE command output.
27 * \param[in,out] cmd_output_size On input, size of the command output buffer
28 * in bytes. On successful return, size of the
29 * response written to the buffer.
30 *
31 * \note The cmd_input and cmd_output memory areas may overlap.
32 *
33 * \return Returns 0 if call succeeded and cmd_output contains a valid response
34 * and returns less than 0 otherwise.
35 */
36int32_t dpe_command_decode(int32_t client_id,
37 const char *cmd_input, size_t cmd_input_size,
38 char *cmd_output, size_t *cmd_output_size);
39
40#ifdef __cplusplus
41}
42#endif
43
44#endif /* __DPE_CMD_DECODE_H__ */