file_resume_block.h
file_service.cc
file_service.h
- file_service_config.cc
- file_service_config.h
file_stats.cc
file_stats.h
)
libfile_api_a_SOURCES = \
file_api.h \
file_service.cc file_service.h \
-file_service_config.cc file_service_config.h \
file_resume_block.cc file_resume_block.h \
file_capture.cc file_capture.h \
circular_buffer.cc circular_buffer.h \
struct FileContext;
struct FileCaptureInfo;
-struct MailLogState;
-struct MailLogConfig;
-struct MimeState;
#define FILE_API_VERSION 4
typedef void (*Enable_file_capture_func)();
typedef void (*Set_file_action_log_func)();
-typedef int (*Set_log_buffers_func)(MailLogState** log_state, MailLogConfig* conf);
-typedef int (*File_resume_block_add_file_func)(Packet* pkt, uint32_t file_sig,
- uint32_t timeout, File_Verdict verdict, uint32_t file_type_id, uint8_t* signature);
-typedef File_Verdict (*File_resume_block_check_func)(Packet* pkt, uint32_t file_sig);
-typedef uint32_t (*Str_to_hash_func)(uint8_t* str, int length);
-typedef void (*File_signature_lookup_func)(Packet* p, bool is_retransmit);
-typedef const uint8_t* (*Process_mime_data_func)(Flow* flow, const uint8_t* start, const
- uint8_t* end,
- MimeState* mime_ssn, bool upload, FilePosition position);
-typedef void (*Free_mime_session_func)(MimeState* mime_ssn);
-typedef void (*Finalize_mime_position_func)(Flow* flow, void* decode_state,
- FilePosition* position);
-typedef File_Verdict (*Get_file_verdict_func)(Flow* flow);
-typedef void (*Render_block_verdict_func)(void* ctx, Packet* p);
-
typedef bool (*Is_file_service_enabled)();
typedef FilePosition (*GetFilePosition)(Packet* pkt);
typedef uint32_t (*Get_file_type_id)(Flow*);
-typedef uint32_t (*Get_new_file_instance)(Flow*);
-
-/*Context based file process functions*/
-typedef struct FileContext* (*Create_file_context_func)(Flow*);
-typedef struct FileContext* (*Get_file_context_func)(Flow*);
-typedef bool (*Set_file_context_func)(Flow*, FileContext*);
typedef int64_t (*Get_max_file_capture_size)(Flow* flow);
*/
Get_file_depth_func get_max_file_depth;
- /*--------------Common functions used for MIME processing-------------*/
- Set_log_buffers_func set_log_buffers;
- Process_mime_data_func process_mime_data;
- Free_mime_session_func free_mime_session;
-
- /*--------------Other helper functions-------------*/
- File_resume_block_add_file_func file_resume_block_add_file;
- File_resume_block_check_func file_resume_block_check;
- Str_to_hash_func str_to_hash;
- File_signature_lookup_func file_signature_lookup;
- Get_file_verdict_func get_file_verdict;
- Render_block_verdict_func render_block_verdict;
/* Return the file rule id associated with a session.
*
*/
Get_file_type_id get_file_type_id;
- /* Create a file context to use
- *
- * Arguments:
- * void* ssnptr: session pointer
- * Returns:
- * FileContext *: file context created.
- */
- Create_file_context_func create_file_context;
-
- /* Set file context to be the current
- *
- * Arguments:
- * void* ssnptr: session pointer
- * FileContext *: file context that will be current
- * Returns:
- * True: changed successfully
- * False: fail to change
- */
- Set_file_context_func set_current_file_context;
-
- /* Get current file context
- *
- * Arguments:
- * void* ssnptr: session pointer
- * Returns:
- * FileContext *: current file context
- */
- Get_file_context_func get_current_file_context;
-
- /* Get main file context that used by preprocessors
- *
- * Arguments:
- * void* ssnptr: session pointer
- * Returns:
- * FileContext *: main file context
- */
- Get_file_context_func get_main_file_context;
-
-
- /* Return a unique file instance number
- *
- * Arguments:
- * void *ssnptr: session pointer
- * Returns:
- * (u32) a unique file instance id.
- */
- Get_new_file_instance get_new_file_instance;
-
GetFilePosition get_file_position;
Get_max_file_capture_size get_max_file_capture_size;
fileAPI.enable_file_signature = &enable_file_signature;
fileAPI.enable_file_capture = &enable_file_capture;
fileAPI.get_max_file_depth = &get_max_file_depth;
- fileAPI.file_resume_block_add_file = &file_resume_block_add_file;
- fileAPI.file_resume_block_check = &file_resume_block_check;
fileAPI.get_file_type_id = &get_file_type_id;
- fileAPI.get_new_file_instance = &get_new_file_instance;
- fileAPI.create_file_context = &create_file_context;
- fileAPI.set_current_file_context = &set_current_file_context;
- fileAPI.get_current_file_context = &get_current_file_context;
- fileAPI.get_main_file_context = &get_main_file_context;
fileAPI.get_file_position = &get_file_position;
-
file_api = &fileAPI;
MimeSession::init();
FileFlowData::init();
+++ /dev/null
-//--------------------------------------------------------------------------
-// Copyright (C) 2014-2015 Cisco and/or its affiliates. All rights reserved.
-// Copyright (C) 2012-2013 Sourcefire, Inc.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License Version 2 as published
-// by the Free Software Foundation. You may not use, modify or distribute
-// this program under any other version of the GNU General Public License.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//--------------------------------------------------------------------------
-/*
-** Author(s): Hui Cao <huica@cisco.com>
-**
-** NOTES
-** 5.25.2012 - Initial Source Code. Hui Cao
-*/
-
-#include "file_service_config.h"
-
-#include <sys/types.h>
-#include <stdio.h>
-#include <stdlib.h>
-
-#include "libs/file_config.h"
-#include "libs/file_lib.h"
-
-#include "main/snort_types.h"
-#include "utils/util.h"
-#include "parser/parser.h"
-
+++ /dev/null
-//--------------------------------------------------------------------------
-// Copyright (C) 2014-2015 Cisco and/or its affiliates. All rights reserved.
-// Copyright (C) 2012-2013 Sourcefire, Inc.
-//
-// This program is free software; you can redistribute it and/or modify it
-// under the terms of the GNU General Public License Version 2 as published
-// by the Free Software Foundation. You may not use, modify or distribute
-// this program under any other version of the GNU General Public License.
-//
-// This program is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License along
-// with this program; if not, write to the Free Software Foundation, Inc.,
-// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
-//--------------------------------------------------------------------------
-
-// file_service_config.h author Hui Cao <huica@cisco.com>
-
-#ifndef FILE_SERVICE_CONFIG_H
-#define FILE_SERVICE_CONFIG_H
-
-// FIXIT-L This will be refactored soon
-#include "file_api/file_service.h"
-
-/*configure file services*/
-void file_service_config(const char* args, void** file_config);
-
-#endif
-
EMAIL_RECIPIENT
};
+struct MailLogConfig
+{
+ char log_mailfrom = 0;
+ char log_rcptto = 0;
+ char log_filename = 0;
+ char log_email_hdrs = 0;
+ uint32_t email_hdrs_log_depth = 0;
+};
+
class MailLogState
{
public:
uint16_t file_current;
};
-struct MailLogConfig
-{
- char log_mailfrom = 0;
- char log_rcptto = 0;
- char log_filename = 0;
- char log_email_hdrs = 0;
- uint32_t email_hdrs_log_depth = 0;
-};
-
#endif
#include "utils/strvec.h"
#include "utils/snort_bounds.h"
#include "ips_options/ips_flowbits.h"
-#include "file_api/file_service_config.h"
#include "packet_io/sfdaq.h"
#include "managers/event_manager.h"
#include "detection/detect.h"