MOS Source Code
|
Go to the source code of this file.
Classes | |
struct | rpc_result_t |
Macros | |
#define | rpc_pb_call(stub, funcid, reqt, req, respt, resp) |
Typedefs | |
typedef struct rpc_server_stub | rpc_server_stub_t |
typedef struct rpc_call | rpc_call_t |
Functions | |
MOSAPI rpc_server_stub_t * | rpc_client_create (const char *server_name) |
Create a new RPC client stub for the given server. | |
MOSAPI void | rpc_client_destroy (rpc_server_stub_t *server) |
Destroy a server stub. | |
MOSAPI rpc_result_code_t | rpc_simple_call (rpc_server_stub_t *stub, u32 funcid, rpc_result_t *result, const char *argspec,...) |
Call a function on the server. | |
MOSAPI rpc_result_code_t | rpc_simple_callv (rpc_server_stub_t *stub, u32 funcid, rpc_result_t *result, const char *argspec, va_list args) |
Call a function on the server. | |
MOSAPI rpc_call_t * | rpc_call_create (rpc_server_stub_t *server, u32 function_id) |
Manually create a new RPC call. | |
MOSAPI void | rpc_call_arg (rpc_call_t *call, rpc_argtype_t argtype, const void *data, size_t size) |
Add an argument to a call. | |
MOSAPI void | rpc_call_arg_u8 (rpc_call_t *call, u8 arg) |
MOSAPI void | rpc_call_arg_u16 (rpc_call_t *call, u16 arg) |
MOSAPI void | rpc_call_arg_u32 (rpc_call_t *call, u32 arg) |
MOSAPI void | rpc_call_arg_u64 (rpc_call_t *call, u64 arg) |
MOSAPI void | rpc_call_arg_s8 (rpc_call_t *call, s8 arg) |
MOSAPI void | rpc_call_arg_s16 (rpc_call_t *call, s16 arg) |
MOSAPI void | rpc_call_arg_s32 (rpc_call_t *call, s32 arg) |
MOSAPI void | rpc_call_arg_s64 (rpc_call_t *call, s64 arg) |
MOSAPI void | rpc_call_arg_string (rpc_call_t *call, const char *arg) |
MOSAPI rpc_result_code_t | rpc_call_exec (rpc_call_t *call, void **result_data, size_t *result_size) |
Execute a call. | |
MOSAPI void | rpc_call_destroy (rpc_call_t *call) |
Destroy a call. | |
MOSAPI rpc_result_code_t | rpc_do_pb_call (rpc_server_stub_t *stub, u32 funcid, const pb_msgdesc_t *reqm, const void *req, const pb_msgdesc_t *respm, void *resp) |
Call a function on the server using protobuf (nanopb) | |
#define rpc_pb_call | ( | stub, | |
funcid, | |||
reqt, | |||
req, | |||
respt, | |||
resp ) |
Definition at line 125 of file rpc_client.h.
typedef struct rpc_server_stub rpc_server_stub_t |
Definition at line 10 of file rpc_client.h.
typedef struct rpc_call rpc_call_t |
Definition at line 11 of file rpc_client.h.
MOSAPI rpc_server_stub_t * rpc_client_create | ( | const char * | server_name | ) |
Create a new RPC client stub for the given server.
server_name | The name of the server to connect to |
Definition at line 65 of file rpc_client.c.
Referenced by userfs_ensure_connected().
MOSAPI void rpc_client_destroy | ( | rpc_server_stub_t * | server | ) |
Destroy a server stub.
server | The server stub to destroy |
Definition at line 81 of file rpc_client.c.
MOSAPI rpc_result_code_t rpc_simple_call | ( | rpc_server_stub_t * | stub, |
u32 | funcid, | ||
rpc_result_t * | result, | ||
const char * | argspec, | ||
... ) |
Call a function on the server.
stub | The server stub to call |
funcid | The function ID to call |
result | A pointer to a result structure, or NULL if no result is expected |
argspec | An argument specification string, see spec.md for details |
... | The arguments to the function |
Definition at line 222 of file rpc_client.c.
MOSAPI rpc_result_code_t rpc_simple_callv | ( | rpc_server_stub_t * | stub, |
u32 | funcid, | ||
rpc_result_t * | result, | ||
const char * | argspec, | ||
va_list | args ) |
Call a function on the server.
stub | The server stub to call |
funcid | The function ID to call |
result | A pointer to a result structure, or NULL if no result is expected |
argspec | An argument specification string, see spec.md for details |
args | The arguments to the function |
Definition at line 231 of file rpc_client.c.
Referenced by rpc_simple_call().
MOSAPI rpc_call_t * rpc_call_create | ( | rpc_server_stub_t * | server, |
u32 | function_id ) |
Manually create a new RPC call.
server | The server stub to call |
function_id | The function ID to call |
Definition at line 88 of file rpc_client.c.
Referenced by rpc_do_pb_call(), and rpc_simple_callv().
MOSAPI void rpc_call_arg | ( | rpc_call_t * | call, |
rpc_argtype_t | argtype, | ||
const void * | data, | ||
size_t | size ) |
Add an argument to a call.
call | The call to add the argument to |
argtype | The type of the argument |
data | A pointer to the argument data |
size | The size of the argument data |
Definition at line 110 of file rpc_client.c.
Referenced by rpc_call_arg_string(), rpc_do_pb_call(), and rpc_simple_callv().
MOSAPI void rpc_call_arg_u8 | ( | rpc_call_t * | call, |
u8 | arg ) |
Definition at line 132 of file rpc_client.c.
MOSAPI void rpc_call_arg_u16 | ( | rpc_call_t * | call, |
u16 | arg ) |
MOSAPI void rpc_call_arg_u32 | ( | rpc_call_t * | call, |
u32 | arg ) |
Definition at line 133 of file rpc_client.c.
MOSAPI void rpc_call_arg_u64 | ( | rpc_call_t * | call, |
u64 | arg ) |
Definition at line 134 of file rpc_client.c.
MOSAPI void rpc_call_arg_s8 | ( | rpc_call_t * | call, |
s8 | arg ) |
Definition at line 135 of file rpc_client.c.
MOSAPI void rpc_call_arg_s16 | ( | rpc_call_t * | call, |
s16 | arg ) |
MOSAPI void rpc_call_arg_s32 | ( | rpc_call_t * | call, |
s32 | arg ) |
Definition at line 136 of file rpc_client.c.
MOSAPI void rpc_call_arg_s64 | ( | rpc_call_t * | call, |
s64 | arg ) |
Definition at line 137 of file rpc_client.c.
MOSAPI void rpc_call_arg_string | ( | rpc_call_t * | call, |
const char * | arg ) |
MOSAPI rpc_result_code_t rpc_call_exec | ( | rpc_call_t * | call, |
void ** | result_data, | ||
size_t * | result_size ) |
Execute a call.
call | The call to execute |
result_data | A pointer to a pointer to the result data, or NULL if no result is expected |
result_size | A pointer to the size of the result data, or NULL if no result is expected |
Definition at line 144 of file rpc_client.c.
Referenced by rpc_do_pb_call(), and rpc_simple_callv().
MOSAPI void rpc_call_destroy | ( | rpc_call_t * | call | ) |
Destroy a call.
call | The call to destroy |
Definition at line 103 of file rpc_client.c.
Referenced by rpc_do_pb_call(), and rpc_simple_callv().
MOSAPI rpc_result_code_t rpc_do_pb_call | ( | rpc_server_stub_t * | stub, |
u32 | funcid, | ||
const pb_msgdesc_t * | reqm, | ||
const void * | req, | ||
const pb_msgdesc_t * | respm, | ||
void * | resp ) |
Call a function on the server using protobuf (nanopb)
stub | The server stub to call |
funcid | The function ID to call |
reqm | The protobuf message descriptor for the request |
req | The request message |
respm | The protobuf message descriptor for the response |
resp | The response message |
Definition at line 298 of file rpc_client.c.