mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
Move Type types to zeek namespace
This commit is contained in:
parent
4a1b39a2be
commit
ed13972924
120 changed files with 2094 additions and 1934 deletions
|
@ -20,7 +20,7 @@ static void analyzer_del_func(void* v)
|
|||
|
||||
AnalyzerSet::AnalyzerSet(File* arg_file) : file(arg_file)
|
||||
{
|
||||
auto t = make_intrusive<TypeList>();
|
||||
auto t = make_intrusive<zeek::TypeList>();
|
||||
t->Append(file_mgr->GetTagType());
|
||||
t->Append(zeek::BifType::Record::Files::AnalyzerArgs);
|
||||
analyzer_hash = new CompositeHash(std::move(t));
|
||||
|
@ -156,7 +156,7 @@ bool AnalyzerSet::RemoveMod::Perform(AnalyzerSet* set)
|
|||
std::unique_ptr<HashKey> AnalyzerSet::GetKey(const file_analysis::Tag& t,
|
||||
IntrusivePtr<RecordVal> args) const
|
||||
{
|
||||
auto lv = make_intrusive<ListVal>(TYPE_ANY);
|
||||
auto lv = make_intrusive<ListVal>(zeek::TYPE_ANY);
|
||||
lv->Append(t.AsVal());
|
||||
lv->Append(std::move(args));
|
||||
auto key = analyzer_hash->MakeHashKey(*lv, true);
|
||||
|
|
|
@ -23,10 +23,10 @@ using namespace file_analysis;
|
|||
|
||||
static IntrusivePtr<TableVal> empty_connection_table()
|
||||
{
|
||||
auto tbl_index = make_intrusive<TypeList>(zeek::id::conn_id);
|
||||
auto tbl_index = make_intrusive<zeek::TypeList>(zeek::id::conn_id);
|
||||
tbl_index->Append(zeek::id::conn_id);
|
||||
auto tbl_type = make_intrusive<TableType>(std::move(tbl_index),
|
||||
zeek::id::connection);
|
||||
auto tbl_type = make_intrusive<zeek::TableType>(std::move(tbl_index),
|
||||
zeek::id::connection);
|
||||
return make_intrusive<TableVal>(std::move(tbl_type));
|
||||
}
|
||||
|
||||
|
@ -170,7 +170,7 @@ double File::LookupFieldDefaultInterval(int idx) const
|
|||
return v->AsInterval();
|
||||
}
|
||||
|
||||
int File::Idx(const std::string& field, const RecordType* type)
|
||||
int File::Idx(const std::string& field, const zeek::RecordType* type)
|
||||
{
|
||||
int rval = type->FieldOffset(field.c_str());
|
||||
|
||||
|
|
|
@ -14,10 +14,11 @@
|
|||
#include "WeirdState.h"
|
||||
|
||||
class Connection;
|
||||
class RecordType;
|
||||
class RecordVal;
|
||||
class EventHandlerPtr;
|
||||
|
||||
FORWARD_DECLARE_NAMESPACED(RecordType, zeek);
|
||||
|
||||
namespace file_analysis {
|
||||
|
||||
class FileReassembler;
|
||||
|
@ -336,8 +337,8 @@ protected:
|
|||
* @param type the record type for which the field will be looked up.
|
||||
* @return the field offset in #val record corresponding to \a field_name.
|
||||
*/
|
||||
static int Idx(const std::string& field_name, const RecordType* type);
|
||||
static int Idx(const std::string& field_name, const IntrusivePtr<RecordType>& type)
|
||||
static int Idx(const std::string& field_name, const zeek::RecordType* type);
|
||||
static int Idx(const std::string& field_name, const IntrusivePtr<zeek::RecordType>& type)
|
||||
{ return Idx(field_name, type.get()); }
|
||||
|
||||
/**
|
||||
|
|
|
@ -519,8 +519,8 @@ string Manager::DetectMIME(const u_char* data, uint64_t len) const
|
|||
|
||||
IntrusivePtr<VectorVal> file_analysis::GenMIMEMatchesVal(const RuleMatcher::MIME_Matches& m)
|
||||
{
|
||||
static auto mime_matches = zeek::id::find_type<VectorType>("mime_matches");
|
||||
static auto mime_match = zeek::id::find_type<RecordType>("mime_match");
|
||||
static auto mime_matches = zeek::id::find_type<zeek::VectorType>("mime_matches");
|
||||
static auto mime_match = zeek::id::find_type<zeek::RecordType>("mime_match");
|
||||
auto rval = make_intrusive<VectorVal>(mime_matches);
|
||||
|
||||
for ( RuleMatcher::MIME_Matches::const_iterator it = m.begin();
|
||||
|
|
|
@ -428,7 +428,7 @@ private:
|
|||
MIMEMap mime_types;/**< Mapping of MIME types to analyzers. */
|
||||
|
||||
inline static TableVal* disabled = nullptr; /**< Table of disabled analyzers. */
|
||||
inline static TableType* tag_set_type = nullptr; /**< Type for set[tag]. */
|
||||
inline static zeek::TableType* tag_set_type = nullptr; /**< Type for set[tag]. */
|
||||
|
||||
size_t cumulative_files;
|
||||
size_t max_files;
|
||||
|
|
|
@ -62,7 +62,7 @@ void Entropy::Finalize()
|
|||
montepi = scc = ent = mean = chisq = 0.0;
|
||||
entropy->Get(&ent, &chisq, &mean, &montepi, &scc);
|
||||
|
||||
static auto entropy_test_result = zeek::id::find_type<RecordType>("entropy_test_result");
|
||||
static auto entropy_test_result = zeek::id::find_type<zeek::RecordType>("entropy_test_result");
|
||||
auto ent_result = make_intrusive<RecordVal>(entropy_test_result);
|
||||
ent_result->Assign<DoubleVal>(0, ent);
|
||||
ent_result->Assign<DoubleVal>(1, chisq);
|
||||
|
|
|
@ -620,7 +620,7 @@ void file_analysis::OCSP::ParseResponse(OCSP_RESPONSE *resp)
|
|||
//ocsp_resp_record->Assign(7, make_intrusive<StringVal>(len, buf));
|
||||
//BIO_reset(bio);
|
||||
|
||||
certs_vector = new VectorVal(zeek::id::find_type<VectorType>("x509_opaque_vector"));
|
||||
certs_vector = new VectorVal(zeek::id::find_type<zeek::VectorType>("x509_opaque_vector"));
|
||||
vl.emplace_back(AdoptRef{}, certs_vector);
|
||||
|
||||
#if ( OPENSSL_VERSION_NUMBER < 0x10100000L ) || defined(LIBRESSL_VERSION_NUMBER)
|
||||
|
@ -675,4 +675,3 @@ void file_analysis::OCSP::ParseExtensionsSpecific(X509_EXTENSION* ex, bool globa
|
|||
#endif
|
||||
ParseSignedCertificateTimestamps(ex);
|
||||
}
|
||||
|
||||
|
|
|
@ -393,7 +393,7 @@ void file_analysis::X509::ParseSAN(X509_EXTENSION* ext)
|
|||
else if ( gen->type == GEN_IPADD )
|
||||
{
|
||||
if ( ips == nullptr )
|
||||
ips = make_intrusive<VectorVal>(zeek::id::find_type<VectorType>("addr_vec"));
|
||||
ips = make_intrusive<VectorVal>(zeek::id::find_type<zeek::VectorType>("addr_vec"));
|
||||
|
||||
uint32_t* addr = (uint32_t*) gen->d.ip->data;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue