static int sigsafe_format_uint64_dec(uint64_t num, char* buf, size_t buf_len)
{
uint64_t divisor;
- size_t len;
+ size_t len, i;
// ceil(log10(0xFFFFFFFFFFFFFFFF)) = 20 + 1 for '\0'
if (buf_len > 21)
len < buf_len - 1 && num / divisor;
len++, divisor *= 10);
- for (size_t i = len, divisor = 1; i > 0; i--, divisor *= 10)
+ for (i = len, divisor = 1; i > 0; i--, divisor *= 10)
buf[i - 1] = '0' + ((num / divisor) % 10);
buf[len] = '\0';
static int sigsafe_format_uint64_hex(uint64_t num, char* buf, size_t buf_len)
{
uint64_t divisor;
- size_t len;
+ size_t len, i;
// log16(0xFFFFFFFFFFFFFFFF) = 16 + 1 for '\0'
if (buf_len > 17)
len < buf_len - 1 && num / divisor;
len++, divisor *= 0x10);
- for (size_t i = len, divisor = 1; i > 0; i--, divisor *= 0x10)
+ for (i = len, divisor = 1; i > 0; i--, divisor *= 0x10)
{
int val = (num / divisor) % 0x10;
else if (i % 2 == 0)
line[lidx++] = ' ';
}
- sigsafe_snprintf(line + lidx, sizeof(line) - lidx, "%02x", data[i]);
+ sigsafe_snprintf(line + lidx, sizeof(line) - lidx, "%02x", (uint64_t) data[i]);
lidx += 2;
}
if (lidx)
{
if ( is_not_locked )
{
- CHECK(host_cache.reload_prune(256, 2) == true);
+ CHECK(host_cache.reload_prune(host_cache.mem_chunk * 1.5, 2) == true);
}
else
{
- CHECK(host_cache.reload_prune(256, 2) == false);
+ CHECK(host_cache.reload_prune(host_cache.mem_chunk * 1.5, 2) == false);
}
}
CHECK(ht_stats[0] == 3);
// no pruning needed for resizing higher than current size
- CHECK(host_cache.reload_resize(2048) == false);
+ CHECK(host_cache.reload_resize(host_cache.mem_chunk * 10) == false);
// pruning needed for resizing lower than current size
- CHECK(host_cache.reload_resize(256) == true);
+ CHECK(host_cache.reload_resize(host_cache.mem_chunk * 1.5) == true);
// pruning in thread is not done when reload_mutex is already locked
host_cache.reload_mutex.lock();
DataBus::publish(APPID_EVENT_ANY_CHANGE, app_event, flow);
}
-bool SslPatternMatchers::scan_hostname(unsigned char const* server_name, unsigned long, AppId& client_id, AppId& payload_id)
+bool SslPatternMatchers::scan_hostname(const uint8_t* server_name, size_t, AppId& client_id, AppId& payload_id)
{
if (((const char*)server_name) == APPID_UT_TLS_HOST)
{
return true;
}
-bool SslPatternMatchers::scan_cname(unsigned char const* cname, unsigned long, AppId& client_id, AppId& payload_id)
+bool SslPatternMatchers::scan_cname(const uint8_t* cname, size_t, AppId& client_id, AppId& payload_id)
{
if (((const char*)cname) == APPID_UT_TLS_HOST)
{
MemoryContext::MemoryContext(MemoryTracker&) { }
MemoryContext::~MemoryContext() { }
-void memory::MemoryCap::update_allocations(unsigned long) { }
-void memory::MemoryCap::update_deallocations(unsigned long) { }
+void memory::MemoryCap::update_allocations(size_t) { }
+void memory::MemoryCap::update_deallocations(size_t) { }
OdpContext::OdpContext(const AppIdConfig&, snort::SnortConfig*) { }
AppIdConfig::~AppIdConfig() { }
//--------------------------------------------------------------------------
namespace snort
{
-uint32_t Active::send_data(snort::Packet*, unsigned long, unsigned char const*, unsigned int)
+uint32_t Active::send_data(snort::Packet*, EncodeFlags, unsigned char const*, unsigned int)
{
return 1;
}
// Stubs to make the code link
const Field Field::FIELD_NULL { STAT_NO_SOURCE };
-const Field& HttpMsgSection::get_classic_buffer(unsigned int, unsigned long, unsigned long)
- { return Field::FIELD_NULL; }
+const Field& HttpMsgSection::get_classic_buffer(unsigned, uint64_t, uint64_t)
+{ return Field::FIELD_NULL; }
TEST_GROUP(pub_sub_http_event_test)
{