aboutsummaryrefslogtreecommitdiff
path: root/components/rpc/direct/direct_caller.h
blob: 0f51845e1e15732cb83abf4626f20860c2bbbf89 (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
/*
 * Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#ifndef DIRECT_CALLER_H
#define DIRECT_CALLER_H

#include <rpc_caller.h>
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>

#ifdef __cplusplus
extern "C" {
#endif

struct call_ep;

/** An rpc_caller that calls methods associated with a specific endpoint
 *  directly.  Used when the caller and endpoint are running in the same
 *  execution context.
 **/
struct direct_caller
{
    struct rpc_caller rpc_caller;
    struct call_ep *call_ep;
    uint32_t caller_id;
    bool is_call_transaction_in_progess;
    size_t req_len;
    size_t req_buf_size;
    size_t resp_buf_size;
    uint8_t *req_buf;
    uint8_t *resp_buf;
};

struct rpc_caller *direct_caller_init(struct direct_caller *s, struct call_ep *ep,
                        size_t req_buf_size, size_t resp_buf_size);

struct rpc_caller *direct_caller_init_default(struct direct_caller *s, struct call_ep *ep);

void direct_caller_deinit(struct direct_caller *s);

#ifdef __cplusplus
}
#endif

#endif /* DIRECT_CALLER_H */