mirror of
https://github.com/zeek/zeek.git
synced 2025-10-05 08:08:19 +00:00
FileAnalysis: add bif for setting timeout interval
This commit is contained in:
parent
e2fbee9054
commit
2fba37e277
7 changed files with 55 additions and 2 deletions
|
@ -189,6 +189,11 @@ double File::GetTimeoutInterval() const
|
|||
return LookupFieldDefaultInterval(timeout_interval_idx);
|
||||
}
|
||||
|
||||
void File::SetTimeoutInterval(double interval)
|
||||
{
|
||||
val->Assign(timeout_interval_idx, new Val(interval, TYPE_INTERVAL));
|
||||
}
|
||||
|
||||
void File::IncrementByteCount(uint64 size, int field_idx)
|
||||
{
|
||||
uint64 old = LookupFieldDefaultCount(field_idx);
|
||||
|
|
|
@ -34,6 +34,11 @@ public:
|
|||
*/
|
||||
double GetTimeoutInterval() const;
|
||||
|
||||
/**
|
||||
* Set the "timeout_interval" field from #val record to \a interval seconds.
|
||||
*/
|
||||
void SetTimeoutInterval(double interval);
|
||||
|
||||
/**
|
||||
* @return value of the "id" field from #val record.
|
||||
*/
|
||||
|
|
|
@ -157,6 +157,16 @@ bool Manager::PostponeTimeout(const FileID& file_id) const
|
|||
return true;
|
||||
}
|
||||
|
||||
bool Manager::SetTimeoutInterval(const FileID& file_id, double interval) const
|
||||
{
|
||||
File* file = Lookup(file_id);
|
||||
|
||||
if ( ! file ) return false;
|
||||
|
||||
file->SetTimeoutInterval(interval);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool Manager::AddAction(const FileID& file_id, RecordVal* args) const
|
||||
{
|
||||
File* file = Lookup(file_id);
|
||||
|
|
|
@ -96,6 +96,11 @@ public:
|
|||
*/
|
||||
bool PostponeTimeout(const FileID& file_id) const;
|
||||
|
||||
/**
|
||||
* Set's an inactivity threshold for the file.
|
||||
*/
|
||||
bool SetTimeoutInterval(const FileID& file_id, double interval) const;
|
||||
|
||||
/**
|
||||
* Queue attachment of an action to the file identifier. Multiple actions
|
||||
* of a given type can be attached per file identifier at a time as long as
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue