diff options
author | Antoine Brodin <antoine@FreeBSD.org> | 2013-09-15 19:03:03 +0000 |
---|---|---|
committer | Antoine Brodin <antoine@FreeBSD.org> | 2013-09-15 19:03:03 +0000 |
commit | 789e5cdbcdfa5c90232264dd6b20b381b06598a3 (patch) | |
tree | 320832392d0feb69e5dbaef0b29e61bdb52ad018 /net | |
parent | 5bbcfac884ef4e4ea6bc8cbf5ed5b5a4353740db (diff) | |
download | ports-789e5cdbcdfa5c90232264dd6b20b381b06598a3.tar.gz ports-789e5cdbcdfa5c90232264dd6b20b381b06598a3.zip |
Notes
Diffstat (limited to 'net')
-rw-r--r-- | net/tcpflow/files/patch-src__be13_api__plugin.cpp | 48 | ||||
-rw-r--r-- | net/tcpflow/files/patch-src__tcpdemux.h | 39 |
2 files changed, 87 insertions, 0 deletions
diff --git a/net/tcpflow/files/patch-src__be13_api__plugin.cpp b/net/tcpflow/files/patch-src__be13_api__plugin.cpp new file mode 100644 index 000000000000..cc2a9d695bf9 --- /dev/null +++ b/net/tcpflow/files/patch-src__be13_api__plugin.cpp @@ -0,0 +1,48 @@ +--- ./src/be13_api/plugin.cpp.orig 2013-08-03 16:58:46.000000000 +0000 ++++ ./src/be13_api/plugin.cpp 2013-09-07 22:32:02.000000000 +0000 +@@ -9,7 +9,16 @@ + #include <sys/stat.h> + #include <dirent.h> + #include <algorithm> ++#ifdef __clang__ ++#if __has_include(<unordered_set>) ++#define HAVE_CXX11_UNORDERED_SET 1 ++#endif ++#endif ++#ifdef HAVE_CXX11_UNORDERED_SET ++#include <unordered_set> ++#else + #include <tr1/unordered_set> ++#endif + #ifdef HAVE_ERR_H + #include <err.h> + #endif +@@ -23,20 +32,28 @@ + #include "../dfxml/src/hash_t.h" + + namespace std { ++#ifndef HAVE_CXX11_UNORDERED_SET + namespace tr1 { ++#endif + template<> + struct hash<md5_t> { + size_t operator()(const md5_t &key) const { + return *(size_t *)(key.final()); + } + }; ++#ifndef HAVE_CXX11_UNORDERED_SET + } ++#endif + } + + class atomic_hash_set + { + cppmutex M; ++#ifdef HAVE_CXX11_UNORDERED_SET ++ std::unordered_set<md5_t>myset; ++#else + std::tr1::unordered_set<md5_t>myset; ++#endif + public: + atomic_hash_set():M(),myset(){} + bool in(const md5_t &s){ diff --git a/net/tcpflow/files/patch-src__tcpdemux.h b/net/tcpflow/files/patch-src__tcpdemux.h new file mode 100644 index 000000000000..d967b5a9191d --- /dev/null +++ b/net/tcpflow/files/patch-src__tcpdemux.h @@ -0,0 +1,39 @@ +--- ./src/tcpdemux.h.orig 2013-05-27 22:28:50.000000000 +0000 ++++ ./src/tcpdemux.h 2013-09-07 22:32:29.000000000 +0000 +@@ -20,8 +20,18 @@ + #include "pcap_writer.h" + #include "dfxml/src/dfxml_writer.h" + #include "dfxml/src/hash_t.h" ++#ifdef __clang__ ++#if __has_include(<unordered_set>) ++#define HAVE_CXX11_UNORDERED_SET 1 ++#endif ++#endif ++#ifdef HAVE_CXX11_UNORDERED_SET ++#include <unordered_map> ++#include <unordered_set> ++#else + #include <tr1/unordered_map> + #include <tr1/unordered_set> ++#endif + #include <queue> + + +@@ -53,10 +63,17 @@ + bool operator() (const flow_addr &x, const flow_addr &y) const { return x==y;} + } flow_addr_key_eq; + ++#ifdef HAVE_CXX11_UNORDERED_SET ++ typedef std::unordered_set<class tcpip *> tcpset; ++ typedef std::vector<class saved_flow *> saved_flows_t; // needs to be ordered ++ typedef std::unordered_map<flow_addr,tcpip *,flow_addr_hash,flow_addr_key_eq> flow_map_t; // active flows ++ typedef std::unordered_map<flow_addr,saved_flow *,flow_addr_hash,flow_addr_key_eq> saved_flow_map_t; // flows that have been saved ++#else + typedef std::tr1::unordered_set<class tcpip *> tcpset; + typedef std::vector<class saved_flow *> saved_flows_t; // needs to be ordered + typedef std::tr1::unordered_map<flow_addr,tcpip *,flow_addr_hash,flow_addr_key_eq> flow_map_t; // active flows + typedef std::tr1::unordered_map<flow_addr,saved_flow *,flow_addr_hash,flow_addr_key_eq> saved_flow_map_t; // flows that have been saved ++#endif + tcpdemux(); + public: + static uint32_t tcp_timeout; |