]> git.ipfire.org Git - thirdparty/snort3.git/commitdiff
Merge pull request #767 in SNORT/snort3 from header_fixes to master
authorMichael Altizer (mialtize) <mialtize@cisco.com>
Fri, 6 Jan 2017 19:06:03 +0000 (14:06 -0500)
committerMichael Altizer (mialtize) <mialtize@cisco.com>
Fri, 6 Jan 2017 19:06:03 +0000 (14:06 -0500)
Squashed commit of the following:

commit 844d73f41f407756e05b7784530f7690285903f8
Author: Michael Altizer <mialtize@cisco.com>
Date:   Fri Jan 6 11:14:12 2017 -0500

    autoconf: Add piglet plugin iface headers and unit_test_main.h to sources lists

commit 36ab75006d396f62642ab37f5bae14d78559d9e9
Author: Michael Altizer <mialtize@cisco.com>
Date:   Fri Jan 6 11:13:23 2017 -0500

    sfrt: Finish removal of sfrt_trie.h

commit eff74954c55abbfeb95af6865c37f06023a6d161
Author: Michael Altizer <mialtize@cisco.com>
Date:   Fri Jan 6 11:13:51 2017 -0500

    http_inspect: Restore stdexcept header inclusion for old compilers

src/catch/Makefile.am
src/piglet_plugins/Makefile.am
src/service_inspectors/http_inspect/http_test_manager.cc
src/sfrt/CMakeLists.txt
src/sfrt/sfrt.h
src/sfrt/sfrt_trie.h [deleted file]

index 5c09bc459e9c1249cf06f17891d5aac163071e35..cf7d9a515e3856e571b1e7cfe91750207db30046 100644 (file)
@@ -4,5 +4,6 @@ noinst_LIBRARIES = libcatch_tests.a
 libcatch_tests_a_SOURCES = \
 catch.hpp \
 unit_test.cc \
-unit_test.h
+unit_test.h \
+unit_test_main.h
 
index 2cb2f276169d3729f94eff34ff0fb9133e74beac..721134e0351e9489761678a4e315faf96966674e 100644 (file)
@@ -6,26 +6,44 @@ piglet_plugins.cc \
 piglet_plugins.h
 
 interface_list = \
+pp_buffer_iface.cc \
+pp_buffer_iface.h \
 pp_codec_data_iface.cc \
+pp_codec_data_iface.h \
+pp_codec_iface.cc \
+pp_codec_iface.h \
+pp_cursor_iface.cc \
+pp_cursor_iface.h \
+pp_daq_pkthdr_iface.cc \
+pp_daq_pkthdr_iface.h \
+pp_decode_data_iface.cc \
+pp_decode_data_iface.h \
 pp_enc_state_iface.cc \
-pp_buffer_iface.cc \
+pp_enc_state_iface.h \
 pp_event_iface.cc \
-pp_codec_iface.cc \
-pp_stream_splitter_iface.cc \
+pp_event_iface.h \
+pp_flow_iface.cc \
+pp_flow_iface.h \
 pp_inspector_iface.cc \
-pp_cursor_iface.cc \
-pp_ips_option_iface.cc \
+pp_inspector_iface.h \
+pp_ip_api_iface.cc \
+pp_ip_api_iface.h \
 pp_ips_action_iface.cc \
+pp_ips_action_iface.h \
+pp_ips_option_iface.cc \
+pp_ips_option_iface.h \
 pp_logger_iface.cc \
+pp_logger_iface.h \
+pp_packet_iface.cc \
+pp_packet_iface.h \
+pp_raw_buffer_iface.cc \
+pp_raw_buffer_iface.h \
 pp_search_engine_iface.cc \
+pp_search_engine_iface.h \
 pp_so_rule_iface.cc \
-pp_raw_buffer_iface.cc \
-pp_packet_iface.cc \
-pp_decode_data_iface.cc \
-pp_flow_iface.cc \
-pp_event_iface.cc \
-pp_daq_pkthdr_iface.cc \
-pp_ip_api_iface.cc
+pp_so_rule_iface.h \
+pp_stream_splitter_iface.cc \
+pp_stream_splitter_iface.h
 
 plugin_list = \
 pp_codec.cc \
index f9745cbc0b55c49c90356146c81719f8a7db915d..81be99dcee76581c66904fa18022dd0087dda81c 100644 (file)
@@ -23,6 +23,8 @@
 
 #ifdef REG_TEST
 
+#include <stdexcept>
+
 #include "http_test_manager.h"
 
 #include "http_test_input.h"
index 12a9afe5797d78e36c4c3fa5741c2b7d6e683642..b5f4eb0dea2ecb76375a6ddf5b2cd5a5ac978a25 100644 (file)
@@ -12,7 +12,6 @@ add_library ( sfrt STATIC
     sfrt_flat.h
     sfrt_flat_dir.cc
     sfrt_flat_dir.h
-    sfrt_trie.h
     ${TEST_FILES}
 )
 
index ffdc4fadc188050ce003747e08a35d174daffbdf..8c777419d9dd24d63f7cb7cd3c188f80248cc59a 100644 (file)
 #include <cstdint>
 
 #include "sfip/sf_ip.h"
