Azinix

evlFsm.c File Reference

Build an FSM from a collection of rules. More...

#include "nm.h"
#include "evl.h"

Go to the source code of this file.

Functions

Evl_Fsm_tEvl_BuildPrefixAutomaton (array_t *byteArrayArray)
 Build a prefix automaton for a set of byte arrays.
int Evl_FsmPrint (Evl_Fsm_t *anFsm)
 Print an FSM, meant for debugging purposes.
int Evl_FsmProcessAcceptingState (Evl_Fsm_t *fsm, u_int32_t ps, st_table *stringToId, array_t *idToRules, var_set_t *set1, var_set_t *set2, var_set_t *set3, array_t *resultPtr)
 Function to be called on hitting an accepting state.
void Evl_FsmComputeRules (Evl_Fsm_t *fsm, st_table *stringToId, array_t *idToRules, var_set_t *set1, var_set_t *set2, var_set_t *set3, char *payload, int length, array_t *result)
 Simulate an FSM on a given string. Return a hash table of strings that occurred, and where they most recently occured.


Detailed Description

Build an FSM from a collection of rules.

Definition in file evlFsm.c.


Function Documentation

Evl_Fsm_t* Evl_BuildPrefixAutomaton ( array_t byteArrayArray  ) 

Build a prefix automaton for a set of byte arrays.

Definition at line 64 of file evlFsm.c.

void Evl_FsmComputeRules ( Evl_Fsm_t fsm,
st_table stringToId,
array_t idToRules,
var_set_t set1,
var_set_t set2,
var_set_t set3,
char *  payload,
int  length,
array_t result 
)

Simulate an FSM on a given string. Return a hash table of strings that occurred, and where they most recently occured.

Checks are case-insensitive, to merge the checks for case-specific and case-insensitive strings. In the final check using evalContentCheck this is resolved - the FSM search merely serves as a pre-processor.

Definition at line 611 of file evlFsm.c.

int Evl_FsmPrint ( Evl_Fsm_t anFsm  ) 

Print an FSM, meant for debugging purposes.

Definition at line 201 of file evlFsm.c.

int Evl_FsmProcessAcceptingState ( Evl_Fsm_t fsm,
u_int32_t  ps,
st_table stringToId,
array_t idToRules,
var_set_t set1,
var_set_t set2,
var_set_t set3,
array_t resultPtr 
)

Function to be called on hitting an accepting state.

Definition at line 556 of file evlFsm.c.