#include "parse_rules.h"
#include "parse_config.h"
#include "hlbrlib.h"
#include "../decoders/decode.h"
#include "../actions/action.h"
#include <string.h>
#include "message.h"
#include <stdlib.h>
Go to the source code of this file.
Functions | |
int | ParseDecoderLine (char *DecoderLine, int RuleNum) |
int | SetAction (int RuleID, char *ActionName) |
int | ParseRule (FILE *fp) |
int | ParseRules (char *FName) |
Variables | |
GlobalVars | Globals |
int ParseDecoderLine | ( | char * | DecoderLine, | |
int | RuleNum | |||
) |
Add a line in a rule to the decoder/test. Receives a buffer with a line from the rule definition and try to parse it as a decoder/test definition (like: "tcp dst(80)").
Definition at line 120 of file parse_rules.c.
References test_rec::AddNode, DBG, DEBUGPATH, DECODER_NONE, global_vars::Decoders, FALSE, GetDecoderByName(), Globals, test_rec::ID, test_rec::Name, decoder_rec::Name, test_rec::Next, PRINT1, PRINTERROR, PRINTERROR1, PRINTERROR2, test_rec::ShortName, and decoder_rec::Tests.
Referenced by ParseRule().
int ParseRule | ( | FILE * | fp | ) |
Make sense out of this rule.
Definition at line 42 of file parse_rules.c.
References rule_rec::Action, ACTION_NONE, global_vars::Actions, DBG, DEBUGPATH, FALSE, GetLine(), rule_rec::GlobalID, Globals, MAX_MESSAGE_LEN, rule_rec::MessageFormat, action_rec::Name, global_vars::NumRules, ParseDecoderLine(), ParseMessageString(), PRINT, PRINT1, PRINTERROR, PRINTERROR1, PRINTERROR2, rule_rec::Revision, global_vars::Rules, SetAction(), TRUE, and USER_RULE_START.
Referenced by ParseRules().
int ParseRules | ( | char * | FName | ) |
Definition at line 200 of file parse_rules.c.
References DEBUGPATH, FALSE, fp, GetLine(), Globals, ParseRule(), ParseRules(), global_vars::RulesFilename, and TRUE.
Referenced by main(), and ParseRules().
int SetAction | ( | int | RuleID, | |
char * | ActionName | |||
) |
Set the action on a rule. Look up an action named ActionName in the actions list and returns its number.
Definition at line 24 of file parse_rules.c.
References global_vars::Actions, DEBUGPATH, Globals, action_rec::Name, and global_vars::NumActions.
Referenced by ParseRule().