mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Remove all fully-deprecated files
This commit is contained in:
parent
a8d28df569
commit
7e9d89db0a
12 changed files with 5 additions and 155 deletions
|
@ -1,2 +0,0 @@
|
||||||
#warning "BroList.h is deprecated and will be removed in v4.1. Use ZeekList.h instead."
|
|
||||||
#include "zeek/ZeekList.h"
|
|
|
@ -1,2 +0,0 @@
|
||||||
#warning "BroString.h is deprecated and will be removed in v4.1. Use ZeekString.h instead."
|
|
||||||
#include "zeek/ZeekString.h"
|
|
|
@ -130,7 +130,6 @@ include(BinPAC)
|
||||||
set(BINPAC_AUXSRC
|
set(BINPAC_AUXSRC
|
||||||
${CMAKE_SOURCE_DIR}/src/binpac.pac
|
${CMAKE_SOURCE_DIR}/src/binpac.pac
|
||||||
${CMAKE_SOURCE_DIR}/src/zeek.pac
|
${CMAKE_SOURCE_DIR}/src/zeek.pac
|
||||||
${CMAKE_SOURCE_DIR}/src/bro.pac
|
|
||||||
${CMAKE_SOURCE_DIR}/src/binpac_zeek.h
|
${CMAKE_SOURCE_DIR}/src/binpac_zeek.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -1,56 +0,0 @@
|
||||||
#warning "This file will be removed in v4.1. The code here is unused by Zeek. Notify a Zeek team member if your plugins are using this code."
|
|
||||||
|
|
||||||
// Helper class to implement continuation-like mechanisms for
|
|
||||||
// suspending/resuming tasks for incremental operation.
|
|
||||||
//
|
|
||||||
// TODO: - Document how to use this.
|
|
||||||
// - Find some nice macro-based interface?
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include "zeek/List.h"
|
|
||||||
|
|
||||||
class Continuation {
|
|
||||||
public:
|
|
||||||
Continuation() { current_level = 0; suspend_level = -1; }
|
|
||||||
|
|
||||||
// Returns true if we're called for the first time.
|
|
||||||
bool NewInstance() const
|
|
||||||
{ return suspend_level < current_level; }
|
|
||||||
|
|
||||||
// Returns true if a function called by us has suspended itself.
|
|
||||||
bool ChildSuspended() const
|
|
||||||
{ return suspend_level > current_level; }
|
|
||||||
|
|
||||||
// Returns true if we have suspended before and are now called again to
|
|
||||||
// resume our operation.
|
|
||||||
bool Resuming() const
|
|
||||||
{ return suspend_level == current_level; }
|
|
||||||
|
|
||||||
// To be called just before we suspend operation for the time being.
|
|
||||||
void Suspend()
|
|
||||||
{ suspend_level = current_level; }
|
|
||||||
|
|
||||||
// To be called right after we resumed operation.
|
|
||||||
void Resume()
|
|
||||||
{ suspend_level = -1; }
|
|
||||||
|
|
||||||
// If we call a function which may suspend itself, we need to
|
|
||||||
// enclose the call with calls to SaveContext() and RestoreContext().
|
|
||||||
void SaveContext() { ++current_level; }
|
|
||||||
void RestoreContext() { --current_level; }
|
|
||||||
|
|
||||||
// We can store some user state which can be retrieved later.
|
|
||||||
void SaveState(void* user_ptr)
|
|
||||||
{ states.replace(current_level, user_ptr); }
|
|
||||||
|
|
||||||
void* RestoreState() const
|
|
||||||
{ return states[current_level]; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
int current_level;
|
|
||||||
int suspend_level;
|
|
||||||
|
|
||||||
using voidp_list = zeek::PList<void>;
|
|
||||||
voidp_list states;
|
|
||||||
};
|
|
|
@ -1,4 +0,0 @@
|
||||||
#warning "Net.h is deprecated and will be removed in v4.1. Use RunState.h and/or ScannedFile.h instead."
|
|
||||||
|
|
||||||
#include "zeek/RunState.h"
|
|
||||||
#include "zeek/ScannedFile.h"
|
|
|
@ -1,43 +0,0 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
|
||||||
|
|
||||||
#include "zeek-config.h"
|
|
||||||
#include "zeek/PacketDumper.h"
|
|
||||||
|
|
||||||
#include "zeek/Reporter.h"
|
|
||||||
#include "zeek/util.h"
|
|
||||||
#include "zeek/iosource/PktDumper.h"
|
|
||||||
|
|
||||||
namespace zeek::detail {
|
|
||||||
|
|
||||||
PacketDumper::PacketDumper(pcap_dumper_t* arg_pkt_dump)
|
|
||||||
{
|
|
||||||
last_timestamp.tv_sec = last_timestamp.tv_usec = 0;
|
|
||||||
|
|
||||||
pkt_dump = arg_pkt_dump;
|
|
||||||
if ( ! pkt_dump )
|
|
||||||
reporter->InternalError("PacketDumper: nil dump file");
|
|
||||||
}
|
|
||||||
|
|
||||||
void PacketDumper::DumpPacket(const struct pcap_pkthdr* hdr,
|
|
||||||
const u_char* pkt, int len)
|
|
||||||
{
|
|
||||||
if ( pkt_dump )
|
|
||||||
{
|
|
||||||
struct pcap_pkthdr h = *hdr;
|
|
||||||
h.caplen = len;
|
|
||||||
if ( h.caplen > hdr->caplen )
|
|
||||||
reporter->InternalError("bad modified caplen");
|
|
||||||
|
|
||||||
pcap_dump((u_char*) pkt_dump, &h, pkt);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PacketDumper::SortTimeStamp(struct timeval* timestamp)
|
|
||||||
{
|
|
||||||
if ( util::time_compare(&last_timestamp, timestamp) > 0 )
|
|
||||||
*timestamp = last_timestamp;
|
|
||||||
else
|
|
||||||
last_timestamp = *timestamp;
|
|
||||||
}
|
|
||||||
|
|
||||||
} // namespace zeek::detail
|
|
|
@ -1,26 +0,0 @@
|
||||||
#warning "This file will be removed in v4.1. The code here is unused by Zeek. Notify a Zeek team member if your plugins are using this code."
|
|
||||||
|
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
|
||||||
|
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#include <sys/types.h> // for u_char
|
|
||||||
#include <pcap.h>
|
|
||||||
|
|
||||||
namespace zeek::detail {
|
|
||||||
|
|
||||||
class PacketDumper {
|
|
||||||
public:
|
|
||||||
explicit PacketDumper(pcap_dumper_t* pkt_dump);
|
|
||||||
|
|
||||||
void DumpPacket(const struct pcap_pkthdr* hdr,
|
|
||||||
const u_char* pkt, int len);
|
|
||||||
|
|
||||||
protected:
|
|
||||||
pcap_dumper_t* pkt_dump;
|
|
||||||
struct timeval last_timestamp;
|
|
||||||
|
|
||||||
void SortTimeStamp(struct timeval* timestamp);
|
|
||||||
};
|
|
||||||
|
|
||||||
} // namespace zeek::detail
|
|
|
@ -1,4 +0,0 @@
|
||||||
#pragma once
|
|
||||||
|
|
||||||
#warning "binpac_bro.h is deprecated and will be removed in v4.1. Use binpac_zeek.h instead."
|
|
||||||
#include "zeek/binpac_zeek.h"
|
|
11
src/bro.pac
11
src/bro.pac
|
@ -1,11 +0,0 @@
|
||||||
%extern{
|
|
||||||
#warning "bro.pac is deprecated and will be removed in v4.1. Use zeek.pac instead."
|
|
||||||
#include "zeek/binpac_bro.h"
|
|
||||||
%}
|
|
||||||
|
|
||||||
extern type BroAnalyzer;
|
|
||||||
extern type BroVal;
|
|
||||||
extern type BroPortVal;
|
|
||||||
extern type BroStringVal;
|
|
||||||
|
|
||||||
function network_time(): double;
|
|
|
@ -35,7 +35,7 @@ EOF
|
||||||
cat >src/foo.bif <<EOF
|
cat >src/foo.bif <<EOF
|
||||||
function hello_plugin_world%(%): string
|
function hello_plugin_world%(%): string
|
||||||
%{
|
%{
|
||||||
return new StringVal("Hello from the plugin!");
|
return zeek::make_intrusive<zeek::StringVal>("Hello from the plugin!");
|
||||||
%}
|
%}
|
||||||
|
|
||||||
event plugin_event%(foo: count%);
|
event plugin_event%(foo: count%);
|
||||||
|
@ -44,4 +44,3 @@ EOF
|
||||||
cat >activate.zeek <<EOF
|
cat >activate.zeek <<EOF
|
||||||
@load-plugin Demo::Foo
|
@load-plugin Demo::Foo
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%include binpac.pac
|
%include binpac.pac
|
||||||
%include bro.pac
|
%include zeek.pac
|
||||||
|
|
||||||
%extern{
|
%extern{
|
||||||
#include "foo.bif.h"
|
#include "foo.bif.h"
|
||||||
|
@ -11,7 +11,7 @@ analyzer FOO withcontext {
|
||||||
};
|
};
|
||||||
|
|
||||||
# Our connection consists of two flows, one in each direction.
|
# Our connection consists of two flows, one in each direction.
|
||||||
connection FOO_Conn(bro_analyzer: BroAnalyzer) {
|
connection FOO_Conn(bro_analyzer: ZeekAnalyzer) {
|
||||||
upflow = FOO_Flow(true);
|
upflow = FOO_Flow(true);
|
||||||
downflow = FOO_Flow(false);
|
downflow = FOO_Flow(false);
|
||||||
};
|
};
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
%include binpac.pac
|
%include binpac.pac
|
||||||
%include bro.pac
|
%include zeek.pac
|
||||||
|
|
||||||
%extern{
|
%extern{
|
||||||
#include "Foo.h"
|
#include "Foo.h"
|
||||||
|
@ -12,7 +12,7 @@ analyzer Foo withcontext {
|
||||||
flow: Foo_Flow;
|
flow: Foo_Flow;
|
||||||
};
|
};
|
||||||
|
|
||||||
connection Foo_Conn(bro_analyzer: BroAnalyzer) {
|
connection Foo_Conn(bro_analyzer: ZeekAnalyzer) {
|
||||||
upflow = Foo_Flow(true);
|
upflow = Foo_Flow(true);
|
||||||
downflow = Foo_Flow(false);
|
downflow = Foo_Flow(false);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue