void spdk_rpc_register_method(const char *method, spdk_rpc_method_handler func,
uint32_t state_mask);
+/**
+ * Register a deprecated alias for an RPC method.
+ *
+ * \param method Name for the registered method.
+ * \param alias Alias for the registered method.
+ */
+void spdk_rpc_register_alias_deprecated(const char *method, const char *alias);
+
+/**
+ * Check if \c method is allowed for \c state_mask
+ *
+ * \param method Method name
+ * \param state_mask state mask to check against
+ * \return 0 if method is allowed or negative error code:
+ * -EPERM method is not allowed
+ * -ENOENT method not found
+ */
+int spdk_rpc_is_method_allowed(const char *method, uint32_t state_mask);
+
#define SPDK_RPC_STARTUP 0x1
#define SPDK_RPC_RUNTIME 0x2
spdk_rpc_register_method(method, func, state_mask); \
}
+#define SPDK_RPC_REGISTER_ALIAS_DEPRECATED(method, alias) \
+static void __attribute__((constructor)) rpc_register_##alias(void) \
+{ \
+ spdk_rpc_register_alias_deprecated(#method, #alias); \
+}
+
/**
* Set the state mask of the RPC server. Any RPC method whose state mask is
* equal to the state of the RPC server is allowed.
*/
void spdk_rpc_set_state(uint32_t state_mask);
+/**
+ * Get the current state of the RPC server.
+ *
+ * \return The current state of the RPC server.
+ */
+uint32_t spdk_rpc_get_state(void);
#ifdef __cplusplus
}