├── INSTALL
├── src
├── tests
│ ├── CMakeLists.txt
│ ├── vermonttest
│ │ ├── VermontTest.h
│ │ ├── exp_output
│ │ │ ├── pcap_export
│ │ │ ├── connectionfilter
│ │ │ └── state_connectionfilter
│ │ ├── data
│ │ │ └── connectionfiltertest.pcap
│ │ ├── testpackets
│ │ │ ├── incorrect_message_length.ipfix
│ │ │ ├── two_correct_data_templates.ipfix
│ │ │ ├── template_set_length_too_small.ipfix
│ │ │ ├── correct_withdraw_all_templates.ipfix
│ │ │ ├── two_correct_templates_in_one_set.ipfix
│ │ │ ├── template_record_field_number_too_big.ipfix
│ │ │ ├── two_correct_data_templates_withdrawals.ipfix
│ │ │ ├── correct_variable_length_template_and_data.ipfix
│ │ │ ├── template_set_length_exceeds_message_boundary.ipfix
│ │ │ ├── README
│ │ │ ├── correct_data_template_with_variable_length_fixed_data.ipfix
│ │ │ └── variable_length_template_and_data_exceeding_message_boundary.ipfix
│ │ ├── test_concentrator.h
│ │ ├── BloomFilterTest.h
│ │ ├── ConnectionFilterTest.h
│ │ ├── PrinterModule.cpp
│ │ ├── TestSuiteBase.cpp
│ │ ├── ConfigTester.h
│ │ ├── CounterDestination.h
│ │ ├── test_configs
│ │ │ ├── pcap_export
│ │ │ ├── state_connectionfilter
│ │ │ └── connectionfilter
│ │ ├── ReconfTest.h
│ │ ├── PrinterModule.h
│ │ ├── TestSuiteBase.h
│ │ ├── VermontTest.cpp
│ │ ├── TestQueue.h
│ │ └── AggregationPerfTest.h
│ └── ipfixlolib
│ │ ├── init_deinit.c
│ │ └── CMakeLists.txt
├── CMakeLists.txt
├── common
│ ├── anon
│ │ ├── README
│ │ ├── CrpytoPanInfoElements.h
│ │ ├── CMakeLists.txt
│ │ ├── AnonIdentity.cpp
│ │ ├── AnonIdentity.h
│ │ ├── AnonShuffle.h
│ │ ├── AnonShorten.cpp
│ │ ├── AnonContinuousChar.cpp
│ │ ├── AnonBroadcastHandler.h
│ │ ├── AnonRandomize.h
│ │ ├── AnonShorten.h
│ │ ├── AnonBytewiseHashSha1.h
│ │ ├── AnonConstOverwrite.cpp
│ │ ├── AnonBytewise.h
│ │ ├── AnonBytewiseHashHmacSha1.h
│ │ ├── AnonConstOverwrite.h
│ │ ├── RandomNumberGenerator.h
│ │ ├── AnonContinuousChar.h
│ │ ├── AnonHashSha1.h
│ │ ├── AnonWhitenoise.h
│ │ ├── AnonCryptoPan.h
│ │ ├── AnonBytewise.cpp
│ │ ├── AnonRandomize.cpp
│ │ ├── AnonBytewiseHashSha1.cpp
│ │ ├── AnonHashHmacSha1.h
│ │ ├── AnonShuffle.cpp
│ │ ├── AnonBytewiseHashHmacSha1.cpp
│ │ ├── AnonPrimitive.cpp
│ │ └── AnonCryptoPan.cpp
│ ├── ipfixlolib
│ │ ├── Makefile.am
│ │ ├── TODO
│ │ ├── ipfixlolib_config.h
│ │ ├── ipfixlolib_private.h
│ │ ├── ipfixlolib_dtls_private.h
│ │ ├── CMakeLists.txt
│ │ └── ipfix_names.h
│ ├── Makefile.am
│ ├── Misc.cpp
│ ├── hmacsha1
│ │ ├── sha1_hmac.h
│ │ └── sha1.h
│ ├── VermontControl.h
│ ├── SignalInterface.h
│ ├── VermontControl.cpp
│ ├── cryptopan
│ │ └── panonymizer.h
│ ├── atomic_lock.h
│ ├── openssl
│ │ └── OpenSSL.h
│ ├── CountingSemaphore.h
│ ├── SignalHandler.h
│ └── CMakeLists.txt
├── osdep
│ ├── linux
│ │ ├── sysinfo.h
│ │ ├── version.h
│ │ ├── version.c
│ │ └── ThreadCPUInterface.h
│ ├── osx
│ │ ├── sem_timedwait.h
│ │ └── sem_timedwait.cpp
│ └── CMakeLists.txt
├── core
│ ├── CfgNode.cpp
│ ├── Node.cpp
│ ├── GraphInstanceSupplier.cpp
│ ├── CfgNode.h
│ ├── CMakeLists.txt
│ ├── XMLTextNode.cpp
│ ├── XMLAttribute.cpp
│ ├── MainSignalHandler.h
│ ├── Node.h
│ ├── GraphInstanceSupplier.h
│ ├── XMLElement.h
│ ├── XMLAttribute.h
│ ├── Emitable.h
│ ├── Edge.h
│ ├── XMLDocument.h
│ ├── XMLElement.cpp
│ ├── Destination.h
│ ├── Connector.h
│ ├── Module.cpp
│ ├── Notifiable.h
│ └── ThreadSafeAdapter.h
└── modules
│ ├── packet
│ ├── Packet.cpp
│ ├── filter
│ │ ├── PayloadFilter.h
│ │ ├── PayloadFilter.cpp
│ │ ├── AnonFilter.h
│ │ ├── HostFilter.h
│ │ ├── RegExFilter.cpp
│ │ ├── SystematicSampler.cpp
│ │ ├── PacketProcessor.h
│ │ ├── FilterModule.h
│ │ ├── StateConnectionFilter.h
│ │ ├── StringFilter.h
│ │ └── RegExFilter.h
│ ├── PCAPExporterBase.h
│ ├── PacketReportingCfg.h
│ ├── PCAPExporterFileCfg.h
│ ├── PCAPExporterBase.cpp
│ └── PCAPExporterFile.h
│ ├── analysis
│ ├── autofocus_iprecord.h
│ ├── AutoFocusCfg.h
│ ├── fpsigmatcher
│ │ └── Utils.h
│ ├── TRWPortscanDetectorCfg.h
│ ├── P2PDetectorCfg.h
│ ├── RBSWormDetectorCfg.h
│ ├── Host.h
│ ├── FlowLenAnalyzerCfg.h
│ ├── FrontPayloadSigMatcherCfg.h
│ └── FlowLenAnalyzer.h
│ ├── idmef
│ ├── IDMEFExporterCfg.h
│ ├── PacketIDMEFReporterCfg.h
│ ├── PacketIDMEFReporter.h
│ └── IDMEFExporterCfg.cpp
│ ├── ipfix
│ ├── IpfixRecordSender.h
│ ├── aggregator
│ │ ├── PacketAggregatorCfg.h
│ │ ├── IpfixAggregatorCfg.h
│ │ ├── AggregatorBaseCfg.h
│ │ └── IpfixAggregator.hpp
│ ├── FpaPacketGeneratorCfg.h
│ ├── IpfixPrinterCfg.h
│ ├── IpfixSamplerCfg.h
│ ├── FpaPcapExporterCfg.h
│ ├── IpfixNetflowExporterCfg.h
│ ├── IpfixRawdirWriter.hpp
│ ├── IpfixSampler.h
│ ├── NetflowV9ConverterCfg.hpp
│ ├── IpfixReceiverFileCfg.h
│ ├── IpfixReceiverUdpIpV4.hpp
│ └── IpfixRecordAnonymizer.h
│ └── AnonymizerCfg.h
├── configs
├── mongo
│ ├── test.pcap
│ └── test.sh
├── oracle
│ ├── oracletest.pcap
│ ├── prepare_oracle.sh
│ └── test.sh
├── signatures
│ ├── HTTP
│ └── signature_with_SIGNATUREID
├── udp_printer.xml
├── sctp_printer.xml
├── interop
│ ├── sctp_collector.xml
│ ├── simple_udp_collector.xml
│ ├── filereader_to_printer.xml
│ ├── file_udp_export.xml
│ └── file_sctp_export.xml
├── analysis
│ └── signature-detection.xml
├── pcapexport.xml
├── anonymize
│ ├── payloaddrop.xml
│ ├── record_anonym.xml
│ ├── packet_anonym.xml
│ └── dbanon.xml
├── dtls
│ └── dtls_printer.xml
├── netflow
│ └── netflow-converter.xml
├── filter
│ ├── statefilter.xml
│ └── connfilter.xml
├── file
│ └── filereader.xml
├── idmef_templates
│ ├── rbsdetector_template.xml
│ ├── datafilter_template.xml
│ ├── trwportscan_template.xml
│ ├── trwportscan_example.xml
│ └── p2pdetector_template.xml
├── psamp-export.xml
└── flowinspector
│ └── flowinspector_exporter.xml
├── .gitmodules
├── dev
├── playbook.yml
├── Vagrantfile
├── README.md
└── roles
│ └── base
│ └── tasks
│ └── main.yml
├── docs
├── ipfixlolib
│ └── README.ipfixlolib
└── README
├── cmake
└── modules
│ ├── Findcppcheck.cpp
│ ├── FindGSL.cmake
│ ├── FindSctp.cmake
│ └── FindRedis.cmake
├── tools
└── iana_ipfix_parser
│ └── ipfix-information-element-data-types.csv
└── .gitignore
/INSTALL:
--------------------------------------------------------------------------------
1 | Installation instructions can be found in the README file.
2 |
--------------------------------------------------------------------------------
/src/tests/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | SUBDIRS(
2 | vermonttest
3 | ipfixlolib
4 | )
5 |
--------------------------------------------------------------------------------
/configs/mongo/test.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/configs/mongo/test.pcap
--------------------------------------------------------------------------------
/src/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | SUBDIRS(
2 | osdep
3 | core
4 | common
5 | modules
6 | tests
7 | )
8 |
--------------------------------------------------------------------------------
/src/common/anon/README:
--------------------------------------------------------------------------------
1 | These files where imported from pktanon (http://www.tm.uka.de/pktanon)
2 |
--------------------------------------------------------------------------------
/.gitmodules:
--------------------------------------------------------------------------------
1 | [submodule "docs/wiki"]
2 | path = docs/wiki
3 | url = git://github.com/tumi8/vermont.wiki.git
4 |
--------------------------------------------------------------------------------
/configs/oracle/oracletest.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/configs/oracle/oracletest.pcap
--------------------------------------------------------------------------------
/dev/playbook.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: all
3 | become_user: root
4 | become: true
5 | roles:
6 | - base
7 |
--------------------------------------------------------------------------------
/docs/ipfixlolib/README.ipfixlolib:
--------------------------------------------------------------------------------
1 | example programs using ipfixlolib can be found in
2 | src/tests/ipfixlolib
3 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/VermontTest.h:
--------------------------------------------------------------------------------
1 | #if !defined(VERMONTTEST_H)
2 | #define VERMONTTEST_H
3 |
4 |
5 |
6 | #endif
7 |
--------------------------------------------------------------------------------
/src/osdep/linux/sysinfo.h:
--------------------------------------------------------------------------------
1 | #ifndef SYSINFO_H_
2 | #define SYSINFO_H_
3 |
4 |
5 | unsigned long long getHertzValue();
6 |
7 | #endif
8 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/exp_output/pcap_export:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/exp_output/pcap_export
--------------------------------------------------------------------------------
/configs/signatures/HTTP:
--------------------------------------------------------------------------------
1 | TOKEN
2 | HTTP
3 | SUPPORT
4 | 0.50000
5 | TOKEN
6 | GET
7 | SUPPORT
8 | 0.50000
9 | THRESHOLD
10 | 1.0
11 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/exp_output/connectionfilter:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/exp_output/connectionfilter
--------------------------------------------------------------------------------
/src/tests/vermonttest/data/connectionfiltertest.pcap:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/data/connectionfiltertest.pcap
--------------------------------------------------------------------------------
/src/tests/vermonttest/exp_output/state_connectionfilter:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/exp_output/state_connectionfilter
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/incorrect_message_length.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/incorrect_message_length.ipfix
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/two_correct_data_templates.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/two_correct_data_templates.ipfix
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/template_set_length_too_small.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/template_set_length_too_small.ipfix
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/correct_withdraw_all_templates.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/correct_withdraw_all_templates.ipfix
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/two_correct_templates_in_one_set.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/two_correct_templates_in_one_set.ipfix
--------------------------------------------------------------------------------
/configs/signatures/signature_with_SIGNATUREID:
--------------------------------------------------------------------------------
1 | SIGNATUREID
2 | HTTP reply
3 | TOKEN
4 | HTTP
5 | SUPPORT
6 | 0.50000
7 | TOKEN
8 | 200 OK
9 | SUPPORT
10 | 0.50000
11 | THRESHOLD
12 | 1.0
13 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/template_record_field_number_too_big.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/template_record_field_number_too_big.ipfix
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/two_correct_data_templates_withdrawals.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/two_correct_data_templates_withdrawals.ipfix
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/correct_variable_length_template_and_data.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/correct_variable_length_template_and_data.ipfix
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/template_set_length_exceeds_message_boundary.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/template_set_length_exceeds_message_boundary.ipfix
--------------------------------------------------------------------------------
/src/common/ipfixlolib/Makefile.am:
--------------------------------------------------------------------------------
1 | noinst_LIBRARIES=libipfixlo.a
2 |
3 | libipfixlo_a_SOURCES=encoding.c encoding.h ipfixlolib.c ipfixlolib.h ipfix_names.c ipfix_names.h
4 |
5 | AM_CFLAGS=-I$(top_srcdir) -Wall -Werror
6 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/README:
--------------------------------------------------------------------------------
1 | IPFIX Test Packets
2 | =================
3 |
4 | Use netcat (nc) to send them to the UDP (test) collector.
5 |
6 | Use hex editor (e.g., ghex) to conveniently create your own packets.
7 |
8 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/correct_data_template_with_variable_length_fixed_data.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/correct_data_template_with_variable_length_fixed_data.ipfix
--------------------------------------------------------------------------------
/src/tests/vermonttest/testpackets/variable_length_template_and_data_exceeding_message_boundary.ipfix:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/tumi8/vermont/HEAD/src/tests/vermonttest/testpackets/variable_length_template_and_data_exceeding_message_boundary.ipfix
--------------------------------------------------------------------------------
/configs/udp_printer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | UDP
5 |
6 | 2
7 |
8 |
9 |
10 |
11 |
12 |
--------------------------------------------------------------------------------
/src/common/Makefile.am:
--------------------------------------------------------------------------------
1 | noinst_LIBRARIES=libcommon.a
2 |
3 | libcommon_a_SOURCES=\
4 | TimeoutSemaphore.h TimeoutSemaphore.cpp \
5 | CountingSemaphore.h CountingSemaphore.cpp \
6 | msg.h msg.cc \
7 | StatisticsManager.h StatisticsManager.cpp
8 |
9 | AM_CXXFLAGS=-Wall -Werror
10 |
--------------------------------------------------------------------------------
/src/core/CfgNode.cpp:
--------------------------------------------------------------------------------
1 | #include "CfgNode.h"
2 |
3 | CfgNode::CfgNode(Graph* g, unsigned int id)
4 | : Node(g, id), cfg(NULL)
5 | {
6 | }
7 |
8 | CfgNode::~CfgNode()
9 | {
10 | if (cfg)
11 | delete cfg;
12 | }
13 |
14 | void CfgNode::setCfg(Cfg* config)
15 | {
16 | cfg = config;
17 | }
18 |
--------------------------------------------------------------------------------
/configs/sctp_printer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SCTP
5 | 4433
6 |
7 | 2
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/configs/interop/sctp_collector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SCTP
5 | 4433
6 |
7 | 2
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/test_concentrator.h:
--------------------------------------------------------------------------------
1 | #if !defined(TESTCONCENTRATOR_H)
2 | #define TESTCONCENTRATOR_H
3 |
4 | #include "TestSuiteBase.h"
5 |
6 | class ConcentratorTestSuite : public Test
7 | {
8 | public:
9 | ConcentratorTestSuite();
10 |
11 | virtual TestResult execTest();
12 | };
13 |
14 | #endif
15 |
--------------------------------------------------------------------------------
/src/core/Node.cpp:
--------------------------------------------------------------------------------
1 | #include "Node.h"
2 | #include "Graph.h"
3 |
4 | #include
5 |
6 | Node::Node(Graph *g, unsigned int id) : graph(g), id(id) { }
7 |
8 | Node::~Node() { }
9 |
10 | unsigned int Node::getID()
11 | {
12 | return id;
13 | }
14 |
15 | void Node::setID(unsigned int id)
16 | {
17 | this->id = id;
18 | }
19 |
--------------------------------------------------------------------------------
/src/core/GraphInstanceSupplier.cpp:
--------------------------------------------------------------------------------
1 | #include "GraphInstanceSupplier.h"
2 |
3 |
4 |
5 | void GraphInstanceSupplier::lockGraph()
6 | {
7 | mutex.lock();
8 | }
9 |
10 | void GraphInstanceSupplier::unlockGraph()
11 | {
12 | mutex.unlock();
13 | }
14 |
15 | bool GraphInstanceSupplier::tryLockGraph()
16 | {
17 | return mutex.try_lock();
18 | }
19 |
--------------------------------------------------------------------------------
/cmake/modules/Findcppcheck.cpp:
--------------------------------------------------------------------------------
1 | /**
2 | * \file Findcppcheck.cpp
3 | * \brief Dummy C++ source file used by CMake module Findcppcheck.cmake
4 | *
5 | * \author
6 | * Ryan Pavlik, 2009-2010
7 | *
8 | * http://academic.cleardefinition.com/
9 | *
10 | */
11 |
12 |
13 |
14 | int main(int argc, char* argv[]) {
15 | return 0;
16 | }
17 |
--------------------------------------------------------------------------------
/src/common/Misc.cpp:
--------------------------------------------------------------------------------
1 | #include "Misc.h"
2 |
3 | #ifndef _GNU_SOURCE
4 | size_t strnlen(const char* s, size_t maxlen)
5 | {
6 | size_t len = 0;
7 | if (maxlen == 0 || !s) {
8 | return 0;
9 | }
10 |
11 | do {
12 | len++;
13 | if (len == maxlen) {
14 | return maxlen;
15 | }
16 | s++;
17 | } while (!s);
18 |
19 | return len;
20 | }
21 | #endif
22 |
23 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/BloomFilterTest.h:
--------------------------------------------------------------------------------
1 | #ifdef HAVE_CONNECTION_FILTER
2 |
3 | #ifndef _BLOOMFILTER_TEST_H_
4 | #define _BLOOMFILTER_TEST_H_
5 |
6 | #include "TestSuiteBase.h"
7 |
8 | class BloomFilterTestSuite : public Test
9 | {
10 | public:
11 | BloomFilterTestSuite();
12 | virtual TestResult execTest();
13 | };
14 |
15 |
16 | #endif
17 |
18 | #endif
19 |
--------------------------------------------------------------------------------
/src/common/ipfixlolib/TODO:
--------------------------------------------------------------------------------
1 | -careful mem-freeing in deinit_exporter()
2 | -free all memory, also from templates, ...
3 |
4 | -decide endianess and make htonll/ntoll in encoding.c a noop,
5 | if big-endian machine
6 | -get info from autoconf OR via ??
7 |
8 | -make API _strictly_ host byte order; automatically convert for internal use
9 | where necessary
10 |
11 |
--------------------------------------------------------------------------------
/src/core/CfgNode.h:
--------------------------------------------------------------------------------
1 | #ifndef CFGNODE_H_
2 | #define CFGNODE_H_
3 |
4 | #include "Cfg.h"
5 | #include "Node.h"
6 |
7 | class CfgNode
8 | : public Node
9 | {
10 | public:
11 | CfgNode(Graph* g, unsigned int id);
12 | virtual ~CfgNode();
13 |
14 | void setCfg(Cfg*);
15 | Cfg* getCfg() { return cfg; }
16 | private:
17 | Cfg* cfg;
18 | };
19 |
20 | #endif /*CFGNODE_H_*/
21 |
--------------------------------------------------------------------------------
/src/core/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ADD_LIBRARY(core
2 | Cfg.cpp
3 | CfgNode.cpp
4 | Connector.cpp
5 | Graph.cpp
6 | GraphInstanceSupplier.cpp
7 | MainSignalHandler.cpp
8 | Module.cpp
9 | SensorManager.cpp
10 | Node.cpp
11 | XMLAttribute.cpp
12 | XMLElement.cpp
13 | XMLDocument.cpp
14 | XMLNode.cpp
15 | XMLTextNode.cpp
16 | )
17 |
18 | add_cppcheck(core STYLE POSSIBLE_ERROR)
19 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/ConnectionFilterTest.h:
--------------------------------------------------------------------------------
1 | #ifdef HAVE_CONNECTION_FILTER
2 |
3 | #ifndef _CONNECTION_FILTER_TEST_H_
4 | #define _CONNECTION_FILTER_TEST_H_
5 |
6 | #include "TestSuiteBase.h"
7 |
8 | class ConnectionFilterTestSuite : public Test
9 | {
10 | public:
11 | ConnectionFilterTestSuite();
12 | virtual TestResult execTest();
13 | };
14 |
15 | #endif
16 |
17 | #endif
18 |
--------------------------------------------------------------------------------
/configs/interop/simple_udp_collector.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | SCTP
5 | 4711
6 |
7 | 2
8 |
9 |
10 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/docs/README:
--------------------------------------------------------------------------------
1 | wiki/ModuleConfiguration.md contains Vermont's module configuration in
2 | the Markdown Markup language.
3 |
4 | Update this page whenever you make any changes to the configuration
5 | subsystem of vermont. The directory wiki is a git submodule that
6 | points directly to the wiki on the website, so you do not have to
7 | update both places.
8 |
9 |
10 | Lothar Braun, 20.02.2012
11 |
--------------------------------------------------------------------------------
/configs/analysis/signature-detection.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UDP
6 | 1500
7 |
8 | 5
9 |
10 |
11 |
12 | ./configs/signatures
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/common/ipfixlolib/ipfixlolib_config.h:
--------------------------------------------------------------------------------
1 | #ifndef IPFIXLOLIB_CONFIG_H
2 | #define IPFIXLOLIB_CONFIG_H
3 |
4 | #include
5 |
6 | typedef struct {
7 | uint16_t mtu; /*!< Maximum transmission unit (MTU).
8 | If set to 0, PMTU discovery will be used.
9 | (Only available on the Linux platform)
10 | Applies to UDP and DTLS over UDP only. */
11 | } ipfix_aux_config_udp;
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/src/common/hmacsha1/sha1_hmac.h:
--------------------------------------------------------------------------------
1 | #ifndef __SHA1_HMAC_H
2 | #define __SHA1_HMAC_H
3 |
4 | namespace HmacSha1 {
5 |
6 | void sha1_hmac (char *dest, char *key, size_t klen, char *text, size_t tlen);
7 | void sha1_hmac_96 (char *dest, char *key, size_t klen, char *text, size_t tlen);
8 |
9 | #define SHA1HMAC_LEN 20
10 | #define SHA1HMAC96_LEN 12
11 |
12 | } // namespace HmacSha1
13 |
14 | #endif // __SHA1_HMAC_H
15 |
--------------------------------------------------------------------------------
/src/common/anon/CrpytoPanInfoElements.h:
--------------------------------------------------------------------------------
1 | #ifndef _CRYPTOPANINFOELEMENTS_H_
2 | #define _CRYPTOPANINFOELEMENTS_H_
3 |
4 |
5 | #include
6 | #include
7 |
8 |
9 | typedef struct {
10 | std::string fromNet;
11 | std::string toNet;
12 | std::string cidr;
13 | } map_info;
14 |
15 | typedef struct {
16 | uint32_t fromNet;
17 | uint32_t toNet;
18 | uint8_t cidr;
19 | } cpan_net_info;
20 |
21 |
22 | #endif
23 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/PrinterModule.cpp:
--------------------------------------------------------------------------------
1 | #include "PrinterModule.h"
2 |
3 | PrinterModule::~PrinterModule()
4 | {
5 | printf("PrinterModule received %u packets!\n", count);
6 | }
7 |
8 | void PrinterModule::receive(Packet* p)
9 | {
10 | if (do_print)
11 | msg(LOG_CRIT, "%s: packet %lu received", prefix.c_str(), p->totalPacketsReceived);
12 | count++;
13 |
14 | if (isEndPoint) {
15 | p->removeReference();
16 | } else
17 | send(p);
18 | }
19 |
--------------------------------------------------------------------------------
/configs/pcapexport.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | nfe0
4 | ip
5 | 128
6 | 2
7 |
8 |
9 |
10 | 10
11 | 3
12 |
13 |
14 |
15 | vermont.pcap
16 | 128
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/core/XMLTextNode.cpp:
--------------------------------------------------------------------------------
1 | #include "XMLNode.h"
2 |
3 | XMLTextNode::XMLTextNode(xmlNodePtr ptr)
4 | : XMLNode(ptr)
5 | {
6 | }
7 |
8 | XMLTextNode::~XMLTextNode()
9 | {
10 | }
11 |
12 | const std::string XMLTextNode::getContent() const
13 | {
14 | const char* content = (const char*)cobj()->content;
15 | if (!content)
16 | return "";
17 |
18 | return content;
19 | }
20 |
21 | bool XMLTextNode::isBlank() const
22 | {
23 | return xmlIsBlankNode(cobj());
24 | }
25 |
--------------------------------------------------------------------------------
/src/osdep/osx/sem_timedwait.h:
--------------------------------------------------------------------------------
1 | #ifndef __OSX_SEM_TIMEDWAIT_H_
2 | #define __OSX_SEM_TIMEDWAIT_H_
3 |
4 | #ifdef __APPLE__
5 |
6 | // Mac OS X does not have a working implementation of sem_init, sem_timedwait, ...
7 | // use Mach semaphores instead
8 | #include
9 | #include
10 | #include
11 |
12 | // Mac OS X timedwait wrapper
13 | int sem_timedwait_mach(semaphore_t* sem, long timeout_ms);
14 |
15 | #endif
16 | #endif
17 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/TestSuiteBase.cpp:
--------------------------------------------------------------------------------
1 | #include "TestSuiteBase.h"
2 |
3 |
4 | Test::~Test()
5 | {
6 | }
7 |
8 | TestSuite::TestSuite()
9 | {
10 |
11 | }
12 |
13 | TestSuite::~TestSuite()
14 | {
15 | for (unsigned i = 0; i != tests.size(); ++i) {
16 | delete tests[i];
17 | }
18 | }
19 |
20 | void TestSuite::add(Test* t)
21 | {
22 | tests.push_back(t);
23 | }
24 |
25 | void TestSuite::run()
26 | {
27 | for (unsigned i = 0; i != tests.size(); ++i) {
28 | tests[i]->execTest();
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/modules/packet/Packet.cpp:
--------------------------------------------------------------------------------
1 | /*
2 | * PSAMP Reference Implementation
3 | *
4 | * Packet.cpp
5 | *
6 | * Encapsulates a captured packet with simple, thread-aware
7 | * reference-(usage-) counting.
8 | *
9 | * Author: Michael Drueing
10 | *
11 | */
12 |
13 | /*
14 | changed by: Ronny T. Lampert, 2005, for VERMONT
15 | */
16 |
17 | #include "Packet.h"
18 |
19 |
20 | // keeps track on how many packets we received until now
21 | unsigned long Packet::totalPacketsReceived = 0;
22 |
--------------------------------------------------------------------------------
/src/common/anon/CMakeLists.txt:
--------------------------------------------------------------------------------
1 | ADD_LIBRARY(anon
2 | AnonModule.cpp
3 | RandomNumberGenerator.cpp
4 | AnonBroadcastHandler.cpp
5 | AnonBytewise.cpp
6 | AnonBytewiseHashHmacSha1.cpp
7 | AnonBytewiseHashSha1.cpp
8 | AnonConstOverwrite.cpp
9 | AnonContinuousChar.cpp
10 | AnonCryptoPan.cpp
11 | AnonCryptoPanPrefix.cpp
12 | AnonHashHmacSha1.cpp
13 | AnonHashSha1.cpp
14 | AnonIdentity.cpp
15 | AnonPrimitive.cpp
16 | AnonRandomize.cpp
17 | AnonShorten.cpp
18 | AnonShuffle.cpp
19 | AnonWhitenoise.cpp
20 | )
21 |
22 |
--------------------------------------------------------------------------------
/configs/interop/filereader_to_printer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | 1
4 |
5 |
6 |
7 | /home/phil/Documents/ipfixdata
8 | test
9 | true
10 | 15
11 | 5
12 |
13 |
14 |
15 |
16 |
17 |
18 |
--------------------------------------------------------------------------------
/configs/anonymize/payloaddrop.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | nfe0
4 | ip
5 | 128
6 | 2
7 |
8 |
9 |
10 |
11 | 3
12 |
13 |
14 |
15 | 10
16 | 4
17 |
18 |
19 |
20 | vermont.pcap
21 | 128
22 |
23 |
24 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/ConfigTester.h:
--------------------------------------------------------------------------------
1 | #ifndef _CONFIG_TESTER_H_
2 | #define _CONFIG_TESTER_H_
3 |
4 | #include "TestSuiteBase.h"
5 |
6 | #include
7 | #include
8 |
9 | class ConfigTester : public Test
10 | {
11 | public:
12 | ConfigTester(std::string config_dir);
13 | ~ConfigTester();
14 | virtual TestResult execTest();
15 |
16 | private:
17 | void test_Rules_parseProtoPattern();
18 | void testConfig(const std::string& configFile);
19 | std::string config_dir;
20 | std::vector configFiles;
21 | };
22 |
23 | #endif
24 |
--------------------------------------------------------------------------------
/src/common/VermontControl.h:
--------------------------------------------------------------------------------
1 | #ifndef VERMONTCONTROL_H_
2 | #define VERMONTCONTROL_H_
3 |
4 | #ifdef __APPLE__
5 | #include
6 | #else
7 | #include
8 | #endif
9 |
10 | #include "common/TimeoutSemaphore.h"
11 |
12 | extern bool run_program;
13 | extern bool reload_config;
14 |
15 | #ifdef __APPLE__
16 | extern semaphore_t mainSemaphore;
17 | #else
18 | extern sem_t mainSemaphore;
19 | #endif
20 | extern TimeoutSemaphore timeoutsem;
21 |
22 | void initiateShutdown();
23 | void wakeupMainThread();
24 |
25 | #endif /*VERMONTCONTROL_H_*/
26 |
--------------------------------------------------------------------------------
/src/core/XMLAttribute.cpp:
--------------------------------------------------------------------------------
1 | #include "XMLAttribute.h"
2 |
3 | XMLAttribute::XMLAttribute(xmlNodePtr ptr)
4 | :XMLNode(ptr)
5 | {
6 | }
7 |
8 | XMLAttribute::~XMLAttribute()
9 | {
10 | }
11 |
12 | std::string XMLAttribute::getName() const
13 | {
14 | if (cobj()->name)
15 | return (const char*)cobj()->name;
16 |
17 | return "";
18 | }
19 |
20 | std::string XMLAttribute::getValue() const
21 | {
22 | std::string ret;
23 | xmlChar *v = xmlGetProp(cobj()->parent, cobj()->name);
24 | ret = (v ? (const char*)v : "");
25 | xmlFree(v);
26 | return ret;
27 |
28 | }
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/common/SignalInterface.h:
--------------------------------------------------------------------------------
1 | #ifndef _SIGNALINTERFACE_
2 | #define _SIGNALINTERFACE_
3 |
4 |
5 | class SignalInterface
6 | {
7 | public:
8 | SignalInterface() {}
9 | virtual void handleSigAlrm(int sig) {}
10 | virtual void handleSigChld(int sig) {}
11 | virtual void handleSigHup(int sig) {}
12 | virtual void handleSigInt(int sig) {}
13 | virtual void handleSigPipe(int sig) {}
14 | virtual void handleSigQuit(int sig) {}
15 | virtual void handleSigTerm(int sig) {}
16 | virtual void handleSigUsr1(int sig) {}
17 | virtual void handleSigUsr2(int sig) {}
18 | };
19 | #endif
20 |
--------------------------------------------------------------------------------
/src/core/MainSignalHandler.h:
--------------------------------------------------------------------------------
1 | #ifndef _MAIN_SIGNAL_HANDLER
2 | #define _MAIN_SIGNAL_HANDLER
3 |
4 | #include "common/SignalInterface.h"
5 | #include "common/SignalHandler.h"
6 |
7 | #include "common/VermontControl.h"
8 | #include "modules/ConfigManager.hpp"
9 |
10 | class MainSignalHandler : public SignalInterface
11 | {
12 |
13 | public:
14 | MainSignalHandler();
15 | virtual void handleSigUsr1(int x);
16 | virtual void handleSigInt(int x);
17 | virtual void handleSigTerm(int x);
18 | virtual void handleSigHup(int x);
19 | virtual void handleSigUsr2(int x);
20 | };
21 | #endif
22 |
--------------------------------------------------------------------------------
/src/common/ipfixlolib/ipfixlolib_private.h:
--------------------------------------------------------------------------------
1 | #ifndef IPFIXLOLIB_PRIVATE_H
2 | #define IPFIXLOLIB_PRIVATE_H
3 |
4 | #include "ipfixlolib.h"
5 | #include "ipfixlolib_config.h"
6 |
7 | int enable_pmtu_discovery(int s);
8 | int update_collector_mtu(ipfix_exporter *exporter, ipfix_receiving_collector *col);
9 | void ipfix_update_header(ipfix_exporter *p_exporter, ipfix_receiving_collector *collector, ipfix_sendbuffer *sendbuf);
10 | void set_mtu_config(ipfix_receiving_collector *col, ipfix_aux_config_udp *aux_config_udp);
11 | void update_exporter_max_message_size(ipfix_exporter *exporter);
12 |
13 | #endif
14 |
--------------------------------------------------------------------------------
/src/common/hmacsha1/sha1.h:
--------------------------------------------------------------------------------
1 | #ifndef __SHA1_H
2 | #define __SHA1_H
3 |
4 | #include
5 |
6 | namespace Sha1 {
7 |
8 | #define SHA1_DIGLEN 20
9 |
10 | typedef struct {
11 | uint32_t state[5];
12 | uint32_t count[2];
13 | unsigned char buffer[64];
14 | } SHA1_CTX;
15 |
16 | void SHA1Transform (uint32_t state[5], unsigned char buffer[64]);
17 | void SHA1_Init (SHA1_CTX* context);
18 | void SHA1_Update (SHA1_CTX* context, unsigned char* data, unsigned int len);
19 | void SHA1_Final (unsigned char digest[20], SHA1_CTX* context);
20 |
21 | } // namespace Sha1
22 |
23 | #endif /* __SHA1_H */
24 |
25 |
--------------------------------------------------------------------------------
/dev/Vagrantfile:
--------------------------------------------------------------------------------
1 | # -*- mode: ruby -*-
2 | # vi: set ft=ruby :
3 |
4 | Vagrant.configure("2") do |config|
5 | config.vm.hostname = "vermont"
6 | config.vm.box = "debian/contrib-jessie64"
7 | config.vm.box_url = "https://app.vagrantup.com/debian/boxes/contrib-jessie64"
8 | config.vm.network "public_network"
9 | config.vm.synced_folder "../", "/vermont"
10 |
11 | config.vm.provision "shell", inline: "apt-get -y install python3" # For ansible to function
12 | config.vm.provision "ansible" do |ansible|
13 | ansible.playbook = "playbook.yml"
14 | ansible.extra_vars = { ansible_python_interpreter: "/usr/bin/python3" }
15 | end
16 | end
17 |
--------------------------------------------------------------------------------
/configs/dtls/dtls_printer.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | configs/example_certs/collector_cert.pem
4 | configs/example_certs/collector_key.pem
5 | configs/example_certs/vermontCA.pem
6 | /etc/ssl/certs
7 |
8 |
9 | DTLS_OVER_UDP
10 |
11 |
12 |
13 | 2
14 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/CounterDestination.h:
--------------------------------------------------------------------------------
1 | #ifndef COUNTERDESTINATION_H
2 | #define COUNTERDESTINATION_H
3 |
4 | /**
5 | * class which counts incoming elements
6 | * used for tests where a chain of module is checked
7 | */
8 | template
9 | class CounterDestination : public Destination
10 | {
11 | public:
12 | CounterDestination() :
13 | count(0)
14 | {
15 | }
16 |
17 | virtual void receive(T t)
18 | {
19 | t->removeReference();
20 | count++;
21 | }
22 |
23 | unsigned int getCount()
24 | {
25 | return count;
26 | }
27 |
28 | void reset()
29 | {
30 | count = 0;
31 | }
32 |
33 | private:
34 | unsigned int count;
35 | };
36 |
37 | #endif
38 |
--------------------------------------------------------------------------------
/src/core/Node.h:
--------------------------------------------------------------------------------
1 | //
2 | // C++ Interface: node
3 | //
4 | // Description:
5 | //
6 | //
7 | // Author: Peter Baumann , (C) 2007
8 | //
9 | // Copyright: See COPYING file that comes with this distribution
10 | //
11 | //
12 | #ifndef NODE_H
13 | #define NODE_H
14 |
15 | /**
16 | @author Peter Baumann
17 | */
18 |
19 | class Graph;
20 |
21 | class Node {
22 | friend class Graph;
23 | public:
24 | Node(Graph *g, unsigned int id);
25 | ~Node();
26 |
27 | unsigned int getID();
28 |
29 |
30 | protected:
31 | void setID(unsigned int);
32 |
33 | private:
34 | Graph *graph;
35 | unsigned int id;
36 | };
37 |
38 | #endif
39 |
--------------------------------------------------------------------------------
/configs/netflow/netflow-converter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | UDP
5 | 3000
6 |
7 | 0
8 | 2
9 |
10 |
11 |
12 | true
13 | 3
14 |
15 |
16 |
17 | 1000
18 | 8
19 |
20 |
21 |
22 | tree
23 |
24 |
25 |
26 |
--------------------------------------------------------------------------------
/configs/interop/file_udp_export.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | /home/phil/Documents/ipfixdata
5 | test
6 | true
7 | 15
8 | 7
9 |
10 |
11 |
12 | 1
13 | 8
14 |
15 |
16 |
17 |
18 | 195.113.231.139
19 | UDP
20 | 4711
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/core/GraphInstanceSupplier.h:
--------------------------------------------------------------------------------
1 | #ifndef GRAPHINSTANCESUPPLIER_H_
2 | #define GRAPHINSTANCESUPPLIER_H_
3 |
4 | #include "Graph.h"
5 |
6 | #include "common/Mutex.h"
7 |
8 |
9 | /**
10 | * manages lock for module graph, as it is accessed by the main thread
11 | * and the SensorManager simultaneously
12 | * this interface is implemented by ConfigManager
13 | */
14 | class GraphInstanceSupplier
15 | {
16 | public:
17 | virtual ~GraphInstanceSupplier() {}
18 |
19 | virtual void lockGraph();
20 | virtual bool tryLockGraph();
21 | virtual void unlockGraph();
22 | virtual Graph* getGraph() = 0;
23 |
24 | private:
25 | Mutex mutex;
26 | };
27 |
28 | #endif /*GRAPHINSTANCESUPPLIER_H_*/
29 |
--------------------------------------------------------------------------------
/src/core/XMLElement.h:
--------------------------------------------------------------------------------
1 | #ifndef XMLELEMENT_H_
2 | #define XMLELEMENT_H_
3 |
4 | #include
5 | #include
6 |
7 | #include "core/XMLNode.h"
8 | #include "core/XMLAttribute.h"
9 |
10 | #include
11 | #include
12 |
13 | class XMLAttribute;
14 |
15 | class XMLElement: public XMLNode
16 | {
17 | public:
18 | typedef std::vector XMLAttributeSet;
19 |
20 | XMLElement(xmlNodePtr ptr);
21 | virtual ~XMLElement();
22 |
23 | XMLAttributeSet getAttributes();
24 | XMLAttribute* getAttribute(const std::string& name);
25 |
26 | private:
27 | XMLAttributeSet getAttribHelper(const std::string&);
28 | };
29 |
30 | #endif /*XMLNODE_H_*/
31 |
--------------------------------------------------------------------------------
/configs/interop/file_sctp_export.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | /home/phil/Documents/ipfixdata
5 | test
6 | true
7 | 15
8 | 7
9 |
10 |
11 |
12 | 1
13 | 8
14 |
15 |
16 |
17 |
18 | 195.113.231.139
19 | SCTP
20 | 4711
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/core/XMLAttribute.h:
--------------------------------------------------------------------------------
1 | #ifndef XMLATTRIBUTE_H_
2 | #define XMLATTRIBUTE_H_
3 |
4 | /**
5 | @author Peter Baumann
6 | */
7 |
8 | #include "XMLNode.h"
9 |
10 | #include
11 |
12 | class XMLAttribute : public XMLNode
13 | {
14 | public:
15 | XMLAttribute(xmlNodePtr ptr);
16 | virtual ~XMLAttribute();
17 |
18 | std::string getName() const;
19 | std::string getValue() const;
20 |
21 | protected:
22 | inline xmlAttrPtr cobj()
23 | {
24 | return reinterpret_cast(XMLNode::cobj());
25 | }
26 |
27 | inline xmlAttrPtr cobj() const
28 | {
29 | return reinterpret_cast(XMLNode::cobj());
30 | }
31 | };
32 |
33 | #endif /*XMLATTRIBUTE_H_*/
34 |
--------------------------------------------------------------------------------
/dev/README.md:
--------------------------------------------------------------------------------
1 | # VERMONT VM
2 |
3 | This vagrant setup provides an entry point for directly testing vermont without
4 | further setup on a local machine.
5 |
6 | It creates a VM which automatically installs all necessary dependecies for
7 | vermont and builds the currently checked out version of it.
8 | The repository is available in the VM via /vermont
9 |
10 | ## Setup
11 |
12 | Install Vagrant and Ansible each with version >= 2.0.
13 | Then, in this folder
14 |
15 | ``` shell
16 | $ vagrant up
17 | ...wait...
18 | $ vagrant ssh
19 | # cd /vermont
20 | # ./vermont -f
21 | ```
22 | ## Build Configuration
23 |
24 | The build process, its steps and parameters can be configured in
25 | roles/base/tasks/main.yml
26 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/test_configs/pcap_export:
--------------------------------------------------------------------------------
1 |
2 |
3 | 2
4 |
5 |
6 |
7 | data/connectionfiltertest.pcap
8 | ip
9 | 1
10 | 0
11 | 65535
12 | 2
13 |
14 |
15 |
16 | 10
17 | 5
18 |
19 |
20 |
21 | gen_output/pcap_export
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/configs/filter/statefilter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | sourcefile.pcap
4 | ip
5 | 65535
6 | -1
7 | 2
8 |
9 |
10 |
11 | 100
12 | 3
13 |
14 |
15 |
16 |
17 | 3
18 | 1000
19 | false
20 |
21 | 4
22 |
23 |
24 |
25 | statefilter.pcap
26 | 65535
27 |
28 |
29 |
--------------------------------------------------------------------------------
/src/common/VermontControl.cpp:
--------------------------------------------------------------------------------
1 | #include "VermontControl.h"
2 |
3 | #include "msg.h"
4 |
5 | bool run_program = true;
6 | bool reload_config = false;
7 |
8 | #ifdef __APPLE__
9 | semaphore_t mainSemaphore;
10 | #else
11 | sem_t mainSemaphore;
12 | #endif
13 | TimeoutSemaphore timeoutsem;
14 |
15 |
16 | /**
17 | * initiates shutdown of Vermont
18 | */
19 | void initiateShutdown()
20 | {
21 | run_program = false;
22 | wakeupMainThread();
23 | }
24 |
25 |
26 | void wakeupMainThread()
27 | {
28 | #ifdef __APPLE__
29 | if (semaphore_signal(mainSemaphore) != KERN_SUCCESS) THROWEXCEPTION("failed to execute sem_post");
30 | #else
31 | if (sem_post(&mainSemaphore) == -1) THROWEXCEPTION("failed to execute sem_post");
32 | #endif
33 | timeoutsem.post();
34 | }
35 |
--------------------------------------------------------------------------------
/src/core/Emitable.h:
--------------------------------------------------------------------------------
1 | #ifndef EMITABLE_H
2 | #define EMITABLE_H
3 |
4 | /**
5 | @author Peter Baumann
6 | */
7 | class Emitable {
8 | public:
9 | virtual ~Emitable() { };
10 | };
11 |
12 | /* This class is here to mark Modules to be no Source/Destination
13 | * A module has to be from type Source and Destination, but e.g. Observer is _only_
14 | * a Source and no Destination
15 | * So we derive Observer from Destination, and all our other wrapper classes
16 | * work as expected.
17 | */
18 | class NullEmitable: public Emitable
19 | {
20 | public:
21 | NullEmitable(): Emitable() { };
22 |
23 | inline void addReference(int count = 1) { };
24 | inline void removeReference() { };
25 | };
26 |
27 | #endif
28 |
29 |
--------------------------------------------------------------------------------
/cmake/modules/FindGSL.cmake:
--------------------------------------------------------------------------------
1 | #################################### Locate gsl
2 | FIND_PATH(
3 | GSL_INCLUDE_DIR
4 | gsl/gsl_cdf.h
5 | /usr/include/ /usr/include/gsl/
6 | /use/local/include/ /usr/local/include/gsl/
7 | )
8 |
9 | FIND_LIBRARY(
10 | GSL_LIBRARY
11 | NAMES gsl
12 | PATHS /usr/lib /usr/local/lib
13 | PATH_SUFFIXES gsl
14 | )
15 |
16 | FIND_LIBRARY(
17 | BLAS_LIBRARY
18 | NAMES gslcblas blas cblas
19 | PATHS /usr/lib /usr/local/lib
20 | PATH_SUFFIXES gsl blas cblas
21 | )
22 |
23 | IF (GSL_LIBRARY AND BLAS_LIBRARY)
24 | SET(GSL_LIBRARIES ${GSL_LIBRARY} ${BLAS_LIBRARY})
25 | ENDIF (GSL_LIBRARY AND BLAS_LIBRARY)
26 |
27 | IF (GSL_INCLUDE_DIR AND GSL_LIBRARIES)
28 | SET(GSL_FOUND TRUE)
29 | ENDIF (GSL_INCLUDE_DIR AND GSL_LIBRARIES)
30 |
31 |
--------------------------------------------------------------------------------
/configs/filter/connfilter.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | sourcefile.pcap
4 | ip
5 | 1518
6 | 2
7 |
8 |
9 |
10 | 100
11 | 3
12 |
13 |
14 |
15 |
16 | 3
17 | 1000
18 | 1000
19 | 3
20 | false
21 |
22 | 4
23 |
24 |
25 |
26 | connfilter.pcap
27 | 1518
28 |
29 |
30 |
--------------------------------------------------------------------------------
/src/tests/vermonttest/ReconfTest.h:
--------------------------------------------------------------------------------
1 | #ifndef RECONFTEST_H_
2 | #define RECONFTEST_H_
3 |
4 |
5 | #include "core/ConnectionQueue.h"
6 | #include "modules/packet/filter/FilterModule.h"
7 | #include "modules/ipfix/aggregator/IpfixAggregator.hpp"
8 | #include "core/InstanceManager.h"
9 |
10 | #include "TestSuiteBase.h"
11 |
12 | using boost::shared_ptr;
13 |
14 | class ReconfTest : public Test
15 | {
16 | public:
17 | ReconfTest();
18 | ~ReconfTest();
19 |
20 | virtual TestResult execTest();
21 | private:
22 | void normalTest();
23 | void splitterTest();
24 |
25 | void setup(bool express);
26 | void sendPacketsTo(Destination* dest, size_t numpackets);
27 | void shutdown();
28 |
29 | static InstanceManager packetManager;
30 | };
31 |
32 |
33 |
34 | #endif /*RECONFTEST_H_*/
35 |
--------------------------------------------------------------------------------
/tools/iana_ipfix_parser/ipfix-information-element-data-types.csv:
--------------------------------------------------------------------------------
1 | Value,Description,Reference
2 | 0,octetArray,[RFC5102]
3 | 1,unsigned8,[RFC5102]
4 | 2,unsigned16,[RFC5102]
5 | 3,unsigned32,[RFC5102]
6 | 4,unsigned64,[RFC5102]
7 | 5,signed8,[RFC5102]
8 | 6,signed16,[RFC5102]
9 | 7,signed32,[RFC5102]
10 | 8,signed64,[RFC5102]
11 | 9,float32,[RFC5102]
12 | 10,float64,[RFC5102]
13 | 11,boolean,[RFC5102]
14 | 12,macAddress,[RFC5102]
15 | 13,string,[RFC5102]
16 | 14,dateTimeSeconds,[RFC5102]
17 | 15,dateTimeMilliseconds,[RFC5102]
18 | 16,dateTimeMicroseconds,[RFC5102]
19 | 17,dateTimeNanoseconds,[RFC5102]
20 | 18,ipv4Address,[RFC5102]
21 | 19,ipv6Address,[RFC5102]
22 | 20,basicList,[RFC6313]
23 | 21,subTemplateList,[RFC6313]
24 | 22,subTemplateMultiList,[RFC6313]
25 | 23-255,Unassigned,
26 |
--------------------------------------------------------------------------------
/src/core/Edge.h:
--------------------------------------------------------------------------------
1 | //
2 | // C++ Interface: edge
3 | //
4 | // Description:
5 | //
6 | //
7 | // Author: Peter Baumann , (C) 2007
8 | //
9 | // Copyright: See COPYING file that comes with this distribution
10 | //
11 | //
12 | #ifndef EDGE_H
13 | #define EDGE_H
14 |
15 |
16 | /**
17 | @author Peter Baumann
18 | */
19 |
20 | class Node;
21 | class Graph;
22 |
23 |
24 | class Edge {
25 | private:
26 | Graph* graph;
27 | unsigned int id;
28 |
29 | public:
30 |
31 | Edge(Graph* g, unsigned int id) : graph(g), id(id) { };
32 | ~Edge() { }
33 |
34 | unsigned int getID() { return id; }
35 |
36 | inline Node* nodeA()
37 | {
38 | return graph->nodeA(this);
39 | }
40 |
41 | inline Node* NodeB()
42 | {
43 | return graph->nodeB(this);
44 | }
45 | };
46 |
47 | #endif
48 |
--------------------------------------------------------------------------------
/src/core/XMLDocument.h:
--------------------------------------------------------------------------------
1 | #ifndef XMLDOCUMENT_H_
2 | #define XMLDOCUMENT_H_
3 |
4 | #include "core/XMLElement.h"
5 |
6 | #include
7 |
8 | class XMLDocument
9 | {
10 | public:
11 | virtual ~XMLDocument();
12 |
13 | /** create a XMLDocument
14 | * @return A pointer the XMLDocument representing the parsed file
15 | */
16 | static XMLDocument* parse_file(const std::string& fileName);
17 |
18 | /** Return the root node.
19 | * @return A pointer to the root node if it exists, NULL otherwise.
20 | */
21 | XMLElement* getRootNode() const;
22 |
23 | private:
24 | // hide the c'tor to create instances of this object only with parse_file
25 | XMLDocument(xmlDocPtr doc);
26 |
27 | xmlDocPtr xmlDocument;
28 |
29 | struct Initializer {
30 | Initializer();
31 | };
32 |
33 | static Initializer init;
34 | };
35 |
36 | #endif /*XMLDOCUMENT_H_*/
37 |
--------------------------------------------------------------------------------
/src/modules/analysis/autofocus_iprecord.h:
--------------------------------------------------------------------------------
1 | #ifndef __autofocus_iprecord_h
2 | #define __autofocus_iprecord_h
3 |
4 | #include