Deprecate names in BifConst, replace with zeek::BifConst

Some Val* types are also replaced with IntrusivePtr at the new location
This commit is contained in:
Jon Siwek 2020-05-13 23:41:01 -07:00
parent eedeb07550
commit 0db5c920f2
39 changed files with 120 additions and 106 deletions

4
NEWS
View file

@ -180,6 +180,10 @@ Deprecated Functionality
deprecated, but there's an equivalent name in ``zeek::BifType::`` of
``IntrusivePtr`` type to use instead.
- All generated ``BifConst::`` names are deprecated, but there's an
equivalent name now in ``zeek::BifCont::``, and changed to ``IntrusivePtr``
if the old name was some ``Val*`` type.
Zeek 3.1.0
==========

@ -1 +1 @@
Subproject commit 5afd05f72b52bd40637546203749fb7bed8dbc4d
Subproject commit 7fdbbfdf5ee3669a77f73360b86326344e15ea99

View file

@ -40,7 +40,7 @@ void KeyedHash::InitializeSeeds(const std::array<uint32_t, SEED_INIT_SIZE>& seed
void KeyedHash::InitOptions()
{
calculate_digest(Hash_SHA256, BifConst::digest_salt->Bytes(), BifConst::digest_salt->Len(), reinterpret_cast<unsigned char*>(cluster_highwayhash_key));
calculate_digest(Hash_SHA256, zeek::BifConst::digest_salt->Bytes(), zeek::BifConst::digest_salt->Len(), reinterpret_cast<unsigned char*>(cluster_highwayhash_key));
}
hash64_t KeyedHash::Hash64(const void* bytes, uint64_t size)

View file

@ -212,6 +212,16 @@ IntrusivePtr<T> lookup_val(std::string_view name)
*/
const IntrusivePtr<Val>& lookup_const(std::string_view name);
/**
* Lookup an ID by its name and return its value (as cast to @c T).
* A fatal occurs if the ID does not exist.
* @param name The identifier name to lookup
* @return The current value of the identifier.
*/
template<class T>
IntrusivePtr<T> lookup_const(std::string_view name)
{ return cast_intrusive<T>(lookup_const(name)); }
/**
* Lookup an ID by its name and return the function it references.
* A fatal occurs if the ID does not exist or if it is not a function.

View file

@ -283,7 +283,7 @@ void net_run()
ready.reserve(iosource_mgr->TotalSize());
while ( iosource_mgr->Size() ||
(BifConst::exit_only_after_terminate && ! terminating) )
(zeek::BifConst::exit_only_after_terminate && ! terminating) )
{
iosource_mgr->FindReadySources(&ready);
@ -314,7 +314,7 @@ void net_run()
}
}
else if ( (have_pending_timers || communication_enabled ||
BifConst::exit_only_after_terminate) &&
zeek::BifConst::exit_only_after_terminate) &&
! pseudo_realtime )
{
// Take advantage of the lull to get up to

View file

@ -54,7 +54,7 @@ void IPTunnelTimer::Dispatch(double t, bool is_expire)
double last_active = it->second.second;
double inactive_time = t > last_active ? t - last_active : 0;
if ( inactive_time >= BifConst::Tunnel::ip_tunnel_timeout )
if ( inactive_time >= zeek::BifConst::Tunnel::ip_tunnel_timeout )
// tunnel activity timed out, delete it from map
sessions->ip_tunnels.erase(tunnel_idx);
@ -409,7 +409,7 @@ void NetSessions::DoNextPacket(double t, const Packet* pkt, const IP_Hdr* ip_hdr
case IPPROTO_GRE:
{
if ( ! BifConst::Tunnel::enable_gre )
if ( ! zeek::BifConst::Tunnel::enable_gre )
{
Weird("GRE_tunnel", ip_hdr, encapsulation);
return;
@ -561,14 +561,14 @@ void NetSessions::DoNextPacket(double t, const Packet* pkt, const IP_Hdr* ip_hdr
case IPPROTO_IPV4:
case IPPROTO_IPV6:
{
if ( ! BifConst::Tunnel::enable_ip )
if ( ! zeek::BifConst::Tunnel::enable_ip )
{
Weird("IP_tunnel", ip_hdr, encapsulation);
return;
}
if ( encapsulation &&
encapsulation->Depth() >= BifConst::Tunnel::max_depth )
encapsulation->Depth() >= zeek::BifConst::Tunnel::max_depth )
{
Weird("exceeded_tunnel_max_depth", ip_hdr, encapsulation);
return;

View file

@ -243,7 +243,7 @@ protected:
class IPTunnelTimer final : public Timer {
public:
IPTunnelTimer(double t, NetSessions::IPPair p)
: Timer(t + BifConst::Tunnel::ip_tunnel_timeout,
: Timer(t + zeek::BifConst::Tunnel::ip_tunnel_timeout,
TIMER_IP_TUNNEL_INACTIVITY), tunnel_idx(p) {}
~IPTunnelTimer() override {}

View file

@ -18,7 +18,7 @@ flow AYIYA_Flow
Connection *c = connection()->bro_analyzer()->Conn();
const EncapsulationStack* e = c->GetEncapsulation();
if ( e && e->Depth() >= BifConst::Tunnel::max_depth )
if ( e && e->Depth() >= zeek::BifConst::Tunnel::max_depth )
{
reporter->Weird(c, "tunnel_depth");
return false;

View file

@ -210,14 +210,14 @@ flow DCE_RPC_Flow(is_orig: bool) {
flowbuf->NewFrame(0, true);
flowbuf->BufferData(frag.begin(), frag.end());
if ( fb.size() > BifConst::DCE_RPC::max_cmd_reassembly )
if ( fb.size() > zeek::BifConst::DCE_RPC::max_cmd_reassembly )
{
reporter->Weird(connection()->bro_analyzer()->Conn(),
"too_many_dce_rpc_msgs_in_reassembly");
connection()->bro_analyzer()->SetSkip(true);
}
if ( flowbuf->data_length() > (int)BifConst::DCE_RPC::max_frag_data )
if ( flowbuf->data_length() > (int)zeek::BifConst::DCE_RPC::max_frag_data )
{
reporter->Weird(connection()->bro_analyzer()->Conn(),
"too_much_dce_rpc_fragment_data");
@ -233,7 +233,7 @@ flow DCE_RPC_Flow(is_orig: bool) {
auto& flowbuf = it->second;
flowbuf->BufferData(frag.begin(), frag.end());
if ( flowbuf->data_length() > (int)BifConst::DCE_RPC::max_frag_data )
if ( flowbuf->data_length() > (int)zeek::BifConst::DCE_RPC::max_frag_data )
{
reporter->Weird(connection()->bro_analyzer()->Conn(),
"too_much_dce_rpc_fragment_data");

View file

@ -652,7 +652,7 @@ flow GTPv1_Flow(is_orig: bool)
connection()->set_valid(is_orig(), false);
if ( e && e->Depth() >= BifConst::Tunnel::max_depth )
if ( e && e->Depth() >= zeek::BifConst::Tunnel::max_depth )
{
reporter->Weird(c, "tunnel_depth");
return false;
@ -738,7 +738,7 @@ flow GTPv1_Flow(is_orig: bool)
{
connection()->set_valid(is_orig(), true);
if ( (! BifConst::Tunnel::delay_gtp_confirmation) ||
if ( (! zeek::BifConst::Tunnel::delay_gtp_confirmation) ||
(connection()->valid(true) && connection()->valid(false)) )
a->ProtocolConfirmation();
}

View file

@ -810,7 +810,7 @@ void HTTP_Message::SetPlainDelivery(int64_t length)
{
content_line->SetPlainDelivery(length);
if ( length > 0 && BifConst::skip_http_data )
if ( length > 0 && zeek::BifConst::skip_http_data )
content_line->SkipBytesAfterThisLine(length);
}

View file

@ -35,10 +35,10 @@ static void warn_krb(const char* msg, krb5_context ctx, krb5_error_code code)
void KRB_Analyzer::Initialize_Krb()
{
if ( BifConst::KRB::keytab->Len() == 0 )
if ( zeek::BifConst::KRB::keytab->Len() == 0 )
return; // no keytab set
const char* keytab_filename = BifConst::KRB::keytab->CheckString();
const char* keytab_filename = zeek::BifConst::KRB::keytab->CheckString();
if ( access(keytab_filename, R_OK) != 0 )
{
reporter->Warning("KRB: Can't access keytab (%s)", keytab_filename);

View file

@ -129,7 +129,7 @@ int FrameBuffer::Deliver(int &len, const u_char* &data)
if ( msg_len > buf_len )
{
if ( msg_len > BifConst::NCP::max_frame_size )
if ( msg_len > zeek::BifConst::NCP::max_frame_size )
return 1;
buf_len = msg_len;

View file

@ -302,15 +302,15 @@ StringVal* NFS_Interp::nfs3_file_data(const u_char*& buf, int& n, uint64_t offse
const u_char *data = extract_XDR_opaque(buf, n, data_n, 1 << 30, true);
// check whether we have to deliver data to the event
if ( ! BifConst::NFS3::return_data )
if ( ! zeek::BifConst::NFS3::return_data )
return nullptr;
if ( BifConst::NFS3::return_data_first_only && offset != 0 )
if ( zeek::BifConst::NFS3::return_data_first_only && offset != 0 )
return nullptr;
// Ok, so we want to return some data
data_n = std::min(data_n, size);
data_n = std::min(data_n, int(BifConst::NFS3::return_data_max));
data_n = std::min(data_n, int(zeek::BifConst::NFS3::return_data_max));
if ( data && data_n > 0 )
return new StringVal(new BroString(data, data_n, false));

View file

@ -4,7 +4,7 @@ refine connection SMB_Conn += {
auto filename = smb_string2stringval(${val.filename});
if ( ! ${header.is_pipe} &&
BifConst::SMB::pipe_filenames->AsTable()->Lookup(filename->CheckString()) )
zeek::BifConst::SMB::pipe_filenames->AsTable()->Lookup(filename->CheckString()) )
{
set_tree_is_pipe(${header.tid});

View file

@ -5,7 +5,7 @@ refine connection SMB_Conn += {
auto filename = smb2_string2stringval(${val.filename});
if ( ! ${h.is_pipe} &&
BifConst::SMB::pipe_filenames->AsTable()->Lookup(filename->CheckString()) )
zeek::BifConst::SMB::pipe_filenames->AsTable()->Lookup(filename->CheckString()) )
{
set_tree_is_pipe(${h.tree_id});

View file

@ -73,11 +73,11 @@ refine connection SSL_Conn += {
if ( bro_analyzer()->ProtocolConfirmed() )
{
reported_errors_++;
if ( reported_errors_ <= BifConst::SSL::dtls_max_reported_version_errors )
if ( reported_errors_ <= zeek::BifConst::SSL::dtls_max_reported_version_errors )
bro_analyzer()->ProtocolViolation(fmt("Invalid version in DTLS connection. Packet reported version: %d", version));
}
if ( invalid_version_count_ > BifConst::SSL::dtls_max_version_errors )
if ( invalid_version_count_ > zeek::BifConst::SSL::dtls_max_version_errors )
bro_analyzer()->SetSkip(true);
return false;
}

View file

@ -2051,7 +2051,7 @@ bool TCPStats_Endpoint::DataSent(double /* t */, uint64_t seq, int len, int capl
int64_t sequence_delta = top_seq - max_top_seq;
if ( sequence_delta <= 0 )
{
if ( ! BifConst::ignore_keep_alive_rexmit || len > 1 || data_in_flight > 0 )
if ( ! zeek::BifConst::ignore_keep_alive_rexmit || len > 1 || data_in_flight > 0 )
{
++num_rxmit;
num_rxmit_bytes += len;

View file

@ -135,7 +135,7 @@ static inline bool established_or_cleanly_closing(const TCP_Endpoint* a,
static inline bool report_gap(const TCP_Endpoint* a, const TCP_Endpoint* b)
{
return content_gap &&
( BifConst::report_gaps_for_partial ||
( zeek::BifConst::report_gaps_for_partial ||
established_or_cleanly_closing(a, b) );
}
@ -210,7 +210,7 @@ void TCP_Reassembler::Undelivered(uint64_t up_to_seq)
// to this method and only if this condition is not true).
reporter->InternalError("Calling Undelivered for data that has already been delivered (or has already been marked as undelivered");
if ( BifConst::detect_filtered_trace && last_reassem_seq == 1 &&
if ( zeek::BifConst::detect_filtered_trace && last_reassem_seq == 1 &&
(endpoint->FIN_cnt > 0 || endpoint->RST_cnt > 0 ||
peer->FIN_cnt > 0 || peer->RST_cnt > 0) )
{
@ -539,7 +539,7 @@ void TCP_Reassembler::AckReceived(uint64_t seq)
return;
bool test_active = ! skip_deliveries && ! tcp_analyzer->Skipping() &&
( BifConst::report_gaps_for_partial ||
( zeek::BifConst::report_gaps_for_partial ||
(endp->state == TCP_ENDPOINT_ESTABLISHED &&
endp->peer->state == TCP_ENDPOINT_ESTABLISHED ) );

View file

@ -161,7 +161,7 @@ void Teredo_Analyzer::DeliverPacket(int len, const u_char* data, bool orig,
const EncapsulationStack* e = Conn()->GetEncapsulation();
if ( e && e->Depth() >= BifConst::Tunnel::max_depth )
if ( e && e->Depth() >= zeek::BifConst::Tunnel::max_depth )
{
Weird("tunnel_depth", true);
return;

View file

@ -42,7 +42,7 @@ public:
*/
void Confirm()
{
if ( ! BifConst::Tunnel::delay_teredo_confirmation ||
if ( ! zeek::BifConst::Tunnel::delay_teredo_confirmation ||
( valid_orig && valid_resp ) )
ProtocolConfirmation();
}

View file

@ -81,7 +81,7 @@ void UDP_Analyzer::DeliverPacket(int len, const u_char* data, bool is_orig,
if ( chksum == 0 )
validate_checksum = false;
else
validate_checksum = BifConst::Tunnel::validate_vxlan_checksums;
validate_checksum = zeek::BifConst::Tunnel::validate_vxlan_checksums;
}
}

View file

@ -48,7 +48,7 @@ void VXLAN_Analyzer::DeliverPacket(int len, const u_char* data, bool orig,
const EncapsulationStack* estack = Conn()->GetEncapsulation();
if ( estack && estack->Depth() >= BifConst::Tunnel::max_depth )
if ( estack && estack->Depth() >= zeek::BifConst::Tunnel::max_depth )
{
reporter->Weird(Conn(), "tunnel_depth");
return;

View file

@ -405,7 +405,7 @@ bool Manager::CreateEventStream(RecordVal* fval)
return false;
}
allow_file_func = BifConst::Input::accept_unsupported_types;
allow_file_func = zeek::BifConst::Input::accept_unsupported_types;
}
@ -637,7 +637,7 @@ bool Manager::CreateTableStream(RecordVal* fval)
int idxfields = fieldsV.size();
if ( val ) // if we are not a set
status = status || ! UnrollRecordType(&fieldsV, val.get(), "", BifConst::Input::accept_unsupported_types);
status = status || ! UnrollRecordType(&fieldsV, val.get(), "", zeek::BifConst::Input::accept_unsupported_types);
int valfields = fieldsV.size() - idxfields;

View file

@ -67,23 +67,23 @@ bool Ascii::DoInit(const ReaderInfo& info, int num_fields, const Field* const* f
{
StopWarningSuppression();
separator.assign( (const char*) BifConst::InputAscii::separator->Bytes(),
BifConst::InputAscii::separator->Len());
separator.assign( (const char*) zeek::BifConst::InputAscii::separator->Bytes(),
zeek::BifConst::InputAscii::separator->Len());
set_separator.assign( (const char*) BifConst::InputAscii::set_separator->Bytes(),
BifConst::InputAscii::set_separator->Len());
set_separator.assign( (const char*) zeek::BifConst::InputAscii::set_separator->Bytes(),
zeek::BifConst::InputAscii::set_separator->Len());
empty_field.assign( (const char*) BifConst::InputAscii::empty_field->Bytes(),
BifConst::InputAscii::empty_field->Len());
empty_field.assign( (const char*) zeek::BifConst::InputAscii::empty_field->Bytes(),
zeek::BifConst::InputAscii::empty_field->Len());
unset_field.assign( (const char*) BifConst::InputAscii::unset_field->Bytes(),
BifConst::InputAscii::unset_field->Len());
unset_field.assign( (const char*) zeek::BifConst::InputAscii::unset_field->Bytes(),
zeek::BifConst::InputAscii::unset_field->Len());
fail_on_invalid_lines = BifConst::InputAscii::fail_on_invalid_lines;
fail_on_file_problem = BifConst::InputAscii::fail_on_file_problem;
fail_on_invalid_lines = zeek::BifConst::InputAscii::fail_on_invalid_lines;
fail_on_file_problem = zeek::BifConst::InputAscii::fail_on_file_problem;
path_prefix.assign((const char*) BifConst::InputAscii::path_prefix->Bytes(),
BifConst::InputAscii::path_prefix->Len());
path_prefix.assign((const char*) zeek::BifConst::InputAscii::path_prefix->Bytes(),
zeek::BifConst::InputAscii::path_prefix->Len());
// Set per-filter configuration options.
for ( ReaderInfo::config_map::const_iterator i = info.config.begin(); i != info.config.end(); i++ )

View file

@ -18,15 +18,15 @@ using threading::Field;
Benchmark::Benchmark(ReaderFrontend *frontend) : ReaderBackend(frontend)
{
num_lines = 0;
multiplication_factor = double(BifConst::InputBenchmark::factor);
autospread = double(BifConst::InputBenchmark::autospread);
spread = int(BifConst::InputBenchmark::spread);
add = int(BifConst::InputBenchmark::addfactor);
multiplication_factor = double(zeek::BifConst::InputBenchmark::factor);
autospread = double(zeek::BifConst::InputBenchmark::autospread);
spread = int(zeek::BifConst::InputBenchmark::spread);
add = int(zeek::BifConst::InputBenchmark::addfactor);
autospread_time = 0;
stopspreadat = int(BifConst::InputBenchmark::stopspreadat);
timedspread = double(BifConst::InputBenchmark::timedspread);
stopspreadat = int(zeek::BifConst::InputBenchmark::stopspreadat);
timedspread = double(zeek::BifConst::InputBenchmark::timedspread);
heartbeatstarttime = 0;
heartbeat_interval = double(BifConst::Threading::heartbeat_interval);
heartbeat_interval = double(zeek::BifConst::Threading::heartbeat_interval);
ascii = new threading::formatter::Ascii(this, threading::formatter::Ascii::SeparatorInfo());
}

View file

@ -19,7 +19,7 @@ Binary::Binary(ReaderFrontend *frontend)
{
if ( ! chunk_size )
{
chunk_size = BifConst::InputBinary::chunk_size;
chunk_size = zeek::BifConst::InputBinary::chunk_size;
if ( ! chunk_size )
chunk_size = 1024;
@ -82,8 +82,8 @@ bool Binary::DoInit(const ReaderInfo& info, int num_fields,
ino = 0;
firstrun = true;
path_prefix.assign((const char*) BifConst::InputBinary::path_prefix->Bytes(),
BifConst::InputBinary::path_prefix->Len());
path_prefix.assign((const char*) zeek::BifConst::InputBinary::path_prefix->Bytes(),
zeek::BifConst::InputBinary::path_prefix->Len());
if ( ! info.source || strlen(info.source) == 0 )
{

View file

@ -63,13 +63,13 @@ void Config::DoClose()
bool Config::DoInit(const ReaderInfo& info, int num_fields, const Field* const* fields)
{
fail_on_file_problem = BifConst::InputConfig::fail_on_file_problem;
fail_on_file_problem = zeek::BifConst::InputConfig::fail_on_file_problem;
set_separator.assign( (const char*) BifConst::InputConfig::set_separator->Bytes(),
BifConst::InputConfig::set_separator->Len());
set_separator.assign( (const char*) zeek::BifConst::InputConfig::set_separator->Bytes(),
zeek::BifConst::InputConfig::set_separator->Len());
empty_field.assign( (const char*) BifConst::InputConfig::empty_field->Bytes(),
BifConst::InputConfig::empty_field->Len());
empty_field.assign( (const char*) zeek::BifConst::InputConfig::empty_field->Bytes(),
zeek::BifConst::InputConfig::empty_field->Len());
formatter::Ascii::SeparatorInfo sep_info("\t", set_separator, "", empty_field);
formatter = std::unique_ptr<threading::formatter::Formatter>(new formatter::Ascii(this, sep_info));

View file

@ -34,10 +34,10 @@ Raw::Raw(ReaderFrontend *frontend) : ReaderBackend(frontend), file(nullptr, fclo
ino = 0;
forcekill = false;
offset = 0;
separator.assign( (const char*) BifConst::InputRaw::record_separator->Bytes(),
BifConst::InputRaw::record_separator->Len());
separator.assign( (const char*) zeek::BifConst::InputRaw::record_separator->Bytes(),
zeek::BifConst::InputRaw::record_separator->Len());
sep_length = BifConst::InputRaw::record_separator->Len();
sep_length = zeek::BifConst::InputRaw::record_separator->Len();
bufpos = 0;

View file

@ -24,18 +24,18 @@ SQLite::SQLite(ReaderFrontend *frontend)
fields(), num_fields(), mode(), started(), query(), db(), st()
{
set_separator.assign(
(const char*) BifConst::LogSQLite::set_separator->Bytes(),
BifConst::InputSQLite::set_separator->Len()
(const char*) zeek::BifConst::LogSQLite::set_separator->Bytes(),
zeek::BifConst::InputSQLite::set_separator->Len()
);
unset_field.assign(
(const char*) BifConst::LogSQLite::unset_field->Bytes(),
BifConst::InputSQLite::unset_field->Len()
(const char*) zeek::BifConst::LogSQLite::unset_field->Bytes(),
zeek::BifConst::InputSQLite::unset_field->Len()
);
empty_field.assign(
(const char*) BifConst::LogAscii::empty_field->Bytes(),
BifConst::InputSQLite::empty_field->Len()
(const char*) zeek::BifConst::LogAscii::empty_field->Bytes(),
zeek::BifConst::InputSQLite::empty_field->Len()
);
io = new threading::formatter::Ascii(this, threading::formatter::Ascii::SeparatorInfo(std::string(), set_separator, unset_field, empty_field));

View file

@ -115,7 +115,7 @@ void Manager::FindReadySources(std::vector<IOSource*>* ready)
// If there aren't any sources and exit_only_after_terminate is false, just
// return an empty set of sources. We want the main loop to end.
if ( Size() == 0 && ( ! BifConst::exit_only_after_terminate || terminating ) )
if ( Size() == 0 && ( ! zeek::BifConst::exit_only_after_terminate || terminating ) )
return;
double timeout = -1;

View file

@ -271,7 +271,7 @@ bool PktSrc::PrecompileBPFFilter(int index, const std::string& filter)
// Compile filter.
BPF_Program* code = new BPF_Program();
if ( ! code->Compile(BifConst::Pcap::snaplen, LinkType(), filter.c_str(), Netmask(), errbuf, sizeof(errbuf)) )
if ( ! code->Compile(zeek::BifConst::Pcap::snaplen, LinkType(), filter.c_str(), Netmask(), errbuf, sizeof(errbuf)) )
{
std::string msg = fmt("cannot compile BPF filter \"%s\"", filter.c_str());

View file

@ -27,7 +27,7 @@ void PcapDumper::Open()
{
int linktype = -1;
pd = pcap_open_dead(DLT_EN10MB, BifConst::Pcap::snaplen);
pd = pcap_open_dead(DLT_EN10MB, zeek::BifConst::Pcap::snaplen);
if ( ! pd )
{

View file

@ -111,7 +111,7 @@ void PcapSource::OpenLive()
return;
}
if ( pcap_set_snaplen(pd, BifConst::Pcap::snaplen) )
if ( pcap_set_snaplen(pd, zeek::BifConst::Pcap::snaplen) )
{
PcapError("pcap_set_snaplen");
return;
@ -137,7 +137,7 @@ void PcapSource::OpenLive()
return;
}
if ( pcap_set_buffer_size(pd, BifConst::Pcap::bufsize * 1024 * 1024) )
if ( pcap_set_buffer_size(pd, zeek::BifConst::Pcap::bufsize * 1024 * 1024) )
{
PcapError("pcap_set_buffer_size");
return;

View file

@ -35,47 +35,47 @@ Ascii::Ascii(WriterFrontend* frontend) : WriterBackend(frontend)
void Ascii::InitConfigOptions()
{
output_to_stdout = BifConst::LogAscii::output_to_stdout;
include_meta = BifConst::LogAscii::include_meta;
use_json = BifConst::LogAscii::use_json;
enable_utf_8 = BifConst::LogAscii::enable_utf_8;
gzip_level = BifConst::LogAscii::gzip_level;
output_to_stdout = zeek::BifConst::LogAscii::output_to_stdout;
include_meta = zeek::BifConst::LogAscii::include_meta;
use_json = zeek::BifConst::LogAscii::use_json;
enable_utf_8 = zeek::BifConst::LogAscii::enable_utf_8;
gzip_level = zeek::BifConst::LogAscii::gzip_level;
separator.assign(
(const char*) BifConst::LogAscii::separator->Bytes(),
BifConst::LogAscii::separator->Len()
(const char*) zeek::BifConst::LogAscii::separator->Bytes(),
zeek::BifConst::LogAscii::separator->Len()
);
set_separator.assign(
(const char*) BifConst::LogAscii::set_separator->Bytes(),
BifConst::LogAscii::set_separator->Len()
(const char*) zeek::BifConst::LogAscii::set_separator->Bytes(),
zeek::BifConst::LogAscii::set_separator->Len()
);
empty_field.assign(
(const char*) BifConst::LogAscii::empty_field->Bytes(),
BifConst::LogAscii::empty_field->Len()
(const char*) zeek::BifConst::LogAscii::empty_field->Bytes(),
zeek::BifConst::LogAscii::empty_field->Len()
);
unset_field.assign(
(const char*) BifConst::LogAscii::unset_field->Bytes(),
BifConst::LogAscii::unset_field->Len()
(const char*) zeek::BifConst::LogAscii::unset_field->Bytes(),
zeek::BifConst::LogAscii::unset_field->Len()
);
meta_prefix.assign(
(const char*) BifConst::LogAscii::meta_prefix->Bytes(),
BifConst::LogAscii::meta_prefix->Len()
(const char*) zeek::BifConst::LogAscii::meta_prefix->Bytes(),
zeek::BifConst::LogAscii::meta_prefix->Len()
);
ODesc tsfmt;
BifConst::LogAscii::json_timestamps->Describe(&tsfmt);
zeek::BifConst::LogAscii::json_timestamps->Describe(&tsfmt);
json_timestamps.assign(
(const char*) tsfmt.Bytes(),
tsfmt.Len()
);
gzip_file_extension.assign(
(const char*) BifConst::LogAscii::gzip_file_extension->Bytes(),
BifConst::LogAscii::gzip_file_extension->Len()
(const char*) zeek::BifConst::LogAscii::gzip_file_extension->Bytes(),
zeek::BifConst::LogAscii::gzip_file_extension->Len()
);
}

View file

@ -12,7 +12,7 @@ using namespace writer;
bool None::DoInit(const WriterInfo& info, int num_fields,
const threading::Field* const * fields)
{
if ( BifConst::LogNone::debug )
if ( zeek::BifConst::LogNone::debug )
{
std::cout << "[logging::writer::None]" << std::endl;
std::cout << " path=" << info.path << std::endl;

View file

@ -22,18 +22,18 @@ SQLite::SQLite(WriterFrontend* frontend)
fields(), num_fields(), db(), st()
{
set_separator.assign(
(const char*) BifConst::LogSQLite::set_separator->Bytes(),
BifConst::LogSQLite::set_separator->Len()
(const char*) zeek::BifConst::LogSQLite::set_separator->Bytes(),
zeek::BifConst::LogSQLite::set_separator->Len()
);
unset_field.assign(
(const char*) BifConst::LogSQLite::unset_field->Bytes(),
BifConst::LogSQLite::unset_field->Len()
(const char*) zeek::BifConst::LogSQLite::unset_field->Bytes(),
zeek::BifConst::LogSQLite::unset_field->Len()
);
empty_field.assign(
(const char*) BifConst::LogSQLite::empty_field->Bytes(),
BifConst::LogSQLite::empty_field->Len()
(const char*) zeek::BifConst::LogSQLite::empty_field->Bytes(),
zeek::BifConst::LogSQLite::empty_field->Len()
);
threading::formatter::Ascii::SeparatorInfo sep_info(string(), set_separator, unset_field, empty_field);

View file

@ -18,7 +18,7 @@ int main(int argc, char** argv)
auto& options = setup_result.options;
auto do_net_run = iosource_mgr->Size() > 0 ||
have_pending_timers ||
BifConst::exit_only_after_terminate;
zeek::BifConst::exit_only_after_terminate;
if ( do_net_run )
{

View file

@ -125,7 +125,7 @@ void Manager::SendHeartbeats()
void Manager::StartHeartbeatTimer()
{
heartbeat_timer_running = true;
timer_mgr->Add(new HeartbeatTimer(network_time + BifConst::Threading::heartbeat_interval));
timer_mgr->Add(new HeartbeatTimer(network_time + zeek::BifConst::Threading::heartbeat_interval));
}
void Manager::Flush()
@ -135,7 +135,7 @@ void Manager::Flush()
if ( network_time && (network_time > next_beat || ! next_beat) )
{
do_beat = true;
next_beat = ::network_time + BifConst::Threading::heartbeat_interval;
next_beat = ::network_time + zeek::BifConst::Threading::heartbeat_interval;
}
did_process = false;