mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
[Spicy] Bump auxil/spicy/
to latest development snapshot.
This commit is contained in:
parent
92868804b1
commit
2307c62a61
6 changed files with 28 additions and 21 deletions
|
@ -1 +1 @@
|
|||
Subproject commit c26202767742818a0ef0e5538ea7df5ca54620b1
|
||||
Subproject commit f9cf2115cf330e7dff61f438ba04c96d9f1a132c
|
|
@ -18,9 +18,9 @@ type ZeekTypeTag = enum {
|
|||
} &cxxname="::zeek::spicy::rt::ZeekTypeTag";
|
||||
|
||||
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<PortRange> 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<string> 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;
|
||||
declare public void register_protocol_analyzer(string name, hilti::Protocol protocol, vector<PortRange> ports, string parser_orig, string parser_resp, string replaces, uint<64> linker_scope) &cxxname="zeek::spicy::rt::register_protocol_analyzer" &have_prototype;
|
||||
declare public void register_file_analyzer(string name, vector<string> mime_types, string parser, string replaces, uint<64> linker_scope) &cxxname="zeek::spicy::rt::register_file_analyzer" &have_prototype;
|
||||
declare public void register_packet_analyzer(string name, string parser, string replaces, uint<64> linker_scope) &cxxname="zeek::spicy::rt::register_packet_analyzer" &have_prototype;
|
||||
declare public void register_type(string ns, string id, BroType t) &cxxname="zeek::spicy::rt::register_type" &have_prototype;
|
||||
declare public void register_spicy_module_end() &cxxname="zeek::spicy::rt::register_spicy_module_end";
|
||||
|
||||
|
|
|
@ -64,7 +64,8 @@ void Manager::registerSpicyModuleEnd() {
|
|||
void Manager::registerProtocolAnalyzer(const std::string& name, hilti::rt::Protocol proto,
|
||||
const hilti::rt::Vector<::zeek::spicy::rt::PortRange>& ports,
|
||||
const std::string& parser_orig, const std::string& parser_resp,
|
||||
const std::string& replaces, const std::string& linker_scope) {
|
||||
const std::string& replaces,
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope) {
|
||||
SPICY_DEBUG(hilti::rt::fmt("Have Spicy protocol analyzer %s", name));
|
||||
|
||||
ProtocolAnalyzerInfo info;
|
||||
|
@ -125,7 +126,7 @@ void Manager::registerProtocolAnalyzer(const std::string& name, hilti::rt::Proto
|
|||
|
||||
void Manager::registerFileAnalyzer(const std::string& name, const hilti::rt::Vector<std::string>& mime_types,
|
||||
const std::string& parser, const std::string& replaces,
|
||||
const std::string& linker_scope) {
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope) {
|
||||
SPICY_DEBUG(hilti::rt::fmt("Have Spicy file analyzer %s", name));
|
||||
|
||||
FileAnalyzerInfo info;
|
||||
|
@ -170,7 +171,7 @@ void Manager::registerFileAnalyzer(const std::string& name, const hilti::rt::Vec
|
|||
}
|
||||
|
||||
void Manager::registerPacketAnalyzer(const std::string& name, const std::string& parser, const std::string& replaces,
|
||||
const std::string& linker_scope) {
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope) {
|
||||
SPICY_DEBUG(hilti::rt::fmt("Have Spicy packet analyzer %s", name));
|
||||
|
||||
PacketAnalyzerInfo info;
|
||||
|
@ -651,7 +652,7 @@ void Manager::InitPostScript() {
|
|||
|
||||
// Fill in the parser information now that we derived from the ASTs.
|
||||
auto find_parser = [](const std::string& analyzer, const std::string& parser,
|
||||
const std::string& linker_scope) -> const ::spicy::rt::Parser* {
|
||||
const auto& linker_scope) -> const ::spicy::rt::Parser* {
|
||||
if ( parser.empty() )
|
||||
return nullptr;
|
||||
|
||||
|
|
|
@ -2,15 +2,16 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include <string>
|
||||
#include <tuple>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
#include <hilti/rt/library.h>
|
||||
#include <hilti/rt/logging.h>
|
||||
#include <hilti/rt/safe-int.h>
|
||||
#include <hilti/rt/types/port.h>
|
||||
|
||||
#include "zeek/Scope.h"
|
||||
|
@ -99,7 +100,7 @@ public:
|
|||
void registerProtocolAnalyzer(const std::string& name, hilti::rt::Protocol proto,
|
||||
const hilti::rt::Vector<::zeek::spicy::rt::PortRange>& ports,
|
||||
const std::string& parser_orig, const std::string& parser_resp,
|
||||
const std::string& replaces, const std::string& linker_scope);
|
||||
const std::string& replaces, const hilti::rt::integer::safe<uint64_t>& linker_scope);
|
||||
|
||||
/**
|
||||
* Runtime method to register a file analyzer with its Zeek-side
|
||||
|
@ -117,7 +118,8 @@ public:
|
|||
* registration
|
||||
*/
|
||||
void registerFileAnalyzer(const std::string& name, const hilti::rt::Vector<std::string>& mime_types,
|
||||
const std::string& parser, const std::string& replaces, const std::string& linker_scope);
|
||||
const std::string& parser, const std::string& replaces,
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope);
|
||||
|
||||
/**
|
||||
* Runtime method to register a packet analyzer with its Zeek-side
|
||||
|
@ -134,7 +136,7 @@ public:
|
|||
* registration
|
||||
*/
|
||||
void registerPacketAnalyzer(const std::string& name, const std::string& parser, const std::string& replaces,
|
||||
const std::string& linker_scope);
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope);
|
||||
|
||||
/**
|
||||
* Runtime method to register a Spicy-generated type with Zeek. The type
|
||||
|
@ -345,7 +347,7 @@ private:
|
|||
std::string name_replaces;
|
||||
hilti::rt::Protocol protocol = hilti::rt::Protocol::Undef;
|
||||
std::vector<::zeek::spicy::rt::PortRange> ports; // we keep this sorted
|
||||
std::string linker_scope;
|
||||
hilti::rt::integer::safe<uint64_t> linker_scope;
|
||||
|
||||
// Computed and available once the analyzer has been registered.
|
||||
std::string name_zeek;
|
||||
|
@ -371,7 +373,7 @@ private:
|
|||
std::string name_parser;
|
||||
std::string name_replaces;
|
||||
hilti::rt::Vector<std::string> mime_types;
|
||||
std::string linker_scope;
|
||||
hilti::rt::integer::safe<uint64_t> linker_scope;
|
||||
|
||||
// Computed and available once the analyzer has been registered.
|
||||
std::string name_zeek;
|
||||
|
@ -395,7 +397,7 @@ private:
|
|||
std::string name_analyzer;
|
||||
std::string name_parser;
|
||||
std::string name_replaces;
|
||||
std::string linker_scope;
|
||||
hilti::rt::integer::safe<uint64_t> linker_scope;
|
||||
|
||||
// Computed and available once the analyzer has been registered.
|
||||
std::string name_zeek;
|
||||
|
|
|
@ -29,20 +29,21 @@ void rt::register_spicy_module_end() { spicy_mgr->registerSpicyModuleEnd(); }
|
|||
void rt::register_protocol_analyzer(const std::string& name, hilti::rt::Protocol proto,
|
||||
const hilti::rt::Vector<::zeek::spicy::rt::PortRange>& ports,
|
||||
const std::string& parser_orig, const std::string& parser_resp,
|
||||
const std::string& replaces, const std::string& linker_scope) {
|
||||
const std::string& replaces,
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope) {
|
||||
auto _ = hilti::rt::profiler::start("zeek/rt/register_protocol_analyzer");
|
||||
spicy_mgr->registerProtocolAnalyzer(name, proto, ports, parser_orig, parser_resp, replaces, linker_scope);
|
||||
}
|
||||
|
||||
void rt::register_file_analyzer(const std::string& name, const hilti::rt::Vector<std::string>& mime_types,
|
||||
const std::string& parser, const std::string& replaces,
|
||||
const std::string& linker_scope) {
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope) {
|
||||
auto _ = hilti::rt::profiler::start("zeek/rt/register_file_analyzer");
|
||||
spicy_mgr->registerFileAnalyzer(name, mime_types, parser, replaces, linker_scope);
|
||||
}
|
||||
|
||||
void rt::register_packet_analyzer(const std::string& name, const std::string& parser, const std::string& replaces,
|
||||
const std::string& linker_scope) {
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope) {
|
||||
auto _ = hilti::rt::profiler::start("zeek/rt/register_packet_analyzer");
|
||||
spicy_mgr->registerPacketAnalyzer(name, parser, replaces, linker_scope);
|
||||
}
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
#include <optional>
|
||||
#include <ostream>
|
||||
#include <string>
|
||||
|
@ -17,6 +18,7 @@
|
|||
#include <hilti/rt/extension-points.h>
|
||||
#include <hilti/rt/fmt.h>
|
||||
#include <hilti/rt/profiler.h>
|
||||
#include <hilti/rt/safe-int.h>
|
||||
#include <hilti/rt/type-info.h>
|
||||
#include <hilti/rt/types/all.h>
|
||||
#include <hilti/rt/util.h>
|
||||
|
@ -111,14 +113,15 @@ void register_spicy_module_begin(const std::string& id, const std::string& descr
|
|||
void register_protocol_analyzer(const std::string& id, hilti::rt::Protocol proto,
|
||||
const hilti::rt::Vector<::zeek::spicy::rt::PortRange>& ports,
|
||||
const std::string& parser_orig, const std::string& parser_resp,
|
||||
const std::string& replaces, const std::string& linker_scope);
|
||||
const std::string& replaces, const hilti::rt::integer::safe<uint64_t>& linker_scope);
|
||||
|
||||
/**
|
||||
* Registers a Spicy file analyzer with its EVT meta information with the
|
||||
* plugin's runtime.
|
||||
*/
|
||||
void register_file_analyzer(const std::string& id, const hilti::rt::Vector<std::string>& mime_types,
|
||||
const std::string& parser, const std::string& replaces, const std::string& linker_scope);
|
||||
const std::string& parser, const std::string& replaces,
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope);
|
||||
|
||||
/** Reports a Zeek-side "weird". */
|
||||
void weird(const std::string& id, const std::string& addl);
|
||||
|
@ -128,7 +131,7 @@ void weird(const std::string& id, const std::string& addl);
|
|||
* plugin's runtime.
|
||||
*/
|
||||
void register_packet_analyzer(const std::string& id, const std::string& parser, const std::string& replaces,
|
||||
const std::string& linker_scope);
|
||||
const hilti::rt::integer::safe<uint64_t>& linker_scope);
|
||||
|
||||
/** Registers a Spicy-generated type to make it available inside Zeek. */
|
||||
void register_type(const std::string& ns, const std::string& id, const TypePtr& type);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue