+/**
+ * Possible results of the vhost user message handling callbacks
+ */
+enum rte_vhost_msg_result {
+ /* Message handling failed */
+ RTE_VHOST_MSG_RESULT_ERR = -1,
+ /* Message handling successful */
+ RTE_VHOST_MSG_RESULT_OK = 0,
+ /* Message handling successful and reply prepared */
+ RTE_VHOST_MSG_RESULT_REPLY = 1,
+ /* Message not handled */
+ RTE_VHOST_MSG_RESULT_NOT_HANDLED,
+};
+
+/**
+ * Function prototype for the vhost backend to handle specific vhost user
+ * messages.
+ *
+ * @param vid
+ * vhost device id
+ * @param msg
+ * Message pointer.
+ * @return
+ * RTE_VHOST_MSG_RESULT_OK on success,
+ * RTE_VHOST_MSG_RESULT_REPLY on success with reply,
+ * RTE_VHOST_MSG_RESULT_ERR on failure,
+ * RTE_VHOST_MSG_RESULT_NOT_HANDLED if message was not handled.
+ */
+typedef enum rte_vhost_msg_result (*rte_vhost_msg_handle)(int vid, void *msg);
+
+/**
+ * Optional vhost user message handlers.
+ */
+struct rte_vhost_user_extern_ops {
+ /* Called prior to the master message handling. */
+ rte_vhost_msg_handle pre_msg_handle;
+ /* Called after the master message handling. */
+ rte_vhost_msg_handle post_msg_handle;
+};
+