diff --git a/src/BroList.h b/src/BroList.h deleted file mode 100644 index 770e300917..0000000000 --- a/src/BroList.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning "BroList.h is deprecated and will be removed in v4.1. Use ZeekList.h instead." -#include "zeek/ZeekList.h" diff --git a/src/BroString.h b/src/BroString.h deleted file mode 100644 index 3bf8b27b53..0000000000 --- a/src/BroString.h +++ /dev/null @@ -1,2 +0,0 @@ -#warning "BroString.h is deprecated and will be removed in v4.1. Use ZeekString.h instead." -#include "zeek/ZeekString.h" diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 05822ff342..854e57fc64 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -130,7 +130,6 @@ 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_zeek.h ) diff --git a/src/Continuation.h b/src/Continuation.h deleted file mode 100644 index 6ae5427f0e..0000000000 --- a/src/Continuation.h +++ /dev/null @@ -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; - voidp_list states; -}; diff --git a/src/Net.h b/src/Net.h deleted file mode 100644 index f61aeb01d8..0000000000 --- a/src/Net.h +++ /dev/null @@ -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" diff --git a/src/PacketDumper.cc b/src/PacketDumper.cc deleted file mode 100644 index a553b2613b..0000000000 --- a/src/PacketDumper.cc +++ /dev/null @@ -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 diff --git a/src/PacketDumper.h b/src/PacketDumper.h deleted file mode 100644 index edf0eb834c..0000000000 --- a/src/PacketDumper.h +++ /dev/null @@ -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 // for u_char -#include - -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 diff --git a/src/binpac_bro.h b/src/binpac_bro.h deleted file mode 100644 index 41c27eae77..0000000000 --- a/src/binpac_bro.h +++ /dev/null @@ -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" diff --git a/src/bro.pac b/src/bro.pac deleted file mode 100644 index 7bfe202d79..0000000000 --- a/src/bro.pac +++ /dev/null @@ -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; diff --git a/testing/btest/plugins/bifs-and-scripts-install.sh b/testing/btest/plugins/bifs-and-scripts-install.sh index 1c8e4a28b9..c93edfaa29 100644 --- a/testing/btest/plugins/bifs-and-scripts-install.sh +++ b/testing/btest/plugins/bifs-and-scripts-install.sh @@ -35,7 +35,7 @@ EOF cat >src/foo.bif <("Hello from the plugin!"); %} event plugin_event%(foo: count%); @@ -44,4 +44,3 @@ EOF cat >activate.zeek <