return RULE_TYPE__NONE;
}
-void action_execute(RuleType action, Packet* p, OptTreeNode* otn, uint16_t event_id)
+void action_execute(RuleType action, Packet* p, const OptTreeNode* otn,
+ uint16_t event_id)
{
switch (action)
{
const char* get_action_string(RuleType);
RuleType get_action_type(const char*);
-void action_execute(RuleType, struct Packet*, struct OptTreeNode*, uint16_t event_id);
+void action_execute(RuleType, struct Packet*, const struct OptTreeNode*,
+ uint16_t event_id);
+
void action_apply(RuleType, struct Packet*);
static inline bool pass_action(RuleType a)
}
}
-void EventTrace_Log(const Packet* p, OptTreeNode* otn, int action)
+void EventTrace_Log(const Packet* p, const OptTreeNode* otn, int action)
{
const char* acts = get_action_string((RuleType)action);
void EventTrace_Init(void);
void EventTrace_Term(void);
-void EventTrace_Log(const Packet*, OptTreeNode*, int action);
+void EventTrace_Log(const Packet*, const OptTreeNode*, int action);
static inline int EventTrace_IsEnabled(void)
{
#include "framework/inspector.h"
#include "framework/ips_action.h"
#include "framework/mpse.h"
-#include "perf_monitor/perf.h"
-#include "perf_monitor/perf_event.h"
+#include "network_inspectors/perf_monitor/perf.h"
+#include "network_inspectors/perf_monitor/perf_event.h"
#include "filters/sfthreshold.h"
#include "filters/rate_filter.h"
#include "events/event_wrapper.h"
// called by fpLogEvent(), which does the filtering etc.
// this handles the non-rule-actions (responses).
static inline void fpLogOther(
- Packet* p, RuleTreeNode* rtn, OptTreeNode* otn, int action)
+ Packet* p, const RuleTreeNode* rtn, const OptTreeNode* otn, int action)
{
if ( EventTrace_IsEnabled() )
EventTrace_Log(p, otn, action);
** function was pulled out of fpEvalSomething, so now we can log an
** event no matter where we are.
*/
-int fpLogEvent(RuleTreeNode* rtn, OptTreeNode* otn, Packet* p)
+int fpLogEvent(const RuleTreeNode* rtn, const OptTreeNode* otn, Packet* p)
{
int action = -1, rateAction = -1;
int override, filterEvent = 0;
** int - 1 max_events variable hit, 0 successful.
**
*/
-int fpAddMatch(OTNX_MATCH_DATA* omd_local, int pLen, OptTreeNode* otn)
+int fpAddMatch(OTNX_MATCH_DATA* omd_local, int pLen, const OptTreeNode* otn)
{
MATCH_INFO* pmi;
int evalIndex;
** 1 if flagged
**
*/
-static inline int fpAddSessionAlert(Packet* p, OptTreeNode* otn)
+static inline int fpAddSessionAlert(Packet* p, const OptTreeNode* otn)
{
if ( !p->flow )
return 0;
** 1 if alert previously generated
**
*/
-static inline int fpSessionAlerted(Packet* p, OptTreeNode* otn)
+static inline int fpSessionAlerted(Packet* p, const OptTreeNode* otn)
{
- SigInfo* si = &otn->sigInfo;
+ const SigInfo* si = &otn->sigInfo;
if (!stream.check_session_alerted(p->flow, p, si->generator, si->id))
return 0;
int i;
int j;
int k;
- OptTreeNode* otn;
+ const OptTreeNode* otn;
int tcnt = 0;
EventQueueConfig* eq = snort_conf->event_queue_config;
RuleTreeNode* rtn;
*/
int fpEvalPacket(Packet* p);
-int fpLogEvent(RuleTreeNode* rtn, OptTreeNode* otn, Packet* p);
+int fpLogEvent(const RuleTreeNode* rtn, const OptTreeNode* otn, Packet* p);
int fpEvalRTN(RuleTreeNode* rtn, Packet* p, int check_ports);
/*
*/
struct MATCH_INFO
{
- OptTreeNode* MatchArray[MAX_EVENT_MATCH];
+ const OptTreeNode* MatchArray[MAX_EVENT_MATCH];
int iMatchCount;
int iMatchIndex;
int iMatchMaxLen;
void otnx_match_data_init(int);
void otnx_match_data_term();
-int fpAddMatch(OTNX_MATCH_DATA* omd_local, int pLen, OptTreeNode* otn);
+int fpAddMatch(OTNX_MATCH_DATA* omd_local, int pLen, const OptTreeNode* otn);
OptTreeNode* GetOTN(uint32_t gid, uint32_t sid);
/* counter for number of times we evaluate rules. Used to
return pruned;
}
-void SetTags(Packet* p, OptTreeNode* otn, uint16_t event_id)
+void SetTags(Packet* p, const OptTreeNode* otn, uint16_t event_id)
{
DebugMessage(DEBUG_FLOW, "Setting tags\n");
void InitTag(void);
void CleanupTag(void);
int CheckTagList(Packet*, Event*, void**);
-void SetTags(Packet*, OptTreeNode*, uint16_t);
+void SetTags(Packet*, const OptTreeNode*, uint16_t);
void TagCacheReset(void);
#endif /* TAG_H */
return true;
}
-void otn_trigger_actions(OptTreeNode* otn, Packet* p)
+void otn_trigger_actions(const OptTreeNode* otn, Packet* p)
{
if ( otn->agent )
otn->agent->action(p);
bool otn_set_agent(OptTreeNode*, IpsOption*);
-void otn_trigger_actions(OptTreeNode*, Packet*);
+void otn_trigger_actions(const OptTreeNode*, Packet*);
#endif
// Return 0 if no OTN since -1 return indicates queue limit reached. See
// fpFinalSelectEvent()
-int SnortEventqAdd(OptTreeNode* otn)
+int SnortEventqAdd(const OptTreeNode* otn)
{
RuleTreeNode* rtn = getRtnFromOtn(otn);
struct EventNode
{
- struct OptTreeNode* otn;
- struct RuleTreeNode* rtn;
+ const struct OptTreeNode* otn;
+ const struct RuleTreeNode* rtn;
RuleType type;
};
void SnortEventqResetCounts(void);
SO_PUBLIC int SnortEventqLog(struct Packet*);
-SO_PUBLIC int SnortEventqAdd(struct OptTreeNode*);
+SO_PUBLIC int SnortEventqAdd(const struct OptTreeNode*);
SO_PUBLIC int SnortEventqAdd(uint32_t gid, uint32_t sid, RuleType = RULE_TYPE__NONE);
SO_PUBLIC bool event_is_enabled(uint32_t gid, uint32_t sid);
0 - rate threshold not reached
*/
int RateFilter_Test(
- OptTreeNode* otn,
+ const OptTreeNode* otn,
Packet* p)
{
unsigned gid = otn->sigInfo.generator;
int RateFilter_Create(SnortConfig* sc, RateFilterConfig*, tSFRFConfigNode*);
void RateFilter_PrintConfig(RateFilterConfig*);
-int RateFilter_Test(OptTreeNode*, Packet*);
+int RateFilter_Test(const OptTreeNode*, Packet*);
void RateFilter_ResetActive(void);
#endif
#include "main/snort_types.h"
#include "main/snort_debug.h"
#include "protocols/packet.h"
-#include "normalize/normalize.h"
+#include "network_inspectors/normalize/normalize.h"
#include "sfprocpidstats.h"
#include <time.h>