}
else
{
+#ifdef BUILD_OBFUSCATION
/* Not a completely ideal place for this since any entries added on
* the packet callback trail will get obliterated - right now there
* isn't anything adding entries there. Really need it here for
* overflow if we don't reset it. Putting it here does have the
* advantage of fewer entries per logging cycle */
obApi->resetObfuscationEntries();
+#endif
do_detect = do_detect_content = 1;
#define DECODE_BLEN 65535
-// FIXIT-L this is now used only by http_inspect and should be relocated accordingly
-enum HTTP_BUFFER
-{
- HTTP_BUFFER_NONE,
- HTTP_BUFFER_CLIENT_BODY,
- HTTP_BUFFER_COOKIE,
- HTTP_BUFFER_HEADER,
- HTTP_BUFFER_METHOD,
- HTTP_BUFFER_RAW_COOKIE,
- HTTP_BUFFER_RAW_HEADER,
- HTTP_BUFFER_RAW_URI,
- HTTP_BUFFER_STAT_CODE,
- HTTP_BUFFER_STAT_MSG,
- HTTP_BUFFER_URI,
- HTTP_BUFFER_MAX
-};
-
-// FIXIT-L this is now used only by http_inspect
-// and should be relocated accordingly
-struct HttpBuffer
-{
- const uint8_t* buf;
- unsigned length;
- uint32_t encode_type;
-};
-
struct DataPointer
{
uint8_t* data;
set (LOG_INCLUDES
messages.h
- obfuscation.h
+# obfuscation.h
text_log.h
)
log_text.cc
log_text.h
messages.cc
- obfuscation.cc
+# obfuscation.cc
text_log.cc
)
x_include_HEADERS = \
messages.h \
-obfuscation.h \
text_log.h
liblog_a_SOURCES = \
log_text.cc \
log_text.h \
messages.cc \
-obfuscation.cc \
text_log.cc
+EXTRA_DIST = \
+obfuscation.h \
+obfuscation.cc
+
#liblog_a_CXXFLAGS = $(AM_CXXFLAGS) -fvisibility=default
AM_CXXFLAGS = @AM_CXXFLAGS@
TextLog_Print(log, "%s\n", SEPARATOR);
}
+#ifdef BUILD_OBFUSCATION
static int LogObfuscatedData(TextLog* log, Packet* p)
{
uint8_t* payload = NULL;
free(payload);
return 0;
}
+#endif
/*--------------------------------------------------------------------
* Function: LogIPPkt(TextLog*, int, Packet *)
void LogPayload(TextLog* log, Packet* p)
{
+#ifdef BUILD_OBFUSCATION
if ((p->dsize > 0) && obApi->payloadObfuscationRequired(p)
&& (LogObfuscatedData(log, p) == 0))
{
return;
}
+#endif
/* dump the application layer data */
if (SnortConfig::output_app_data() && !SnortConfig::verbose_byte_dump())
#ifndef OBFUSCATION_H
#define OBFUSCATION_H
+// BUILD_OBFUSCATION is not defined because nothing creates obfuscation
+// entries. when sdf is ported, BUILD_OBFUSCATION should be deleted so the
+// full code is built. at that time the api should be turned into an
+// obfuscator class and the test code should be replaced with actual unit
+// tests. #ifdef BUILD_OBFUSCATION is used in detect.cc, log_text.cc, and
+// unified2.cc.
+
extern "C" {
#include <daq.h>
}
static void _AlertIP4_v2(Packet*, const char*, Unified2Config*, Event*);
static void _AlertIP6_v2(Packet*, const char*, Unified2Config*, Event*);
+#ifdef BUILD_OBFUSCATION
static ObRet Unified2LogObfuscationCallback(const DAQ_PktHdr_t* pkth,
const uint8_t* packet_data, ob_size_t length, ob_char_t ob_char, void* userdata);
+#endif
static void AlertExtraData(Flow*, void* data, LogFunction* log_funcs, uint32_t max_count, uint32_t
xtradata_mask, uint32_t event_id, uint32_t event_second);
logheader.event_second = 0;
}
+#ifdef BUILD_OBFUSCATION
if ( p and p->pkth and obApi->payloadObfuscationRequired(p) )
{
Unified2LogCallbackData unifiedData;
return;
}
}
+#endif
if ( p and p->pkth )
{
Unified2Write(write_pkt_buffer, write_len, config);
}
+#ifdef BUILD_OBFUSCATION
static ObRet Unified2LogObfuscationCallback(const DAQ_PktHdr_t* pkth,
const uint8_t* packet_data, ob_size_t length,
ob_char_t ob_char, void* userdata)
return OB_RET_SUCCESS;
}
+#endif
/******************************************************************************
* Function: Unified2Write()
#define DEFLATE_WBITS 15
#define GZIP_WBITS 31
+enum HTTP_BUFFER
+{
+ HTTP_BUFFER_NONE,
+ HTTP_BUFFER_CLIENT_BODY,
+ HTTP_BUFFER_COOKIE,
+ HTTP_BUFFER_HEADER,
+ HTTP_BUFFER_METHOD,
+ HTTP_BUFFER_RAW_COOKIE,
+ HTTP_BUFFER_RAW_HEADER,
+ HTTP_BUFFER_RAW_URI,
+ HTTP_BUFFER_STAT_CODE,
+ HTTP_BUFFER_STAT_MSG,
+ HTTP_BUFFER_URI,
+ HTTP_BUFFER_MAX
+};
+
+struct HttpBuffer
+{
+ const uint8_t* buf;
+ unsigned length;
+ uint32_t encode_type;
+};
+
extern SO_PUBLIC THREAD_LOCAL uint32_t http_mask;
extern SO_PUBLIC THREAD_LOCAL HttpBuffer http_buffer[HTTP_BUFFER_MAX];
extern THREAD_LOCAL DataBuffer HttpDecodeBuf;