Haka
|
#include <include/haka/packet_module.h>
Data Fields | |
struct module | module |
bool(* | multi_threaded )() |
bool(* | pass_through )() |
bool(* | is_realtime )() |
struct packet_module_state *(* | init_state )(int thread_id) |
void(* | cleanup_state )(struct packet_module_state *state) |
int(* | receive )(struct packet_module_state *state, struct packet **pkt) |
void(* | verdict )(struct packet *pkt, filter_result result) |
uint64(* | get_id )(struct packet *pkt) |
const char *(* | get_dissector )(struct packet *pkt) |
void(* | release_packet )(struct packet *pkt) |
enum packet_status(* | packet_getstate )(struct packet *pkt) |
struct packet *(* | new_packet )(struct packet_module_state *state, size_t size) |
bool(* | send_packet )(struct packet *pkt) |
size_t(* | get_mtu )(struct packet *pkt) |
const struct time *(* | get_timestamp )(struct packet *pkt) |
Opaque state structure. Packet module used to interact with the low-level packets. The module will be used to receive packets and set a verdict on them. It also define an interface to access the packet fields.
void(* packet_module::cleanup_state) (struct packet_module_state *state) |
Cleanup the packet module state.
const char*(* packet_module::get_dissector) (struct packet *pkt) |
Get the packet dissector.
size_t(* packet_module::get_mtu) (struct packet *pkt) |
Get the mtu for a packet.
struct packet_module_state*(* packet_module::init_state) (int thread_id) |
Initialize the packet module state. This function will be called to create multiple states if the module supports multi-threading.
bool(* packet_module::is_realtime) () |
Check if the module is realtime or not.
struct module packet_module::module |
Module structure.
bool(* packet_module::multi_threaded) () |
Get if the module support multi-threading.
struct packet*(* packet_module::new_packet) (struct packet_module_state *state, size_t size) |
Create a new packet.
enum packet_status(* packet_module::packet_getstate) (struct packet *pkt) |
Get packet status.
bool(* packet_module::pass_through) () |
Get the capture mode.
int(* packet_module::receive) (struct packet_module_state *state, struct packet **pkt) |
Callback used to receive a new packet. This function should block until a packet is received.
void(* packet_module::release_packet) (struct packet *pkt) |
Release the packet and free its memory.
Send a forged packet. This packet will be received again by Haka as a regular packet on the network.
void(* packet_module::verdict) (struct packet *pkt, filter_result result) |
Apply a verdict on a received packet. The module should then apply this verdict on the underlying packet.
pkt | The received packet. After calling this function the packet address is never used again by the application but allow the module to free it if needed. |
result | The verdict to apply to this packet. |