mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
include cleanup
The Zeek code base has very inconsistent #includes. Many sources included a few headers, and those headers included other headers, and in the end, nearly everything is included everywhere, so missing #includes were never noticed. Another side effect was a lot of header bloat which slows down the build. First step to fix it: in each source file, its own header should be included first to verify that each header's includes are correct, and none is missing. After adding the missing #includes, I replaced lots of #includes inside headers with class forward declarations. In most headers, object pointers are never referenced, so declaring the function prototypes with forward-declared classes is just fine. This patch speeds up the build by 19%, because each compilation unit gets smaller. Here are the "time" numbers for a fresh build (with a warm page cache but without ccache): Before this patch: 3144.94user 161.63system 3:02.87elapsed 1808%CPU (0avgtext+0avgdata 2168608maxresident)k 760inputs+12008400outputs (1511major+57747204minor)pagefaults 0swaps After this patch: 2565.17user 141.83system 2:25.46elapsed 1860%CPU (0avgtext+0avgdata 1489076maxresident)k 72576inputs+9130920outputs (1667major+49400430minor)pagefaults 0swaps
This commit is contained in:
parent
532c66df51
commit
0db61f3094
332 changed files with 1047 additions and 606 deletions
|
@ -1,3 +1,5 @@
|
||||||
|
#include "Anon.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
@ -5,7 +7,6 @@
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "net_util.h"
|
#include "net_util.h"
|
||||||
#include "Anon.h"
|
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
|
|
||||||
|
|
|
@ -11,11 +11,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <set>
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "net_util.h"
|
|
||||||
|
using std::map;
|
||||||
|
|
||||||
// TODO: Anon.h may not be the right place to put these functions ...
|
// TODO: Anon.h may not be the right place to put these functions ...
|
||||||
|
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include "Attr.h"
|
#include "Attr.h"
|
||||||
#include "Expr.h"
|
#include "Expr.h"
|
||||||
|
#include "Desc.h"
|
||||||
|
#include "Val.h"
|
||||||
#include "threading/SerialTypes.h"
|
#include "threading/SerialTypes.h"
|
||||||
|
|
||||||
const char* attr_name(attr_tag t)
|
const char* attr_name(attr_tag t)
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Obj.h"
|
#include "Obj.h"
|
||||||
|
#include "BroList.h"
|
||||||
|
|
||||||
class Expr;
|
class Expr;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
#include "Base64.h"
|
#include "Base64.h"
|
||||||
|
#include "BroString.h"
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
int Base64Converter::default_base64_table[256];
|
int Base64Converter::default_base64_table[256];
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#include "util.h"
|
|
||||||
#include "BroString.h"
|
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "Conn.h"
|
#include "Conn.h"
|
||||||
|
|
||||||
|
class BroString;
|
||||||
|
|
||||||
// Maybe we should have a base class for generic decoders?
|
// Maybe we should have a base class for generic decoders?
|
||||||
class Base64Converter {
|
class Base64Converter {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "BroString.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <iostream>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include <algorithm>
|
#include "Val.h"
|
||||||
|
|
||||||
#include "BroString.h"
|
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
|
||||||
|
|
|
@ -2,13 +2,13 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "util.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <iostream>
|
#include <iosfwd>
|
||||||
#include <stdlib.h>
|
|
||||||
#include <sys/types.h>
|
|
||||||
|
|
||||||
#include "util.h"
|
#include <sys/types.h>
|
||||||
|
|
||||||
typedef u_char* byte_vec;
|
typedef u_char* byte_vec;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
#include "Brofiler.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <sstream>
|
#include <sstream>
|
||||||
|
@ -5,7 +7,10 @@
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include "Brofiler.h"
|
|
||||||
|
#include "Stmt.h"
|
||||||
|
#include "Desc.h"
|
||||||
|
#include "Reporter.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
Brofiler::Brofiler()
|
Brofiler::Brofiler()
|
||||||
|
|
|
@ -3,8 +3,14 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <Stmt.h>
|
#include <string>
|
||||||
|
|
||||||
|
using std::list;
|
||||||
|
using std::map;
|
||||||
|
using std::pair;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
|
class Stmt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* A simple class for managing stats of Bro script coverage across Bro runs.
|
* A simple class for managing stats of Bro script coverage across Bro runs.
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "util.h" // for ptr_compat_int
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include "List.h"
|
|
||||||
|
|
||||||
typedef std::vector<ptr_compat_int> int_list;
|
typedef std::vector<ptr_compat_int> int_list;
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Hash.h"
|
|
||||||
#include "Type.h"
|
#include "Type.h"
|
||||||
|
|
||||||
class ListVal;
|
class ListVal;
|
||||||
|
class HashKey;
|
||||||
|
|
||||||
class CompositeHash {
|
class CompositeHash {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -2,15 +2,18 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
|
#include "Conn.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
|
#include "Desc.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Conn.h"
|
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
#include "iosource/IOSource.h"
|
||||||
#include "analyzer/protocol/pia/PIA.h"
|
#include "analyzer/protocol/pia/PIA.h"
|
||||||
#include "binpac.h"
|
#include "binpac.h"
|
||||||
#include "TunnelEncapsulation.h"
|
#include "TunnelEncapsulation.h"
|
||||||
|
|
|
@ -7,17 +7,15 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "Dict.h"
|
#include "Dict.h"
|
||||||
#include "Val.h"
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "RuleMatcher.h"
|
#include "Rule.h"
|
||||||
#include "IPAddr.h"
|
#include "IPAddr.h"
|
||||||
#include "TunnelEncapsulation.h"
|
|
||||||
#include "UID.h"
|
#include "UID.h"
|
||||||
#include "WeirdState.h"
|
#include "WeirdState.h"
|
||||||
|
#include "iosource/Packet.h"
|
||||||
|
|
||||||
#include "analyzer/Tag.h"
|
#include "analyzer/Tag.h"
|
||||||
#include "analyzer/Analyzer.h"
|
#include "analyzer/Analyzer.h"
|
||||||
#include "iosource/Packet.h"
|
|
||||||
|
|
||||||
class Connection;
|
class Connection;
|
||||||
class ConnectionTimer;
|
class ConnectionTimer;
|
||||||
|
@ -26,6 +24,9 @@ class LoginConn;
|
||||||
class RuleHdrTest;
|
class RuleHdrTest;
|
||||||
class Specific_RE_Matcher;
|
class Specific_RE_Matcher;
|
||||||
class RuleEndpointState;
|
class RuleEndpointState;
|
||||||
|
class EncapsulationStack;
|
||||||
|
class Val;
|
||||||
|
class RecordVal;
|
||||||
|
|
||||||
namespace analyzer { class TransportLayerAnalyzer; }
|
namespace analyzer { class TransportLayerAnalyzer; }
|
||||||
|
|
||||||
|
|
|
@ -2,8 +2,9 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "EquivClass.h"
|
|
||||||
#include "DFA.h"
|
#include "DFA.h"
|
||||||
|
#include "EquivClass.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "digest.h"
|
#include "digest.h"
|
||||||
|
|
||||||
unsigned int DFA_State::transition_counter = 0;
|
unsigned int DFA_State::transition_counter = 0;
|
||||||
|
|
|
@ -3,9 +3,15 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <assert.h>
|
#include "RE.h" // for typedef AcceptingSet
|
||||||
|
#include "Obj.h"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
class DFA_State;
|
class DFA_State;
|
||||||
|
|
||||||
// Transitions to the uncomputed state indicate that we haven't yet
|
// Transitions to the uncomputed state indicate that we haven't yet
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
|
#include "DNS_Mgr.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
#ifdef TIME_WITH_SYS_TIME
|
||||||
|
@ -29,9 +31,9 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "DNS_Mgr.h"
|
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
|
#include "Val.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "iosource/Manager.h"
|
#include "iosource/Manager.h"
|
||||||
|
|
|
@ -7,9 +7,7 @@
|
||||||
#include <queue>
|
#include <queue>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "util.h"
|
|
||||||
#include "List.h"
|
#include "List.h"
|
||||||
#include "Dict.h"
|
|
||||||
#include "EventHandler.h"
|
#include "EventHandler.h"
|
||||||
#include "iosource/IOSource.h"
|
#include "iosource/IOSource.h"
|
||||||
#include "IPAddr.h"
|
#include "IPAddr.h"
|
||||||
|
|
|
@ -2,17 +2,22 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
|
#include "DbgBreakpoint.h"
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
|
#include "Desc.h"
|
||||||
#include "ID.h"
|
#include "ID.h"
|
||||||
#include "Queue.h"
|
#include "Queue.h"
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
|
#include "Frame.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
|
#include "Val.h"
|
||||||
#include "Stmt.h"
|
#include "Stmt.h"
|
||||||
#include "DbgBreakpoint.h"
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
#include "Reporter.h"
|
||||||
|
#include "module_util.h"
|
||||||
|
|
||||||
// BreakpointTimer used for time-based breakpoints
|
// BreakpointTimer used for time-based breakpoints
|
||||||
class BreakpointTimer : public Timer {
|
class BreakpointTimer : public Timer {
|
||||||
|
|
|
@ -2,7 +2,12 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Debug.h"
|
#include <string>
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
|
||||||
|
struct ParseLocationRec;
|
||||||
|
class Stmt;
|
||||||
|
|
||||||
enum BreakCode { bcNoHit, bcHit, bcHitAndDelete };
|
enum BreakCode { bcNoHit, bcHit, bcHitAndDelete };
|
||||||
class DbgBreakpoint {
|
class DbgBreakpoint {
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Debug.h"
|
class Expr;
|
||||||
|
|
||||||
// Automatic displays: display these at each stoppage.
|
// Automatic displays: display these at each stoppage.
|
||||||
class DbgDisplay {
|
class DbgDisplay {
|
||||||
|
|
|
@ -2,7 +2,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Debug.h"
|
class BroObj;
|
||||||
|
class Expr;
|
||||||
|
|
||||||
class DbgWatch {
|
class DbgWatch {
|
||||||
public:
|
public:
|
||||||
|
|
11
src/Debug.cc
11
src/Debug.cc
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
|
#include "Debug.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
@ -11,13 +13,20 @@
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "Debug.h"
|
|
||||||
#include "DebugCmds.h"
|
#include "DebugCmds.h"
|
||||||
#include "DbgBreakpoint.h"
|
#include "DbgBreakpoint.h"
|
||||||
|
#include "ID.h"
|
||||||
|
#include "Expr.h"
|
||||||
#include "Stmt.h"
|
#include "Stmt.h"
|
||||||
|
#include "Frame.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "PolicyFile.h"
|
#include "PolicyFile.h"
|
||||||
|
#include "Desc.h"
|
||||||
|
#include "Reporter.h"
|
||||||
|
#include "Val.h"
|
||||||
|
#include "module_util.h"
|
||||||
|
#include "input.h"
|
||||||
|
|
||||||
#ifdef HAVE_READLINE
|
#ifdef HAVE_READLINE
|
||||||
#include <readline/readline.h>
|
#include <readline/readline.h>
|
||||||
|
|
14
src/Debug.h
14
src/Debug.h
|
@ -2,10 +2,15 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Obj.h"
|
||||||
|
#include "Queue.h"
|
||||||
|
#include "StmtEnums.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
class Val;
|
||||||
class Stmt;
|
class Stmt;
|
||||||
|
|
||||||
// This needs to be defined before we do the includes that come after it.
|
// This needs to be defined before we do the includes that come after it.
|
||||||
|
@ -17,17 +22,10 @@ struct ParseLocationRec {
|
||||||
int line;
|
int line;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include "Expr.h"
|
|
||||||
#include "Var.h"
|
|
||||||
#include "Frame.h"
|
|
||||||
#include "Queue.h"
|
|
||||||
#include "Dict.h"
|
|
||||||
#include "StmtEnums.h"
|
|
||||||
#include "DbgBreakpoint.h"
|
|
||||||
|
|
||||||
class StmtLocMapping;
|
class StmtLocMapping;
|
||||||
typedef PQueue<StmtLocMapping> Filemap; // mapping for a single file
|
typedef PQueue<StmtLocMapping> Filemap; // mapping for a single file
|
||||||
|
|
||||||
|
class Frame;
|
||||||
class DbgBreakpoint;
|
class DbgBreakpoint;
|
||||||
class DbgWatch;
|
class DbgWatch;
|
||||||
class DbgDisplay;
|
class DbgDisplay;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
// implementation of most commands.
|
// implementation of most commands.
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "DebugCmds.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
|
||||||
|
@ -9,14 +10,18 @@
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
|
|
||||||
#include "Debug.h"
|
|
||||||
#include "DebugCmds.h"
|
|
||||||
#include "DebugCmdInfoConstants.cc"
|
#include "DebugCmdInfoConstants.cc"
|
||||||
|
#include "Debug.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "DbgBreakpoint.h"
|
#include "DbgBreakpoint.h"
|
||||||
|
#include "ID.h"
|
||||||
|
#include "Frame.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
#include "Stmt.h"
|
#include "Stmt.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
|
#include "Reporter.h"
|
||||||
#include "PolicyFile.h"
|
#include "PolicyFile.h"
|
||||||
|
#include "Val.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,15 +1,15 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "Desc.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <string.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include "Desc.h"
|
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
|
||||||
#include "ConvertUTF.h"
|
#include "ConvertUTF.h"
|
||||||
|
|
||||||
#define DEFAULT_SIZE 128
|
#define DEFAULT_SIZE 128
|
||||||
|
|
|
@ -2,12 +2,14 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <stdio.h>
|
#include "BroString.h" // for byte_vec
|
||||||
|
#include "util.h" // for bro_int_t
|
||||||
|
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "BroString.h"
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
DESC_READABLE,
|
DESC_READABLE,
|
||||||
|
|
|
@ -1,13 +1,18 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "Net.h"
|
|
||||||
#include "Var.h"
|
|
||||||
#include "Discard.h"
|
#include "Discard.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include "Net.h"
|
||||||
|
#include "Func.h"
|
||||||
|
#include "Var.h"
|
||||||
|
#include "Val.h"
|
||||||
|
#include "IP.h"
|
||||||
|
#include "Reporter.h" // for InterpreterException
|
||||||
|
|
||||||
Discarder::Discarder()
|
Discarder::Discarder()
|
||||||
{
|
{
|
||||||
check_ip = internal_func("discarder_check_ip");
|
check_ip = internal_func("discarder_check_ip");
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "IP.h"
|
#include <sys/types.h> // for u_char
|
||||||
#include "Func.h"
|
|
||||||
|
|
||||||
struct ip;
|
struct ip;
|
||||||
struct tcphdr;
|
struct tcphdr;
|
||||||
struct udphdr;
|
struct udphdr;
|
||||||
struct icmp;
|
struct icmp;
|
||||||
|
|
||||||
|
class IP_Hdr;
|
||||||
class Val;
|
class Val;
|
||||||
class RecordType;
|
class RecordType;
|
||||||
class Func;
|
class Func;
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "EquivClass.h"
|
#include "EquivClass.h"
|
||||||
|
#include "CCL.h"
|
||||||
|
|
||||||
EquivClass::EquivClass(int arg_size)
|
EquivClass::EquivClass(int arg_size)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#include "CCL.h"
|
class CCL;
|
||||||
|
|
||||||
class EquivClass {
|
class EquivClass {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Trigger.h"
|
#include "Trigger.h"
|
||||||
|
|
|
@ -2,10 +2,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "EventRegistry.h"
|
|
||||||
|
|
||||||
#include "analyzer/Tag.h"
|
|
||||||
#include "analyzer/Analyzer.h"
|
#include "analyzer/Analyzer.h"
|
||||||
|
#include "Val.h"
|
||||||
|
|
||||||
class EventMgr;
|
class EventMgr;
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "Event.h"
|
|
||||||
#include "EventHandler.h"
|
#include "EventHandler.h"
|
||||||
|
#include "Event.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
|
|
|
@ -2,11 +2,10 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <assert.h>
|
#include "BroList.h"
|
||||||
|
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include "List.h"
|
|
||||||
#include "BroList.h"
|
|
||||||
|
|
||||||
class Func;
|
class Func;
|
||||||
class FuncType;
|
class FuncType;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "EventRegistry.h"
|
#include "EventRegistry.h"
|
||||||
|
#include "EventHandler.h"
|
||||||
#include "RE.h"
|
#include "RE.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
|
||||||
|
|
|
@ -4,11 +4,14 @@
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include "Func.h"
|
using std::string;
|
||||||
#include "List.h"
|
using std::vector;
|
||||||
#include "Dict.h"
|
|
||||||
#include "EventHandler.h"
|
class EventHandler;
|
||||||
|
class EventHandlerPtr;
|
||||||
|
class RE_Matcher;
|
||||||
|
|
||||||
// The registry keeps track of all events that we provide or handle.
|
// The registry keeps track of all events that we provide or handle.
|
||||||
class EventRegistry {
|
class EventRegistry {
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
|
|
||||||
#include "Expr.h"
|
#include "Expr.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
#include "RE.h"
|
#include "RE.h"
|
||||||
|
@ -15,6 +16,8 @@
|
||||||
#include "Trigger.h"
|
#include "Trigger.h"
|
||||||
#include "IPAddr.h"
|
#include "IPAddr.h"
|
||||||
#include "digest.h"
|
#include "digest.h"
|
||||||
|
#include "module_util.h"
|
||||||
|
#include "DebugLogger.h"
|
||||||
|
|
||||||
#include "broker/Data.h"
|
#include "broker/Data.h"
|
||||||
|
|
||||||
|
|
|
@ -5,16 +5,18 @@
|
||||||
// BRO expressions.
|
// BRO expressions.
|
||||||
|
|
||||||
#include "BroList.h"
|
#include "BroList.h"
|
||||||
#include "ID.h"
|
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
#include "Type.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "Debug.h"
|
|
||||||
#include "EventHandler.h"
|
#include "EventHandler.h"
|
||||||
#include "TraverseTypes.h"
|
#include "TraverseTypes.h"
|
||||||
|
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
EXPR_ANY = -1,
|
EXPR_ANY = -1,
|
||||||
EXPR_NAME, EXPR_CONST,
|
EXPR_NAME, EXPR_CONST,
|
||||||
|
@ -873,8 +875,6 @@ protected:
|
||||||
int num_fields;
|
int num_fields;
|
||||||
};
|
};
|
||||||
|
|
||||||
class EventHandler;
|
|
||||||
|
|
||||||
class ScheduleTimer : public Timer {
|
class ScheduleTimer : public Timer {
|
||||||
public:
|
public:
|
||||||
ScheduleTimer(EventHandlerPtr event, val_list* args, double t,
|
ScheduleTimer(EventHandlerPtr event, val_list* args, double t,
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "File.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
#ifdef TIME_WITH_SYS_TIME
|
||||||
|
@ -20,13 +21,14 @@
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "File.h"
|
#include "Attr.h"
|
||||||
#include "Type.h"
|
#include "Type.h"
|
||||||
#include "Expr.h"
|
#include "Expr.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Desc.h"
|
||||||
|
|
||||||
std::list<std::pair<std::string, BroFile*>> BroFile::open_files;
|
std::list<std::pair<std::string, BroFile*>> BroFile::open_files;
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,21 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <fcntl.h>
|
|
||||||
#include "util.h"
|
|
||||||
#include "Obj.h"
|
#include "Obj.h"
|
||||||
#include "Attr.h"
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <string>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
#include <fcntl.h>
|
||||||
|
|
||||||
# ifdef NEED_KRB5_H
|
# ifdef NEED_KRB5_H
|
||||||
# include <krb5.h>
|
# include <krb5.h>
|
||||||
# endif // NEED_KRB5_H
|
# endif // NEED_KRB5_H
|
||||||
|
|
||||||
|
class Attributes;
|
||||||
class BroType;
|
class BroType;
|
||||||
|
class RecordVal;
|
||||||
|
|
||||||
class BroFile : public BroObj {
|
class BroFile : public BroObj {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -2,11 +2,12 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "util.h"
|
|
||||||
#include "Hash.h"
|
|
||||||
#include "Frag.h"
|
#include "Frag.h"
|
||||||
|
#include "Hash.h"
|
||||||
|
#include "IP.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
|
#include "Reporter.h"
|
||||||
|
|
||||||
#define MIN_ACCEPTABLE_FRAG_SIZE 64
|
#define MIN_ACCEPTABLE_FRAG_SIZE 64
|
||||||
#define MAX_ACCEPTABLE_FRAG_SIZE 64000
|
#define MAX_ACCEPTABLE_FRAG_SIZE 64000
|
||||||
|
|
12
src/Frag.h
12
src/Frag.h
|
@ -2,16 +2,18 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <tuple>
|
#include "util.h" // for bro_uint_t
|
||||||
|
#include "IPAddr.h"
|
||||||
#include "util.h"
|
|
||||||
#include "IP.h"
|
|
||||||
#include "Net.h"
|
|
||||||
#include "Reassem.h"
|
#include "Reassem.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
|
||||||
|
#include <tuple>
|
||||||
|
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
class HashKey;
|
class HashKey;
|
||||||
class NetSessions;
|
class NetSessions;
|
||||||
|
class IP_Hdr;
|
||||||
|
|
||||||
class FragReassembler;
|
class FragReassembler;
|
||||||
class FragTimer;
|
class FragTimer;
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
|
#include "Frame.h"
|
||||||
|
|
||||||
#include <broker/error.hh>
|
#include <broker/error.hh>
|
||||||
#include "broker/Data.h"
|
#include "broker/Data.h"
|
||||||
|
|
||||||
#include "Frame.h"
|
#include "Func.h"
|
||||||
|
#include "Desc.h"
|
||||||
|
#include "IntrusivePtr.h"
|
||||||
#include "Trigger.h"
|
#include "Trigger.h"
|
||||||
|
|
||||||
vector<Frame*> g_frame_stack;
|
vector<Frame*> g_frame_stack;
|
||||||
|
|
|
@ -2,17 +2,20 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "BroList.h" // for typedef val_list
|
||||||
|
#include "Val.h"
|
||||||
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <memory>
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <utility>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <broker/data.hh>
|
#include <broker/data.hh>
|
||||||
#include <broker/expected.hh>
|
#include <broker/expected.hh>
|
||||||
|
|
||||||
#include "Val.h"
|
|
||||||
|
|
||||||
namespace trigger { class Trigger; }
|
namespace trigger { class Trigger; }
|
||||||
class CallExpr;
|
class CallExpr;
|
||||||
|
class BroFunc;
|
||||||
|
|
||||||
class Frame : public BroObj {
|
class Frame : public BroObj {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "Func.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
|
@ -32,12 +33,14 @@
|
||||||
#include <broker/error.hh>
|
#include <broker/error.hh>
|
||||||
|
|
||||||
#include "Base64.h"
|
#include "Base64.h"
|
||||||
|
#include "Debug.h"
|
||||||
|
#include "Desc.h"
|
||||||
|
#include "Expr.h"
|
||||||
#include "Stmt.h"
|
#include "Stmt.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Func.h"
|
|
||||||
#include "Frame.h"
|
#include "Frame.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
#include "analyzer/protocol/login/Login.h"
|
#include "analyzer/protocol/login/Login.h"
|
||||||
|
@ -47,6 +50,9 @@
|
||||||
#include "Traverse.h"
|
#include "Traverse.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "plugin/Manager.h"
|
#include "plugin/Manager.h"
|
||||||
|
#include "module_util.h"
|
||||||
|
#include "iosource/PktSrc.h"
|
||||||
|
#include "iosource/PktDumper.h"
|
||||||
|
|
||||||
extern RETSIGTYPE sig_handler(int signo);
|
extern RETSIGTYPE sig_handler(int signo);
|
||||||
|
|
||||||
|
|
14
src/Func.h
14
src/Func.h
|
@ -2,16 +2,21 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "BroList.h"
|
||||||
|
#include "Obj.h"
|
||||||
|
#include "Type.h" /* for function_flavor */
|
||||||
|
#include "TraverseTypes.h"
|
||||||
|
|
||||||
#include <utility>
|
#include <utility>
|
||||||
#include <memory>
|
#include <memory>
|
||||||
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
#include <broker/data.hh>
|
#include <broker/data.hh>
|
||||||
#include <broker/expected.hh>
|
#include <broker/expected.hh>
|
||||||
|
|
||||||
#include "BroList.h"
|
using std::string;
|
||||||
#include "Obj.h"
|
using std::vector;
|
||||||
#include "Debug.h"
|
|
||||||
#include "Frame.h"
|
|
||||||
|
|
||||||
class Val;
|
class Val;
|
||||||
class ListExpr;
|
class ListExpr;
|
||||||
|
@ -20,6 +25,7 @@ class Stmt;
|
||||||
class Frame;
|
class Frame;
|
||||||
class ID;
|
class ID;
|
||||||
class CallExpr;
|
class CallExpr;
|
||||||
|
class Scope;
|
||||||
|
|
||||||
class Func : public BroObj {
|
class Func : public BroObj {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -19,6 +19,7 @@
|
||||||
|
|
||||||
#include "Hash.h"
|
#include "Hash.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "BroString.h"
|
||||||
|
|
||||||
#include "siphash24.h"
|
#include "siphash24.h"
|
||||||
|
|
||||||
|
|
|
@ -2,12 +2,14 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "util.h" // for bro_int_t
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "BroString.h"
|
|
||||||
|
|
||||||
#define UHASH_KEY_SIZE 36
|
#define UHASH_KEY_SIZE 36
|
||||||
|
|
||||||
|
class BroString;
|
||||||
|
|
||||||
typedef uint64_t hash_t;
|
typedef uint64_t hash_t;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
|
|
@ -3,6 +3,7 @@
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "ID.h"
|
#include "ID.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "Expr.h"
|
#include "Expr.h"
|
||||||
#include "Dict.h"
|
#include "Dict.h"
|
||||||
#include "EventRegistry.h"
|
#include "EventRegistry.h"
|
||||||
|
@ -11,7 +12,11 @@
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "Traverse.h"
|
#include "Traverse.h"
|
||||||
|
#include "Val.h"
|
||||||
#include "zeekygen/Manager.h"
|
#include "zeekygen/Manager.h"
|
||||||
|
#include "zeekygen/IdentifierInfo.h"
|
||||||
|
#include "zeekygen/ScriptInfo.h"
|
||||||
|
#include "module_util.h"
|
||||||
|
|
||||||
ID::ID(const char* arg_name, IDScope arg_scope, bool arg_is_export)
|
ID::ID(const char* arg_name, IDScope arg_scope, bool arg_is_export)
|
||||||
{
|
{
|
||||||
|
|
7
src/ID.h
7
src/ID.h
|
@ -2,14 +2,21 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Obj.h"
|
||||||
#include "Type.h"
|
#include "Type.h"
|
||||||
#include "Attr.h"
|
#include "Attr.h"
|
||||||
#include "Notifier.h"
|
#include "Notifier.h"
|
||||||
#include "TraverseTypes.h"
|
#include "TraverseTypes.h"
|
||||||
|
|
||||||
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
class Val;
|
class Val;
|
||||||
|
class Expr;
|
||||||
class Func;
|
class Func;
|
||||||
|
class BroType;
|
||||||
|
class Attributes;
|
||||||
|
|
||||||
typedef enum { INIT_NONE, INIT_FULL, INIT_EXTRA, INIT_REMOVE, } init_class;
|
typedef enum { INIT_NONE, INIT_FULL, INIT_EXTRA, INIT_REMOVE, } init_class;
|
||||||
typedef enum { SCOPE_FUNCTION, SCOPE_MODULE, SCOPE_GLOBAL } IDScope;
|
typedef enum { SCOPE_FUNCTION, SCOPE_MODULE, SCOPE_GLOBAL } IDScope;
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
|
#include "IP.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/icmp6.h>
|
#include <netinet/icmp6.h>
|
||||||
|
|
||||||
#include "IP.h"
|
|
||||||
#include "Type.h"
|
#include "Type.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
|
|
7
src/IP.h
7
src/IP.h
|
@ -3,15 +3,16 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
#include "net_util.h"
|
|
||||||
#include "IPAddr.h"
|
#include "IPAddr.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "Val.h"
|
|
||||||
#include "Type.h"
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <netinet/ip.h>
|
#include <netinet/ip.h>
|
||||||
|
|
||||||
|
using std::vector;
|
||||||
|
|
||||||
#ifdef ENABLE_MOBILE_IPV6
|
#ifdef ENABLE_MOBILE_IPV6
|
||||||
|
|
||||||
#ifndef IPPROTO_MOBILITY
|
#ifndef IPPROTO_MOBILITY
|
||||||
|
|
11
src/IPAddr.h
11
src/IPAddr.h
|
@ -2,17 +2,16 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "BroString.h"
|
||||||
|
#include "Hash.h"
|
||||||
|
#include "threading/SerialTypes.h"
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "BroString.h"
|
using std::string;
|
||||||
#include "Hash.h"
|
|
||||||
#include "util.h"
|
|
||||||
#include "Type.h"
|
|
||||||
#include "threading/SerialTypes.h"
|
|
||||||
|
|
||||||
struct ConnID;
|
struct ConnID;
|
||||||
namespace analyzer { class ExpectedConn; }
|
namespace analyzer { class ExpectedConn; }
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include <algorithm>
|
|
||||||
|
|
||||||
#include "NFA.h"
|
#include "NFA.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "EquivClass.h"
|
#include "EquivClass.h"
|
||||||
|
#include "IntSet.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
static int nfa_state_id = 0;
|
static int nfa_state_id = 0;
|
||||||
|
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "RE.h"
|
#include "Obj.h"
|
||||||
#include "IntSet.h"
|
#include "List.h"
|
||||||
|
|
||||||
|
class CCL;
|
||||||
|
class Func;
|
||||||
class NFA_State;
|
class NFA_State;
|
||||||
class EquivClass;
|
class EquivClass;
|
||||||
|
|
||||||
|
|
10
src/Net.cc
10
src/Net.cc
|
@ -1,6 +1,7 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "Net.h"
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef TIME_WITH_SYS_TIME
|
#ifdef TIME_WITH_SYS_TIME
|
||||||
|
@ -19,13 +20,16 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
extern "C" {
|
||||||
|
#include "setsignal.h"
|
||||||
|
};
|
||||||
|
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
#include "Net.h"
|
|
||||||
#include "Anon.h"
|
#include "Anon.h"
|
||||||
#include "PacketDumper.h"
|
#include "PacketDumper.h"
|
||||||
#include "iosource/Manager.h"
|
#include "iosource/Manager.h"
|
||||||
|
@ -34,10 +38,6 @@
|
||||||
#include "plugin/Manager.h"
|
#include "plugin/Manager.h"
|
||||||
#include "broker/Manager.h"
|
#include "broker/Manager.h"
|
||||||
|
|
||||||
extern "C" {
|
|
||||||
#include "setsignal.h"
|
|
||||||
};
|
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
extern int select(int, fd_set *, fd_set *, fd_set *, struct timeval *);
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,14 +2,14 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <list>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
#include "net_util.h"
|
#include <sys/stat.h> // for ino_t
|
||||||
#include "util.h"
|
|
||||||
#include "List.h"
|
using std::string;
|
||||||
#include "Func.h"
|
|
||||||
|
|
||||||
namespace iosource {
|
namespace iosource {
|
||||||
class IOSource;
|
class IOSource;
|
||||||
|
|
|
@ -2,8 +2,10 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "Var.h"
|
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
|
#include "Var.h"
|
||||||
|
#include "EventHandler.h"
|
||||||
|
#include "Val.h"
|
||||||
|
|
||||||
RecordType* conn_id;
|
RecordType* conn_id;
|
||||||
RecordType* endpoint;
|
RecordType* endpoint;
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "DebugLogger.h"
|
|
||||||
#include "Notifier.h"
|
#include "Notifier.h"
|
||||||
|
#include "DebugLogger.h"
|
||||||
|
|
||||||
|
#include <set>
|
||||||
|
|
||||||
notifier::Registry notifier::registry;
|
notifier::Registry notifier::registry;
|
||||||
|
|
||||||
|
|
|
@ -7,12 +7,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <set>
|
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
#include <string>
|
|
||||||
|
|
||||||
#include "util.h"
|
|
||||||
#include "DebugLogger.h"
|
|
||||||
|
|
||||||
namespace notifier {
|
namespace notifier {
|
||||||
|
|
||||||
|
|
|
@ -1,10 +1,11 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "Obj.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#include "Obj.h"
|
#include "Desc.h"
|
||||||
#include "Func.h"
|
#include "Func.h"
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "plugin/Manager.h"
|
#include "plugin/Manager.h"
|
||||||
|
|
|
@ -4,8 +4,7 @@
|
||||||
|
|
||||||
#include <limits.h>
|
#include <limits.h>
|
||||||
|
|
||||||
#include "input.h"
|
class ODesc;
|
||||||
#include "Desc.h"
|
|
||||||
|
|
||||||
class Location {
|
class Location {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -5,9 +5,12 @@
|
||||||
#include "OpaqueVal.h"
|
#include "OpaqueVal.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Desc.h"
|
||||||
|
#include "Var.h"
|
||||||
#include "probabilistic/BloomFilter.h"
|
#include "probabilistic/BloomFilter.h"
|
||||||
#include "probabilistic/CardinalityCounter.h"
|
#include "probabilistic/CardinalityCounter.h"
|
||||||
|
|
||||||
|
#include <broker/data.hh>
|
||||||
#include <broker/error.hh>
|
#include <broker/error.hh>
|
||||||
|
|
||||||
// Helper to retrieve a broker value out of a broker::vector at a specified
|
// Helper to retrieve a broker value out of a broker::vector at a specified
|
||||||
|
|
|
@ -2,14 +2,16 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <broker/data.hh>
|
|
||||||
#include <broker/expected.hh>
|
|
||||||
|
|
||||||
#include "RandTest.h"
|
#include "RandTest.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "digest.h"
|
#include "digest.h"
|
||||||
#include "paraglob/paraglob.h"
|
#include "paraglob/paraglob.h"
|
||||||
|
|
||||||
|
#include <broker/expected.hh>
|
||||||
|
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
|
namespace broker { class data; }
|
||||||
class OpaqueVal;
|
class OpaqueVal;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,9 +1,13 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include <unistd.h>
|
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
|
#include "Options.h"
|
||||||
|
|
||||||
|
#include <algorithm>
|
||||||
|
|
||||||
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef HAVE_GETOPT_H
|
#ifdef HAVE_GETOPT_H
|
||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
@ -11,8 +15,6 @@
|
||||||
#include "bsd-getopt-long.h"
|
#include "bsd-getopt-long.h"
|
||||||
#include "logging/writers/ascii/Ascii.h"
|
#include "logging/writers/ascii/Ascii.h"
|
||||||
|
|
||||||
#include "Options.h"
|
|
||||||
|
|
||||||
void zeek::Options::filter_supervisor_options()
|
void zeek::Options::filter_supervisor_options()
|
||||||
{
|
{
|
||||||
pcap_filter = {};
|
pcap_filter = {};
|
||||||
|
|
|
@ -1,14 +1,10 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include <assert.h>
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#include "Event.h"
|
|
||||||
#include "Net.h"
|
|
||||||
#include "PacketDumper.h"
|
#include "PacketDumper.h"
|
||||||
|
#include "Reporter.h"
|
||||||
|
#include "util.h"
|
||||||
|
#include "iosource/PktDumper.h"
|
||||||
|
|
||||||
PacketDumper::PacketDumper(pcap_dumper_t* arg_pkt_dump)
|
PacketDumper::PacketDumper(pcap_dumper_t* arg_pkt_dump)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,8 @@
|
||||||
|
|
||||||
#include <pcap.h>
|
#include <pcap.h>
|
||||||
|
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
class PacketDumper {
|
class PacketDumper {
|
||||||
public:
|
public:
|
||||||
explicit PacketDumper(pcap_dumper_t* pkt_dump);
|
explicit PacketDumper(pcap_dumper_t* pkt_dump);
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "PacketFilter.h"
|
#include "PacketFilter.h"
|
||||||
|
#include "IP.h"
|
||||||
|
|
||||||
void PacketFilter::DeleteFilter(void* data)
|
void PacketFilter::DeleteFilter(void* data)
|
||||||
{
|
{
|
||||||
|
|
|
@ -2,9 +2,12 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "IP.h"
|
#include "IPAddr.h"
|
||||||
#include "PrefixTable.h"
|
#include "PrefixTable.h"
|
||||||
|
|
||||||
|
class IP_Hdr;
|
||||||
|
class Val;
|
||||||
|
|
||||||
class PacketFilter {
|
class PacketFilter {
|
||||||
public:
|
public:
|
||||||
explicit PacketFilter(bool arg_default);
|
explicit PacketFilter(bool arg_default);
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
#include "PrefixTable.h"
|
#include "PrefixTable.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Val.h"
|
||||||
|
|
||||||
prefix_t* PrefixTable::MakePrefix(const IPAddr& addr, int width)
|
prefix_t* PrefixTable::MakePrefix(const IPAddr& addr, int width)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,13 +1,19 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Val.h"
|
|
||||||
#include "net_util.h"
|
|
||||||
#include "IPAddr.h"
|
#include "IPAddr.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "patricia.h"
|
#include "patricia.h"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#include <list>
|
||||||
|
|
||||||
|
using std::list;
|
||||||
|
using std::tuple;
|
||||||
|
|
||||||
|
class Val;
|
||||||
|
class SubNetVal;
|
||||||
|
|
||||||
class PrefixTable {
|
class PrefixTable {
|
||||||
private:
|
private:
|
||||||
struct iterator {
|
struct iterator {
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "util.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
class PriorityQueue;
|
class PriorityQueue;
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include <iterator>
|
||||||
|
|
||||||
// Queue.h --
|
// Queue.h --
|
||||||
// Interface for class Queue, current implementation is as an
|
// Interface for class Queue, current implementation is as an
|
||||||
// array of ent's. This implementation was chosen to optimize
|
// array of ent's. This implementation was chosen to optimize
|
||||||
|
|
|
@ -1,15 +1,16 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "RE.h"
|
||||||
|
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "RE.h"
|
|
||||||
#include "DFA.h"
|
#include "DFA.h"
|
||||||
#include "CCL.h"
|
#include "CCL.h"
|
||||||
#include "EquivClass.h"
|
#include "EquivClass.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "BroString.h"
|
||||||
|
|
||||||
CCL* curr_ccl = 0;
|
CCL* curr_ccl = 0;
|
||||||
|
|
||||||
|
|
6
src/RE.h
6
src/RE.h
|
@ -2,9 +2,7 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Obj.h"
|
#include "List.h"
|
||||||
#include "Dict.h"
|
|
||||||
#include "BroString.h"
|
|
||||||
#include "CCL.h"
|
#include "CCL.h"
|
||||||
#include "EquivClass.h"
|
#include "EquivClass.h"
|
||||||
|
|
||||||
|
@ -12,6 +10,7 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
typedef int (*cce_func)(int);
|
typedef int (*cce_func)(int);
|
||||||
|
|
||||||
|
@ -21,6 +20,7 @@ class DFA_Machine;
|
||||||
class Specific_RE_Matcher;
|
class Specific_RE_Matcher;
|
||||||
class RE_Matcher;
|
class RE_Matcher;
|
||||||
class DFA_State;
|
class DFA_State;
|
||||||
|
class BroString;
|
||||||
|
|
||||||
extern int case_insensitive;
|
extern int case_insensitive;
|
||||||
extern CCL* curr_ccl;
|
extern CCL* curr_ccl;
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
Modified for Bro by Seth Hall - July 2010
|
Modified for Bro by Seth Hall - July 2010
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <math.h>
|
|
||||||
#include "RandTest.h"
|
#include "RandTest.h"
|
||||||
|
|
||||||
|
#include <math.h>
|
||||||
|
|
||||||
#define log2of10 3.32192809488736234787
|
#define log2of10 3.32192809488736234787
|
||||||
/* RT_LOG2 -- Calculate log to the base 2 */
|
/* RT_LOG2 -- Calculate log to the base 2 */
|
||||||
static double rt_log2(double x)
|
static double rt_log2(double x)
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "util.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
#define RT_MONTEN 6 /* Bytes used as Monte Carlo
|
#define RT_MONTEN 6 /* Bytes used as Monte Carlo
|
||||||
co-ordinates. This should be no more
|
co-ordinates. This should be no more
|
||||||
|
|
|
@ -1,10 +1,13 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
|
|
||||||
|
#include "zeek-config.h"
|
||||||
|
#include "Reassem.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "Desc.h"
|
||||||
|
|
||||||
#include "Reassem.h"
|
using std::min;
|
||||||
|
|
||||||
uint64_t Reassembler::total_size = 0;
|
uint64_t Reassembler::total_size = 0;
|
||||||
uint64_t Reassembler::sizes[REASSEM_NUM];
|
uint64_t Reassembler::sizes[REASSEM_NUM];
|
||||||
|
|
|
@ -5,7 +5,10 @@
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "Obj.h"
|
#include "Obj.h"
|
||||||
#include "IPAddr.h"
|
|
||||||
|
#include <assert.h>
|
||||||
|
#include <string.h>
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
// Whenever subclassing the Reassembler class
|
// Whenever subclassing the Reassembler class
|
||||||
// you should add to this for known subclasses.
|
// you should add to this for known subclasses.
|
||||||
|
|
|
@ -2,18 +2,23 @@
|
||||||
// See the file "COPYING" in the main distribution directory for copyright.
|
// See the file "COPYING" in the main distribution directory for copyright.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include "zeek-config.h"
|
||||||
|
#include "Reporter.h"
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <syslog.h>
|
#include <syslog.h>
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "Desc.h"
|
||||||
#include "Reporter.h"
|
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
#include "Expr.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "Conn.h"
|
#include "Conn.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
|
#include "EventHandler.h"
|
||||||
#include "plugin/Plugin.h"
|
#include "plugin/Plugin.h"
|
||||||
#include "plugin/Manager.h"
|
#include "plugin/Manager.h"
|
||||||
|
#include "input.h"
|
||||||
#include "file_analysis/File.h"
|
#include "file_analysis/File.h"
|
||||||
|
|
||||||
#ifdef SYSLOG_INT
|
#ifdef SYSLOG_INT
|
||||||
|
|
|
@ -11,8 +11,6 @@
|
||||||
#include <unordered_set>
|
#include <unordered_set>
|
||||||
#include <unordered_map>
|
#include <unordered_map>
|
||||||
|
|
||||||
#include "util.h"
|
|
||||||
#include "EventHandler.h"
|
|
||||||
#include "IPAddr.h"
|
#include "IPAddr.h"
|
||||||
|
|
||||||
namespace analyzer { class Analyzer; }
|
namespace analyzer { class Analyzer; }
|
||||||
|
@ -20,6 +18,7 @@ namespace file_analysis { class File; }
|
||||||
class Connection;
|
class Connection;
|
||||||
class Location;
|
class Location;
|
||||||
class Reporter;
|
class Reporter;
|
||||||
|
class EventHandlerPtr;
|
||||||
|
|
||||||
// One cannot raise this exception directly, go through the
|
// One cannot raise this exception directly, go through the
|
||||||
// Reporter's methods instead.
|
// Reporter's methods instead.
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "Rule.h"
|
#include "Rule.h"
|
||||||
|
#include "RuleAction.h"
|
||||||
|
#include "RuleCondition.h"
|
||||||
#include "RuleMatcher.h"
|
#include "RuleMatcher.h"
|
||||||
|
|
||||||
// Start at one as we want search for this within a list,
|
// Start at one as we want search for this within a list,
|
||||||
|
|
14
src/Rule.h
14
src/Rule.h
|
@ -1,17 +1,17 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <limits.h>
|
|
||||||
#include <map>
|
|
||||||
|
|
||||||
#include "Obj.h"
|
|
||||||
#include "List.h"
|
#include "List.h"
|
||||||
#include "Dict.h"
|
#include "Obj.h"
|
||||||
#include "util.h"
|
|
||||||
|
#include <map>
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <limits.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
class RuleCondition;
|
class RuleCondition;
|
||||||
class RuleAction;
|
class RuleAction;
|
||||||
class RuleHdrTest;
|
class RuleHdrTest;
|
||||||
|
|
||||||
class Rule;
|
class Rule;
|
||||||
|
|
||||||
typedef PList<Rule> rule_list;
|
typedef PList<Rule> rule_list;
|
||||||
|
|
|
@ -1,11 +1,15 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "BroString.h"
|
|
||||||
#include "List.h"
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include "analyzer/Tag.h"
|
#include "analyzer/Tag.h"
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
#include <sys/types.h> // for u_char
|
||||||
|
|
||||||
|
using std::string;
|
||||||
|
|
||||||
class Rule;
|
class Rule;
|
||||||
class RuleEndpointState;
|
class RuleEndpointState;
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,13 @@
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
#include "RuleCondition.h"
|
#include "RuleCondition.h"
|
||||||
|
#include "RuleMatcher.h"
|
||||||
#include "analyzer/protocol/tcp/TCP.h"
|
#include "analyzer/protocol/tcp/TCP.h"
|
||||||
|
#include "Reporter.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
|
#include "Func.h"
|
||||||
|
#include "Val.h"
|
||||||
|
#include "Var.h" // for internal_type()
|
||||||
|
|
||||||
static inline bool is_established(const analyzer::tcp::TCP_Endpoint* e)
|
static inline bool is_established(const analyzer::tcp::TCP_Endpoint* e)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,10 +1,9 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "BroString.h"
|
#include <stdint.h> // for u_char
|
||||||
#include "Func.h"
|
#include <sys/types.h> // for u_char
|
||||||
#include "List.h"
|
|
||||||
#include "util.h"
|
|
||||||
|
|
||||||
|
class ID;
|
||||||
class Rule;
|
class Rule;
|
||||||
class RuleEndpointState;
|
class RuleEndpointState;
|
||||||
|
|
||||||
|
|
|
@ -1,15 +1,23 @@
|
||||||
|
|
||||||
|
#include "zeek-config.h"
|
||||||
|
#include "RuleMatcher.h"
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "RuleAction.h"
|
||||||
|
#include "RuleCondition.h"
|
||||||
|
#include "ID.h"
|
||||||
|
#include "IntSet.h"
|
||||||
|
#include "IP.h"
|
||||||
#include "analyzer/Analyzer.h"
|
#include "analyzer/Analyzer.h"
|
||||||
#include "RuleMatcher.h"
|
|
||||||
#include "DFA.h"
|
#include "DFA.h"
|
||||||
|
#include "DebugLogger.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "module_util.h"
|
||||||
|
|
||||||
// FIXME: Things that are not fully implemented/working yet:
|
// FIXME: Things that are not fully implemented/working yet:
|
||||||
//
|
//
|
||||||
|
|
|
@ -1,24 +1,17 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <limits.h>
|
#include "Rule.h"
|
||||||
|
#include "RE.h"
|
||||||
|
#include "CCL.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <functional>
|
#include <functional>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "IPAddr.h"
|
#include <sys/types.h> // for u_char
|
||||||
#include "BroString.h"
|
#include <limits.h>
|
||||||
#include "List.h"
|
|
||||||
#include "RE.h"
|
|
||||||
#include "Net.h"
|
|
||||||
#include "Sessions.h"
|
|
||||||
#include "IntSet.h"
|
|
||||||
#include "util.h"
|
|
||||||
#include "Rule.h"
|
|
||||||
#include "RuleAction.h"
|
|
||||||
#include "RuleCondition.h"
|
|
||||||
#include "iosource/Packet.h"
|
|
||||||
|
|
||||||
//#define MATCHER_PRINT_STATS
|
//#define MATCHER_PRINT_STATS
|
||||||
|
|
||||||
|
@ -34,6 +27,18 @@ extern FILE* rules_in;
|
||||||
extern int rules_line_number;
|
extern int rules_line_number;
|
||||||
extern const char* current_rule_file;
|
extern const char* current_rule_file;
|
||||||
|
|
||||||
|
using std::vector;
|
||||||
|
using std::map;
|
||||||
|
using std::set;
|
||||||
|
using std::string;
|
||||||
|
|
||||||
|
class Val;
|
||||||
|
class BroFile;
|
||||||
|
class IntSet;
|
||||||
|
class IP_Hdr;
|
||||||
|
class IPPrefix;
|
||||||
|
class RE_Match_State;
|
||||||
|
class Specific_RE_Matcher;
|
||||||
class RuleMatcher;
|
class RuleMatcher;
|
||||||
extern RuleMatcher* rule_matcher;
|
extern RuleMatcher* rule_matcher;
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,12 @@
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
|
||||||
|
#include "Scope.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "ID.h"
|
#include "ID.h"
|
||||||
#include "Val.h"
|
#include "Val.h"
|
||||||
#include "Scope.h"
|
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "module_util.h"
|
||||||
|
|
||||||
typedef PList<Scope> scope_list;
|
typedef PList<Scope> scope_list;
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,9 @@
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <map>
|
#include <map>
|
||||||
|
|
||||||
#include "Dict.h"
|
|
||||||
#include "Obj.h"
|
#include "Obj.h"
|
||||||
#include "BroList.h"
|
#include "BroList.h"
|
||||||
#include "TraverseTypes.h"
|
#include "TraverseTypes.h"
|
||||||
#include "module_util.h"
|
|
||||||
|
|
||||||
class ID;
|
class ID;
|
||||||
class BroType;
|
class BroType;
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
|
#include "SerializationFormat.h"
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
|
|
||||||
#include "net_util.h"
|
|
||||||
#include "SerializationFormat.h"
|
|
||||||
#include "DebugLogger.h"
|
#include "DebugLogger.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "net_util.h"
|
||||||
|
|
||||||
const float SerializationFormat::GROWTH_FACTOR = 2.5;
|
const float SerializationFormat::GROWTH_FACTOR = 2.5;
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
#include "util.h"
|
#include <stdint.h>
|
||||||
|
|
||||||
class IPAddr;
|
class IPAddr;
|
||||||
class IPPrefix;
|
class IPPrefix;
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
|
|
||||||
#include "zeek-config.h"
|
#include "zeek-config.h"
|
||||||
|
#include "Sessions.h"
|
||||||
|
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
@ -9,11 +10,11 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include "Desc.h"
|
||||||
#include "Net.h"
|
#include "Net.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
#include "Timer.h"
|
#include "Timer.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
#include "Sessions.h"
|
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
|
||||||
#include "analyzer/protocol/icmp/ICMP.h"
|
#include "analyzer/protocol/icmp/ICMP.h"
|
||||||
|
|
|
@ -2,26 +2,25 @@
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
|
#include "Frag.h"
|
||||||
|
#include "PacketFilter.h"
|
||||||
|
#include "NetVar.h"
|
||||||
|
#include "analyzer/protocol/tcp/Stats.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include "Dict.h"
|
#include <sys/types.h> // for u_char
|
||||||
#include "CompHash.h"
|
|
||||||
#include "IP.h"
|
|
||||||
#include "Frag.h"
|
|
||||||
#include "PacketFilter.h"
|
|
||||||
#include "Stats.h"
|
|
||||||
#include "NetVar.h"
|
|
||||||
#include "TunnelEncapsulation.h"
|
|
||||||
#include "analyzer/protocol/tcp/Stats.h"
|
|
||||||
|
|
||||||
class EncapsulationStack;
|
class EncapsulationStack;
|
||||||
|
class EncapsulatingConn;
|
||||||
|
class Packet;
|
||||||
|
class PacketProfiler;
|
||||||
class Connection;
|
class Connection;
|
||||||
class ConnCompressor;
|
class ConnCompressor;
|
||||||
struct ConnID;
|
struct ConnID;
|
||||||
|
|
||||||
class Discarder;
|
class Discarder;
|
||||||
class PacketFilter;
|
|
||||||
|
|
||||||
namespace analyzer { namespace stepping_stone { class SteppingStoneManager; } }
|
namespace analyzer { namespace stepping_stone { class SteppingStoneManager; } }
|
||||||
namespace analyzer { namespace arp { class ARP_Analyzer; } }
|
namespace analyzer { namespace arp { class ARP_Analyzer; } }
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
#include "Val.h"
|
||||||
|
|
||||||
BroSubstring::BroSubstring(const BroSubstring& bst)
|
BroSubstring::BroSubstring(const BroSubstring& bst)
|
||||||
: BroString((const BroString&) bst), _num(), _new(bst._new)
|
: BroString((const BroString&) bst), _num(), _new(bst._new)
|
||||||
|
|
|
@ -1,15 +1,19 @@
|
||||||
|
#include "Stats.h"
|
||||||
|
#include "RuleMatcher.h"
|
||||||
#include "Conn.h"
|
#include "Conn.h"
|
||||||
#include "File.h"
|
#include "File.h"
|
||||||
#include "Event.h"
|
#include "Event.h"
|
||||||
|
#include "Net.h"
|
||||||
#include "NetVar.h"
|
#include "NetVar.h"
|
||||||
|
#include "Var.h" // for internal_type()
|
||||||
#include "Sessions.h"
|
#include "Sessions.h"
|
||||||
#include "Stats.h"
|
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "cq.h"
|
#include "cq.h"
|
||||||
#include "DNS_Mgr.h"
|
#include "DNS_Mgr.h"
|
||||||
#include "Trigger.h"
|
#include "Trigger.h"
|
||||||
#include "threading/Manager.h"
|
#include "threading/Manager.h"
|
||||||
#include "broker/Manager.h"
|
#include "broker/Manager.h"
|
||||||
|
#include "input.h"
|
||||||
|
|
||||||
uint64_t killed_by_inactivity = 0;
|
uint64_t killed_by_inactivity = 0;
|
||||||
|
|
||||||
|
|
|
@ -5,6 +5,12 @@
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#include <sys/time.h>
|
#include <sys/time.h>
|
||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
class Func;
|
||||||
|
class TableVal;
|
||||||
|
class Location;
|
||||||
|
class BroFile;
|
||||||
|
|
||||||
// Object called by SegmentProfiler when it is done and reports its
|
// Object called by SegmentProfiler when it is done and reports its
|
||||||
// cumulative CPU/memory statistics.
|
// cumulative CPU/memory statistics.
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
#include "Stmt.h"
|
#include "Stmt.h"
|
||||||
#include "Scope.h"
|
#include "Scope.h"
|
||||||
#include "Var.h"
|
#include "Var.h"
|
||||||
|
#include "Desc.h"
|
||||||
#include "Debug.h"
|
#include "Debug.h"
|
||||||
#include "Traverse.h"
|
#include "Traverse.h"
|
||||||
#include "Trigger.h"
|
#include "Trigger.h"
|
||||||
|
|
|
@ -5,8 +5,9 @@
|
||||||
// BRO statements.
|
// BRO statements.
|
||||||
|
|
||||||
#include "BroList.h"
|
#include "BroList.h"
|
||||||
|
#include "Dict.h"
|
||||||
|
#include "ID.h"
|
||||||
#include "Obj.h"
|
#include "Obj.h"
|
||||||
#include "Expr.h"
|
|
||||||
#include "Reporter.h"
|
#include "Reporter.h"
|
||||||
|
|
||||||
#include "StmtEnums.h"
|
#include "StmtEnums.h"
|
||||||
|
@ -14,7 +15,11 @@
|
||||||
#include "TraverseTypes.h"
|
#include "TraverseTypes.h"
|
||||||
|
|
||||||
class StmtList;
|
class StmtList;
|
||||||
|
class CompositeHash;
|
||||||
|
class EventExpr;
|
||||||
|
class ListExpr;
|
||||||
class ForStmt;
|
class ForStmt;
|
||||||
|
class Frame;
|
||||||
|
|
||||||
class Stmt : public BroObj {
|
class Stmt : public BroObj {
|
||||||
public:
|
public:
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue