mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Merge remote-tracking branch 'MaxKellermann/includes'
* MaxKellermann/includes: broker: include cleanup file_analysis: include cleanup file_analysis/Analyzer: eliminate duplicate constructor probabilistic/Topk: include cleanup digest: eliminate the "Reporter.h" include Val: eliminate the "RE.h" include Val: eliminate the "BroString.h" include Val: eliminate the "CompHash.h" include Val: forward-declare class PDict, reduce includes Val: eliminate the "Scope.h" include
This commit is contained in:
commit
cf8496dc0a
58 changed files with 283 additions and 136 deletions
23
CHANGES
23
CHANGES
|
@ -1,4 +1,27 @@
|
||||||
|
|
||||||
|
3.2.0-dev.36 | 2020-02-14 10:29:36 -0700
|
||||||
|
|
||||||
|
* broker: include cleanup (Max Kellermann)
|
||||||
|
|
||||||
|
* file_analysis: include cleanup (Max Kellermann)
|
||||||
|
|
||||||
|
* file_analysis/Analyzer: eliminate duplicate constructor (Max Kellermann)
|
||||||
|
|
||||||
|
* probabilistic/Topk: include cleanup (Max Kellermann)
|
||||||
|
|
||||||
|
* digest: eliminate the "Reporter.h" include (Max Kellermann)
|
||||||
|
|
||||||
|
* Val: eliminate the "RE.h" include (Max Kellermann)
|
||||||
|
|
||||||
|
* Val: eliminate the "BroString.h" include (Max Kellermann)
|
||||||
|
|
||||||
|
* Val: eliminate the "CompHash.h" include (Max Kellermann)
|
||||||
|
|
||||||
|
* Val: forward-declare class PDict, reduce includes (Max Kellermann)
|
||||||
|
|
||||||
|
* Val: eliminate the "Scope.h" include (Max Kellermann)
|
||||||
|
|
||||||
|
|
||||||
3.2.0-dev.25 | 2020-02-13 19:05:56 -0800
|
3.2.0-dev.25 | 2020-02-13 19:05:56 -0800
|
||||||
|
|
||||||
* Reset the number of entries in a dict when calling Clear() (Tim Wojtulewicz, Corelight)
|
* Reset the number of entries in a dict when calling Clear() (Tim Wojtulewicz, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
3.2.0-dev.25
|
3.2.0-dev.36
|
||||||
|
|
|
@ -205,6 +205,7 @@ set_source_files_properties(nb_dns.c PROPERTIES COMPILE_FLAGS
|
||||||
|
|
||||||
set(MAIN_SRCS
|
set(MAIN_SRCS
|
||||||
main.cc
|
main.cc
|
||||||
|
digest.cc
|
||||||
net_util.cc
|
net_util.cc
|
||||||
util.cc
|
util.cc
|
||||||
module_util.cc
|
module_util.cc
|
||||||
|
|
|
@ -3,7 +3,10 @@
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "CompHash.h"
|
#include "CompHash.h"
|
||||||
|
#include "BroString.h"
|
||||||
|
#include "Dict.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
|
#include "RE.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
|
|
||||||
|
|
|
@ -31,6 +31,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
|
#include "ID.h"
|
||||||
|
|
||||||
#include "broker/Manager.h"
|
#include "broker/Manager.h"
|
||||||
#include "broker/Data.h"
|
#include "broker/Data.h"
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "IntrusivePtr.h"
|
#include "IntrusivePtr.h"
|
||||||
#include "Trigger.h"
|
#include "Trigger.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
|
#include "ID.h"
|
||||||
|
|
||||||
vector<Frame*> g_frame_stack;
|
vector<Frame*> g_frame_stack;
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "Type.h"
|
#include "Type.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
|
#include "BroString.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
|
||||||
static RecordType* ip4_hdr_type = 0;
|
static RecordType* ip4_hdr_type = 0;
|
||||||
|
|
|
@ -30,6 +30,7 @@ extern "C" {
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Scope.h"
|
||||||
#include "Anon.h"
|
#include "Anon.h"
|
||||||
#include "PacketDumper.h"
|
#include "PacketDumper.h"
|
||||||
#include "iosource/Manager.h"
|
#include "iosource/Manager.h"
|
||||||
|
|
|
@ -3,8 +3,10 @@
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
|
||||||
#include "OpaqueVal.h"
|
#include "OpaqueVal.h"
|
||||||
|
#include "CompHash.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Scope.h"
|
||||||
#include "Desc.h"
|
#include "Desc.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
#include "probabilistic/BloomFilter.h"
|
#include "probabilistic/BloomFilter.h"
|
||||||
|
|
|
@ -15,6 +15,7 @@
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "Conn.h"
|
#include "Conn.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
#include "Var.h" // for internal_val()
|
||||||
#include "EventHandler.h"
|
#include "EventHandler.h"
|
||||||
#include "plugin/Plugin.h"
|
#include "plugin/Plugin.h"
|
||||||
#include "plugin/Manager.h"
|
#include "plugin/Manager.h"
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
|
|
||||||
#include "RuleAction.h"
|
#include "RuleAction.h"
|
||||||
#include "RuleCondition.h"
|
#include "RuleCondition.h"
|
||||||
|
#include "BroString.h"
|
||||||
#include "ID.h"
|
#include "ID.h"
|
||||||
#include "IntSet.h"
|
#include "IntSet.h"
|
||||||
#include "IP.h"
|
#include "IP.h"
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
|
#include "CompHash.h"
|
||||||
#include "Expr.h"
|
#include "Expr.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
|
|
39
src/Val.cc
39
src/Val.cc
|
@ -14,6 +14,9 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "Attr.h"
|
#include "Attr.h"
|
||||||
|
#include "BroString.h"
|
||||||
|
#include "CompHash.h"
|
||||||
|
#include "Dict.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
|
@ -28,6 +31,7 @@
|
||||||
#include "Conn.h"
|
#include "Conn.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "IPAddr.h"
|
#include "IPAddr.h"
|
||||||
|
#include "Var.h" // for internal_type()
|
||||||
|
|
||||||
#include "broker/Data.h"
|
#include "broker/Data.h"
|
||||||
|
|
||||||
|
@ -363,6 +367,11 @@ void Val::ValDescribeReST(ODesc* d) const
|
||||||
|
|
||||||
|
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
ID* Val::GetID() const
|
||||||
|
{
|
||||||
|
return bound_id ? global_scope()->Lookup(bound_id) : 0;
|
||||||
|
}
|
||||||
|
|
||||||
void Val::SetID(ID* id)
|
void Val::SetID(ID* id)
|
||||||
{
|
{
|
||||||
delete [] bound_id;
|
delete [] bound_id;
|
||||||
|
@ -991,6 +1000,26 @@ StringVal::StringVal(const string& s) : Val(TYPE_STRING)
|
||||||
val.string_val = new BroString(reinterpret_cast<const u_char*>(s.data()), s.length(), 1);
|
val.string_val = new BroString(reinterpret_cast<const u_char*>(s.data()), s.length(), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Val* StringVal::SizeVal() const
|
||||||
|
{
|
||||||
|
return val_mgr->GetCount(val.string_val->Len());
|
||||||
|
}
|
||||||
|
|
||||||
|
int StringVal::Len()
|
||||||
|
{
|
||||||
|
return AsString()->Len();
|
||||||
|
}
|
||||||
|
|
||||||
|
const u_char* StringVal::Bytes()
|
||||||
|
{
|
||||||
|
return AsString()->Bytes();
|
||||||
|
}
|
||||||
|
|
||||||
|
const char* StringVal::CheckString()
|
||||||
|
{
|
||||||
|
return AsString()->CheckString();
|
||||||
|
}
|
||||||
|
|
||||||
string StringVal::ToStdString() const
|
string StringVal::ToStdString() const
|
||||||
{
|
{
|
||||||
auto* bs = AsString();
|
auto* bs = AsString();
|
||||||
|
@ -1352,6 +1381,11 @@ void TableVal::RemoveAll()
|
||||||
val.table_val->SetDeleteFunc(table_entry_val_delete_func);
|
val.table_val->SetDeleteFunc(table_entry_val_delete_func);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int TableVal::Size() const
|
||||||
|
{
|
||||||
|
return AsTable()->Length();
|
||||||
|
}
|
||||||
|
|
||||||
int TableVal::RecursiveSize() const
|
int TableVal::RecursiveSize() const
|
||||||
{
|
{
|
||||||
int n = AsTable()->Length();
|
int n = AsTable()->Length();
|
||||||
|
@ -2544,6 +2578,11 @@ unsigned int TableVal::MemoryAllocation() const
|
||||||
+ table_hash->MemoryAllocation();
|
+ table_hash->MemoryAllocation();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HashKey* TableVal::ComputeHash(const Val* index) const
|
||||||
|
{
|
||||||
|
return table_hash->ComputeHash(index, 1);
|
||||||
|
}
|
||||||
|
|
||||||
vector<RecordVal*> RecordVal::parse_time_records;
|
vector<RecordVal*> RecordVal::parse_time_records;
|
||||||
|
|
||||||
RecordVal::RecordVal(RecordType* t, bool init_fields) : Val(t)
|
RecordVal::RecordVal(RecordType* t, bool init_fields) : Val(t)
|
||||||
|
|
31
src/Val.h
31
src/Val.h
|
@ -3,13 +3,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Type.h"
|
#include "Type.h"
|
||||||
#include "Dict.h"
|
|
||||||
#include "CompHash.h"
|
|
||||||
#include "BroString.h"
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Scope.h"
|
|
||||||
#include "Notifier.h"
|
#include "Notifier.h"
|
||||||
#include "RE.h"
|
|
||||||
#include "net_util.h"
|
#include "net_util.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -32,7 +27,11 @@ using std::string;
|
||||||
#define UDP_PORT_MASK 0x20000
|
#define UDP_PORT_MASK 0x20000
|
||||||
#define ICMP_PORT_MASK 0x30000
|
#define ICMP_PORT_MASK 0x30000
|
||||||
|
|
||||||
|
template<typename T> class PDict;
|
||||||
|
class IterCookie;
|
||||||
|
|
||||||
class Val;
|
class Val;
|
||||||
|
class BroString;
|
||||||
class BroFunc;
|
class BroFunc;
|
||||||
class Func;
|
class Func;
|
||||||
class BroFile;
|
class BroFile;
|
||||||
|
@ -60,6 +59,8 @@ class VectorVal;
|
||||||
|
|
||||||
class TableEntryVal;
|
class TableEntryVal;
|
||||||
|
|
||||||
|
class RE_Matcher;
|
||||||
|
|
||||||
typedef union {
|
typedef union {
|
||||||
// Used for bool, int, enum.
|
// Used for bool, int, enum.
|
||||||
bro_int_t int_val;
|
bro_int_t int_val;
|
||||||
|
@ -286,10 +287,7 @@ public:
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
// For debugging, we keep a reference to the global ID to which a
|
// For debugging, we keep a reference to the global ID to which a
|
||||||
// value has been bound *last*.
|
// value has been bound *last*.
|
||||||
ID* GetID() const
|
ID* GetID() const;
|
||||||
{
|
|
||||||
return bound_id ? global_scope()->Lookup(bound_id) : 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
void SetID(ID* id);
|
void SetID(ID* id);
|
||||||
#endif
|
#endif
|
||||||
|
@ -549,12 +547,11 @@ public:
|
||||||
explicit StringVal(const string& s);
|
explicit StringVal(const string& s);
|
||||||
StringVal(int length, const char* s);
|
StringVal(int length, const char* s);
|
||||||
|
|
||||||
Val* SizeVal() const override
|
Val* SizeVal() const override;
|
||||||
{ return val_mgr->GetCount(val.string_val->Len()); }
|
|
||||||
|
|
||||||
int Len() { return AsString()->Len(); }
|
int Len();
|
||||||
const u_char* Bytes() { return AsString()->Bytes(); }
|
const u_char* Bytes();
|
||||||
const char* CheckString() { return AsString()->CheckString(); }
|
const char* CheckString();
|
||||||
|
|
||||||
// Note that one needs to de-allocate the return value of
|
// Note that one needs to de-allocate the return value of
|
||||||
// ExpandedString() to avoid a memory leak.
|
// ExpandedString() to avoid a memory leak.
|
||||||
|
@ -700,6 +697,7 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
class CompositeHash;
|
class CompositeHash;
|
||||||
|
class HashKey;
|
||||||
class Frame;
|
class Frame;
|
||||||
|
|
||||||
class TableVal : public Val, public notifier::Modifiable {
|
class TableVal : public Val, public notifier::Modifiable {
|
||||||
|
@ -790,7 +788,7 @@ public:
|
||||||
Attributes* Attrs() { return attrs; }
|
Attributes* Attrs() { return attrs; }
|
||||||
|
|
||||||
// Returns the size of the table.
|
// Returns the size of the table.
|
||||||
int Size() const { return AsTable()->Length(); }
|
int Size() const;
|
||||||
int RecursiveSize() const;
|
int RecursiveSize() const;
|
||||||
|
|
||||||
// Returns the Prefix table used inside the table (if present).
|
// Returns the Prefix table used inside the table (if present).
|
||||||
|
@ -816,8 +814,7 @@ public:
|
||||||
timer = 0;
|
timer = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
HashKey* ComputeHash(const Val* index) const
|
HashKey* ComputeHash(const Val* index) const;
|
||||||
{ return table_hash->ComputeHash(index, 1); }
|
|
||||||
|
|
||||||
notifier::Modifiable* Modifiable() override { return this; }
|
notifier::Modifiable* Modifiable() override { return this; }
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "binpac.h"
|
#include "binpac.h"
|
||||||
|
|
||||||
#include "analyzer/protocol/pia/PIA.h"
|
#include "analyzer/protocol/pia/PIA.h"
|
||||||
|
#include "../BroString.h"
|
||||||
#include "../Event.h"
|
#include "../Event.h"
|
||||||
|
|
||||||
namespace analyzer {
|
namespace analyzer {
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
%extern{
|
%extern{
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
|
#include "Conn.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
connection AYIYA_Conn(bro_analyzer: BroAnalyzer)
|
connection AYIYA_Conn(bro_analyzer: BroAnalyzer)
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Base64.h"
|
#include "Base64.h"
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
%extern{
|
%extern{
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
|
#include "BroString.h"
|
||||||
%}
|
%}
|
||||||
|
|
||||||
%code{
|
%code{
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Ident.h"
|
#include "Ident.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "RE.h"
|
#include "RE.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include "MQTT.h"
|
#include "MQTT.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Scope.h"
|
||||||
#include "mqtt_pac.h"
|
#include "mqtt_pac.h"
|
||||||
|
|
||||||
using namespace analyzer::MQTT;
|
using namespace analyzer::MQTT;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "XDR.h"
|
#include "XDR.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
|
|
@ -6,6 +6,7 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "XDR.h"
|
#include "XDR.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
%include consts.pac
|
%include consts.pac
|
||||||
|
|
||||||
|
%extern{
|
||||||
|
#include "BroString.h"
|
||||||
|
%}
|
||||||
|
|
||||||
# Common constructs across SSH1 and SSH2
|
# Common constructs across SSH1 and SSH2
|
||||||
########################################
|
########################################
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "analyzer/Analyzer.h"
|
#include "analyzer/Analyzer.h"
|
||||||
#include "analyzer/protocol/tcp/TCP.h"
|
#include "analyzer/protocol/tcp/TCP.h"
|
||||||
|
#include "BroString.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "RuleMatcher.h"
|
#include "RuleMatcher.h"
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "IP.h"
|
#include "IP.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
|
#include "BroString.h"
|
||||||
|
|
||||||
#include "events.bif.h"
|
#include "events.bif.h"
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,9 @@
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Desc.h"
|
#include "Desc.h"
|
||||||
#include "IntrusivePtr.h"
|
#include "IntrusivePtr.h"
|
||||||
|
#include "RE.h"
|
||||||
|
#include "Var.h" // for internal_type()
|
||||||
|
#include "Scope.h"
|
||||||
#include "module_util.h"
|
#include "module_util.h"
|
||||||
#include "3rdparty/doctest.h"
|
#include "3rdparty/doctest.h"
|
||||||
#include "broker/data.bif.h"
|
#include "broker/data.bif.h"
|
||||||
|
@ -1170,6 +1173,14 @@ IntrusivePtr<Val> bro_broker::DataVal::castTo(BroType* t)
|
||||||
return data_to_val(data, t);
|
return data_to_val(data, t);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BroType* bro_broker::DataVal::ScriptDataType()
|
||||||
|
{
|
||||||
|
if ( ! script_data_type )
|
||||||
|
script_data_type = internal_type("Broker::Data");
|
||||||
|
|
||||||
|
return script_data_type;
|
||||||
|
}
|
||||||
|
|
||||||
IMPLEMENT_OPAQUE_VALUE(bro_broker::DataVal)
|
IMPLEMENT_OPAQUE_VALUE(bro_broker::DataVal)
|
||||||
|
|
||||||
broker::expected<broker::data> bro_broker::DataVal::DoSerialize() const
|
broker::expected<broker::data> bro_broker::DataVal::DoSerialize() const
|
||||||
|
|
|
@ -4,7 +4,6 @@
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
#include "Expr.h"
|
#include "Expr.h"
|
||||||
#include "Var.h" // for internal_type()
|
|
||||||
|
|
||||||
template <class T>
|
template <class T>
|
||||||
class IntrusivePtr;
|
class IntrusivePtr;
|
||||||
|
@ -111,13 +110,7 @@ public:
|
||||||
// Returns the Bro type that scripts use to represent a Broker data
|
// Returns the Bro type that scripts use to represent a Broker data
|
||||||
// instance. This may be wrapping the opaque value inside another
|
// instance. This may be wrapping the opaque value inside another
|
||||||
// type.
|
// type.
|
||||||
static BroType* ScriptDataType()
|
static BroType* ScriptDataType();
|
||||||
{
|
|
||||||
if ( ! script_data_type )
|
|
||||||
script_data_type = internal_type("Broker::Data");
|
|
||||||
|
|
||||||
return script_data_type;
|
|
||||||
}
|
|
||||||
|
|
||||||
broker::data data;
|
broker::data data;
|
||||||
|
|
||||||
|
|
|
@ -17,11 +17,11 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "NetVar.h"
|
|
||||||
#include "iosource/IOSource.h"
|
#include "iosource/IOSource.h"
|
||||||
#include "logging/WriterBackend.h"
|
#include "logging/WriterBackend.h"
|
||||||
|
|
||||||
class Frame;
|
class Frame;
|
||||||
|
class Func;
|
||||||
|
|
||||||
namespace bro_broker {
|
namespace bro_broker {
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,28 @@
|
||||||
#include "Store.h"
|
#include "Store.h"
|
||||||
#include "Desc.h"
|
#include "Desc.h"
|
||||||
|
#include "Var.h" // for internal_type()
|
||||||
#include "broker/Manager.h"
|
#include "broker/Manager.h"
|
||||||
|
|
||||||
namespace bro_broker {
|
namespace bro_broker {
|
||||||
|
|
||||||
OpaqueType* opaque_of_store_handle;
|
OpaqueType* opaque_of_store_handle;
|
||||||
|
|
||||||
|
EnumVal* query_status(bool success)
|
||||||
|
{
|
||||||
|
static EnumType* store_query_status = nullptr;
|
||||||
|
static int success_val;
|
||||||
|
static int failure_val;
|
||||||
|
|
||||||
|
if ( ! store_query_status )
|
||||||
|
{
|
||||||
|
store_query_status = internal_type("Broker::QueryStatus")->AsEnumType();
|
||||||
|
success_val = store_query_status->Lookup("Broker", "SUCCESS");
|
||||||
|
failure_val = store_query_status->Lookup("Broker", "FAILURE");
|
||||||
|
}
|
||||||
|
|
||||||
|
return store_query_status->GetVal(success ? success_val : failure_val);
|
||||||
|
}
|
||||||
|
|
||||||
void StoreHandleVal::ValDescribe(ODesc* d) const
|
void StoreHandleVal::ValDescribe(ODesc* d) const
|
||||||
{
|
{
|
||||||
//using BifEnum::Broker::BackendType;
|
//using BifEnum::Broker::BackendType;
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
|
|
||||||
#include "broker/store.bif.h"
|
#include "broker/store.bif.h"
|
||||||
#include "broker/data.bif.h"
|
#include "broker/data.bif.h"
|
||||||
#include "Type.h"
|
|
||||||
#include "Var.h" // for internal_type()
|
|
||||||
#include "OpaqueVal.h"
|
#include "OpaqueVal.h"
|
||||||
#include "Trigger.h"
|
#include "Trigger.h"
|
||||||
|
|
||||||
|
@ -20,21 +18,7 @@ extern OpaqueType* opaque_of_store_handle;
|
||||||
* @param success whether the query status should be set to success or failure.
|
* @param success whether the query status should be set to success or failure.
|
||||||
* @return a Broker::QueryStatus value.
|
* @return a Broker::QueryStatus value.
|
||||||
*/
|
*/
|
||||||
inline EnumVal* query_status(bool success)
|
EnumVal* query_status(bool success);
|
||||||
{
|
|
||||||
static EnumType* store_query_status = nullptr;
|
|
||||||
static int success_val;
|
|
||||||
static int failure_val;
|
|
||||||
|
|
||||||
if ( ! store_query_status )
|
|
||||||
{
|
|
||||||
store_query_status = internal_type("Broker::QueryStatus")->AsEnumType();
|
|
||||||
success_val = store_query_status->Lookup("Broker", "SUCCESS");
|
|
||||||
failure_val = store_query_status->Lookup("Broker", "FAILURE");
|
|
||||||
}
|
|
||||||
|
|
||||||
return store_query_status->GetVal(success ? success_val : failure_val);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return a Broker::QueryResult value that has a Broker::QueryStatus indicating
|
* @return a Broker::QueryResult value that has a Broker::QueryStatus indicating
|
||||||
|
|
75
src/digest.cc
Normal file
75
src/digest.cc
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Wrapper and helper functions for MD5/SHA digest algorithms.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include "digest.h"
|
||||||
|
|
||||||
|
#include "Reporter.h"
|
||||||
|
|
||||||
|
EVP_MD_CTX* hash_init(HashAlgorithm alg)
|
||||||
|
{
|
||||||
|
EVP_MD_CTX* c = EVP_MD_CTX_new();
|
||||||
|
const EVP_MD* md;
|
||||||
|
|
||||||
|
switch (alg)
|
||||||
|
{
|
||||||
|
case Hash_MD5:
|
||||||
|
#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
|
||||||
|
/* Allow this to work even if FIPS disables it */
|
||||||
|
EVP_MD_CTX_set_flags(c, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
|
||||||
|
#endif
|
||||||
|
md = EVP_md5();
|
||||||
|
break;
|
||||||
|
case Hash_SHA1:
|
||||||
|
md = EVP_sha1();
|
||||||
|
break;
|
||||||
|
case Hash_SHA224:
|
||||||
|
md = EVP_sha224();
|
||||||
|
break;
|
||||||
|
case Hash_SHA256:
|
||||||
|
md = EVP_sha256();
|
||||||
|
break;
|
||||||
|
case Hash_SHA384:
|
||||||
|
md = EVP_sha384();
|
||||||
|
break;
|
||||||
|
case Hash_SHA512:
|
||||||
|
md = EVP_sha512();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
reporter->InternalError("Unknown hash algorithm passed to hash_init");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( ! EVP_DigestInit_ex(c, md, NULL) )
|
||||||
|
reporter->InternalError("EVP_DigestInit failed");
|
||||||
|
|
||||||
|
return c;
|
||||||
|
}
|
||||||
|
|
||||||
|
void hash_update(EVP_MD_CTX* c, const void* data, unsigned long len)
|
||||||
|
{
|
||||||
|
if ( ! EVP_DigestUpdate(c, data, len) )
|
||||||
|
reporter->InternalError("EVP_DigestUpdate failed");
|
||||||
|
}
|
||||||
|
|
||||||
|
void hash_final(EVP_MD_CTX* c, u_char* md)
|
||||||
|
{
|
||||||
|
if ( ! EVP_DigestFinal(c, md, NULL) )
|
||||||
|
reporter->InternalError("EVP_DigestFinal failed");
|
||||||
|
|
||||||
|
EVP_MD_CTX_free(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
unsigned char* internal_md5(const unsigned char* data, unsigned long len, unsigned char* out)
|
||||||
|
{
|
||||||
|
static unsigned char static_out[MD5_DIGEST_LENGTH];
|
||||||
|
|
||||||
|
if ( ! out )
|
||||||
|
out = static_out; // use static array for return, see OpenSSL man page
|
||||||
|
|
||||||
|
EVP_MD_CTX* c = hash_init(Hash_MD5);
|
||||||
|
hash_update(c, data, len);
|
||||||
|
hash_final(c, out);
|
||||||
|
return out;
|
||||||
|
}
|
70
src/digest.h
70
src/digest.h
|
@ -10,6 +10,8 @@
|
||||||
#include <openssl/sha.h>
|
#include <openssl/sha.h>
|
||||||
#include <openssl/evp.h>
|
#include <openssl/evp.h>
|
||||||
|
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER)
|
#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER)
|
||||||
#define EVP_MD_CTX_new EVP_MD_CTX_create
|
#define EVP_MD_CTX_new EVP_MD_CTX_create
|
||||||
#define EVP_MD_CTX_free EVP_MD_CTX_destroy
|
#define EVP_MD_CTX_free EVP_MD_CTX_destroy
|
||||||
|
@ -20,8 +22,6 @@ inline void* EVP_MD_CTX_md_data(const EVP_MD_CTX* ctx)
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Reporter.h"
|
|
||||||
|
|
||||||
enum HashAlgorithm { Hash_MD5, Hash_SHA1, Hash_SHA224, Hash_SHA256, Hash_SHA384, Hash_SHA512 };
|
enum HashAlgorithm { Hash_MD5, Hash_SHA1, Hash_SHA224, Hash_SHA256, Hash_SHA384, Hash_SHA512 };
|
||||||
|
|
||||||
inline const char* digest_print(const u_char* digest, size_t n)
|
inline const char* digest_print(const u_char* digest, size_t n)
|
||||||
|
@ -47,68 +47,10 @@ inline const char* sha256_digest_print(const u_char digest[SHA256_DIGEST_LENGTH]
|
||||||
return digest_print(digest, SHA256_DIGEST_LENGTH);
|
return digest_print(digest, SHA256_DIGEST_LENGTH);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline EVP_MD_CTX* hash_init(HashAlgorithm alg)
|
EVP_MD_CTX* hash_init(HashAlgorithm alg);
|
||||||
{
|
|
||||||
EVP_MD_CTX* c = EVP_MD_CTX_new();
|
|
||||||
const EVP_MD* md;
|
|
||||||
|
|
||||||
switch (alg)
|
void hash_update(EVP_MD_CTX* c, const void* data, unsigned long len);
|
||||||
{
|
|
||||||
case Hash_MD5:
|
|
||||||
#ifdef EVP_MD_CTX_FLAG_NON_FIPS_ALLOW
|
|
||||||
/* Allow this to work even if FIPS disables it */
|
|
||||||
EVP_MD_CTX_set_flags(c, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
|
|
||||||
#endif
|
|
||||||
md = EVP_md5();
|
|
||||||
break;
|
|
||||||
case Hash_SHA1:
|
|
||||||
md = EVP_sha1();
|
|
||||||
break;
|
|
||||||
case Hash_SHA224:
|
|
||||||
md = EVP_sha224();
|
|
||||||
break;
|
|
||||||
case Hash_SHA256:
|
|
||||||
md = EVP_sha256();
|
|
||||||
break;
|
|
||||||
case Hash_SHA384:
|
|
||||||
md = EVP_sha384();
|
|
||||||
break;
|
|
||||||
case Hash_SHA512:
|
|
||||||
md = EVP_sha512();
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
reporter->InternalError("Unknown hash algorithm passed to hash_init");
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( ! EVP_DigestInit_ex(c, md, NULL) )
|
void hash_final(EVP_MD_CTX* c, u_char* md);
|
||||||
reporter->InternalError("EVP_DigestInit failed");
|
|
||||||
|
|
||||||
return c;
|
unsigned char* internal_md5(const unsigned char* data, unsigned long len, unsigned char* out);
|
||||||
}
|
|
||||||
|
|
||||||
inline void hash_update(EVP_MD_CTX* c, const void* data, unsigned long len)
|
|
||||||
{
|
|
||||||
if ( ! EVP_DigestUpdate(c, data, len) )
|
|
||||||
reporter->InternalError("EVP_DigestUpdate failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
inline void hash_final(EVP_MD_CTX* c, u_char* md)
|
|
||||||
{
|
|
||||||
if ( ! EVP_DigestFinal(c, md, NULL) )
|
|
||||||
reporter->InternalError("EVP_DigestFinal failed");
|
|
||||||
|
|
||||||
EVP_MD_CTX_free(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline unsigned char* internal_md5(const unsigned char* data, unsigned long len, unsigned char* out)
|
|
||||||
{
|
|
||||||
static unsigned char static_out[MD5_DIGEST_LENGTH];
|
|
||||||
|
|
||||||
if ( ! out )
|
|
||||||
out = static_out; // use static array for return, see OpenSSL man page
|
|
||||||
|
|
||||||
EVP_MD_CTX* c = hash_init(Hash_MD5);
|
|
||||||
hash_update(c, data, len);
|
|
||||||
hash_final(c, out);
|
|
||||||
return out;
|
|
||||||
}
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
#include "Analyzer.h"
|
#include "Analyzer.h"
|
||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
|
#include "Val.h"
|
||||||
|
|
||||||
file_analysis::ID file_analysis::Analyzer::id_counter = 0;
|
file_analysis::ID file_analysis::Analyzer::id_counter = 0;
|
||||||
|
|
||||||
|
@ -17,3 +18,13 @@ void file_analysis::Analyzer::SetAnalyzerTag(const file_analysis::Tag& arg_tag)
|
||||||
assert(! tag || tag == arg_tag);
|
assert(! tag || tag == arg_tag);
|
||||||
tag = arg_tag;
|
tag = arg_tag;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
file_analysis::Analyzer::Analyzer(file_analysis::Tag arg_tag, RecordVal* arg_args, File* arg_file)
|
||||||
|
: tag(arg_tag),
|
||||||
|
args(arg_args->Ref()->AsRecordVal()),
|
||||||
|
file(arg_file),
|
||||||
|
got_stream_delivery(false),
|
||||||
|
skip(false)
|
||||||
|
{
|
||||||
|
id = ++id_counter;
|
||||||
|
}
|
||||||
|
|
|
@ -2,11 +2,11 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Val.h"
|
|
||||||
#include "NetVar.h"
|
|
||||||
#include "Tag.h"
|
#include "Tag.h"
|
||||||
|
|
||||||
#include "file_analysis/file_analysis.bif.h"
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
|
class RecordVal;
|
||||||
|
|
||||||
namespace file_analysis {
|
namespace file_analysis {
|
||||||
|
|
||||||
|
@ -146,15 +146,7 @@ protected:
|
||||||
* tunable options, if any, related to a particular analyzer type.
|
* tunable options, if any, related to a particular analyzer type.
|
||||||
* @param arg_file the file to which the the analyzer is being attached.
|
* @param arg_file the file to which the the analyzer is being attached.
|
||||||
*/
|
*/
|
||||||
Analyzer(file_analysis::Tag arg_tag, RecordVal* arg_args, File* arg_file)
|
Analyzer(file_analysis::Tag arg_tag, RecordVal* arg_args, File* arg_file);
|
||||||
: tag(arg_tag),
|
|
||||||
args(arg_args->Ref()->AsRecordVal()),
|
|
||||||
file(arg_file),
|
|
||||||
got_stream_delivery(false),
|
|
||||||
skip(false)
|
|
||||||
{
|
|
||||||
id = ++id_counter;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor. Only derived classes are meant to be instantiated.
|
* Constructor. Only derived classes are meant to be instantiated.
|
||||||
|
@ -166,13 +158,8 @@ protected:
|
||||||
* @param arg_file the file to which the the analyzer is being attached.
|
* @param arg_file the file to which the the analyzer is being attached.
|
||||||
*/
|
*/
|
||||||
Analyzer(RecordVal* arg_args, File* arg_file)
|
Analyzer(RecordVal* arg_args, File* arg_file)
|
||||||
: tag(),
|
: Analyzer({}, arg_args, arg_file)
|
||||||
args(arg_args->Ref()->AsRecordVal()),
|
|
||||||
file(arg_file),
|
|
||||||
got_stream_delivery(false),
|
|
||||||
skip(false)
|
|
||||||
{
|
{
|
||||||
id = ++id_counter;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -4,6 +4,9 @@
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Analyzer.h"
|
#include "Analyzer.h"
|
||||||
#include "Manager.h"
|
#include "Manager.h"
|
||||||
|
#include "CompHash.h"
|
||||||
|
#include "Val.h"
|
||||||
|
#include "file_analysis/file_analysis.bif.h"
|
||||||
|
|
||||||
using namespace file_analysis;
|
using namespace file_analysis;
|
||||||
|
|
||||||
|
@ -106,6 +109,12 @@ bool AnalyzerSet::AddMod::Perform(AnalyzerSet* set)
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void AnalyzerSet::AddMod::Abort()
|
||||||
|
{
|
||||||
|
delete a;
|
||||||
|
delete key;
|
||||||
|
}
|
||||||
|
|
||||||
bool AnalyzerSet::Remove(const file_analysis::Tag& tag, RecordVal* args)
|
bool AnalyzerSet::Remove(const file_analysis::Tag& tag, RecordVal* args)
|
||||||
{
|
{
|
||||||
return Remove(tag, GetKey(tag, args));
|
return Remove(tag, GetKey(tag, args));
|
||||||
|
|
|
@ -4,14 +4,17 @@
|
||||||
|
|
||||||
#include <queue>
|
#include <queue>
|
||||||
|
|
||||||
#include "Analyzer.h"
|
|
||||||
#include "Dict.h"
|
#include "Dict.h"
|
||||||
#include "CompHash.h"
|
|
||||||
#include "Val.h"
|
|
||||||
#include "Tag.h"
|
#include "Tag.h"
|
||||||
|
|
||||||
|
using std::queue;
|
||||||
|
|
||||||
|
class CompositeHash;
|
||||||
|
class RecordVal;
|
||||||
|
|
||||||
namespace file_analysis {
|
namespace file_analysis {
|
||||||
|
|
||||||
|
class Analyzer;
|
||||||
class File;
|
class File;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -173,7 +176,7 @@ private:
|
||||||
: Modification(), a(arg_a), key(arg_key) {}
|
: Modification(), a(arg_a), key(arg_key) {}
|
||||||
~AddMod() override {}
|
~AddMod() override {}
|
||||||
bool Perform(AnalyzerSet* set) override;
|
bool Perform(AnalyzerSet* set) override;
|
||||||
void Abort() override { delete a; delete key; }
|
void Abort() override;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
file_analysis::Analyzer* a;
|
file_analysis::Analyzer* a;
|
||||||
|
|
|
@ -2,17 +2,22 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <list>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include "analyzer/Tag.h"
|
||||||
#include "AnalyzerSet.h"
|
#include "AnalyzerSet.h"
|
||||||
#include "BroString.h"
|
#include "BroString.h"
|
||||||
|
#include "BroList.h" // for val_list
|
||||||
#include "WeirdState.h"
|
#include "WeirdState.h"
|
||||||
|
|
||||||
using std::string;
|
using std::string;
|
||||||
|
|
||||||
class Connection;
|
class Connection;
|
||||||
|
class RecordType;
|
||||||
class RecordVal;
|
class RecordVal;
|
||||||
|
class EventHandlerPtr;
|
||||||
|
|
||||||
namespace file_analysis {
|
namespace file_analysis {
|
||||||
|
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
|
|
||||||
#include "plugin/Manager.h"
|
#include "plugin/Manager.h"
|
||||||
#include "analyzer/Manager.h"
|
#include "analyzer/Manager.h"
|
||||||
|
#include "file_analysis/file_analysis.bif.h"
|
||||||
|
|
||||||
#include <openssl/md5.h>
|
#include <openssl/md5.h>
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@
|
||||||
|
|
||||||
#include "plugin/ComponentManager.h"
|
#include "plugin/ComponentManager.h"
|
||||||
|
|
||||||
#include "file_analysis/file_analysis.bif.h"
|
#include "analyzer/Tag.h"
|
||||||
|
|
||||||
using std::map;
|
using std::map;
|
||||||
using std::set;
|
using std::set;
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
#include "DataEvent.h"
|
#include "DataEvent.h"
|
||||||
#include "EventRegistry.h"
|
#include "EventRegistry.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
#include "Func.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "file_analysis/Manager.h"
|
#include "file_analysis/Manager.h"
|
||||||
|
|
||||||
|
|
|
@ -7,6 +7,7 @@
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Analyzer.h"
|
#include "Analyzer.h"
|
||||||
|
#include "EventHandler.h"
|
||||||
|
|
||||||
namespace file_analysis {
|
namespace file_analysis {
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,7 @@ module FileExtract;
|
||||||
|
|
||||||
%%{
|
%%{
|
||||||
#include "file_analysis/Manager.h"
|
#include "file_analysis/Manager.h"
|
||||||
|
#include "file_analysis/file_analysis.bif.h"
|
||||||
%%}
|
%%}
|
||||||
|
|
||||||
## :zeek:see:`FileExtract::set_limit`.
|
## :zeek:see:`FileExtract::set_limit`.
|
||||||
|
|
|
@ -10,6 +10,7 @@
|
||||||
#include "types.bif.h"
|
#include "types.bif.h"
|
||||||
#include "ocsp_events.bif.h"
|
#include "ocsp_events.bif.h"
|
||||||
|
|
||||||
|
#include "file_analysis/File.h"
|
||||||
#include "file_analysis/Manager.h"
|
#include "file_analysis/Manager.h"
|
||||||
|
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
|
|
|
@ -4,14 +4,14 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "../File.h"
|
|
||||||
#include "Analyzer.h"
|
|
||||||
#include "X509Common.h"
|
#include "X509Common.h"
|
||||||
|
|
||||||
#include <openssl/ocsp.h>
|
#include <openssl/ocsp.h>
|
||||||
|
|
||||||
namespace file_analysis {
|
namespace file_analysis {
|
||||||
|
|
||||||
|
class File;
|
||||||
|
|
||||||
class OCSP : public file_analysis::X509Common {
|
class OCSP : public file_analysis::X509Common {
|
||||||
public:
|
public:
|
||||||
bool DeliverStream(const u_char* data, uint64_t len) override;
|
bool DeliverStream(const u_char* data, uint64_t len) override;
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "events.bif.h"
|
#include "events.bif.h"
|
||||||
#include "types.bif.h"
|
#include "types.bif.h"
|
||||||
|
|
||||||
|
#include "file_analysis/File.h"
|
||||||
#include "file_analysis/Manager.h"
|
#include "file_analysis/Manager.h"
|
||||||
|
|
||||||
#include <broker/error.hh>
|
#include <broker/error.hh>
|
||||||
|
|
|
@ -5,16 +5,20 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "file_analysis/File.h"
|
|
||||||
#include "Analyzer.h"
|
#include "Analyzer.h"
|
||||||
|
|
||||||
#include <openssl/x509.h>
|
#include <openssl/x509.h>
|
||||||
#include <openssl/asn1.h>
|
#include <openssl/asn1.h>
|
||||||
|
|
||||||
|
class EventHandlerPtr;
|
||||||
class Reporter;
|
class Reporter;
|
||||||
|
class StringVal;
|
||||||
|
|
||||||
namespace file_analysis {
|
namespace file_analysis {
|
||||||
|
|
||||||
|
class Tag;
|
||||||
|
class File;
|
||||||
|
|
||||||
class X509Common : public file_analysis::Analyzer {
|
class X509Common : public file_analysis::Analyzer {
|
||||||
public:
|
public:
|
||||||
~X509Common() override {};
|
~X509Common() override {};
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "PktDumper.h"
|
#include "PktDumper.h"
|
||||||
#include "plugin/Manager.h"
|
#include "plugin/Manager.h"
|
||||||
#include "broker/Manager.h"
|
#include "broker/Manager.h"
|
||||||
|
#include "NetVar.h"
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
|
|
|
@ -8,6 +8,7 @@
|
||||||
#include "Var.h" // for add_type()
|
#include "Var.h" // for add_type()
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Scope.h"
|
||||||
#include "zeekygen/Manager.h"
|
#include "zeekygen/Manager.h"
|
||||||
#include "DebugLogger.h"
|
#include "DebugLogger.h"
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
#include "CompHash.h"
|
#include "CompHash.h"
|
||||||
#include "IntrusivePtr.h"
|
#include "IntrusivePtr.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "NetVar.h"
|
#include "Dict.h"
|
||||||
|
|
||||||
namespace probabilistic {
|
namespace probabilistic {
|
||||||
|
|
||||||
|
|
|
@ -4,12 +4,13 @@
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "CompHash.h"
|
|
||||||
#include "OpaqueVal.h"
|
#include "OpaqueVal.h"
|
||||||
|
|
||||||
// This class implements the top-k algorithm. Or - to be more precise - an
|
// This class implements the top-k algorithm. Or - to be more precise - an
|
||||||
// interpretation of it.
|
// interpretation of it.
|
||||||
|
|
||||||
|
class CompositeHash;
|
||||||
|
|
||||||
namespace probabilistic {
|
namespace probabilistic {
|
||||||
|
|
||||||
struct Element;
|
struct Element;
|
||||||
|
|
|
@ -13,7 +13,11 @@
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
|
||||||
#include "iosource/Manager.h"
|
#include "iosource/Manager.h"
|
||||||
|
#include "BroString.h"
|
||||||
|
#include "Dict.h"
|
||||||
|
#include "RE.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Scope.h"
|
||||||
#include "DebugLogger.h"
|
#include "DebugLogger.h"
|
||||||
#include "ID.h"
|
#include "ID.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "Desc.h"
|
#include "Desc.h"
|
||||||
|
#include "Dict.h"
|
||||||
#include "digest.h"
|
#include "digest.h"
|
||||||
#include "input.h"
|
#include "input.h"
|
||||||
#include "Obj.h"
|
#include "Obj.h"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue