Go to the source code of this file.
Functions | |
void * | sfeventq_event_alloc (void) |
void | sfeventq_reset (void) |
int | sfeventq_add (void *event) |
int | sfeventq_action (int(*action_func)(void *event, void *user), void *user) |
int | sfeventq_init (int max_nodes, int log_nodes, int event_size, int(*sort)(void *, void *)) |
|
|
|
Add this event to the queue using the supplied ordering function. If the queue is exhausted, then we compare the event to be added with the last event, and decide whether it is a higher priority than the last node.
Definition at line 270 of file sfeventq.c. References s_SF_EVENTQ::cur_nodes, s_SF_EVENTQ_NODE::event, get_eventq_node(), s_SF_EVENTQ::head, s_SF_EVENTQ::last, s_SF_EVENTQ_NODE::next, NULL, s_SF_EVENTQ_NODE::prev, and s_SF_EVENTQ::sort. Referenced by SnortEventqAdd(). |
|
Allocate the memory for an event to add to the event queue. This function is meant to be called first, the event structure filled in, and then added to the queue. While you can allocate several times before adding to the queue, this is not recommended as you may get a NULL ptr if you allocate more than the max node number.
Definition at line 148 of file sfeventq.c. References s_SF_EVENTQ::cur_events, s_SF_EVENTQ::event_mem, s_SF_EVENTQ::event_size, s_SF_EVENTQ::max_nodes, NULL, and s_SF_EVENTQ::reserve_event. Referenced by SnortEventqAdd(). |
|
Initialize the event queue. Provide the max number of nodes that this queue will support, the number of top nodes to log in the queue, the size of the event structure that the user will fill in, and the function to determine where to insert the incoming events in the queue.
Definition at line 102 of file sfeventq.c. References s_SF_EVENTQ::cur_events, s_SF_EVENTQ::cur_nodes, s_SF_EVENTQ::event_mem, s_SF_EVENTQ::event_size, s_SF_EVENTQ::log_nodes, s_SF_EVENTQ::max_nodes, s_SF_EVENTQ::node_mem, s_SF_EVENTQ::reserve_event, and s_SF_EVENTQ::sort. Referenced by SnortEventqInit(). |
|
Resets the event queue. We also set the reserve event back to the last event in the queue.
Definition at line 182 of file sfeventq.c. References s_SF_EVENTQ::cur_events, s_SF_EVENTQ::cur_nodes, s_SF_EVENTQ::event_mem, s_SF_EVENTQ::event_size, s_SF_EVENTQ::head, s_SF_EVENTQ::max_nodes, NULL, and s_SF_EVENTQ::reserve_event. Referenced by SnortEventqReset(). |