include/rpc.h: add comments for public APIs

Change-Id: I0f8adc8a9045d9d1817483122a023d5dda04fb3b
Signed-off-by: Yanbo Zhou <yanbo.zhou@intel.com>
Reviewed-on: https://review.gerrithub.io/401966
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: GangCao <gang.cao@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Yanbo Zhou 2018-03-01 09:40:34 +08:00 committed by Jim Harris
parent da002ddb80
commit a3cb5fa598

View File

@ -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) \