Helium
|
Creation, destruction, registration, and execution for a plugin chain. More...
#include "he_internal.h"
Go to the source code of this file.
Functions | |
he_plugin_chain_t * | he_plugin_create_chain (void) |
Creates a Helium plugin chain. More... | |
void | he_plugin_destroy_chain (he_plugin_chain_t *chain) |
Releases all memory allocated by Helium for this plugin chain. More... | |
he_return_code_t | he_plugin_register_plugin (he_plugin_chain_t *chain, plugin_struct_t *plugin) |
Register the plugin to the plugin chain. More... | |
he_return_code_t | he_plugin_ingress (he_plugin_chain_t *chain, uint8_t *packet, size_t *length, size_t capacity) |
Execute the ingress function of each registered plugin. More... | |
he_return_code_t | he_plugin_egress (he_plugin_chain_t *chain, uint8_t *packet, size_t *length, size_t capacity) |
Execute the egress function of each registered plugin. More... | |
Creation, destruction, registration, and execution for a plugin chain.
he_plugin_chain_t* he_plugin_create_chain | ( | void | ) |
Creates a Helium plugin chain.
This function must be called to create the initial plugin chain for use with other functions
void he_plugin_destroy_chain | ( | he_plugin_chain_t * | chain | ) |
Releases all memory allocated by Helium for this plugin chain.
chain | A pointer to a valid plugin chain |
plugin
objects registered to the plugin chain. he_return_code_t he_plugin_egress | ( | he_plugin_chain_t * | chain, |
uint8_t * | packet, | ||
size_t * | length, | ||
size_t | capacity | ||
) |
Execute the egress function of each registered plugin.
chain | A pointer to a valid plugin chain |
packet | A pointer to the packet data |
length | A pointer to the length of the packet data. If the packet size changed after processed by this function, the length will be set to the new length of the packet data. |
capacity | The length of the underlying buffer for packet |
he_return_code_t he_plugin_ingress | ( | he_plugin_chain_t * | chain, |
uint8_t * | packet, | ||
size_t * | length, | ||
size_t | capacity | ||
) |
Execute the ingress function of each registered plugin.
chain | A pointer to a valid plugin chain |
packet | A pointer to the packet data |
length | A pointer to the length of the packet data. If the packet size changed after processed by this function, the length will be set to the new length of the packet data. |
capacity | The length of the underlying buffer for packet |
he_return_code_t he_plugin_register_plugin | ( | he_plugin_chain_t * | chain, |
plugin_struct_t * | plugin | ||
) |
Register the plugin to the plugin chain.
chain | A pointer to a valid plugin chain |
plugin | A pointer to the initialised plugin struct |
plugin
object after use.