}
SCMutexLock(&aft->file_ctx->fp_mutex);
- MemBufferPrintToFPAsString(aft->buffer, aft->file_ctx->fp);
+ (void)MemBufferPrintToFPAsString(aft->buffer, aft->file_ctx->fp);
fflush(aft->file_ctx->fp);
aft->file_ctx->alerts += p->alerts.cnt;
SCMutexUnlock(&aft->file_ctx->fp_mutex);
GET_PKT_DATA(p), GET_PKT_LEN(p));
SCMutexLock(&aft->file_ctx->fp_mutex);
- MemBufferPrintToFPAsString(aft->buffer, aft->file_ctx->fp);
+ (void)MemBufferPrintToFPAsString(aft->buffer, aft->file_ctx->fp);
fflush(aft->file_ctx->fp);
aft->file_ctx->alerts += p->alerts.cnt;
SCMutexUnlock(&aft->file_ctx->fp_mutex);
return 1;
}
-static int MD5MatchLookupString(ROHashTable *hash, char *string) {
- uint8_t md5[16];
- if (Md5ReadString(md5, string) == 1) {
- void *ptr = ROHashLookup(hash, &md5, (uint16_t)sizeof(md5));
- if (ptr == NULL)
- return 0;
- else
- return 1;
- }
- return 0;
-}
-
/**
* \brief match the specified filemd5
*
}
#ifdef UNITTESTS
+static int MD5MatchLookupString(ROHashTable *hash, char *string) {
+ uint8_t md5[16];
+ if (Md5ReadString(md5, string) == 1) {
+ void *ptr = ROHashLookup(hash, &md5, (uint16_t)sizeof(md5));
+ if (ptr == NULL)
+ return 0;
+ else
+ return 1;
+ }
+ return 0;
+}
+
static int MD5MatchTest01(void) {
ROHashTable *hash = ROHashInit(4, 16);
if (hash == NULL) {
aft->uri_cnt ++;
SCMutexLock(&hlog->file_ctx->fp_mutex);
- MemBufferPrintToFPAsString(aft->buffer, hlog->file_ctx->fp);
+ (void)MemBufferPrintToFPAsString(aft->buffer, hlog->file_ctx->fp);
fflush(hlog->file_ctx->fp);
SCMutexUnlock(&hlog->file_ctx->fp_mutex);
* \param buffer Pointer to the src MemBuffer instance to write.
* \param fp Pointer to the file file instance to write to.
*/
-#define MemBufferPrintToFPAsString(mem_buffer, fp) do { \
- fwrite((mem_buffer)->buffer, sizeof(uint8_t), (mem_buffer)->offset, fp); \
- } while (0)
+#define MemBufferPrintToFPAsString(mem_buffer, fp) ({ \
+ fwrite((mem_buffer)->buffer, sizeof(uint8_t), (mem_buffer)->offset, fp); \
+})
/**
* \brief Write a buffer in hex format.
static SCRadixTree *sc_hinfo_tree = NULL;
static SCRadixTree *sc_hinfo_tree_backup = NULL;
-static void SCHInfoCreateContextBackup(void)
-{
- sc_hinfo_tree_backup = sc_hinfo_tree;
- sc_hinfo_tree = NULL;
-
- return;
-}
-
-static void SCHInfoRestoreContextBackup(void)
-{
- sc_hinfo_tree = sc_hinfo_tree_backup;
- sc_hinfo_tree_backup = NULL;
-
- return;
-}
-
/**
* \brief Validates an IPV4 address and returns the network endian arranged
* version of the IPV4 address
#ifdef UNITTESTS
+static void SCHInfoCreateContextBackup(void)
+{
+ sc_hinfo_tree_backup = sc_hinfo_tree;
+ sc_hinfo_tree = NULL;
+
+ return;
+}
+
+static void SCHInfoRestoreContextBackup(void)
+{
+ sc_hinfo_tree = sc_hinfo_tree_backup;
+ sc_hinfo_tree_backup = NULL;
+
+ return;
+}
+
/**
* \test Check if we the IPs with the right OS flavours are added to the host OS
* radix tree, and the IPS with invalid flavours returns an error(-1)