![]() |
dfx 0.1.0
Linux-based dynamic dataflow executor
|
Host-provided API for interrogating message handles. More...
#include <dfx-plugins-interface/PluginInterface.h>
Public Attributes | |
| dfx_message_handle_t | handle |
| The borrowed handle to the message being interrogated. | |
| dfx_port_kind_t(* | get_kind )(dfx_message_handle_t handle) |
| Query the kind of the message. | |
| int(* | get_uuid )(dfx_message_handle_t handle, uint8_t out_uuid[16]) |
| Gets the unique identifier (UUID) of the message. | |
| int(* | get_parent_uuid )(dfx_message_handle_t handle, uint8_t out_uuid[16]) |
| Gets the UUID of the message's parent (for lineage tracking). | |
| size_t(* | get_mime_type )(dfx_message_handle_t handle, char *out_buf, size_t buf_size) |
| Copies the MIME type string into a plugin-provided buffer. | |
| int(* | get_timestamp )(dfx_message_handle_t handle, struct timespec *tp) |
| Gets the wall-clock timestamp of when the message was created. | |
| size_t(* | get_path_count )(dfx_message_handle_t handle) |
| Get the number of endpoints this message has traversed. | |
| size_t(* | get_path_step )(dfx_message_handle_t handle, size_t index, char *out_buf, size_t buf_size) |
| Copies a specific step in the message's traversal path. | |
| int(* | get_data )(dfx_message_handle_t handle, uint8_t const **out_data, size_t *out_size) |
| Provides a direct view into the raw data payload. | |
| size_t(* | get_ctrl_cmd )(dfx_message_handle_t handle, char *out_buf, size_t buf_size) |
| Copies the dfx::Core::ControlMessage command string. | |
| size_t(* | get_ctrl_params )(dfx_message_handle_t handle, char *out_buf, size_t buf_size) |
| Provides a direct view into the dfx::Core::ControlMessage parameters (JSON). | |
| int(* | get_ctrl_version )(dfx_message_handle_t handle) |
| Provides the version used for this dfx::Core::ControlMessage. | |
Host-provided API for interrogating message handles.
This structure is provided to the plugin during the on_message callback. It allows the plugin to inspect message metadata and payloads.
| size_t(* dfx_message_api_t::get_ctrl_cmd) (dfx_message_handle_t handle, char *out_buf, size_t buf_size) |
Copies the dfx::Core::ControlMessage command string.
If out_buf is NULL or buf_size is 0 then no data is copied and the length of the command string is still returned.
| [in] | handle | The handle provided in this struct. |
| [out] | out_buf | Buffer to receive the command. |
| [in] | buf_size | Size of the supplied buffer. |
errno is set to:handle is NULL.handle is not a DFX_KIND_CONTROL. | size_t(* dfx_message_api_t::get_ctrl_params) (dfx_message_handle_t handle, char *out_buf, size_t buf_size) |
Provides a direct view into the dfx::Core::ControlMessage parameters (JSON).
If out_buf is NULL or buf_size is 0 then no data is copied and the length of the parameters string is still returned.
| [in] | handle | The handle provided in this struct. |
| [out] | out_buf | Buffer to receive the parameters. |
| [in] | buf_size | Size of the supplied buffer. |
errno is set to:handle is NULL.handle is not a DFX_KIND_CONTROL. | int(* dfx_message_api_t::get_ctrl_version) (dfx_message_handle_t handle) |
Provides the version used for this dfx::Core::ControlMessage.
| [in] | handle | The handle provided in this struct. |
errno is set to:handle is NULL.handle is not a DFX_KIND_CONTROL. | int(* dfx_message_api_t::get_data) (dfx_message_handle_t handle, uint8_t const **out_data, size_t *out_size) |
Provides a direct view into the raw data payload.
| [in] | handle | The handle provided in this struct. |
| [out] | out_data | Pointer to the internal host memory. |
| [out] | out_size | The size of the payload in bytes. |
errno is set to:handle, out_data, or out_size is NULL.handle is not a DFX_KIND_DATA.| dfx_port_kind_t(* dfx_message_api_t::get_kind) (dfx_message_handle_t handle) |
Query the kind of the message.
| [in] | handle | The handle provided in this struct. |
errno is set to:handle is NULL. | size_t(* dfx_message_api_t::get_mime_type) (dfx_message_handle_t handle, char *out_buf, size_t buf_size) |
Copies the MIME type string into a plugin-provided buffer.
If out_buf is NULL or buf_size is 0 then no data is copied and the length of the mime_type is still returned.
| [in] | handle | The handle provided in this struct. |
| [out] | out_buf | Buffer to receive the string. If NULL, only the size is returned. |
| [in] | buf_size | Size of the destination buffer. |
errno is set to:handle is NULL. | int(* dfx_message_api_t::get_parent_uuid) (dfx_message_handle_t handle, uint8_t out_uuid[16]) |
| size_t(* dfx_message_api_t::get_path_count) (dfx_message_handle_t handle) |
Get the number of endpoints this message has traversed.
| [in] | handle | The handle provided in this struct. |
errno is set to:handle is NULL. | size_t(* dfx_message_api_t::get_path_step) (dfx_message_handle_t handle, size_t index, char *out_buf, size_t buf_size) |
Copies a specific step in the message's traversal path.
If out_buf is NULL or buf_size is 0 then no data is copied and the length of the path is still returned.
| [in] | handle | The handle provided in this struct. |
| [in] | index | The step index (0 to count-1). |
| [out] | out_buf | Buffer to receive the "node.port" string. |
| [in] | buf_size | Size of the supplied buffer. |
errno is set to:handle is NULL.index is out of bounds. | int(* dfx_message_api_t::get_timestamp) (dfx_message_handle_t handle, struct timespec *tp) |
| int(* dfx_message_api_t::get_uuid) (dfx_message_handle_t handle, uint8_t out_uuid[16]) |
| dfx_message_handle_t dfx_message_api_t::handle |
The borrowed handle to the message being interrogated.