Update deprecated ValManager::GetBool usages

This commit is contained in:
Jon Siwek 2020-04-07 21:32:55 -07:00
parent 9af84bb2b0
commit d9edd855da
68 changed files with 370 additions and 370 deletions

View file

@ -97,7 +97,7 @@ File::File(const std::string& file_id, const std::string& source_name, Connectio
if ( conn )
{
val->Assign(is_orig_idx, val_mgr->GetBool(is_orig));
val->Assign(is_orig_idx, val_mgr->Bool(is_orig));
UpdateConnectionFields(conn, is_orig);
}
@ -157,7 +157,7 @@ void File::RaiseFileOverNewConnection(Connection* conn, bool is_orig)
FileEvent(file_over_new_connection, {
IntrusivePtr{NewRef{}, val},
IntrusivePtr{AdoptRef{}, conn->BuildConnVal()},
IntrusivePtr{AdoptRef{}, val_mgr->GetBool(is_orig)},
val_mgr->Bool(is_orig),
});
}
}

View file

@ -437,7 +437,7 @@ string Manager::GetFileID(const analyzer::Tag& tag, Connection* c, bool is_orig)
mgr.Enqueue(get_file_handle,
IntrusivePtr{NewRef{}, tagval},
IntrusivePtr{AdoptRef{}, c->BuildConnVal()},
IntrusivePtr{AdoptRef{}, val_mgr->GetBool(is_orig)}
val_mgr->Bool(is_orig)
);
mgr.Drain(); // need file handle immediately so we don't have to buffer data
return current_file_id;

View file

@ -13,7 +13,7 @@ function FileExtract::__set_limit%(file_id: string, args: any, n: count%): bool
using BifType::Record::Files::AnalyzerArgs;
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
bool result = file_mgr->SetExtractionLimit(file_id->CheckString(), rv.get(), n);
return val_mgr->GetBool(result);
return val_mgr->Bool(result);
%}
module GLOBAL;

View file

@ -290,7 +290,7 @@ void file_analysis::X509::ParseBasicConstraints(X509_EXTENSION* ex)
if ( x509_ext_basic_constraints )
{
auto pBasicConstraint = make_intrusive<RecordVal>(BifType::Record::X509::BasicConstraints);
pBasicConstraint->Assign(0, val_mgr->GetBool(constr->ca));
pBasicConstraint->Assign(0, val_mgr->Bool(constr->ca));
if ( constr->pathlen )
pBasicConstraint->Assign(1, val_mgr->GetCount((int32_t) ASN1_INTEGER_get(constr->pathlen)));
@ -434,7 +434,7 @@ void file_analysis::X509::ParseSAN(X509_EXTENSION* ext)
if ( ips != nullptr )
sanExt->Assign(3, ips);
sanExt->Assign(4, val_mgr->GetBool(otherfields));
sanExt->Assign(4, val_mgr->Bool(otherfields));
mgr.Enqueue(x509_ext_subject_alternative_name,
IntrusivePtr{NewRef{}, GetFile()->GetVal()},

View file

@ -276,7 +276,7 @@ void file_analysis::X509Common::ParseExtension(X509_EXTENSION* ex, const EventHa
pX509Ext->Assign(1, make_intrusive<StringVal>(short_name));
pX509Ext->Assign(2, make_intrusive<StringVal>(oid));
pX509Ext->Assign(3, val_mgr->GetBool(critical));
pX509Ext->Assign(3, val_mgr->Bool(critical));
pX509Ext->Assign(4, ext_val);
// send off generic extension event
@ -289,7 +289,7 @@ void file_analysis::X509Common::ParseExtension(X509_EXTENSION* ex, const EventHa
if ( h == ocsp_extension )
mgr.Enqueue(h, IntrusivePtr{NewRef{}, GetFile()->GetVal()},
std::move(pX509Ext),
IntrusivePtr{AdoptRef{}, val_mgr->GetBool(global)});
val_mgr->Bool(global));
else
mgr.Enqueue(h, IntrusivePtr{NewRef{}, GetFile()->GetVal()},
std::move(pX509Ext));

View file

@ -742,7 +742,7 @@ function sct_verify%(cert: opaque of x509, logid: string, log_key: string, signa
EVP_MD_CTX_destroy(mdctx);
EVP_PKEY_free(key);
return val_mgr->GetBool(success);
return val_mgr->Bool(success);
sct_verify_err:
if (mdctx)

View file

@ -14,28 +14,28 @@ type AnalyzerArgs: record;
function Files::__set_timeout_interval%(file_id: string, t: interval%): bool
%{
bool result = file_mgr->SetTimeoutInterval(file_id->CheckString(), t);
return val_mgr->GetBool(result);
return val_mgr->Bool(result);
%}
## :zeek:see:`Files::enable_reassembly`.
function Files::__enable_reassembly%(file_id: string%): bool
%{
bool result = file_mgr->EnableReassembly(file_id->CheckString());
return val_mgr->GetBool(result);
return val_mgr->Bool(result);
%}
## :zeek:see:`Files::disable_reassembly`.
function Files::__disable_reassembly%(file_id: string%): bool
%{
bool result = file_mgr->DisableReassembly(file_id->CheckString());
return val_mgr->GetBool(result);
return val_mgr->Bool(result);
%}
## :zeek:see:`Files::set_reassembly_buffer_size`.
function Files::__set_reassembly_buffer%(file_id: string, max: count%): bool
%{
bool result = file_mgr->SetReassemblyBuffer(file_id->CheckString(), max);
return val_mgr->GetBool(result);
return val_mgr->Bool(result);
%}
## :zeek:see:`Files::add_analyzer`.
@ -45,7 +45,7 @@ function Files::__add_analyzer%(file_id: string, tag: Files::Tag, args: any%): b
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
bool result = file_mgr->AddAnalyzer(file_id->CheckString(),
file_mgr->GetComponentTag(tag), rv.get());
return val_mgr->GetBool(result);
return val_mgr->Bool(result);
%}
## :zeek:see:`Files::remove_analyzer`.
@ -55,14 +55,14 @@ function Files::__remove_analyzer%(file_id: string, tag: Files::Tag, args: any%)
auto rv = args->AsRecordVal()->CoerceTo(AnalyzerArgs);
bool result = file_mgr->RemoveAnalyzer(file_id->CheckString(),
file_mgr->GetComponentTag(tag) , rv.get());
return val_mgr->GetBool(result);
return val_mgr->Bool(result);
%}
## :zeek:see:`Files::stop`.
function Files::__stop%(file_id: string%): bool
%{
bool result = file_mgr->IgnoreFile(file_id->CheckString());
return val_mgr->GetBool(result);
return val_mgr->Bool(result);
%}
## :zeek:see:`Files::analyzer_name`.