From: huica Date: Tue, 11 Aug 2015 18:05:07 +0000 (-0400) Subject: remove service config X-Git-Tag: 3.0.0-233~828^2~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=22edd294eda8e6946fdf98a4355395ebdaea929a;p=thirdparty%2Fsnort3.git remove service config --- diff --git a/src/file_api/CMakeLists.txt b/src/file_api/CMakeLists.txt index f35fa7f5e..e1754374b 100644 --- a/src/file_api/CMakeLists.txt +++ b/src/file_api/CMakeLists.txt @@ -14,8 +14,6 @@ add_library ( file_api STATIC file_resume_block.h file_service.cc file_service.h - file_service_config.cc - file_service_config.h file_stats.cc file_stats.h ) diff --git a/src/file_api/Makefile.am b/src/file_api/Makefile.am index 0274c72bb..162576fd0 100644 --- a/src/file_api/Makefile.am +++ b/src/file_api/Makefile.am @@ -4,7 +4,6 @@ noinst_LIBRARIES = libfile_api.a 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 \ diff --git a/src/file_api/file_api.h b/src/file_api/file_api.h index 8719313c3..bf458ad11 100644 --- a/src/file_api/file_api.h +++ b/src/file_api/file_api.h @@ -109,9 +109,6 @@ struct FileState struct FileContext; struct FileCaptureInfo; -struct MailLogState; -struct MailLogConfig; -struct MimeState; #define FILE_API_VERSION 4 @@ -146,30 +143,9 @@ typedef void (*Enable_file_signature_func)(); 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); @@ -363,18 +339,6 @@ typedef struct _file_api */ 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. * @@ -386,54 +350,6 @@ typedef struct _file_api */ 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; diff --git a/src/file_api/file_service.cc b/src/file_api/file_service.cc index e1e700ecc..11a62a753 100644 --- a/src/file_api/file_service.cc +++ b/src/file_api/file_service.cc @@ -136,18 +136,10 @@ void init_fileAPI(void) 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(); diff --git a/src/file_api/file_service_config.cc b/src/file_api/file_service_config.cc deleted file mode 100644 index a38ae5d05..000000000 --- a/src/file_api/file_service_config.cc +++ /dev/null @@ -1,38 +0,0 @@ -//-------------------------------------------------------------------------- -// 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 -** -** NOTES -** 5.25.2012 - Initial Source Code. Hui Cao -*/ - -#include "file_service_config.h" - -#include -#include -#include - -#include "libs/file_config.h" -#include "libs/file_lib.h" - -#include "main/snort_types.h" -#include "utils/util.h" -#include "parser/parser.h" - diff --git a/src/file_api/file_service_config.h b/src/file_api/file_service_config.h deleted file mode 100644 index 156be7e59..000000000 --- a/src/file_api/file_service_config.h +++ /dev/null @@ -1,32 +0,0 @@ -//-------------------------------------------------------------------------- -// 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 - -#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 - diff --git a/src/mime/file_mime_log.h b/src/mime/file_mime_log.h index dc65cbe26..6fe8c3309 100644 --- a/src/mime/file_mime_log.h +++ b/src/mime/file_mime_log.h @@ -36,6 +36,15 @@ enum EmailUserType 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: @@ -70,14 +79,5 @@ private: 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 diff --git a/src/parser/config_file.cc b/src/parser/config_file.cc index eed5d2a13..e68c8f196 100644 --- a/src/parser/config_file.cc +++ b/src/parser/config_file.cc @@ -49,7 +49,6 @@ #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"