-#include "sfrt/sfrt_trie.h"
+
+/* A 32-bit word is used to hold the bit patterns of
+   the addresses. In IPv6 this should be 128 bits.
+   The following typedef is machine dependent.
+   A word must be 32 bits long! */
+typedef unsigned long word;
 
 typedef void* GENERIC;   /* To be replaced with a pointer to a policy */
 struct tuple_t
diff --git a/src/sfrt/sfrt_trie.h b/src/sfrt/sfrt_trie.h
deleted file mode 100644 (file)
index 40f5d32..0000000
+++ /dev/null
@@ -1,153 +0,0 @@
-//--------------------------------------------------------------------------
-// Copyright (C) 2014-2016 Cisco and/or its affiliates. All rights reserved.
-// Copyright (C) 2006-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.
-//--------------------------------------------------------------------------
-
-/*
-   trie.h
-
-   A routing table for wordsized (32bits) bitstrings implemented as a
-   static level- and pathcompressed trie. For details please consult
-
-      Stefan Nilsson and Gunnar Karlsson. Fast Address Look-Up
-      for Internet Routers. International Conference of Broadband
-      Communications (BC'97).
-
-      http://www.hut.fi/~sni/papers/router/router.html
-
-   The code presented in this file has been tested with care but is
-   not guaranteed for any purpose. The writer does not offer any
-   warranties nor does he accept any liabilities with respect to
-   the code.
-
-   Stefan Nilsson, 4 nov 1997.
-
-   Laboratory of Information Processing Science
-   Helsinki University of Technology
-   Stefan.Nilsson@hut.fi
-*/
-
-/*
-   The trie is represented by an array and each node consists of an
-   unsigned word. The first 5 bits (31-27) indicate the logarithm
-   of the branching factor. The next 5 bits (26-22) indicate the
-   skip value. The final 22 (21-0) bits is an adress, either to
-   another internal node, or the base vector.
-   The maximum capacity is 2^21 strings (or a few more). The trie
-   is prefixfree. All strings that are prefixes of another string
-   are stored separately.
-*/
-
-#ifndef SFRT_TRIE_H
-#define SFRT_TRIE_H
-
-#define ADRSIZE 32        /* the number of bits in an address */
-
-/* A 32-bit word is used to hold the bit patterns of
-   the addresses. In IPv6 this should be 128 bits.
-   The following typedef is machine dependent.
-   A word must be 32 bits long! */
-typedef unsigned long word;
-
-/* The trie is represented by an array and each node in
-   the trie is compactly represented using only 32 bits:
-   5 + 5 + 22 = branch + skip + adr */
-typedef word node_t;
-
-#define NOPRE -1          /* an empty prefix pointer */
-
-#define SETBRANCH(branch)   ((branch)<<27)
-#define GETBRANCH(node)     ((node)>>27)
-#define SETSKIP(skip)       ((skip)<<22)
-#define GETSKIP(node)       ((node)>>22 & 037)
-#define SETADR(adr)         (adr)
-#define GETADR(node)        ((node) & 017777777)
-
-/* extract n bits from str starting at position p */
-#define EXTRACT(p, n, str) ((str)<<(p)>>(32-(n)))
-
-/* remove the first p bits from string */
-#define REMOVE(p, str)   ((str)<<(p)>>(p))
-
-/* A next-hop table entry is a 32 bit string */
-
-typedef word policy_t;
-
-/* The routing table entries are initially stored in
-   a simple array */
-
-typedef struct entryrec* entry_t;
-struct entryrec
-{
-    word data;         /* the routing entry */
-    int len;           /* and its length */
-    policy_t policy; /* the corresponding next-hop */
-    int pre;           /* this auxiliary variable is used in the */
-};                     /* construction of the final data structure */
-
-/* base vector */
-
-typedef struct baserec* base_t;
-struct baserec
-{
-    word str;   /* the routing entry */
-    int len;    /* and its length */
-    int pre;    /* pointer to prefix table, -1 if no prefix */
-    int policy; /* pointer to next-hop table */
-};
-
-typedef struct   /* compact version of above */
-{ word str;
-  int len;
-  int pre;
-  int policy; } comp_base_t;
-
-/* prefix vector */
-
-typedef struct prerec* pre_t;
-struct prerec
-{
-    int len;    /* the length of the prefix */
-    int pre;    /* pointer to prefix, -1 if no prefix */
-    int policy; /* pointer to policy table */
-};
-
-typedef struct   /* compact version of above */
-{ int len;
-  int pre;
-  int policy; } comp_pre_t;
-
-/* The complete routing table data structure consists of
-   a trie, a base vector, a prefix vector, and a next-hop table. */
-
-typedef struct routtablerec* routtable_t;
-struct routtablerec
-{
-    node_t* trie;        /* the main trie search structure */
-    int triesize;
-    comp_base_t* base;   /* the base vector */
-    int basesize;
-    comp_pre_t* pre;     /* the prefix vector */
-    int presize;
-    policy_t* policy;    /* the next-hop table */
-    int policysize;
-
-    int dirty;           /* Whether or not the table needs to be rebuilt */
-};
-
-#endif
-