source = s;
command = AC_NONE;
swap = nullptr;
+ daqh = nullptr;
}
void Analyzer::operator()(unsigned id, Swapper* ps)
pin_thread_to_cpu(source);
snort_thread_init(source);
+ daqh = DAQ_GetHandle();
analyze();
if ( command && command != AC_PAUSE )
return false;
+ if ( ac == AC_STOP )
+ DAQ_BreakLoop(-1, daqh);
+
// FIXIT-L executing a command while paused
// will cause a resume
command = ac;
take_break();
+
return true;
}
const char* source;
volatile AnalyzerCommand command;
Swapper* swap;
+ void* daqh;
};
#endif
if ( snort_conf->pkt_cnt && pc.total_from_daq >= snort_conf->pkt_cnt )
DAQ_BreakLoop(-1);
- if ( break_time() )
+ else if ( break_time() )
DAQ_BreakLoop(0);
MODULE_PROFILE_END(totalPerfStats);
return err;
}
-int DAQ_BreakLoop (int error)
+//--------------------------------------------------------------------
+
+void* DAQ_GetHandle()
+{ return daq_hand; }
+
+int DAQ_BreakLoop (int error, void* hand)
{
+ if ( !hand )
+ hand = daq_hand;
s_error = error;
- return ( daq_breakloop(daq_mod, daq_hand) == DAQ_SUCCESS );
+ return ( daq_breakloop(daq_mod, hand) == DAQ_SUCCESS );
}
//--------------------------------------------------------------------
// (but only where performance justifies exposing implementation!)
int DAQ_Acquire(int max, DAQ_Analysis_Func_t, uint8_t* user);
int DAQ_Inject(const DAQ_PktHdr_t*, int rev, const uint8_t* buf, uint32_t len);
-int DAQ_BreakLoop(int error);
+
+void* DAQ_GetHandle();
+int DAQ_BreakLoop(int error, void* handle = nullptr);
+
#ifdef HAVE_DAQ_ACQUIRE_WITH_META
void DAQ_Set_MetaCallback(DAQ_Meta_Func_t meta_callback);
#endif