mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
Rename the bro-related binpac files to zeek
This commit is contained in:
parent
80a573d2b2
commit
ece65ceff6
6 changed files with 65 additions and 43 deletions
|
@ -125,14 +125,15 @@ include(BinPAC)
|
|||
|
||||
set(BINPAC_AUXSRC
|
||||
${CMAKE_SOURCE_DIR}/src/binpac.pac
|
||||
${CMAKE_SOURCE_DIR}/src/zeek.pac
|
||||
${CMAKE_SOURCE_DIR}/src/bro.pac
|
||||
${CMAKE_SOURCE_DIR}/src/binpac_bro.h
|
||||
${CMAKE_SOURCE_DIR}/src/binpac_zeek.h
|
||||
)
|
||||
|
||||
binpac_target(binpac-lib.pac)
|
||||
list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}")
|
||||
|
||||
binpac_target(binpac_bro-lib.pac)
|
||||
binpac_target(binpac_zeek-lib.pac)
|
||||
list(APPEND BINPAC_OUTPUTS "${BINPAC_OUTPUT_CC}")
|
||||
|
||||
########################################################################
|
||||
|
|
|
@ -1,42 +1,4 @@
|
|||
#pragma once
|
||||
|
||||
#include "util.h"
|
||||
#include "Val.h"
|
||||
#include "IntrusivePtr.h"
|
||||
#include "analyzer/Analyzer.h"
|
||||
#include "file_analysis/Analyzer.h"
|
||||
#include "event.bif.func_h"
|
||||
|
||||
#include "binpac.h"
|
||||
|
||||
namespace binpac {
|
||||
|
||||
using BroAnalyzer = zeek::analyzer::Analyzer*;
|
||||
using BroFileAnalyzer = zeek::file_analysis::Analyzer;
|
||||
using BroVal = zeek::Val*;
|
||||
using BroPortVal = zeek::PortVal*;
|
||||
using BroStringVal = zeek::StringVal*;
|
||||
|
||||
[[deprecated("Remove in v4.1. Use StringVal constructor directly.")]]
|
||||
inline zeek::StringVal* string_to_val(string const &str)
|
||||
{
|
||||
return new zeek::StringVal(str.c_str());
|
||||
}
|
||||
|
||||
[[deprecated("Remove in v4.1. Use binpac::to_stringval() instead.")]]
|
||||
inline zeek::StringVal* bytestring_to_val(const_bytestring const &str)
|
||||
{
|
||||
return new zeek::StringVal(str.length(), (const char*) str.begin());
|
||||
}
|
||||
|
||||
inline zeek::StringValPtr to_stringval(const_bytestring const& str)
|
||||
{
|
||||
return zeek::make_intrusive<zeek::StringVal>(str.length(), (const char*) str.begin());
|
||||
}
|
||||
|
||||
zeek::StringValPtr utf16_to_utf8_val(zeek::Connection* conn, const bytestring& utf16);
|
||||
|
||||
[[deprecated("Remove in v4.1. Use utf16_to_utf8_val() instead.")]]
|
||||
zeek::StringVal* utf16_bytestring_to_utf8_val(zeek::Connection* conn, const bytestring& utf16);
|
||||
|
||||
} // namespace binpac
|
||||
#warning "binpac_bro.h is deprecated and will be removed in v4.1. Use binpac_zeek.h instead."
|
||||
#include "binpac_zeek.h"
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
%extern{
|
||||
#include "binpac_bro.h"
|
||||
#include "binpac_zeek.h"
|
||||
#include "util.h"
|
||||
#include "Reporter.h"
|
||||
#include "Val.h"
|
48
src/binpac_zeek.h
Normal file
48
src/binpac_zeek.h
Normal file
|
@ -0,0 +1,48 @@
|
|||
#pragma once
|
||||
|
||||
#include "util.h"
|
||||
#include "Val.h"
|
||||
#include "IntrusivePtr.h"
|
||||
#include "analyzer/Analyzer.h"
|
||||
#include "file_analysis/Analyzer.h"
|
||||
#include "event.bif.func_h"
|
||||
|
||||
#include "binpac.h"
|
||||
|
||||
namespace binpac {
|
||||
|
||||
using ZeekAnalyzer = zeek::analyzer::Analyzer*;
|
||||
using ZeekFileAnalyzer = zeek::file_analysis::Analyzer;
|
||||
using ZeekVal = zeek::Val*;
|
||||
using ZeekPortVal = zeek::PortVal*;
|
||||
using ZeekStringVal = zeek::StringVal*;
|
||||
|
||||
using BroAnalyzer [[deprecated("Remove in v4.1. Use ZeekAnalyzer.")]] = ZeekAnalyzer;
|
||||
using BroFileAnalyzer [[deprecated("Remove in v4.1. Use ZeekFileAnalyzer.")]] = ZeekFileAnalyzer;
|
||||
using BroVal [[deprecated("Remove in v4.1. Use ZeekVal.")]] = ZeekVal;
|
||||
using BroPortVal [[deprecated("Remove in v4.1. Use ZeekPortVal.")]] = ZeekPortVal;
|
||||
using BroStringVal [[deprecated("Remove in v4.1. Use ZeekStringVal.")]] = ZeekStringVal;
|
||||
|
||||
[[deprecated("Remove in v4.1. Use StringVal constructor directly.")]]
|
||||
inline zeek::StringVal* string_to_val(string const &str)
|
||||
{
|
||||
return new zeek::StringVal(str.c_str());
|
||||
}
|
||||
|
||||
[[deprecated("Remove in v4.1. Use binpac::to_stringval() instead.")]]
|
||||
inline zeek::StringVal* bytestring_to_val(const_bytestring const &str)
|
||||
{
|
||||
return new zeek::StringVal(str.length(), (const char*) str.begin());
|
||||
}
|
||||
|
||||
inline zeek::StringValPtr to_stringval(const_bytestring const& str)
|
||||
{
|
||||
return zeek::make_intrusive<zeek::StringVal>(str.length(), (const char*) str.begin());
|
||||
}
|
||||
|
||||
zeek::StringValPtr utf16_to_utf8_val(zeek::Connection* conn, const bytestring& utf16);
|
||||
|
||||
[[deprecated("Remove in v4.1. Use utf16_to_utf8_val() instead.")]]
|
||||
zeek::StringVal* utf16_bytestring_to_utf8_val(zeek::Connection* conn, const bytestring& utf16);
|
||||
|
||||
} // namespace binpac
|
|
@ -1,4 +1,5 @@
|
|||
%extern{
|
||||
#warning "bro.pac is deprecated and will be removed in v4.1. Use zeek.pac instead."
|
||||
#include "binpac_bro.h"
|
||||
%}
|
||||
|
||||
|
|
10
src/zeek.pac
Normal file
10
src/zeek.pac
Normal file
|
@ -0,0 +1,10 @@
|
|||
%extern{
|
||||
#include "binpac_zeek.h"
|
||||
%}
|
||||
|
||||
extern type ZeekAnalyzer;
|
||||
extern type ZeekVal;
|
||||
extern type ZeekPortVal;
|
||||
extern type ZeekStringVal;
|
||||
|
||||
function network_time(): double;
|
Loading…
Add table
Add a link
Reference in a new issue