hashKey.padding[0] = hashKey.padding[1] = hashKey.padding[2] = 0;
FileContext* file = find(hashKey, timeout);
if (to_create and !file)
- {
file = add(hashKey, timeout);
- if (file)
- file->set_processing_flow(flow);
- }
return file;
}
bool resume, FilePolicyBase* policy)
{
Flow* flow = p->flow;
- Flow* processing_flow = file_ctx->get_processing_flow();
Active* act = p->active;
struct timeval now = {0, 0};
struct timeval add_time;
return false;
case FILE_VERDICT_LOG:
if (resume)
- policy->log_file_action(processing_flow, file_ctx, FILE_RESUME_LOG);
+ policy->log_file_action(flow, file_ctx, FILE_RESUME_LOG);
return false;
case FILE_VERDICT_BLOCK:
// can't block session inside a session
}
if (resume)
- policy->log_file_action(processing_flow, file_ctx, FILE_RESUME_BLOCK);
+ policy->log_file_action(flow, file_ctx, FILE_RESUME_BLOCK);
else
file_ctx->verdict = FILE_VERDICT_LOG;
"apply_verdict:FILE_VERDICT_PENDING with action retry\n");
if (resume)
- policy->log_file_action(processing_flow, file_ctx, FILE_RESUME_BLOCK);
+ policy->log_file_action(flow, file_ctx, FILE_RESUME_BLOCK);
else if (store_verdict(flow, file_ctx, lookup_timeout) != 0)
{
FILE_DEBUG(file_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL, p,
FILE_DEBUG(file_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL, p,
"apply_verdict:Resume block file\n");
file_ctx->log_file_event(flow, policy);
- policy->log_file_action(processing_flow, file_ctx, FILE_RESUME_BLOCK);
+ policy->log_file_action(flow, file_ctx, FILE_RESUME_BLOCK);
}
else if (file_ctx->is_cacheable())
{
if (file_found)
{
- // file_found might be a new context, set the flow here
- file_found->set_processing_flow(flow);
- //Query the file policy in case verdict has been changed
+ /*Query the file policy in case verdict has been changed*/
verdict = check_verdict(p, file_found, policy);
FILE_DEBUG(file_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL, p,
"cached_verdict_lookup:Verdict received from cached_verdict_lookup %d\n", verdict);
}
context = new FileContext;
- context->set_processing_flow(flow);
main_context = context;
context->check_policy(flow, dir, file_policy);
else
{
context = new FileContext;
- context->set_processing_flow(flow);
-
partially_processed_contexts[multi_file_processing_id] = context;
FILE_DEBUG(file_trace, DEFAULT_TRACE_OPTION_ID, TRACE_DEBUG_LEVEL, GET_CURRENT_PACKET,
"get_file_context:creating new context\n");
file_capture_enabled = other.file_capture_enabled;
file_state = other.file_state;
pending_expire_time = other.pending_expire_time;
- processing_flow = other.processing_flow;
// only one copy of file capture
file_capture = nullptr;
}
}
if (policy and log_needed)
- policy->log_file_action(processing_flow, this, FILE_ACTION_DEFAULT);
+ policy->log_file_action(flow, this, FILE_ACTION_DEFAULT);
if ( config->trace_type )
print(std::cout);
FileVerdict verdict = FILE_VERDICT_UNKNOWN;
bool processing_complete = false;
struct timeval pending_expire_time = {0, 0};
- void set_processing_flow(Flow* flow) { processing_flow = flow; }
- Flow* get_processing_flow() { return processing_flow; }
protected:
std::string file_name;
uint8_t* sha256 = nullptr;
uint64_t file_id = 0;
FileCapture* file_capture = nullptr;
- Flow* processing_flow = nullptr;
bool file_type_enabled = false;
bool file_signature_enabled = false;
bool file_capture_enabled = false;