mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Removal of the --enable-int64 config option.
This will now be always on. As such, uses of the USE_INT64 preprocessor definition have been cleaned out.
This commit is contained in:
parent
5cad4c8789
commit
13569aaab7
11 changed files with 2 additions and 66 deletions
|
@ -27,9 +27,6 @@ set(DATADIR share/bro
|
||||||
set(BROv6 false
|
set(BROv6 false
|
||||||
CACHE STRING "enable IPv6 processing" FORCE)
|
CACHE STRING "enable IPv6 processing" FORCE)
|
||||||
|
|
||||||
set(USE_INT64 true
|
|
||||||
CACHE STRING "enable use of int64 (long long) for integers" FORCE)
|
|
||||||
|
|
||||||
# TODO: add to configure wrapper as '--enable-debug'
|
# TODO: add to configure wrapper as '--enable-debug'
|
||||||
# TODO: make this option do stuff
|
# TODO: make this option do stuff
|
||||||
set(ENABLE_DEBUG false
|
set(ENABLE_DEBUG false
|
||||||
|
|
|
@ -183,9 +183,6 @@
|
||||||
/* GeoIP geographic lookup functionality */
|
/* GeoIP geographic lookup functionality */
|
||||||
#undef USE_GEOIP
|
#undef USE_GEOIP
|
||||||
|
|
||||||
/* enable use of 64-bit integers */
|
|
||||||
#cmakedefine USE_INT64
|
|
||||||
|
|
||||||
/* Use libclamav */
|
/* Use libclamav */
|
||||||
#undef USE_LIBCLAMAV
|
#undef USE_LIBCLAMAV
|
||||||
|
|
||||||
|
|
|
@ -8,13 +8,8 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <regex.h>
|
#include <regex.h>
|
||||||
|
|
||||||
#ifdef USE_INT64
|
|
||||||
# define FMT_INT "%lld"
|
# define FMT_INT "%lld"
|
||||||
# define FMT_UINT "%llu"
|
# define FMT_UINT "%llu"
|
||||||
#else
|
|
||||||
# define FMT_INT "%d"
|
|
||||||
# define FMT_UINT "%u"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static TableType* bt_tracker_headers = 0;
|
static TableType* bt_tracker_headers = 0;
|
||||||
static RecordType* bittorrent_peer;
|
static RecordType* bittorrent_peer;
|
||||||
|
|
|
@ -105,7 +105,6 @@ void ODesc::Add(uint32 u)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_INT64
|
|
||||||
void ODesc::Add(int64 i)
|
void ODesc::Add(int64 i)
|
||||||
{
|
{
|
||||||
if ( IsBinary() )
|
if ( IsBinary() )
|
||||||
|
@ -129,7 +128,6 @@ void ODesc::Add(uint64 u)
|
||||||
Add(tmp);
|
Add(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
void ODesc::Add(double d)
|
void ODesc::Add(double d)
|
||||||
{
|
{
|
||||||
|
|
|
@ -57,10 +57,8 @@ public:
|
||||||
void AddN(const char* s, int len) { AddBytes(s, len); }
|
void AddN(const char* s, int len) { AddBytes(s, len); }
|
||||||
void Add(int i);
|
void Add(int i);
|
||||||
void Add(uint32 u);
|
void Add(uint32 u);
|
||||||
#ifdef USE_INT64
|
|
||||||
void Add(int64 i);
|
void Add(int64 i);
|
||||||
void Add(uint64 u);
|
void Add(uint64 u);
|
||||||
#endif
|
|
||||||
void Add(double d);
|
void Add(double d);
|
||||||
|
|
||||||
// Add s as a counted string.
|
// Add s as a counted string.
|
||||||
|
|
|
@ -237,8 +237,6 @@ HashKey::HashKey(bro_uint_t u)
|
||||||
is_our_dynamic = 0;
|
is_our_dynamic = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_INT64
|
|
||||||
|
|
||||||
HashKey::HashKey(uint32 u)
|
HashKey::HashKey(uint32 u)
|
||||||
{
|
{
|
||||||
key_u.u32 = u;
|
key_u.u32 = u;
|
||||||
|
@ -248,8 +246,6 @@ HashKey::HashKey(uint32 u)
|
||||||
is_our_dynamic = 0;
|
is_our_dynamic = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // USE_INT64
|
|
||||||
|
|
||||||
HashKey::HashKey(const uint32 u[], int n)
|
HashKey::HashKey(const uint32 u[], int n)
|
||||||
{
|
{
|
||||||
size = n * sizeof(u[0]);
|
size = n * sizeof(u[0]);
|
||||||
|
|
|
@ -24,9 +24,7 @@ class HashKey {
|
||||||
public:
|
public:
|
||||||
HashKey(bro_int_t i);
|
HashKey(bro_int_t i);
|
||||||
HashKey(bro_uint_t u);
|
HashKey(bro_uint_t u);
|
||||||
#ifdef USE_INT64
|
|
||||||
HashKey(uint32 u);
|
HashKey(uint32 u);
|
||||||
#endif
|
|
||||||
HashKey(const uint32 u[], int n);
|
HashKey(const uint32 u[], int n);
|
||||||
HashKey(double d);
|
HashKey(double d);
|
||||||
HashKey(const void* p);
|
HashKey(const void* p);
|
||||||
|
@ -78,9 +76,7 @@ protected:
|
||||||
|
|
||||||
union {
|
union {
|
||||||
bro_int_t i;
|
bro_int_t i;
|
||||||
#ifdef USE_INT64
|
|
||||||
uint32 u32;
|
uint32 u32;
|
||||||
#endif
|
|
||||||
double d;
|
double d;
|
||||||
const void* p;
|
const void* p;
|
||||||
} key_u;
|
} key_u;
|
||||||
|
|
|
@ -161,8 +161,6 @@ bro_int_t TCP_Endpoint::Size() const
|
||||||
{
|
{
|
||||||
bro_int_t size;
|
bro_int_t size;
|
||||||
|
|
||||||
#ifdef USE_INT64
|
|
||||||
|
|
||||||
uint64 last_seq_64 = (uint64(last_seq_high) << 32) | last_seq;
|
uint64 last_seq_64 = (uint64(last_seq_high) << 32) | last_seq;
|
||||||
uint64 ack_seq_64 = (uint64(ack_seq_high) << 32) | ack_seq;
|
uint64 ack_seq_64 = (uint64(ack_seq_high) << 32) | ack_seq;
|
||||||
if ( last_seq_64 > ack_seq_64 )
|
if ( last_seq_64 > ack_seq_64 )
|
||||||
|
@ -170,26 +168,6 @@ bro_int_t TCP_Endpoint::Size() const
|
||||||
else
|
else
|
||||||
size = ack_seq_64 - start_seq;
|
size = ack_seq_64 - start_seq;
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
if ( seq_delta(last_seq, ack_seq) > 0 || ack_seq == start_seq + 1 )
|
|
||||||
// Either last_seq corresponds to more data sent than we've
|
|
||||||
// seen ack'd, or we haven't seen any data ack'd (in which
|
|
||||||
// case we should trust last_seq anyway). This last test
|
|
||||||
// matters for the case in which the connection has
|
|
||||||
// transferred > 2 GB of data, in which case we will find
|
|
||||||
// seq_delta(last_seq, ack_seq) < 0 even if ack_seq
|
|
||||||
// corresponds to no data transferred.
|
|
||||||
size = last_seq - start_seq;
|
|
||||||
|
|
||||||
else
|
|
||||||
// It could be that ack_seq > last_seq, if we've seen an
|
|
||||||
// ack for the connection (say in a FIN) without seeing
|
|
||||||
// the corresponding data.
|
|
||||||
size = ack_seq - start_seq;
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// Don't include SYN octet in sequence space. For partial connections
|
// Don't include SYN octet in sequence space. For partial connections
|
||||||
// (no SYN seen), we're still careful to adjust start_seq as though
|
// (no SYN seen), we're still careful to adjust start_seq as though
|
||||||
// there was an initial SYN octet, because if we don't then the
|
// there was an initial SYN octet, because if we don't then the
|
||||||
|
|
|
@ -127,7 +127,6 @@ public:
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_INT64
|
|
||||||
Val(int64 i, TypeTag t)
|
Val(int64 i, TypeTag t)
|
||||||
{
|
{
|
||||||
val.int_val = i;
|
val.int_val = i;
|
||||||
|
@ -147,7 +146,6 @@ public:
|
||||||
bound_id = 0;
|
bound_id = 0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#endif // USE_INT64
|
|
||||||
|
|
||||||
Val(double d, TypeTag t)
|
Val(double d, TypeTag t)
|
||||||
{
|
{
|
||||||
|
|
10
src/bro.bif
10
src/bro.bif
|
@ -222,25 +222,15 @@ static void do_fmt(const char*& fmt, Val* v, ODesc* d)
|
||||||
u = ntohl(uint32(u));
|
u = ntohl(uint32(u));
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef USE_INT64
|
|
||||||
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%s", num_fmt,
|
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%s", num_fmt,
|
||||||
*fmt == 'd' ? "llu" : "llx");
|
*fmt == 'd' ? "llu" : "llx");
|
||||||
#else
|
|
||||||
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%c", num_fmt,
|
|
||||||
*fmt == 'd' ? 'u' : 'x');
|
|
||||||
#endif
|
|
||||||
snprintf(out_buf, sizeof(out_buf), fmt_buf, u);
|
snprintf(out_buf, sizeof(out_buf), fmt_buf, u);
|
||||||
}
|
}
|
||||||
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
#ifdef USE_INT64
|
|
||||||
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%s", num_fmt,
|
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%s", num_fmt,
|
||||||
*fmt == 'd' ? "lld" : "llx");
|
*fmt == 'd' ? "lld" : "llx");
|
||||||
#else
|
|
||||||
snprintf(fmt_buf, sizeof(fmt_buf), "%%%s%c", num_fmt,
|
|
||||||
*fmt == 'd' ? 'd' : 'x');
|
|
||||||
#endif
|
|
||||||
snprintf(out_buf, sizeof(out_buf), fmt_buf,
|
snprintf(out_buf, sizeof(out_buf), fmt_buf,
|
||||||
v->CoerceToInt());
|
v->CoerceToInt());
|
||||||
}
|
}
|
||||||
|
|
11
src/util.h
11
src/util.h
|
@ -44,15 +44,8 @@ typedef unsigned int uint32;
|
||||||
typedef unsigned short uint16;
|
typedef unsigned short uint16;
|
||||||
typedef unsigned char uint8;
|
typedef unsigned char uint8;
|
||||||
typedef long long int int64;
|
typedef long long int int64;
|
||||||
|
typedef int64 bro_int_t;
|
||||||
#ifdef USE_INT64
|
typedef uint64 bro_uint_t;
|
||||||
typedef int64 bro_int_t;
|
|
||||||
typedef uint64 bro_uint_t;
|
|
||||||
#else
|
|
||||||
typedef int bro_int_t;
|
|
||||||
typedef uint32 bro_uint_t;
|
|
||||||
// # error "USE_INT64 not defined!"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if SIZEOF_LONG_LONG == 8
|
#if SIZEOF_LONG_LONG == 8
|
||||||
typedef unsigned long long uint64;
|
typedef unsigned long long uint64;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue