mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 22:58:20 +00:00
Add input interface to forward data for file analysis.
The new Input::add_analysis function is used to automatically forward input data on to the file analysis framework.
This commit is contained in:
parent
90fa331279
commit
0ef074594d
9 changed files with 219 additions and 45 deletions
|
@ -85,14 +85,10 @@ File::File(const string& file_id, Connection* conn, AnalyzerTag::Tag tag,
|
|||
if ( conn )
|
||||
{
|
||||
// add source, connection, is_orig fields
|
||||
val->Assign(source_idx, new StringVal(::Analyzer::GetTagName(tag)));
|
||||
SetSource(::Analyzer::GetTagName(tag));
|
||||
val->Assign(is_orig_idx, new Val(is_orig, TYPE_BOOL));
|
||||
UpdateConnectionFields(conn);
|
||||
}
|
||||
else
|
||||
{
|
||||
// TODO: what to use as source field? (input framework interface)
|
||||
}
|
||||
|
||||
UpdateLastActivityTime();
|
||||
}
|
||||
|
@ -172,6 +168,18 @@ int File::Idx(const string& field)
|
|||
return rval;
|
||||
}
|
||||
|
||||
string File::GetSource() const
|
||||
{
|
||||
Val* v = val->Lookup(source_idx);
|
||||
|
||||
return v ? v->AsString()->CheckString() : string();
|
||||
}
|
||||
|
||||
void File::SetSource(const string& source)
|
||||
{
|
||||
val->Assign(source_idx, new StringVal(source.c_str()));
|
||||
}
|
||||
|
||||
double File::GetTimeoutInterval() const
|
||||
{
|
||||
return LookupFieldDefaultInterval(timeout_interval_idx);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue