diff --git a/scripts/spicy/zeek_rt.hlt b/scripts/spicy/zeek_rt.hlt index d90f9c5187..3f4dd28adc 100644 --- a/scripts/spicy/zeek_rt.hlt +++ b/scripts/spicy/zeek_rt.hlt @@ -17,7 +17,7 @@ type ZeekTypeTag = enum { Addr, Any, Bool, Count, Double, Enum, Error, File, Func, Int, Interval, List, Opaque, Pattern, Port, Record, String, Subnet, Table, Time, Type, Vector, Void } &cxxname="::zeek::spicy::rt::ZeekTypeTag"; -declare public void register_spicy_module_begin(string name, string description, time mtime) &cxxname="zeek::spicy::rt::register_spicy_module_begin"; +declare public void register_spicy_module_begin(string name, string description) &cxxname="zeek::spicy::rt::register_spicy_module_begin"; declare public void register_protocol_analyzer(string name, hilti::Protocol protocol, vector ports, string parser_orig, string parser_resp, string replaces, string linker_scope) &cxxname="zeek::spicy::rt::register_protocol_analyzer" &have_prototype; declare public void register_file_analyzer(string name, vector mime_types, string parser, string replaces, string linker_scope) &cxxname="zeek::spicy::rt::register_file_analyzer" &have_prototype; declare public void register_packet_analyzer(string name, string parser, string replaces, string linker_scope) &cxxname="zeek::spicy::rt::register_packet_analyzer" &have_prototype; diff --git a/src/spicy/manager.cc b/src/spicy/manager.cc index 063fa495ad..87543e33aa 100644 --- a/src/spicy/manager.cc +++ b/src/spicy/manager.cc @@ -47,10 +47,9 @@ static std::pair parseID(const std::string& s) { Manager::~Manager() {} -void Manager::registerSpicyModuleBegin(const std::string& name, const std::string& description, hilti::rt::Time mtime) { +void Manager::registerSpicyModuleBegin(const std::string& name, const std::string& description) { assert(! _module_info); - _module_info = - std::make_unique(name, description, static_cast(mtime.seconds())); + _module_info = std::make_unique(name, description); } void Manager::registerSpicyModuleEnd() { diff --git a/src/spicy/manager.h b/src/spicy/manager.h index 2c5fac9008..6f74176d50 100644 --- a/src/spicy/manager.h +++ b/src/spicy/manager.h @@ -75,10 +75,8 @@ public: * and to index it, inside the Zeekygen documentation. * @param description textual description in reST that will be shown for * this module inside the Zeekygen documentation - * @param mtime timestamp indicating last time of modification of any of - * the module's content; used by Zeekygen to trigger rebuilds as necessary */ - void registerSpicyModuleBegin(const std::string& name, const std::string& description, hilti::rt::Time mtime); + void registerSpicyModuleBegin(const std::string& name, const std::string& description); /** * Runtime method to register a protocol analyzer with its Zeek-side diff --git a/src/spicy/runtime-support.cc b/src/spicy/runtime-support.cc index cd812cf106..0319ba15ee 100644 --- a/src/spicy/runtime-support.cc +++ b/src/spicy/runtime-support.cc @@ -20,9 +20,8 @@ using namespace zeek; using namespace zeek::spicy; -void rt::register_spicy_module_begin(const std::string& name, const std::string& description, - const hilti::rt::Time& mtime) { - spicy_mgr->registerSpicyModuleBegin(name, description, mtime); +void rt::register_spicy_module_begin(const std::string& name, const std::string& description) { + spicy_mgr->registerSpicyModuleBegin(name, description); } void rt::register_spicy_module_end() { spicy_mgr->registerSpicyModuleEnd(); } diff --git a/src/spicy/runtime-support.h b/src/spicy/runtime-support.h index 60a4890ea2..d84d4258a5 100644 --- a/src/spicy/runtime-support.h +++ b/src/spicy/runtime-support.h @@ -94,7 +94,7 @@ public: * Begins registration of a Spicy EVT module. All subsequent, other `register_*()` * function call will be associated with this module for documentation purposes. */ -void register_spicy_module_begin(const std::string& name, const std::string& description, const hilti::rt::Time& mtime); +void register_spicy_module_begin(const std::string& name, const std::string& description); /** * Registers a Spicy protocol analyzer with its EVT meta information with the diff --git a/src/spicy/spicyz/glue-compiler.cc b/src/spicy/spicyz/glue-compiler.cc index 550813539f..f81478f2ad 100644 --- a/src/spicy/spicyz/glue-compiler.cc +++ b/src/spicy/spicyz/glue-compiler.cc @@ -987,10 +987,10 @@ bool GlueCompiler::compile() { return false; if ( ! _doc_id.empty() ) { - auto mtime = hilti::expression::Ctor(hilti::ctor::Time(hilti::rt::time::current_time())); - preinit_body.addCall("zeek_rt::register_spicy_module_begin", - {hilti::builder::string_mut(_doc_id), hilti::builder::string_mut(_doc_description), - mtime}); + preinit_body.addCall("zeek_rt::register_spicy_module_begin", { + hilti::builder::string_mut(_doc_id), + hilti::builder::string_mut(_doc_description), + }); } for ( auto& a : _protocol_analyzers ) { diff --git a/src/zeekygen/SpicyModuleInfo.h b/src/zeekygen/SpicyModuleInfo.h index 75da7eeedd..634d0c3228 100644 --- a/src/zeekygen/SpicyModuleInfo.h +++ b/src/zeekygen/SpicyModuleInfo.h @@ -22,8 +22,8 @@ public: * @param name name of the Spicy EVT module. * @param description text describing the module further */ - explicit SpicyModuleInfo(const std::string& name, const std::string& description, time_t mtime) - : name(name), description(description), mtime(mtime) {} + explicit SpicyModuleInfo(const std::string& name, const std::string& description) + : name(name), description(description) {} /** @return textual description of the module */ const auto& Description() const { return description; } @@ -45,13 +45,12 @@ public: void AddBifItem(const std::string& id, plugin::BifItem::Type type) { bif_items.emplace_back(id, type); } private: - time_t DoGetModificationTime() const override { return mtime; } + time_t DoGetModificationTime() const override { return time(nullptr); } std::string DoName() const override { return name; } std::string DoReStructuredText(bool roles_only) const override { return ""; } std::string name; std::string description; - time_t mtime; std::list components; std::list bif_items;