flow: display info about bypass in log

pull/2302/head
Eric Leblond 9 years ago committed by Victor Julien
parent e88555caf9
commit 745dad9809

@ -349,6 +349,10 @@ static uint32_t FlowManagerHashRowTimeout(Flow *f, struct timeval *ts,
f->flow_end_flags |= FLOW_END_FLAG_STATE_ESTABLISHED; f->flow_end_flags |= FLOW_END_FLAG_STATE_ESTABLISHED;
else if (state == FLOW_STATE_CLOSED) else if (state == FLOW_STATE_CLOSED)
f->flow_end_flags |= FLOW_END_FLAG_STATE_CLOSED; f->flow_end_flags |= FLOW_END_FLAG_STATE_CLOSED;
else if (state == FLOW_STATE_LOCAL_BYPASSED)
f->flow_end_flags |= FLOW_END_FLAG_STATE_BYPASSED;
else if (state == FLOW_STATE_CAPTURE_BYPASSED)
f->flow_end_flags |= FLOW_END_FLAG_STATE_BYPASSED;
if (emergency) if (emergency)
f->flow_end_flags |= FLOW_END_FLAG_EMERGENCY; f->flow_end_flags |= FLOW_END_FLAG_EMERGENCY;

@ -190,6 +190,7 @@ typedef struct AppLayerParserState_ AppLayerParserState;
#define FLOW_END_FLAG_TIMEOUT 0x10 #define FLOW_END_FLAG_TIMEOUT 0x10
#define FLOW_END_FLAG_FORCED 0x20 #define FLOW_END_FLAG_FORCED 0x20
#define FLOW_END_FLAG_SHUTDOWN 0x40 #define FLOW_END_FLAG_SHUTDOWN 0x40
#define FLOW_END_FLAG_STATE_BYPASSED 0x80
/** Mutex or RWLocks for the flow. */ /** Mutex or RWLocks for the flow. */
//#define FLOWLOCK_RWLOCK //#define FLOWLOCK_RWLOCK

@ -219,6 +219,8 @@ static void JsonFlowLogJSON(JsonFlowLogThread *aft, json_t *js, Flow *f)
state = "established"; state = "established";
else if (f->flow_end_flags & FLOW_END_FLAG_STATE_CLOSED) else if (f->flow_end_flags & FLOW_END_FLAG_STATE_CLOSED)
state = "closed"; state = "closed";
else if (f->flow_end_flags & FLOW_END_FLAG_STATE_BYPASSED)
state = "bypassed";
json_object_set_new(hjs, "state", json_object_set_new(hjs, "state",
json_string(state)); json_string(state));

Loading…
Cancel
Save