From a3cb5fa5985d3fa979bf473cee377b9832ee31ff Mon Sep 17 00:00:00 2001 From: Yanbo Zhou Date: Thu, 1 Mar 2018 09:40:34 +0800 Subject: [PATCH] include/rpc.h: add comments for public APIs Change-Id: I0f8adc8a9045d9d1817483122a023d5dda04fb3b Signed-off-by: Yanbo Zhou Reviewed-on: https://review.gerrithub.io/401966 Tested-by: SPDK Automated Test System Reviewed-by: GangCao Reviewed-by: Changpeng Liu Reviewed-by: Jim Harris --- include/spdk/rpc.h | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/include/spdk/rpc.h b/include/spdk/rpc.h index 1ef3066c1..4516590d6 100644 --- a/include/spdk/rpc.h +++ b/include/spdk/rpc.h @@ -42,13 +42,40 @@ extern "C" { #endif +/** + * Listen on the required address. + * + * \param listen_addr Listening address. + * + * \return 0 on success, -1 on failure. + */ int spdk_rpc_listen(const char *listen_addr); + +/** + * Poll the RPC server for accepting the request. + */ void spdk_rpc_accept(void); + +/** + * Close the RPC server. + */ void spdk_rpc_close(void); +/** + * Function to handle the RPC request. + * + * \param request RPC request to handle. + * \param params Parameters associated with the RPC request. + */ typedef void (*spdk_rpc_method_handler)(struct spdk_jsonrpc_request *request, const struct spdk_json_val *params); +/** + * Register the RPC method. + * + * \param method Name for the registered method. + * \param func Function registered for this method to handle the RPC request. + */ void spdk_rpc_register_method(const char *method, spdk_rpc_method_handler func); #define SPDK_RPC_REGISTER(method, func) \