"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/side-channel/sidechannel.c" between
snort-2.9.16.1.tar.gz and snort-2.9.17.tar.gz

About: Snort is a network intrusion prevention and detection system (IDS/IPS) combining the benefits of signature, protocol and anomaly-based inspection.

sidechannel.c  (snort-2.9.16.1):sidechannel.c  (snort-2.9.17)
skipping to change at line 381 skipping to change at line 381
return 0; return 0;
} }
/* Called by an out-of-band thread (probably a Side Channel Module). */ /* Called by an out-of-band thread (probably a Side Channel Module). */
int SideChannelEnqueueMessageRX(SCMsgHdr *hdr, const uint8_t *msg, uint32_t leng th, void *msg_handle, SCMQMsgFreeFunc msgFreeFunc) int SideChannelEnqueueMessageRX(SCMsgHdr *hdr, const uint8_t *msg, uint32_t leng th, void *msg_handle, SCMQMsgFreeFunc msgFreeFunc)
{ {
int rval; int rval;
/* /*
* During snort exit, any messages need not to be processed. So checking
* stop_processing before processing the message.
*/
if (stop_processing) {
return -1;
}
/*
* Because the Snort main thread relinquishes control to DAQ_Acquire for up to a second, * Because the Snort main thread relinquishes control to DAQ_Acquire for up to a second,
* we potentially need to preempt it and process RX messages as they are bei ng enqueued * we potentially need to preempt it and process RX messages as they are bei ng enqueued
* to avoid backups and overruns. * to avoid backups and overruns.
* This should be safe since the main thread holds the snort_process_lock mu tex while it * This should be safe since the main thread holds the snort_process_lock mu tex while it
* is not in DAQ_Acquire(). * is not in DAQ_Acquire().
*/ */
while (pthread_mutex_trylock(&snort_process_lock) == 0) while (pthread_mutex_trylock(&snort_process_lock) == 0)
{ {
/* If there are no more messages in the RX queue, process the new messag e without enqueuing it and return. */ /* If there are no more messages in the RX queue, process the new messag e without enqueuing it and return. */
if (SCDrainAndProcess(&rx_queue, rx_handlers) != 0) if (SCDrainAndProcess(&rx_queue, rx_handlers) != 0)
skipping to change at line 592 skipping to change at line 599
{ {
for (module = modules; module; module = module->next) for (module = modules; module; module = module->next)
{ {
if (module->enabled && module->funcs.idleFunc) if (module->enabled && module->funcs.idleFunc)
module->funcs.idleFunc(); module->funcs.idleFunc();
} }
} }
} }
done: done:
pthread_mutex_unlock(&tx_queue.mutex); pthread_mutex_unlock(&tx_queue.mutex);
tx_thread_running = 0;
LogMessage("Side Channel thread exiting...\n"); LogMessage("Side Channel thread exiting...\n");
return NULL; return NULL;
} }
static void SCParseConfiguration(SnortConfig *sc, SCConfig *config) static void SCParseConfiguration(SnortConfig *sc, SCConfig *config)
{ {
long int value; long int value;
char *token, *argcpy, *endptr; char *token, *argcpy, *endptr;
 End of changes. 2 change blocks. 
0 lines changed or deleted 8 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)