set_if_true (STATIC_IPS_ACTIONS STATIC_IPS_ACTIONS)
set_if_true (STATIC_IPS_OPTIONS STATIC_IPS_OPTIONS)
set_if_true (STATIC_CODECS STATIC_CODECS)
-set_if_true (ENABLE_VALGRIND VALGRIND_TESTING)
set_if_true (BUILD_HA ENABLE_HA )
set_if_true (ENABLE_LINUX_SMP_STATS LINUX_SMP)
set_if_true (ENABLE_DEBUG DEBUG)
option (STATIC_IPS_OPTIONS "include ips options in binary" ON)
option (STATIC_SEARCH_ENGINES "include search engines in binary" ON)
option (ENABLE_STATIC_DAQ "Link static DAQ modules" ON)
-option (ENABLE_VALGRIND "Only use if you are testing with valgrind" OFF)
option (ENABLE_LINUX_SMP_STATS "Enable statistics reporting through proc" OFF)
option (ENABLE_PTHREAD "Disable pthread support" ON)
option (ENABLE_DEBUG_MSGS "Enable debug printing options (bugreports and developers only)" OFF)
/* build side channel */
#cmakedefine SIDE_CHANNEL 1
-/* Workarounds for valgrind testing */
-#cmakedefine VALGRIND_TESTING 1
-
/* enable proc stats */
#cmakedefine LINUX_SMP 1
AC_DEFINE(STATIC_PIGLETS, [1], [include internal piglets in binary])
fi
-AC_ARG_ENABLE(valgrind,
- AC_HELP_STRING([--enable-valgrind],[only use if you are testing with valgrind.]),
- enable_valgrind="$enableval", enable_valgrind="no")
-
-if test "x$enable_valgrind" = "xyes"; then
- AC_DEFINE([VALGRIND_TESTING],[1],[Workarounds for valgrind testing])
-fi
-
AC_ARG_ENABLE(shell,
AC_HELP_STRING([--enable-shell],[enable command line shell support]),
enable_shell="$enableval", enable_shell="no")
--enable-static-daq)
append_cache_entry ENABLE_STATIC_DAQ BOOL true
;;
- --disable-valgrind)
- append_cache_entry ENABLE_VALGRIND BOOL false
- ;;
- --enable-valgrind)
- append_cache_entry ENABLE_VALGRIND BOOL true
- ;;
--disable-linux-smp-stats)
append_cache_entry ENABLE_LINUX_SMP_STATS BOOL false
;;
static inline uint16_t IpId_Next()
{
-#if defined(REG_TEST) || defined(VALGRIND_TESTING)
+#if defined(REG_TEST)
uint16_t id = htons(s_id_index + 1);
#else
uint16_t id = s_id_pool[s_id_index];
#endif
s_id_index = (s_id_index + 1) % IP_ID_COUNT;
-#ifndef VALGRIND_TESTING
if ( !s_id_index )
rand_shuffle(s_rand, &s_id_pool[0], sizeof(s_id_pool), 1);
-#endif
+
return id;
}
//-------------------------------------------------------------------------
static void ipv4_codec_ginit()
{
-#ifndef VALGRIND_TESTING
if ( s_rand )
rand_close(s_rand);
FatalError("rand_open() failed.\n");
rand_get(s_rand, &s_id_pool[0], sizeof(s_id_pool));
-#endif
// Reserved addresses within multicast address space (See RFC 5771)
MulticastReservedIp = sfip_var_from_string(
// FIXIT-L convert sigaction, etc. to c++11
static int add_signal(int sig, sighandler_t signal_handler, int check_needed)
{
-#ifdef VALGRIND_TESTING
- if ( sig == SIGUSR2 )
- return 0; // used by valgrind
-#endif
sighandler_t pre_handler;
#ifdef HAVE_SIGACTION
if ( output_use_utc() )
thiszone = 0;
-#ifndef VALGRIND_TESTING
else
thiszone = gmt2local(0);
-#endif
init_policies(this);
ParseRules(this);
if (!grinder)
ParseError("Unable to find a Codec with data link type %d\n", daq_dlt);
-#ifndef VALGRIND_TESTING
if ( s_rand )
rand_close(s_rand);
ParseError("rand_open() failed.\n");
rand_get(s_rand, s_id_pool.data(), s_id_pool.size());
-#endif
}
void CodecManager::thread_term()
void DAQ_Term()
{
-//#ifndef VALGRIND_TESTING
if ( loaded )
DAQ_Unload();
daq_mod = NULL;
-//#endif
}
void DAQ_Abort()
(uint8_t*)&iface_vars[i].netmask);
}
}
-#ifndef VALGRIND_TESTING
else
{
char errbuf[PCAP_ERRBUF_SIZE];
pcap_freealldevs(alldevs);
}
-#endif
}
static RuleListNode* addNodeToOrderedList(RuleListNode* ordered_list,
LogStat("fail state memory", acsm2_failstate_memory/scale);
#if 0 // FIXIT-L clean up format; not all this should be printed all the time
-//#ifndef VALGRIND_TESTING
- // valgrind on macos claims leakage here ...
-
if (acsm2_dfa_memory > 0)
{
if (summary.acsm.compress_states)
void LogStat(const char* s, uint64_t n, uint64_t tot)
{
-#ifdef VALGRIND_TESTING
- LogMessage("%25.25s: " FMTu64("-12") "\n", s, n);
-#else
LogMessage("%25.25s: " FMTu64("-12") "\t(%7.3f%%)\n", s, n, CalcPct(n, tot));
-#endif
}
void LogStat(const char* s, double d)
for (i = 0; i < NUM_IP_PROTOS; i++)
{
-#ifndef VALGRIND_TESTING
struct protoent* pt = getprotobynumber(i); // main thread only
if (pt != NULL)
protocol_names[i][j] = toupper(protocol_names[i][j]);
}
else
-#endif
{
char protoname[10];