AC_MSG_RESULT(no)
fi
-
#--------------------------------------------------------------------------
# visibility foo
#--------------------------------------------------------------------------
src/codecs/ip/Makefile \
src/codecs/misc/Makefile \
src/control/Makefile \
+src/decompress/Makefile \
src/detection/Makefile \
src/events/Makefile \
src/file_api/Makefile \
change -> config 'max_attribute_services_per_host' ==> 'attribute_table.max_services_per_host'
change -> config 'nopcre' ==> 'detection.pcre_enable'
change -> config 'pkt_count' ==> 'packets.limit'
-change -> config 'policy_mode' ==> 'ips.mode'
change -> config 'rate_filter' ==> 'alerts.rate_filter_memcap'
change -> config 'react' ==> 'react.page'
change -> config 'threshold' ==> 'alerts.event_filter_memcap'
change -> mpls_payload_type: 'config mpls_payload_type: ethernet' ==> 'mpls_payload_type = eth'
change -> mpls_payload_type: 'config mpls_payload_type: ipv4' ==> 'mpls_payload_type = ip4'
change -> mpls_payload_type: 'config mpls_payload_type: ipv6' ==> 'mpls_payload_type = ip6'
-change -> normalizers: 'block' ==> 'base'
-change -> normalizers: 'pad' ==> 'base'
-change -> normalizers: 'req_pay' ==> 'base'
-change -> normalizers: 'req_urg' ==> 'base'
-change -> normalizers: 'req_urp' ==> 'base'
-change -> normalizers: 'rsv' ==> 'base'
-change -> normalizers: 'trim_mss' ==> 'trim'
-change -> normalizers: 'trim_rst' ==> 'trim'
-change -> normalizers: 'trim_syn' ==> 'trim'
-change -> normalizers: 'trim_win' ==> 'trim'
change -> paf_max: 'paf_max [0:63780]' ==> 'max_pdu [1460:63780]'
change -> perfmonitor: 'accumulate' ==> 'reset = false'
change -> perfmonitor: 'flow-file' ==> 'flow_file = true'
change -> perfmonitor: 'pktcnt' ==> 'packets'
change -> perfmonitor: 'snortfile' ==> 'file = true'
change -> perfmonitor: 'time' ==> 'seconds'
+change -> policy_mode: 'inline_test' ==> 'inline-test'
change -> ppm: 'debug-pkts' ==> 'debug_pkts'
change -> ppm: 'fastpath-expensive-packets' ==> 'fastpath_expensive_packets'
change -> ppm: 'max-pkt-time' ==> 'max_pkt_time'
network_inspectors
search_engines
helpers
+ decompress
ips_options
loggers
service_inspectors
add_subdirectory(time)
add_subdirectory(utils)
add_subdirectory(helpers)
+add_subdirectory(decompress)
add_subdirectory(ips_options)
add_subdirectory(loggers)
add_subdirectory(network_inspectors)
log/liblog.a \
packet_io/libpacket_io.a \
helpers/libhelpers.a \
+decompress/libdecompress.a \
sfip/libsfip.a \
sfrt/libsfrt.a \
protocols/libprotocols.a \
actions \
codecs \
control \
+decompress \
detection \
events \
file_api \
--- /dev/null
+
+add_library (decompress STATIC
+ file_decomp.cc
+ file_decomp.h
+ file_decomp_pdf.cc
+ file_decomp_pdf.h
+ file_decomp_swf.cc
+ file_decomp_swf.h
+)
+
+
+target_link_libraries(decompress
+ log
+ utils
+)
--- /dev/null
+AUTOMAKE_OPTIONS=foreign no-dependencies
+
+noinst_LIBRARIES = libdecompress.a
+
+libdecompress_a_SOURCES = \
+file_decomp.cc \
+file_decomp.h \
+file_decomp_pdf.cc \
+file_decomp_pdf.h \
+file_decomp_swf.cc \
+file_decomp_swf.h
+
+AM_CXXFLAGS = @AM_CXXFLAGS@
#include "config.h"
#endif
-#include "util.h"
-#include "hi_file_decomp.h"
+#include "utils/util.h"
+#include "file_decomp.h"
#include "snort_types.h"
#include "detection_util.h"
-#include "hi_file_decomp_pdf.h"
-#include "hi_file_decomp_swf.h"
+#include "file_decomp_pdf.h"
+#include "file_decomp_swf.h"
static const char PDF_Sig[5] = { '%', 'P', 'D', 'F', '-' };
static const char SWF_ZLIB_Sig[3] = { 'C', 'W', 'S' };
if( (SessionPtr != NULL) && (SessionPtr->Alert_Callback != NULL) && (SessionPtr->Alert_Context) )
(SessionPtr->Alert_Callback)(SessionPtr->Alert_Context, Event);
}
+
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//--------------------------------------------------------------------------
-#ifndef HI_FILE_DECOMP_H
-#define HI_FILE_DECOMP_H
-
-// FIXIT-H temporary for development convenience
-//#define LZMA 1
+#ifndef FILE_DECOMP_H
+#define FILE_DECOMP_H
#include <stdint.h>
#include <string.h>
typedef struct fd_session_s *fd_session_p_t, fd_session_t;
-#include "hi_file_decomp_pdf.h"
-#include "hi_file_decomp_swf.h"
+#include "file_decomp_pdf.h"
+#include "file_decomp_swf.h"
#include <zlib.h>
#ifdef LZMA
#define FILE_PDF_ANY (FILE_PDF_DEFL_BIT)
#define FILE_SWF_ANY (FILE_SWF_LZMA_BIT | FILE_SWF_ZLIB_BIT)
+enum FileDecompError
+{
+ FILE_DECOMP_ERR_SWF_ZLIB_FAILURE,
+ FILE_DECOMP_ERR_SWF_LZMA_FAILURE,
+ FILE_DECOMP_ERR_PDF_DEFL_FAILURE,
+ FILE_DECOMP_ERR_PDF_UNSUP_COMP_TYPE,
+ FILE_DECOMP_ERR_PDF_CASC_COMP,
+ FILE_DECOMP_ERR_PDF_PARSE_FAILURE
+};
+
/* Private Types */
typedef enum file_type
{
#include <string.h>
#include <stdlib.h>
-#include "hi_file_decomp.h"
-#include "hi_file_decomp_pdf.h"
-#include "hi_events.h"
+#include "file_decomp.h"
+#include "file_decomp_pdf.h"
#include "mstring.h"
+#include "service_inspectors/http_inspect/hi_events.h"
/* Define characters and tokens in PDF grammar */
#define TOK_STRM_OPEN "stream"
/* Check if we've found one already. Indicate cascading if we did. */
if( SessionPtr->Decomp_Type != FILE_COMPRESSION_TYPE_NONE )
{
- File_Decomp_Alert( SessionPtr, HI_SERVER_PDF_CASC_COMP );
+ File_Decomp_Alert( SessionPtr, FILE_DECOMP_ERR_PDF_CASC_COMP );
SessionPtr->Decomp_Type = FILE_COMPRESSION_TYPE_NONE;
}
else
}
else
{
- File_Decomp_Alert( SessionPtr, HI_SERVER_PDF_UNSUP_COMP_TYPE );
+ File_Decomp_Alert( SessionPtr, FILE_DECOMP_ERR_PDF_UNSUP_COMP_TYPE );
SessionPtr->Decomp_Type = FILE_COMPRESSION_TYPE_NONE;
}
}
if( z_ret != Z_OK )
{
- File_Decomp_Alert( SessionPtr, HI_SERVER_PDF_DEFL_FAILURE );
+ File_Decomp_Alert( SessionPtr, FILE_DECOMP_ERR_PDF_DEFL_FAILURE );
return( File_Decomp_Error );
}
if( z_ret != Z_OK )
{
DEBUG_WRAP(DebugMessage(DEBUG_HTTPINSPECT, "Decompression Error: objnum: %u\n", StPtr->Parse.Obj_Number););
- File_Decomp_Alert( SessionPtr, HI_SERVER_PDF_DEFL_FAILURE );
+ File_Decomp_Alert( SessionPtr, FILE_DECOMP_ERR_PDF_DEFL_FAILURE );
return( File_Decomp_Error );
}
if( z_ret != Z_OK )
{
- File_Decomp_Alert( SessionPtr, HI_SERVER_PDF_DEFL_FAILURE );
+ File_Decomp_Alert( SessionPtr, FILE_DECOMP_ERR_PDF_DEFL_FAILURE );
return( File_Decomp_Error );
}
Ret_Code = File_Decomp_End_PDF( SessionPtr );
if( Close_Stream( SessionPtr ) != File_Decomp_OK )
return( File_Decomp_Error );
- File_Decomp_Alert( SessionPtr, HI_SERVER_PDF_DEFL_FAILURE );
+ File_Decomp_Alert( SessionPtr, FILE_DECOMP_ERR_PDF_DEFL_FAILURE );
break;
}
Ret_Code = File_Decomp_End_PDF( SessionPtr );
if( Close_Stream( SessionPtr ) != File_Decomp_OK )
return( File_Decomp_Error );
- File_Decomp_Alert( SessionPtr, HI_SERVER_PDF_DEFL_FAILURE );
+ File_Decomp_Alert( SessionPtr, FILE_DECOMP_ERR_PDF_DEFL_FAILURE );
break;
}
/* OK -> circle back for more input */
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//--------------------------------------------------------------------------
-#ifndef HI_FILE_DECOMP_PDF_H
-#define HI_FILE_DECOMP_PDF_H
+#ifndef FILE_DECOMP_PDF_H
+#define FILE_DECOMP_PDF_H
#include <zlib.h>
#include <lzma.h>
#endif
-#include "hi_file_decomp.h"
-#include "hi_file_decomp_swf.h"
-#include "hi_events.h"
+#include "file_decomp.h"
+#include "file_decomp_swf.h"
+//#include "service_inspectors/http_inspect/hi_events.h"
#ifdef LZMA
#define LZMA_HEADER_LEN (13)
if( SWF_Uncomp_Len < SWF_HDR_LEN )
{
- SessionPtr->Error_Event = HI_SERVER_SWF_LZMA_FAILURE;
+ SessionPtr->Error_Event = FILE_DECOMP_ERR_SWF_LZMA_FAILURE;
return( File_Decomp_DecompError );
}
if( l_ret != LZMA_OK )
{
- SessionPtr->Error_Event = HI_SERVER_SWF_LZMA_FAILURE;
+ SessionPtr->Error_Event = FILE_DECOMP_ERR_SWF_LZMA_FAILURE;
return( File_Decomp_DecompError );
}
if( z_ret != Z_OK )
{
- SessionPtr->Error_Event = HI_SERVER_SWF_ZLIB_FAILURE;
+ SessionPtr->Error_Event = FILE_DECOMP_ERR_SWF_ZLIB_FAILURE;
return( File_Decomp_DecompError );
}
if( l_ret != LZMA_OK )
{
- SessionPtr->Error_Event = HI_SERVER_SWF_LZMA_FAILURE;
+ SessionPtr->Error_Event = FILE_DECOMP_ERR_SWF_LZMA_FAILURE;
return( File_Decomp_DecompError );
}
if( z_ret != Z_OK )
{
- SessionPtr->Error_Event = HI_SERVER_SWF_ZLIB_FAILURE;
+ SessionPtr->Error_Event = FILE_DECOMP_ERR_SWF_ZLIB_FAILURE;
return( File_Decomp_DecompError );
}
if( z_ret != Z_OK )
{
- SessionPtr->Error_Event = HI_SERVER_SWF_ZLIB_FAILURE;
+ SessionPtr->Error_Event = FILE_DECOMP_ERR_SWF_ZLIB_FAILURE;
return( File_Decomp_DecompError );
}
if( l_ret != LZMA_OK )
{
- SessionPtr->Error_Event = HI_SERVER_SWF_LZMA_FAILURE;
+ SessionPtr->Error_Event = FILE_DECOMP_ERR_SWF_LZMA_FAILURE;
return( File_Decomp_DecompError );
}
// 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
//--------------------------------------------------------------------------
-#ifndef HI_FILE_DECOMP_SWF_H
-#define HI_FILE_DECOMP_SWF_H
+#ifndef FILE_DECOMP_SWF_H
+#define FILE_DECOMP_SWF_H
#include <zlib.h>
#ifdef LZMA
hi_client_norm.h
hi_cmd_lookup.cc
hi_cmd_lookup.h
- hi_file_decomp.cc
- hi_file_decomp.h
- hi_file_decomp_pdf.cc
- hi_file_decomp_pdf.h
- hi_file_decomp_swf.cc
- hi_file_decomp_swf.h
hi_include.h
hi_mi.cc
hi_mi.h
hi_client_norm.cc hi_client_norm.h \
hi_cmd_lookup.cc hi_cmd_lookup.h \
hi_events.cc hi_events.h \
-hi_file_decomp.cc hi_file_decomp.h \
-hi_file_decomp_pdf.cc hi_file_decomp_pdf.h \
-hi_file_decomp_swf.cc hi_file_decomp_swf.h \
hi_include.h \
hi_mi.cc hi_mi.h \
hi_module.cc hi_module.h \
static void LogFileDecomp(void*, int event)
{
- // FIXIT-H first argument is supposed to be pointer to session which may be needed to
- // generate the event correctly.
+ switch ( event )
+ {
+ case FILE_DECOMP_ERR_SWF_ZLIB_FAILURE:
+ event = HI_SERVER_SWF_ZLIB_FAILURE;
+ break;
+ case FILE_DECOMP_ERR_SWF_LZMA_FAILURE:
+ event = HI_SERVER_SWF_LZMA_FAILURE;
+ break;
+ case FILE_DECOMP_ERR_PDF_DEFL_FAILURE:
+ event = HI_SERVER_PDF_DEFL_FAILURE;
+ break;
+ case FILE_DECOMP_ERR_PDF_UNSUP_COMP_TYPE:
+ event = HI_SERVER_PDF_UNSUP_COMP_TYPE;
+ break;
+ case FILE_DECOMP_ERR_PDF_CASC_COMP:
+ event = HI_SERVER_PDF_CASC_COMP;
+ break;
+ case FILE_DECOMP_ERR_PDF_PARSE_FAILURE:
+ event = HI_SERVER_PDF_PARSE_FAILURE;
+ break;
+ }
hi_set_event(GID_HTTP_SERVER, event);
}
#include "sf_ip.h"
#include "hi_util_kmap.h"
#include "file_api/file_api.h"
-#include "hi_file_decomp.h"
+#include "decompress/file_decomp.h"
#include "framework/bits.h"
/*
#include "snort_debug.h"
#include "util.h"
#include "parser.h"
-#include "hi_file_decomp.h"
+#include "decompress/file_decomp.h"
#include "hi_client.h"
#include "hi_ui_config.h"