mirror of
https://github.com/zeek/zeek.git
synced 2025-10-09 18:18:19 +00:00
Merge remote-tracking branch 'origin/topic/awelzel/pre-commit-typos'
* origin/topic/awelzel/pre-commit-typos: all: Fix typos identified by typos pre-commit hook NEWS typo fixes Start with a typos pre-commit file
This commit is contained in:
commit
0fe32715c0
62 changed files with 173 additions and 85 deletions
|
@ -23,3 +23,9 @@ repos:
|
||||||
hooks:
|
hooks:
|
||||||
- id: cmake-format
|
- id: cmake-format
|
||||||
exclude: '^auxil/.*$'
|
exclude: '^auxil/.*$'
|
||||||
|
|
||||||
|
- repo: https://github.com/crate-ci/typos
|
||||||
|
rev: v1.15.0
|
||||||
|
hooks:
|
||||||
|
- id: typos
|
||||||
|
exclude: '^(.typos.toml|src/SmithWaterman.cc|testing/.*|auxil/.*|scripts/base/frameworks/files/magic/.*|CHANGES)$'
|
||||||
|
|
71
.typos.toml
Normal file
71
.typos.toml
Normal file
|
@ -0,0 +1,71 @@
|
||||||
|
[default]
|
||||||
|
extend-ignore-re = [
|
||||||
|
"#.*MSDN Ref.*\\[ms-oaut\\]",
|
||||||
|
# seh too close to she
|
||||||
|
"registered SEH to support IDL",
|
||||||
|
# ALLO is a valid FTP command
|
||||||
|
"\"ALLO\".*200",
|
||||||
|
"des-ede3-cbc-Env-OID",
|
||||||
|
"Remove in v6.1.*SupressWeird",
|
||||||
|
"max_repititions:.*Remove in v6.1",
|
||||||
|
# On purpose
|
||||||
|
"\"THE NETBIOS NAM\"",
|
||||||
|
# NFS stuff.
|
||||||
|
"commited: stable_how_t &optional",
|
||||||
|
# script_opt uses "ot" a lot, but it's very close to "to", so
|
||||||
|
# don't want to add it as identifier. Match some patterns.
|
||||||
|
"ASSERT\\(ot == OP_.*",
|
||||||
|
"ot->InternalType",
|
||||||
|
"ot->Tag\\(\\) == TYPE_.*",
|
||||||
|
"auto.* ot =",
|
||||||
|
"ot = OP_.*",
|
||||||
|
"if \\( ot == OP_.*",
|
||||||
|
"ot->Yield\\(\\)->InternalType\\(\\)",
|
||||||
|
"switch \\( ot \\)",
|
||||||
|
"\\(ZAMOpType ot\\)",
|
||||||
|
|
||||||
|
# News stuff
|
||||||
|
"SupressWeirds.*deprecated",
|
||||||
|
"\"BaR\"",
|
||||||
|
"\"xFoObar\"",
|
||||||
|
"\"FoO\"",
|
||||||
|
]
|
||||||
|
|
||||||
|
extend-ignore-identifiers-re = [
|
||||||
|
"TLS_.*_EDE.*_.*",
|
||||||
|
"SSL.*_EDE.*_.*",
|
||||||
|
"_3DES_EDE_CBC_SHA",
|
||||||
|
"GOST_R_.*",
|
||||||
|
"icmp6_nd_.*",
|
||||||
|
"ND_ROUTER_.*",
|
||||||
|
"ND_NEIGHBOR_.*",
|
||||||
|
".*_ND_option.*",
|
||||||
|
]
|
||||||
|
|
||||||
|
[default.extend-identifiers]
|
||||||
|
BuildNDOptionsVal = "BuildNDOptionsVal"
|
||||||
|
ESC_SER = "ESC_SER"
|
||||||
|
MCA_OCCURED = "MCA_OCCURED"
|
||||||
|
MNT3ERR_ACCES = "MNT3ERR_ACCES"
|
||||||
|
ND_QUEUE_OVERFLOW = "ND_QUEUE_OVERFLOW"
|
||||||
|
ND_REDIRECT = "ND_REDIRECT"
|
||||||
|
NED_ACK = "NED_ACK"
|
||||||
|
NFS3ERR_ACCES = "NFS3ERR_ACCES"
|
||||||
|
NO_SEH = "NO_SEH"
|
||||||
|
OP_SWITCHS_VVV = "OP_SWITCHS_VVV"
|
||||||
|
O_WRONLY = "O_WRONLY"
|
||||||
|
RPC_NT_CALL_FAILED_DNE = "RPC_NT_CALL_FAILED_DNE"
|
||||||
|
RpcAddPrintProvidor = "RpcAddPrintProvidor"
|
||||||
|
RpcDeletePrintProvidor = "RpcDeletePrintProvidor"
|
||||||
|
THA = "THA"
|
||||||
|
ar_tha = "ar_tha"
|
||||||
|
have_2nd = "have_2nd"
|
||||||
|
ot1 = "ot1"
|
||||||
|
ot2 = "ot2"
|
||||||
|
uses_seh = "uses_seh"
|
||||||
|
|
||||||
|
[default.extend-words]
|
||||||
|
caf = "caf"
|
||||||
|
helo = "helo"
|
||||||
|
# Seems we use this in the management framework
|
||||||
|
requestor = "requestor"
|
11
CHANGES
11
CHANGES
|
@ -1,3 +1,14 @@
|
||||||
|
6.1.0-dev.46 | 2023-06-14 12:59:41 +0200
|
||||||
|
|
||||||
|
* all: Fix typos identified by typos pre-commit hook (Arne Welzel, Corelight)
|
||||||
|
|
||||||
|
* NEWS typo fixes (Arne Welzel, Corelight)
|
||||||
|
|
||||||
|
* Start with a typos pre-commit file (Arne Welzel, Corelight)
|
||||||
|
|
||||||
|
Inspired by Spicy and me creating typos everywhere. Some of the
|
||||||
|
suggestions are also very reasonable.
|
||||||
|
|
||||||
6.1.0-dev.42 | 2023-06-14 12:51:08 +0200
|
6.1.0-dev.42 | 2023-06-14 12:51:08 +0200
|
||||||
|
|
||||||
* NEWS: Small section about assert statement (Arne Welzel, Corelight)
|
* NEWS: Small section about assert statement (Arne Welzel, Corelight)
|
||||||
|
|
8
NEWS
8
NEWS
|
@ -279,7 +279,7 @@ New Functionality
|
||||||
recognize CCMP-encrypted packets. These encrypted packets are currently
|
recognize CCMP-encrypted packets. These encrypted packets are currently
|
||||||
dropped to Zeek's inability to do anything with them.
|
dropped to Zeek's inability to do anything with them.
|
||||||
|
|
||||||
- Add packet analzyers for LLC, SNAP, and Novell 802.3, called from the Ethernet
|
- Add packet analyzers for LLC, SNAP, and Novell 802.3, called from the Ethernet
|
||||||
and VLAN analyzers by default.
|
and VLAN analyzers by default.
|
||||||
|
|
||||||
- Environment variables for the execution of log rotation postprocessors can
|
- Environment variables for the execution of log rotation postprocessors can
|
||||||
|
@ -2400,7 +2400,7 @@ Changed Functionality
|
||||||
- The IOSource API changed fairly wildly. The ``GetFds()`` and
|
- The IOSource API changed fairly wildly. The ``GetFds()`` and
|
||||||
``NextTimestamp`` methods no longer exist. If you had previously
|
``NextTimestamp`` methods no longer exist. If you had previously
|
||||||
implemented a custom IOSource, you will need to look at the new API
|
implemented a custom IOSource, you will need to look at the new API
|
||||||
and make changes to your code to accomodate it. This does not include
|
and make changes to your code to accommodate it. This does not include
|
||||||
packet sources, which should remain functional with little to no
|
packet sources, which should remain functional with little to no
|
||||||
changes, since the entirety of the changes should be in ``PktSrc``.
|
changes, since the entirety of the changes should be in ``PktSrc``.
|
||||||
|
|
||||||
|
@ -4052,7 +4052,7 @@ Changed Functionality
|
||||||
|
|
||||||
- HTTP
|
- HTTP
|
||||||
|
|
||||||
Removed 'filename' field (which was seldomly used).
|
Removed 'filename' field (which was seldom used).
|
||||||
|
|
||||||
New 'orig_filenames' and 'resp_filenames' fields which each
|
New 'orig_filenames' and 'resp_filenames' fields which each
|
||||||
contain a vector of filenames seen in entities transferred.
|
contain a vector of filenames seen in entities transferred.
|
||||||
|
@ -5038,7 +5038,7 @@ New Functionality
|
||||||
Instead of adding a separate worker entry in node.cfg for each Bro
|
Instead of adding a separate worker entry in node.cfg for each Bro
|
||||||
worker process on each worker host, it is now possible to just
|
worker process on each worker host, it is now possible to just
|
||||||
specify the number of worker processes on each host and BroControl
|
specify the number of worker processes on each host and BroControl
|
||||||
configures everything correctly (including any necessary enviroment
|
configures everything correctly (including any necessary environment
|
||||||
variables for the balancers).
|
variables for the balancers).
|
||||||
|
|
||||||
This change adds three new keywords to the node.cfg file (to be used
|
This change adds three new keywords to the node.cfg file (to be used
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
6.1.0-dev.42
|
6.1.0-dev.46
|
||||||
|
|
|
@ -2,7 +2,7 @@ FROM ubuntu:22.10
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
|
ENV DEBIAN_FRONTEND="noninteractive" TZ="America/Los_Angeles"
|
||||||
|
|
||||||
# A version field to invalide Cirrus's build cache when needed, as suggested in
|
# A version field to invalidate Cirrus's build cache when needed, as suggested in
|
||||||
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
|
# https://github.com/cirruslabs/cirrus-ci-docs/issues/544#issuecomment-566066822
|
||||||
ENV DOCKERFILE_VERSION 20230413
|
ENV DOCKERFILE_VERSION 20230413
|
||||||
|
|
||||||
|
|
|
@ -41,7 +41,7 @@ function archiver_encode_log_metadata(tbl: table[string] of string): string
|
||||||
local metadata_vec: vector of string;
|
local metadata_vec: vector of string;
|
||||||
for ( k, v in tbl )
|
for ( k, v in tbl )
|
||||||
{
|
{
|
||||||
if ( |v| == 0 ) # Assume concious decision to skip this entry.
|
if ( |v| == 0 ) # Assume conscious decision to skip this entry.
|
||||||
next;
|
next;
|
||||||
|
|
||||||
if ( /[,=]/ in k || /[,=]/ in v )
|
if ( /[,=]/ in k || /[,=]/ in v )
|
||||||
|
|
|
@ -167,7 +167,7 @@ export {
|
||||||
##
|
##
|
||||||
## For example, a search for 192.168.17.0/8 will reveal a rule that exists for
|
## For example, a search for 192.168.17.0/8 will reveal a rule that exists for
|
||||||
## 192.168.0.0/16, since this rule affects the subnet. However, it will not reveal
|
## 192.168.0.0/16, since this rule affects the subnet. However, it will not reveal
|
||||||
## a more specific rule for 192.168.17.1/32, which does not directy affect the whole
|
## a more specific rule for 192.168.17.1/32, which does not directly affect the whole
|
||||||
## subnet.
|
## subnet.
|
||||||
##
|
##
|
||||||
## This function works on both the manager and workers of a cluster. Note that on
|
## This function works on both the manager and workers of a cluster. Note that on
|
||||||
|
|
|
@ -26,7 +26,7 @@ export {
|
||||||
}
|
}
|
||||||
|
|
||||||
redef record ResultVal += {
|
redef record ResultVal += {
|
||||||
# Internal use only. This is not meant to be publically available
|
# Internal use only. This is not meant to be publicly available
|
||||||
# because probabilistic data structures have to be examined using
|
# because probabilistic data structures have to be examined using
|
||||||
# specialized bifs.
|
# specialized bifs.
|
||||||
card: opaque of cardinality &optional;
|
card: opaque of cardinality &optional;
|
||||||
|
|
|
@ -26,7 +26,7 @@ export {
|
||||||
}
|
}
|
||||||
|
|
||||||
redef record ResultVal += {
|
redef record ResultVal += {
|
||||||
# Internal use only. This is not meant to be publically available
|
# Internal use only. This is not meant to be publicly available
|
||||||
# and just a copy of num_samples from the Reducer. Needed for
|
# and just a copy of num_samples from the Reducer. Needed for
|
||||||
# availability in the compose hook.
|
# availability in the compose hook.
|
||||||
num_samples: count &default=0;
|
num_samples: count &default=0;
|
||||||
|
|
|
@ -28,7 +28,7 @@ redef record ResultVal += {
|
||||||
# set in the reducer.
|
# set in the reducer.
|
||||||
unique_max: count &optional;
|
unique_max: count &optional;
|
||||||
|
|
||||||
# Internal use only. This is not meant to be publically available
|
# Internal use only. This is not meant to be publicly available
|
||||||
# because we don't want to trust that we can inspect the values
|
# because we don't want to trust that we can inspect the values
|
||||||
# since we will likely move to a probabilistic data structure in the future.
|
# since we will likely move to a probabilistic data structure in the future.
|
||||||
# TODO: in the future this will optionally be a hyperloglog structure
|
# TODO: in the future this will optionally be a hyperloglog structure
|
||||||
|
|
|
@ -167,7 +167,7 @@ export {
|
||||||
global get_emails: function(a: addr): string;
|
global get_emails: function(a: addr): string;
|
||||||
}
|
}
|
||||||
|
|
||||||
# Please ignore, this is an interally used variable.
|
# Please ignore, this is an internally used variable.
|
||||||
global local_dns_suffix_regex: pattern = /MATCH_NOTHING/;
|
global local_dns_suffix_regex: pattern = /MATCH_NOTHING/;
|
||||||
global local_dns_neighbor_suffix_regex: pattern = /MATCH_NOTHING/;
|
global local_dns_neighbor_suffix_regex: pattern = /MATCH_NOTHING/;
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
##! Logs Spicy-related resource usage continously for debugging purposes.
|
##! Logs Spicy-related resource usage continuously for debugging purposes.
|
||||||
|
|
||||||
module Spicy;
|
module Spicy;
|
||||||
|
|
||||||
|
|
|
@ -1554,7 +1554,7 @@ TableValPtr DNS_Mgr::empty_addr_set()
|
||||||
|
|
||||||
// Unit testing coverage for the DNS_Mgr code, including making actual DNS requests to
|
// Unit testing coverage for the DNS_Mgr code, including making actual DNS requests to
|
||||||
// test responses and timeouts. Note that all of these tests are marked with the skip
|
// test responses and timeouts. Note that all of these tests are marked with the skip
|
||||||
// decorator, since they take some time to run and this slows down local developement. To
|
// decorator, since they take some time to run and this slows down local development. To
|
||||||
// run them manually, pass the --no-skip flag when running tests. These tests are
|
// run them manually, pass the --no-skip flag when running tests. These tests are
|
||||||
// run automatically as part of CI builds.
|
// run automatically as part of CI builds.
|
||||||
|
|
||||||
|
@ -1605,7 +1605,7 @@ public:
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Derived testing version of DNS_Mgr so that the Process() method can be exposed
|
* Derived testing version of DNS_Mgr so that the Process() method can be exposed
|
||||||
* publically. If new unit tests are added, this class should be used over using
|
* publicly. If new unit tests are added, this class should be used over using
|
||||||
* DNS_Mgr directly.
|
* DNS_Mgr directly.
|
||||||
*/
|
*/
|
||||||
class TestDNS_Mgr final : public DNS_Mgr
|
class TestDNS_Mgr final : public DNS_Mgr
|
||||||
|
|
|
@ -485,7 +485,7 @@ int dbg_shutdown_debugger()
|
||||||
// by the operation argument; the additional arguments are put in the
|
// by the operation argument; the additional arguments are put in the
|
||||||
// supplied vector.
|
// supplied vector.
|
||||||
//
|
//
|
||||||
// Parse the string into individual tokens, similarily to how shell
|
// Parse the string into individual tokens, similarly to how shell
|
||||||
// would do it.
|
// would do it.
|
||||||
|
|
||||||
void tokenize(const char* cstr, string& operation, vector<string>& arguments)
|
void tokenize(const char* cstr, string& operation, vector<string>& arguments)
|
||||||
|
|
|
@ -191,7 +191,7 @@ protected:
|
||||||
std::pair<const char*, size_t> FirstEscapeLoc(const char* bytes, size_t n);
|
std::pair<const char*, size_t> FirstEscapeLoc(const char* bytes, size_t n);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param start start of string to check for starting with an espace
|
* @param start start of string to check for starting with an escape
|
||||||
* sequence.
|
* sequence.
|
||||||
* @param end one byte past the last character in the string.
|
* @param end one byte past the last character in the string.
|
||||||
* @return The number of bytes in the escape sequence that the string
|
* @return The number of bytes in the escape sequence that the string
|
||||||
|
|
2
src/RE.h
2
src/RE.h
|
@ -167,7 +167,7 @@ public:
|
||||||
|
|
||||||
const AcceptingMatchSet& AcceptedMatches() const { return accepted_matches; }
|
const AcceptingMatchSet& AcceptedMatches() const { return accepted_matches; }
|
||||||
|
|
||||||
// Returns the number of bytes feeded into the matcher so far
|
// Returns the number of bytes fed into the matcher so far
|
||||||
int Length() { return current_pos; }
|
int Length() { return current_pos; }
|
||||||
|
|
||||||
// Returns true if this inputs leads to at least one new match.
|
// Returns true if this inputs leads to at least one new match.
|
||||||
|
|
|
@ -557,7 +557,7 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
|
||||||
|
|
||||||
int size = sizeof(tmp);
|
int size = sizeof(tmp);
|
||||||
char* buffer = tmp;
|
char* buffer = tmp;
|
||||||
char* alloced = nullptr;
|
char* allocated = nullptr;
|
||||||
|
|
||||||
std::string loc_str;
|
std::string loc_str;
|
||||||
|
|
||||||
|
@ -621,7 +621,7 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
|
||||||
|
|
||||||
// Enlarge buffer;
|
// Enlarge buffer;
|
||||||
size *= 2;
|
size *= 2;
|
||||||
buffer = alloced = (char*)realloc(alloced, size);
|
buffer = allocated = (char*)realloc(allocated, size);
|
||||||
|
|
||||||
if ( ! buffer )
|
if ( ! buffer )
|
||||||
FatalError("out of memory in Reporter");
|
FatalError("out of memory in Reporter");
|
||||||
|
@ -740,8 +740,8 @@ void Reporter::DoLog(const char* prefix, EventHandlerPtr event, FILE* out, Conne
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( alloced )
|
if ( allocated )
|
||||||
free(alloced);
|
free(allocated);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool Reporter::EmitToStderr(bool flag)
|
bool Reporter::EmitToStderr(bool flag)
|
||||||
|
|
|
@ -178,7 +178,7 @@ void ProfileLogger::Log()
|
||||||
DNS_Mgr::Stats dstats;
|
DNS_Mgr::Stats dstats;
|
||||||
dns_mgr->GetStats(&dstats);
|
dns_mgr->GetStats(&dstats);
|
||||||
|
|
||||||
file->Write(util::fmt("%.06f DNS_Mgr: requests=%lu succesful=%lu failed=%lu pending=%lu "
|
file->Write(util::fmt("%.06f DNS_Mgr: requests=%lu successful=%lu failed=%lu pending=%lu "
|
||||||
"cached_hosts=%lu cached_addrs=%lu\n",
|
"cached_hosts=%lu cached_addrs=%lu\n",
|
||||||
run_state::network_time, dstats.requests, dstats.successful,
|
run_state::network_time, dstats.requests, dstats.successful,
|
||||||
dstats.failed, dstats.pending, dstats.cached_hosts,
|
dstats.failed, dstats.pending, dstats.cached_hosts,
|
||||||
|
|
|
@ -636,7 +636,7 @@ private:
|
||||||
|
|
||||||
bool is_return = false;
|
bool is_return = false;
|
||||||
|
|
||||||
// The name of parameter passed ot the lambda.
|
// The name of parameter passed to the lambda.
|
||||||
std::string lambda_param_id;
|
std::string lambda_param_id;
|
||||||
|
|
||||||
// The expression for constructing the lambda, and its type.
|
// The expression for constructing the lambda, and its type.
|
||||||
|
|
|
@ -92,7 +92,7 @@ public:
|
||||||
|
|
||||||
void Describe(ODesc* d) const override;
|
void Describe(ODesc* d) const override;
|
||||||
|
|
||||||
// Overidden from Notifier. We queue the trigger and evaluate it
|
// Overridden from Notifier. We queue the trigger and evaluate it
|
||||||
// later to avoid race conditions.
|
// later to avoid race conditions.
|
||||||
void Modified(zeek::notifier::detail::Modifiable* m) override;
|
void Modified(zeek::notifier::detail::Modifiable* m) override;
|
||||||
|
|
||||||
|
|
|
@ -1375,7 +1375,7 @@ static std::variant<ValPtr, std::string> BuildVal(const rapidjson::Value& j, con
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return util::fmt("type '%s' unsupport", type_name(t->Tag()));
|
return util::fmt("type '%s' unsupported", type_name(t->Tag()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2425,7 +2425,7 @@ void TableVal::SendToStore(const Val* index, const TableEntryVal* new_entry_val,
|
||||||
{
|
{
|
||||||
if ( attrs->Find(detail::ATTR_EXPIRE_CREATE) )
|
if ( attrs->Find(detail::ATTR_EXPIRE_CREATE) )
|
||||||
{
|
{
|
||||||
// for create expiry, we have to substract the already elapsed time from
|
// for create expiry, we have to subtract the already elapsed time from
|
||||||
// the expiry.
|
// the expiry.
|
||||||
auto e = expire_time -
|
auto e = expire_time -
|
||||||
(run_state::network_time - new_entry_val->ExpireAccessTime());
|
(run_state::network_time - new_entry_val->ExpireAccessTime());
|
||||||
|
@ -2720,7 +2720,7 @@ void TableVal::Describe(ODesc* d) const
|
||||||
|
|
||||||
void TableVal::InitDefaultFunc(detail::Frame* f)
|
void TableVal::InitDefaultFunc(detail::Frame* f)
|
||||||
{
|
{
|
||||||
// Value aready initialized.
|
// Value already initialized.
|
||||||
if ( def_val )
|
if ( def_val )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -466,7 +466,7 @@ public:
|
||||||
Analyzer* GetChildAnalyzer(const zeek::Tag& tag) const;
|
Analyzer* GetChildAnalyzer(const zeek::Tag& tag) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively searches all (direct or indirect) childs of the
|
* Recursively searches all (direct or indirect) children of the
|
||||||
* analyzer for an analyzer with a specific ID.
|
* analyzer for an analyzer with a specific ID.
|
||||||
*
|
*
|
||||||
* @param id The analyzer id to search. This is the ID that GetID()
|
* @param id The analyzer id to search. This is the ID that GetID()
|
||||||
|
@ -477,7 +477,7 @@ public:
|
||||||
virtual Analyzer* FindChild(ID id);
|
virtual Analyzer* FindChild(ID id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively searches all (direct or indirect) childs of the
|
* Recursively searches all (direct or indirect) children of the
|
||||||
* analyzer for an analyzer of a given type.
|
* analyzer for an analyzer of a given type.
|
||||||
*
|
*
|
||||||
* @param tag The analyzer type to search.
|
* @param tag The analyzer type to search.
|
||||||
|
@ -488,7 +488,7 @@ public:
|
||||||
virtual Analyzer* FindChild(zeek::Tag tag);
|
virtual Analyzer* FindChild(zeek::Tag tag);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Recursively searches all (direct or indirect) childs of the
|
* Recursively searches all (direct or indirect) children of the
|
||||||
* analyzer for an analyzer of a given type.
|
* analyzer for an analyzer of a given type.
|
||||||
*
|
*
|
||||||
* @param name The name of the analyzer type to search (e.g.,
|
* @param name The name of the analyzer type to search (e.g.,
|
||||||
|
|
|
@ -297,7 +297,7 @@ public:
|
||||||
* @param init True if the newly added analyzers should be
|
* @param init True if the newly added analyzers should be
|
||||||
* immediately initialized.
|
* immediately initialized.
|
||||||
*
|
*
|
||||||
* @param root If given, the scheduled analyzers will become childs
|
* @param root If given, the scheduled analyzers will become children
|
||||||
* of this; if not given the connection's root analyzer is used
|
* of this; if not given the connection's root analyzer is used
|
||||||
* instead.
|
* instead.
|
||||||
*
|
*
|
||||||
|
|
|
@ -66,13 +66,13 @@
|
||||||
// (excluding CRC fields) in the current DNP3 packet.
|
// (excluding CRC fields) in the current DNP3 packet.
|
||||||
//
|
//
|
||||||
// Since "Len" is of size one byte, the largest length it can represent is
|
// Since "Len" is of size one byte, the largest length it can represent is
|
||||||
// 255 bytes. The larget DNP3 Application Layer size is "255 - 5 + size of
|
// 255 bytes. The largest DNP3 Application Layer size is "255 - 5 + size of
|
||||||
// all CRC fields". "minus 5" is coming from the 5 bytes after "Len" field in
|
// all CRC fields". "minus 5" is coming from the 5 bytes after "Len" field in
|
||||||
// the DNP3 Link Layer, i.e. Ctrl Dest_LSB Dest_MSB Src_LSB Src_MSB Hence,
|
// the DNP3 Link Layer, i.e. Ctrl Dest_LSB Dest_MSB Src_LSB Src_MSB Hence,
|
||||||
// the largest size of a DNP3 Packet (DNP3 Data Link Layer : DNP3 Transport
|
// the largest size of a DNP3 Packet (DNP3 Data Link Layer : DNP3 Transport
|
||||||
// Layer : DNP3 Application Layer) can only be 292 bytes.
|
// Layer : DNP3 Application Layer) can only be 292 bytes.
|
||||||
//
|
//
|
||||||
// The "Len" field indicates the length of of a single chunk of DNP3 Psuedo
|
// The "Len" field indicates the length of of a single chunk of DNP3 Pseudo
|
||||||
// Application Layer data instead of the whole DNP3 Application Layer
|
// Application Layer data instead of the whole DNP3 Application Layer
|
||||||
// Fragment. However, we can not know the whole length of the DNP3
|
// Fragment. However, we can not know the whole length of the DNP3
|
||||||
// Application Layer Fragment (which Binpac would normally need) until all
|
// Application Layer Fragment (which Binpac would normally need) until all
|
||||||
|
|
|
@ -775,7 +775,7 @@ type FrozenCounter16woFlag = record {
|
||||||
|
|
||||||
# g21v11 and g21v12 are obsolete
|
# g21v11 and g21v12 are obsolete
|
||||||
|
|
||||||
# Conter event g22
|
# Counter event g22
|
||||||
|
|
||||||
# g22v1
|
# g22v1
|
||||||
type CounterEve32wFlag = record {
|
type CounterEve32wFlag = record {
|
||||||
|
@ -807,7 +807,7 @@ type CounterEve16wFlagTime = record {
|
||||||
|
|
||||||
# g22v7 g22v8 obsolete
|
# g22v7 g22v8 obsolete
|
||||||
|
|
||||||
# Conter event g23
|
# Counter event g23
|
||||||
|
|
||||||
# g23v1
|
# g23v1
|
||||||
type FrozenCounterEve32wFlag = record {
|
type FrozenCounterEve32wFlag = record {
|
||||||
|
|
|
@ -72,7 +72,7 @@ enum RR_Type
|
||||||
TYPE_NSEC3 = 50,
|
TYPE_NSEC3 = 50,
|
||||||
TYPE_NSEC3PARAM = 51, ///< Contains the NSEC3 parameters (RFC 5155)
|
TYPE_NSEC3PARAM = 51, ///< Contains the NSEC3 parameters (RFC 5155)
|
||||||
TYPE_SVCB =
|
TYPE_SVCB =
|
||||||
64, ///< SerViCe Binding (RFC draft:
|
64, ///< Service Binding (RFC draft:
|
||||||
///< https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https-07#section-1.1)
|
///< https://datatracker.ietf.org/doc/html/draft-ietf-dnsop-svcb-https-07#section-1.1)
|
||||||
TYPE_HTTPS = 65, ///< HTTPS record (HTTPS specific SVCB resource record)
|
TYPE_HTTPS = 65, ///< HTTPS record (HTTPS specific SVCB resource record)
|
||||||
// Obsoleted
|
// Obsoleted
|
||||||
|
|
|
@ -1293,7 +1293,7 @@ int HTTP_Analyzer::HTTP_RequestLine(const char* line, const char* end_of_line)
|
||||||
|
|
||||||
// If we determined HTTP/0.9 (no HTTP/ in the request line), assert that
|
// If we determined HTTP/0.9 (no HTTP/ in the request line), assert that
|
||||||
// minimally we have an URI and a 3 character method (HTTP 0.9 only
|
// minimally we have an URI and a 3 character method (HTTP 0.9 only
|
||||||
// supports GET). If that doesn't hold, probably not HTTP or very stange.
|
// supports GET). If that doesn't hold, probably not HTTP or very strange.
|
||||||
if ( request_version == HTTP_VersionNumber{0, 9} )
|
if ( request_version == HTTP_VersionNumber{0, 9} )
|
||||||
{
|
{
|
||||||
bool maybe_get_method = (end_of_method - line) >= 3;
|
bool maybe_get_method = (end_of_method - line) >= 3;
|
||||||
|
|
|
@ -1079,7 +1079,7 @@ void IRC_Analyzer::DeliverStream(int length, const u_char* line, bool orig)
|
||||||
|
|
||||||
void IRC_Analyzer::StartTLS()
|
void IRC_Analyzer::StartTLS()
|
||||||
{
|
{
|
||||||
// STARTTLS was succesful. Remove support analyzers, add SSL
|
// STARTTLS was successful. Remove support analyzers, add SSL
|
||||||
// analyzer, and throw event signifying the change.
|
// analyzer, and throw event signifying the change.
|
||||||
starttls = true;
|
starttls = true;
|
||||||
|
|
||||||
|
|
|
@ -72,7 +72,7 @@ private:
|
||||||
* \brief Splits a string into its words which are separated by
|
* \brief Splits a string into its words which are separated by
|
||||||
* the split character.
|
* the split character.
|
||||||
*
|
*
|
||||||
* \param input string which will be splitted
|
* \param input string which will be split
|
||||||
* \param split character which separates the words
|
* \param split character which separates the words
|
||||||
* \return vector containing words
|
* \return vector containing words
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -48,7 +48,7 @@ type LengthEncodedStringArg(first_byte: uint8) = record {
|
||||||
public:
|
public:
|
||||||
int operator()(uint24le* num) const
|
int operator()(uint24le* num) const
|
||||||
{
|
{
|
||||||
// Convert 24bit little endian int parsed as 3 uint8 into host endianess.
|
// Convert 24bit little endian int parsed as 3 uint8 into host endianness.
|
||||||
return (num->byte1() << 16) | (num->byte2() << 8) | num->byte3();
|
return (num->byte1() << 16) | (num->byte2() << 8) | num->byte3();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -806,7 +806,7 @@ void POP3_Analyzer::ProcessReply(int length, const char* line)
|
||||||
|
|
||||||
void POP3_Analyzer::StartTLS()
|
void POP3_Analyzer::StartTLS()
|
||||||
{
|
{
|
||||||
// STARTTLS was succesful. Remove support analyzers, add SSL
|
// STARTTLS was successful. Remove support analyzers, add SSL
|
||||||
// analyzer, and throw event signifying the change.
|
// analyzer, and throw event signifying the change.
|
||||||
RemoveSupportAnalyzer(cl_orig);
|
RemoveSupportAnalyzer(cl_orig);
|
||||||
RemoveSupportAnalyzer(cl_resp);
|
RemoveSupportAnalyzer(cl_resp);
|
||||||
|
|
|
@ -9,7 +9,7 @@ event rfb_authentication_type%(c: connection, authtype: count%);
|
||||||
##
|
##
|
||||||
## c: The connection record for the underlying transport-layer session/flow.
|
## c: The connection record for the underlying transport-layer session/flow.
|
||||||
##
|
##
|
||||||
## result: whether or not authentication was succesful
|
## result: whether or not authentication was successful
|
||||||
event rfb_auth_result%(c: connection, result: bool%);
|
event rfb_auth_result%(c: connection, result: bool%);
|
||||||
|
|
||||||
## Generated for RFB event share flag messages
|
## Generated for RFB event share flag messages
|
||||||
|
|
|
@ -224,8 +224,8 @@ type PixelData(encoding: int32, x: uint16, y: uint16, w: uint16, h: uint16) = ca
|
||||||
15 -> trle: PD_TRLE;
|
15 -> trle: PD_TRLE;
|
||||||
16 -> zrle: PD_ZRLE;
|
16 -> zrle: PD_ZRLE;
|
||||||
# TODO: binpac is not happy with negative values here
|
# TODO: binpac is not happy with negative values here
|
||||||
#-239 -> cursor_pseudo: PD_PsuedoCursor;
|
#-239 -> cursor_pseudo: PD_PseudoCursor;
|
||||||
#-223 -> desktop_size: PD_PsuedoDesktopSize;
|
#-223 -> desktop_size: PD_PseudoDesktopSize;
|
||||||
};
|
};
|
||||||
|
|
||||||
type PD_Raw(w: uint16, h: uint16) = record {
|
type PD_Raw(w: uint16, h: uint16) = record {
|
||||||
|
@ -266,12 +266,12 @@ type PD_ZRLE = record {
|
||||||
zlib_data: bytestring &length=len &transient;
|
zlib_data: bytestring &length=len &transient;
|
||||||
} &length=(4 + len);
|
} &length=(4 + len);
|
||||||
|
|
||||||
type PD_PsuedoCursor(w: uint16, h: uint16) = record {
|
type PD_PseudoCursor(w: uint16, h: uint16) = record {
|
||||||
pixels: bytestring &length=(w * h * $context.connection.get_bytes_per_pixel()) &transient;
|
pixels: bytestring &length=(w * h * $context.connection.get_bytes_per_pixel()) &transient;
|
||||||
bitmask: bytestring &length=(h * ((w + 7) / 8)) &transient;
|
bitmask: bytestring &length=(h * ((w + 7) / 8)) &transient;
|
||||||
} &length=(w * h * $context.connection.get_bytes_per_pixel()) + (h * ((w + 7) / 8))
|
} &length=(w * h * $context.connection.get_bytes_per_pixel()) + (h * ((w + 7) / 8))
|
||||||
|
|
||||||
type PD_PsuedoDesktopSize = record {
|
type PD_PseudoDesktopSize = record {
|
||||||
# Actually no further data
|
# Actually no further data
|
||||||
nothing: empty;
|
nothing: empty;
|
||||||
} &length=0;
|
} &length=0;
|
||||||
|
|
|
@ -384,7 +384,7 @@ void SMTP_Analyzer::NewCmd(int cmd_code)
|
||||||
|
|
||||||
void SMTP_Analyzer::StartTLS()
|
void SMTP_Analyzer::StartTLS()
|
||||||
{
|
{
|
||||||
// STARTTLS was succesful. Remove SMTP support analyzers, add SSL
|
// STARTTLS was successful. Remove SMTP support analyzers, add SSL
|
||||||
// analyzer, and throw event signifying the change.
|
// analyzer, and throw event signifying the change.
|
||||||
state = detail::SMTP_IN_TLS;
|
state = detail::SMTP_IN_TLS;
|
||||||
expect_sender = expect_recver = true;
|
expect_sender = expect_recver = true;
|
||||||
|
|
|
@ -33,8 +33,8 @@ refine connection SSL_Conn += {
|
||||||
|
|
||||||
for ( unsigned int i = 0; i < cipher_suites.size(); ++i )
|
for ( unsigned int i = 0; i < cipher_suites.size(); ++i )
|
||||||
{
|
{
|
||||||
auto ciph = zeek::val_mgr->Count(cipher_suites[i]);
|
auto cipher = zeek::val_mgr->Count(cipher_suites[i]);
|
||||||
cipher_vec->Assign(i, ciph);
|
cipher_vec->Assign(i, std::move(cipher));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto comp_vec = zeek::make_intrusive<zeek::VectorVal>(zeek::id::index_vec);
|
auto comp_vec = zeek::make_intrusive<zeek::VectorVal>(zeek::id::index_vec);
|
||||||
|
|
|
@ -91,10 +91,10 @@ type V2ServerHello(rec: SSLRecord) = record {
|
||||||
#cert_type : uint8;
|
#cert_type : uint8;
|
||||||
server_version : uint16;
|
server_version : uint16;
|
||||||
cert_len : uint16;
|
cert_len : uint16;
|
||||||
ciph_len : uint16;
|
ciphers_len : uint16;
|
||||||
conn_id_len : uint16;
|
conn_id_len : uint16;
|
||||||
cert_data : bytestring &length = cert_len;
|
cert_data : bytestring &length = cert_len;
|
||||||
ciphers : uint24[ciph_len/3];
|
ciphers : uint24[ciphers_len/3];
|
||||||
conn_id_data : bytestring &length = conn_id_len;
|
conn_id_data : bytestring &length = conn_id_len;
|
||||||
} &let {
|
} &let {
|
||||||
session_id_hit : uint8 = rec.head3;
|
session_id_hit : uint8 = rec.head3;
|
||||||
|
|
|
@ -56,8 +56,8 @@ refine connection Handshake_Conn += {
|
||||||
|
|
||||||
for ( unsigned int i = 0; i < cipher_suites.size(); ++i )
|
for ( unsigned int i = 0; i < cipher_suites.size(); ++i )
|
||||||
{
|
{
|
||||||
auto ciph = zeek::val_mgr->Count(cipher_suites[i]);
|
auto cipher = zeek::val_mgr->Count(cipher_suites[i]);
|
||||||
cipher_vec->Assign(i, ciph);
|
cipher_vec->Assign(i, std::move(cipher));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto comp_vec = zeek::make_intrusive<zeek::VectorVal>(zeek::id::index_vec);
|
auto comp_vec = zeek::make_intrusive<zeek::VectorVal>(zeek::id::index_vec);
|
||||||
|
|
|
@ -130,9 +130,9 @@ bool File::UpdateConnectionFields(Connection* conn, bool is_orig)
|
||||||
|
|
||||||
if ( ! conns )
|
if ( ! conns )
|
||||||
{
|
{
|
||||||
auto ect = empty_connection_table();
|
auto empty_conn_table = empty_connection_table();
|
||||||
conns = ect;
|
conns = empty_conn_table;
|
||||||
val->Assign(conns_idx, std::move(ect));
|
val->Assign(conns_idx, std::move(empty_conn_table));
|
||||||
}
|
}
|
||||||
|
|
||||||
auto idx = get_conn_id_val(conn);
|
auto idx = get_conn_id_val(conn);
|
||||||
|
|
|
@ -39,7 +39,7 @@ event ocsp_request_certificate%(f: fa_file, hashAlgorithm: string, issuerNameHas
|
||||||
##
|
##
|
||||||
## f: The file.
|
## f: The file.
|
||||||
##
|
##
|
||||||
## status: The status of the OCSP response (e.g. succesful, malformedRequest, tryLater).
|
## status: The status of the OCSP response (e.g. successful, malformedRequest, tryLater).
|
||||||
##
|
##
|
||||||
## .. zeek:see:: ocsp_request ocsp_request_certificate
|
## .. zeek:see:: ocsp_request ocsp_request_certificate
|
||||||
## ocsp_response_bytes ocsp_response_certificate ocsp_extension
|
## ocsp_response_bytes ocsp_response_certificate ocsp_extension
|
||||||
|
@ -52,7 +52,7 @@ event ocsp_response_status%(f: fa_file, status: string%);
|
||||||
##
|
##
|
||||||
## f: The file.
|
## f: The file.
|
||||||
##
|
##
|
||||||
## status: The status of the OCSP response (e.g. succesful, malformedRequest, tryLater).
|
## status: The status of the OCSP response (e.g. successful, malformedRequest, tryLater).
|
||||||
##
|
##
|
||||||
## version: Version of the OCSP response (typically - for version 1).
|
## version: Version of the OCSP response (typically - for version 1).
|
||||||
##
|
##
|
||||||
|
|
|
@ -653,7 +653,7 @@ bool Manager::CreateTableStream(RecordVal* fval)
|
||||||
if ( ! CheckErrorEventTypes(stream_name, error_event, true) )
|
if ( ! CheckErrorEventTypes(stream_name, error_event, true) )
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
vector<Field*> fieldsV; // vector, because we don't know the length beforehands
|
vector<Field*> fieldsV; // vector, because we don't know the length beforehand
|
||||||
|
|
||||||
bool status = (! UnrollRecordType(&fieldsV, idx, "", false));
|
bool status = (! UnrollRecordType(&fieldsV, idx, "", false));
|
||||||
|
|
||||||
|
|
|
@ -83,7 +83,7 @@ public:
|
||||||
*
|
*
|
||||||
* @param pkt The packet to record.
|
* @param pkt The packet to record.
|
||||||
*
|
*
|
||||||
* @return True if succesful, false otherwise (in which case \a
|
* @return True if successful, false otherwise (in which case \a
|
||||||
* Error() must have been called.)
|
* Error() must have been called.)
|
||||||
*/
|
*/
|
||||||
virtual bool Dump(const Packet* pkt) = 0;
|
virtual bool Dump(const Packet* pkt) = 0;
|
||||||
|
|
|
@ -263,7 +263,7 @@ protected:
|
||||||
uint32_t netmask;
|
uint32_t netmask;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* True if the source is reading live inout, false for
|
* True if the source is reading live input, false for
|
||||||
* working offline.
|
* working offline.
|
||||||
*/
|
*/
|
||||||
bool is_live;
|
bool is_live;
|
||||||
|
|
|
@ -20,7 +20,7 @@ public:
|
||||||
PcapDumper(const std::string& path, bool append);
|
PcapDumper(const std::string& path, bool append);
|
||||||
~PcapDumper() override;
|
~PcapDumper() override;
|
||||||
|
|
||||||
static PktDumper* Instantiate(const std::string& path, bool appen);
|
static PktDumper* Instantiate(const std::string& path, bool append);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// PktDumper interface.
|
// PktDumper interface.
|
||||||
|
|
|
@ -198,7 +198,7 @@ protected:
|
||||||
bool initialized; // True if initialized.
|
bool initialized; // True if initialized.
|
||||||
bool buf; // True if buffering is enabled (default).
|
bool buf; // True if buffering is enabled (default).
|
||||||
bool local; // True if logging locally.
|
bool local; // True if logging locally.
|
||||||
bool remote; // True if loggin remotely.
|
bool remote; // True if logging remotely.
|
||||||
|
|
||||||
const char* name; // Descriptive name of the
|
const char* name; // Descriptive name of the
|
||||||
WriterBackend::WriterInfo* info; // The writer information.
|
WriterBackend::WriterInfo* info; // The writer information.
|
||||||
|
|
|
@ -41,7 +41,7 @@ bool IEEE802_11Analyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet*
|
||||||
if ( (fc_80211 >> 4) & 0x08 )
|
if ( (fc_80211 >> 4) & 0x08 )
|
||||||
{
|
{
|
||||||
// Store off whether this is an A-MSDU header, which indicates that there are
|
// Store off whether this is an A-MSDU header, which indicates that there are
|
||||||
// mulitple packets following the 802.11 header.
|
// multiple packets following the 802.11 header.
|
||||||
is_amsdu = (data[len_80211] & 0x80) == 0x80;
|
is_amsdu = (data[len_80211] & 0x80) == 0x80;
|
||||||
|
|
||||||
// Check for the protected bit. This means the data is encrypted and we can't
|
// Check for the protected bit. This means the data is encrypted and we can't
|
||||||
|
|
|
@ -87,7 +87,7 @@ bool IPAnalyzer::AnalyzePacket(size_t len, const uint8_t* data, Packet* packet)
|
||||||
total_len = packet->cap_len - hdr_size;
|
total_len = packet->cap_len - hdr_size;
|
||||||
else
|
else
|
||||||
// If this is caused by segmentation offloading, the checksum will
|
// If this is caused by segmentation offloading, the checksum will
|
||||||
// also be incorrect. If checksum validation is enabled - jus tbail here.
|
// also be incorrect. If checksum validation is enabled - just bail here.
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1356,7 +1356,7 @@ void TCPSessionAdapter::ConnectionClosed(analyzer::tcp::TCP_Endpoint* endpoint,
|
||||||
const analyzer::analyzer_list& children(GetChildren());
|
const analyzer::analyzer_list& children(GetChildren());
|
||||||
LOOP_OVER_CONST_CHILDREN(i)
|
LOOP_OVER_CONST_CHILDREN(i)
|
||||||
// Using this type of cast here is nasty (will crash if
|
// Using this type of cast here is nasty (will crash if
|
||||||
// we inadvertantly have a child analyzer that's not a
|
// we inadvertently have a child analyzer that's not a
|
||||||
// TCP_ApplicationAnalyzer), but we have to ...
|
// TCP_ApplicationAnalyzer), but we have to ...
|
||||||
static_cast<analyzer::tcp::TCP_ApplicationAnalyzer*>(*i)->ConnectionClosed(endpoint, peer,
|
static_cast<analyzer::tcp::TCP_ApplicationAnalyzer*>(*i)->ConnectionClosed(endpoint, peer,
|
||||||
gen_event);
|
gen_event);
|
||||||
|
|
|
@ -136,7 +136,7 @@ private:
|
||||||
* Define x = 2*(log(1.04*k/error)/log(2)). Then b is the ceiling of x.
|
* Define x = 2*(log(1.04*k/error)/log(2)). Then b is the ceiling of x.
|
||||||
*
|
*
|
||||||
* After that initial estimate, the value of b is increased until the
|
* After that initial estimate, the value of b is increased until the
|
||||||
* standard deviation falls within the specified valud.
|
* standard deviation falls within the specified value.
|
||||||
*
|
*
|
||||||
* @param error error margin
|
* @param error error margin
|
||||||
*
|
*
|
||||||
|
|
|
@ -146,7 +146,7 @@ void CPPCompile::DeclareSubclass(const FuncTypePtr& ft, const ProfileFunc* pf, c
|
||||||
Emit("%s_cl(const char* name%s) : CPPStmt(name, %s)%s { }", fname, addl_args, loc_info, inits);
|
Emit("%s_cl(const char* name%s) : CPPStmt(name, %s)%s { }", fname, addl_args, loc_info, inits);
|
||||||
|
|
||||||
// An additional constructor just used to generate place-holder
|
// An additional constructor just used to generate place-holder
|
||||||
// instances, due to the mis-design that lambdas are identified
|
// instances, due to the misdesign that lambdas are identified
|
||||||
// by their Func objects rather than their FuncVal objects.
|
// by their Func objects rather than their FuncVal objects.
|
||||||
if ( lambda_ids && lambda_ids->length() > 0 )
|
if ( lambda_ids && lambda_ids->length() > 0 )
|
||||||
Emit("%s_cl(const char* name) : CPPStmt(name, %s) { }", fname, loc_info);
|
Emit("%s_cl(const char* name) : CPPStmt(name, %s) { }", fname, loc_info);
|
||||||
|
|
|
@ -414,7 +414,7 @@ ExprPtr Expr::AssignToTemporary(ExprPtr e, Reducer* c, StmtPtr& red_stmt)
|
||||||
|
|
||||||
// Important: our result is not result_tmp, but a duplicate of it.
|
// Important: our result is not result_tmp, but a duplicate of it.
|
||||||
// This is important because subsequent passes that associate
|
// This is important because subsequent passes that associate
|
||||||
// information with Expr's need to not mis-associate that
|
// information with Expr's need to not misassociate that
|
||||||
// information with both the assignment creating the temporary,
|
// information with both the assignment creating the temporary,
|
||||||
// and the subsequent use of the temporary.
|
// and the subsequent use of the temporary.
|
||||||
return result_tmp->Duplicate();
|
return result_tmp->Duplicate();
|
||||||
|
|
|
@ -59,10 +59,10 @@ public:
|
||||||
// (= more inner) block level.
|
// (= more inner) block level.
|
||||||
int BlockLevel() const { return block_level; }
|
int BlockLevel() const { return block_level; }
|
||||||
|
|
||||||
// True if in the region the identifer could be defined.
|
// True if in the region the identifier could be defined.
|
||||||
bool MaybeDefined() const { return maybe_defined; }
|
bool MaybeDefined() const { return maybe_defined; }
|
||||||
|
|
||||||
// Returns (or sets) the statement after which the identifer is
|
// Returns (or sets) the statement after which the identifier is
|
||||||
// (definitely) defined, or NO_DEF if it doesn't have a definite
|
// (definitely) defined, or NO_DEF if it doesn't have a definite
|
||||||
// point of definition.
|
// point of definition.
|
||||||
int DefinedAfter() const { return defined; }
|
int DefinedAfter() const { return defined; }
|
||||||
|
@ -198,7 +198,7 @@ public:
|
||||||
// the block.
|
// the block.
|
||||||
void ConfluenceBlockEndsAfter(const Stmt* s, bool no_orig_flow);
|
void ConfluenceBlockEndsAfter(const Stmt* s, bool no_orig_flow);
|
||||||
|
|
||||||
// All of these regard the identifer's state just *prior* to
|
// All of these regard the identifier's state just *prior* to
|
||||||
// executing the given statement.
|
// executing the given statement.
|
||||||
bool IsPossiblyDefinedBefore(const Stmt* s);
|
bool IsPossiblyDefinedBefore(const Stmt* s);
|
||||||
bool IsDefinedBefore(const Stmt* s);
|
bool IsDefinedBefore(const Stmt* s);
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
// Classes for traversing functions and their body ASTs to build up profiles
|
// Classes for traversing functions and their body ASTs to build up profiles
|
||||||
// of the various elements (types, globals, locals, lambdas, etc.) that appear.
|
// of the various elements (types, globals, locals, lambdas, etc.) that appear.
|
||||||
// These profiles enable script optimization to make decisions regarding
|
// These profiles enable script optimization to make decisions regarding
|
||||||
// compilability and how to efficiently provide run-time components.
|
// compatibility and how to efficiently provide run-time components.
|
||||||
// For all of the following, we use the term "function" to refer to a single
|
// For all of the following, we use the term "function" to refer to a single
|
||||||
// ScriptFunc/body pair, so an event handler or hook with multiple bodies
|
// ScriptFunc/body pair, so an event handler or hook with multiple bodies
|
||||||
// is treated as multiple distinct "function"'s.
|
// is treated as multiple distinct "function"'s.
|
||||||
|
|
|
@ -43,7 +43,7 @@ struct AnalyOpt
|
||||||
// Whether to analyze scripts.
|
// Whether to analyze scripts.
|
||||||
bool activate = false;
|
bool activate = false;
|
||||||
|
|
||||||
// If true, compile all compileable functions, even those that
|
// If true, compile all compilable functions, even those that
|
||||||
// are inlined. Mainly useful for ensuring compatibility for
|
// are inlined. Mainly useful for ensuring compatibility for
|
||||||
// some tests in the test suite.
|
// some tests in the test suite.
|
||||||
bool compile_all = false;
|
bool compile_all = false;
|
||||||
|
|
|
@ -438,7 +438,7 @@ macro EvalCast(rhs)
|
||||||
else
|
else
|
||||||
ZAM_run_time_error(z.loc, error.c_str());
|
ZAM_run_time_error(z.loc, error.c_str());
|
||||||
|
|
||||||
# Cast an "any" type to the given type. Only needed for type-based swith
|
# Cast an "any" type to the given type. Only needed for type-based switch
|
||||||
# statements.
|
# statements.
|
||||||
internal-op Cast-Any
|
internal-op Cast-Any
|
||||||
type VV
|
type VV
|
||||||
|
|
|
@ -201,7 +201,7 @@ void Manager::registerPacketAnalyzer(const std::string& name, const std::string&
|
||||||
::zeek::detail::zeekygen_mgr->Script(info.name_zeekygen);
|
::zeek::detail::zeekygen_mgr->Script(info.name_zeekygen);
|
||||||
::zeek::detail::set_location(makeLocation(info.name_zeekygen));
|
::zeek::detail::set_location(makeLocation(info.name_zeekygen));
|
||||||
|
|
||||||
// TODO: Should Zeek do this? It has run component intialization at
|
// TODO: Should Zeek do this? It has run component initialization at
|
||||||
// this point already, so ours won't get initialized anymore.
|
// this point already, so ours won't get initialized anymore.
|
||||||
c->Initialize();
|
c->Initialize();
|
||||||
|
|
||||||
|
|
|
@ -30,7 +30,7 @@ static struct option long_driver_options[] = {{"abort-on-exceptions", required_a
|
||||||
{"output-c++-files", no_argument, nullptr, 'x'},
|
{"output-c++-files", no_argument, nullptr, 'x'},
|
||||||
{"print-module-path", no_argument, nullptr, 'M'},
|
{"print-module-path", no_argument, nullptr, 'M'},
|
||||||
{"print-plugin-path", no_argument, nullptr,
|
{"print-plugin-path", no_argument, nullptr,
|
||||||
'P'}, // for backwards compatiblity
|
'P'}, // for backwards compatibility
|
||||||
{"print-prefix-path", no_argument, nullptr, 'p'},
|
{"print-prefix-path", no_argument, nullptr, 'p'},
|
||||||
{"print-zeek-config", no_argument, nullptr, 'z'},
|
{"print-zeek-config", no_argument, nullptr, 'z'},
|
||||||
{"report-times", required_argument, nullptr, 'R'},
|
{"report-times", required_argument, nullptr, 'R'},
|
||||||
|
|
|
@ -409,7 +409,7 @@ function split_string%(str: string, re: pattern%): string_vec
|
||||||
## re: The pattern describing the separator to split *str* in two pieces.
|
## re: The pattern describing the separator to split *str* in two pieces.
|
||||||
##
|
##
|
||||||
## Returns: An array of strings with two elements in which the first represents
|
## Returns: An array of strings with two elements in which the first represents
|
||||||
## the substring in *str* up to the first occurence of *re*, and the
|
## the substring in *str* up to the first occurrence of *re*, and the
|
||||||
## second everything after *re*. An array of one string is returned
|
## second everything after *re*. An array of one string is returned
|
||||||
## when *s* cannot be split.
|
## when *s* cannot be split.
|
||||||
##
|
##
|
||||||
|
@ -474,7 +474,7 @@ function split_string_n%(str: string, re: pattern,
|
||||||
##
|
##
|
||||||
## repl: The string that replaces *re*.
|
## repl: The string that replaces *re*.
|
||||||
##
|
##
|
||||||
## Returns: A copy of *str* with the first occurence of *re* replaced with
|
## Returns: A copy of *str* with the first occurrence of *re* replaced with
|
||||||
## *repl*.
|
## *repl*.
|
||||||
##
|
##
|
||||||
## .. zeek:see:: gsub subst_string
|
## .. zeek:see:: gsub subst_string
|
||||||
|
|
|
@ -159,7 +159,7 @@ public:
|
||||||
// "scripts" field. It can go when we remove that deprecation.
|
// "scripts" field. It can go when we remove that deprecation.
|
||||||
NodeConfig() = default;
|
NodeConfig() = default;
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
// MSVC throws this error when specifing this constructor:
|
// MSVC throws this error when specifying this constructor:
|
||||||
// error C2580: multiple versions of a defaulted special member functions are not allowed
|
// error C2580: multiple versions of a defaulted special member functions are not allowed
|
||||||
NodeConfig(NodeConfig&) = default;
|
NodeConfig(NodeConfig&) = default;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -232,7 +232,7 @@ protected:
|
||||||
*
|
*
|
||||||
* This is method is called regularly by the threading::Manager.
|
* This is method is called regularly by the threading::Manager.
|
||||||
*
|
*
|
||||||
* @return The message, wth ownership passed to caller. Returns null
|
* @return The message, with ownership passed to caller. Returns null
|
||||||
* if the queue is empty.
|
* if the queue is empty.
|
||||||
*/
|
*/
|
||||||
BasicOutputMessage* RetrieveOut();
|
BasicOutputMessage* RetrieveOut();
|
||||||
|
@ -298,7 +298,7 @@ private:
|
||||||
*
|
*
|
||||||
* Must only be called by the child thread.
|
* Must only be called by the child thread.
|
||||||
*
|
*
|
||||||
* @return The message, wth ownership passed to caller. Returns null
|
* @return The message, with ownership passed to caller. Returns null
|
||||||
* if the queue is empty.
|
* if the queue is empty.
|
||||||
*/
|
*/
|
||||||
BasicInputMessage* RetrieveIn();
|
BasicInputMessage* RetrieveIn();
|
||||||
|
|
|
@ -138,7 +138,7 @@ struct Value
|
||||||
|
|
||||||
// A small note for handling subnet values: Subnet values emitted from
|
// A small note for handling subnet values: Subnet values emitted from
|
||||||
// the logging framework will always have a length that is based on the
|
// the logging framework will always have a length that is based on the
|
||||||
// internal IPv6 representation (so you have to substract 96 from it to
|
// internal IPv6 representation (so you have to subtract 96 from it to
|
||||||
// get the correct value for IPv4).
|
// get the correct value for IPv4).
|
||||||
// However, the Input framework expects the "normal" length for an IPv4
|
// However, the Input framework expects the "normal" length for an IPv4
|
||||||
// address (so do not add 96 to it), because the underlying constructors
|
// address (so do not add 96 to it), because the underlying constructors
|
||||||
|
|
|
@ -363,7 +363,7 @@ extern const char* strpbrk_n(size_t len, const char* s, const char* charset);
|
||||||
int strstr_n(const int big_len, const unsigned char* big, const int little_len,
|
int strstr_n(const int big_len, const unsigned char* big, const int little_len,
|
||||||
const unsigned char* little);
|
const unsigned char* little);
|
||||||
|
|
||||||
// Replaces all occurences of *o* in *s* with *n*.
|
// Replaces all occurrences of *o* in *s* with *n*.
|
||||||
extern std::string strreplace(const std::string& s, const std::string& o, const std::string& n);
|
extern std::string strreplace(const std::string& s, const std::string& o, const std::string& n);
|
||||||
|
|
||||||
// Remove all leading and trailing white space from string.
|
// Remove all leading and trailing white space from string.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue