]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
remove service config
authorhuica <huica@cisco.com>
Tue, 11 Aug 2015 18:05:07 +0000 (14:05 -0400)
committerhuica <huica@cisco.com>
Tue, 11 Aug 2015 18:05:07 +0000 (14:05 -0400)
src/file_api/CMakeLists.txt
src/file_api/Makefile.am
src/file_api/file_api.h
src/file_api/file_service.cc
src/file_api/file_service_config.cc [deleted file]
src/file_api/file_service_config.h [deleted file]
src/mime/file_mime_log.h
src/parser/config_file.cc

index f35fa7f5e5f914ed812493aa1f525b3d661f7039..e1754374bc54beb849ea1adb33dd93542d0ce8d0 100644 (file)
@@ -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
 )
index 0274c72bb4f057b8944c7b93e5c7529a4da10e2a..162576fd065d8131a34f2363ede0a555ffe07a8c 100644 (file)
@@ -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 \
index 8719313c385eeddd4f915282eecba4dae80fb7ee..bf458ad11fe5b6cff885392c4837b3b5c52ab7f9 100644 (file)
@@ -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;
index e1e700eccfa8dee8183956a8fa528a8f49897a4e..11a62a75329a5bc5dd07b88f815d11b9c707a190 100644 (file)
@@ -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 (file)
index a38ae5d..0000000
+++ /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 <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"
-
diff --git a/src/file_api/file_service_config.h b/src/file_api/file_service_config.h
deleted file mode 100644 (file)
index 156be7e..0000000
+++ /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 <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
-
index dc65cbe26e08f2b0afe243b7b12ba07635cb3656..6fe8c33090da49f23240724499dafce91de7fc50 100644 (file)
@@ -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
 
index eed5d2a1309c538073fa7804577dfa470c4171c1..e68c8f196a9f67c4064a0c173660d9eafbe695aa 100644 (file)
@@ -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"