Commit Graph

1287 Commits (8cc87025ffd06c2d685e1dee5eb2a8876b493887)

Author SHA1 Message Date
Lothar Braun 8cc87025ff
Merge pull request #136 from constcast/fuzz-target
CMake option to gracefully shutdown in case of exceptions
2020-04-27 10:22:31 +02:00
Lothar Braun 4f8d79f3a2 Introduce a new cmake option that allows graceful shutdown in case of options 2020-04-27 10:21:39 +02:00
Lothar Braun 9ff81ed021
Merge pull request #135 from constcast/fix-match-proto-parsing
Fix for parseProtoInformation
2020-04-27 10:14:47 +02:00
Lothar Braun e6924a8fb0 Added mtutest to regularly run tests 2020-04-27 10:02:29 +02:00
Lothar Braun b9d6ea35d9 Provide errors on invalid values for protocolIdentifier in aggregators 2020-04-25 15:40:07 +02:00
Lothar Braun c947c7c8e1 Reenable ConfigTester in vermonttest. Added test for parseProtoPattern 2020-04-25 15:39:11 +02:00
Philipp Urlbauer 5b2cf7bbe2 Fix logic bug found by clang10
proto can never be <0 and >255
2020-04-25 14:50:34 +02:00
Lothar Braun 6c1a175511
Merge pull request #133 from constcast/travis-bionic
Switch travis build system to Ubuntu 18.04 (Bionic)
2020-04-25 13:27:20 +02:00
Lothar Braun d36ddd6364 Fix DTLS MTU calculation for OpenSSL 1.1.0 2020-04-22 22:35:34 +02:00
Nicholas Brown e59a8a8e71 Better Boost detection in CMAKE 2020-04-12 12:39:30 +02:00
Lothar Braun d4c84e1576 Travis: Switch build container from xenial to bionic 2020-04-12 12:36:29 +02:00
Lothar Braun dc8608d5d0 Support openssl > 1.1.0 (older versions not supported) 2020-04-12 12:24:48 +02:00
Lothar Braun 3e22a8f5e9
Merge pull request #132 from nickbroon/fix_wiki_submodule
Use a wiki remote that exists
2020-04-12 11:29:53 +02:00
Nick Brown 845f5c8040 Use a wiki remote that exists
Looks like constcast repo has fallen off the internet :

fatal: remote error: access denied or repository not exported: /a/nw/ad/0c/93/1421452/254611723.wiki.git
fatal: clone of 'git://github.com/constcast/vermont.wiki.git' into submodule path '/Users/Nick/Software/vermont/docs/wiki' failed

Probably best to use tumi8 as that's the definitive uptream anyway.
2020-04-12 08:53:04 +01:00
Oliver Gasser 21095fe8f2
Merge pull request #127 from nickbroon/travis_clang_8
Travis clang 8
2019-04-04 13:38:17 +02:00
Oliver Gasser 3d3054d180
Merge pull request #126 from nickbroon/quieter_data_path_logging
Quieter data path logging
2019-04-04 12:59:00 +02:00
Nicholas Brown 654eba2a87 add clang 8 to the travis builds 2019-03-29 12:58:03 +00:00
Nicholas Brown bba706fe8c Removed unused code from Rule.cpp 2019-03-29 12:17:50 +00:00
Nicholas Brown fd82f2d280 Don't log normal behaviour in the aggregator data path 2019-03-29 12:17:50 +00:00
Nicholas Brown 0f98329a02 Don't log in the fast data path
Should not be generating logs per ipfix frame.
Use DPRINT_ functions in the critical datapath so that they disabled
by default and don't impact performance.
LOG_* should be used for interesting state that's not per
packets/frame, and DPRINTF_ used for per packet/frame logging, and
then explicitly enabled and compile time.
2019-03-29 12:17:50 +00:00
Nicholas Brown 30aedc9edf Simplify ConfigManager parsing loop 2019-03-29 12:17:50 +00:00
Oliver Gasser 32e684a36b
Merge pull request #124 from nickbroon/idiomatic_cxx
Idiomatic c++11
2019-01-21 15:23:32 +01:00
Nicholas Brown 6e660ed5ac Debug logging around IpfixReceiverZmq zpoller 2019-01-21 13:47:45 +00:00
Nicholas Brown 3302877136 Use idiomatic C++11
Modern for loop on a containers
Silences several cpp_check warnings
2019-01-21 13:47:45 +00:00
Oliver Gasser e605885030
Merge pull request #122 from nickbroon/clear_collector_stats
Allow clearing collector related stats
2018-11-30 18:06:15 +01:00
Nicholas Brown 5b0a04f59c Allow clearing collector related stats 2018-11-30 15:51:43 +00:00
Oliver Gasser 9416cb6411
Merge pull request #121 from tumi8/fix_config
Fix default config file
2018-11-29 13:53:36 +01:00
Oliver Gasser 4d1304eb7e Further simplify the config file 2018-11-29 12:34:04 +01:00
Oliver Gasser 10fc0ae7cd Fix default config file 2018-11-29 12:09:32 +01:00
Oliver Gasser 0a2fd86df2
Merge pull request #120 from tumi8/gcc8_build
Fix build on gcc8
2018-11-29 12:02:45 +01:00
Oliver Gasser 011294caa6 Fix build on gcc8 2018-11-29 11:17:12 +01:00
Oliver Gasser a61dbc4b15
Merge pull request #118 from nickbroon/xmlString_free
Don't leak the xmlString in Cfg
2018-11-08 11:48:04 +01:00
Oliver Gasser 2b47ca721d
Merge pull request #119 from nickbroon/test_tidy_compilers
Additional compiler builds for Travis
2018-11-08 11:47:32 +01:00
Nicholas Brown f4a3b38555 Add scan-build static analysis
Commented out stage showing how scan-build can be run.
It fails the build with about 50 errors.
scan-build is very conservative, producing almost no false positives,
so these are probably all real issues that need investigating.
2018-11-07 17:36:13 +00:00
Nicholas Brown 130ce8cdbf vermont does not compile with gcc 8 2018-11-07 15:27:37 +00:00
Nicholas Brown d434b92b14 Add clang 6 and 7 to travis 2018-11-07 15:26:36 +00:00
Nicholas Brown b96ea10783 Add noreturn function attributes so the SA tools give better results
scan-build from clang works better when it knows which functions don't
return. See
https://clang-analyzer.llvm.org/annotations.html#attr_noreturn

Can be run with:

scan-build cmake .
scan-build make

Currently about 40+ Static Analysis warnings
2018-11-07 12:51:44 +00:00
Nicholas Brown a795cd8c2f Don't leak the xml document in the ConfigManager
This actually deletes the object on exit.

Better would be to use proper RAII instead of using pointers for this
class data, but would involve checking if the document is shared, and
if reference or shr_ptr was needed in that case. It's probaby not
shared in which case simply RAII with class data would be work.
2018-11-05 11:22:20 +00:00
Nicholas Brown eefb9e8d61 Don't leak the xmlString in Cfg
Valgrind was reporting lots of leaks of the form:

==5048==    at 0x4C2BBAF: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==5048==    by 0x5D50D18: xmlBufCreateSize (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==5048==    by 0x5CDDD91: xmlNodeGetContent (in /usr/lib/x86_64-linux-gnu/libxml2.so.2.9.4)
==5048==    by 0x38EB01: XMLNode::getContent[abi:cxx11]() const (in /usr/sbin/vermont)
==5048==    by 0x285B62: CollectorCfg::CollectorCfg(XMLElement*, unsigned int) (in /usr/sbin/vermont)

The API guide for xmlNodeGetContent() states:

Returns: a new #xmlChar * or NULL if no content is available. It's up to the caller to free the memory with xmlFree().

So call xmlFree() after using the std:string copy constructor

Fixes #117
2018-11-05 10:56:14 +00:00
Oliver Gasser e3fb206034
Merge pull request #116 from nickbroon/print_uint8_as_string
Correct output the protocol as a string
2018-10-23 12:48:30 +02:00
Nicholas Brown 5382f46ad9 Correct output the protocol as a string
stringstream treats uint8_t as a char which in some cases may be
unprintable ascii (eg 255 might be the protocol), so explicitly print
it as a string so it can be read.
2018-10-22 14:46:27 +01:00
Oliver Gasser fe7b8475b2
Merge pull request #114 from nickbroon/ignored_key_nonkey_config
Error message when key/nonkey configuration doesn't match actual behaviour
2018-09-10 14:27:28 +02:00
Nicholas Brown 9f2b3eb7b3 Error message when key/nonkey configuration doesn't match actual behaviour
Using a 'traditional' flow definition like that below will result in:

vermont[4729]: Field bgpDestinationAsNumber configured as nonFlowKey will not be Aggregated
vermont[4729]: Field bgpSourceAsNumber configured as nonFlowKey will not be Aggregated
vermont[4729]: Field destinationIPv4PrefixLength configured as nonFlowKey will not be Aggregated
vermont[4729]: Field egressInterface configured as nonFlowKey will not be Aggregated
vermont[4729]: Field ipNextHopIPv4Address configured as nonFlowKey will not be Aggregated
vermont[4729]: Field sourceIPv4PrefixLength configured as nonFlowKey will not be Aggregated

<rule>
        <flowKey>
               <ieName>destinationIPv4Address</ieName>
               <autoAddV4PrefixLength>false</autoAddV4PrefixLength>
        </flowKey>
        <flowKey>
               <ieName>destinationTransportPort</ieName>
        </flowKey>
        <flowKey>
               <ieName>ingressInterface</ieName>
        </flowKey>
        <flowKey>
               <ieName>ipClassOfService</ieName>
        </flowKey>
        <flowKey>
               <ieName>protocolIdentifier</ieName>
        </flowKey>
        <flowKey>
               <ieName>sourceIPv4Address</ieName>
               <autoAddV4PrefixLength>false</autoAddV4PrefixLength>
        </flowKey>
        <flowKey>
               <ieName>sourceTransportPort</ieName>
        </flowKey>
        <nonFlowKey>
               <ieName>bgpDestinationAsNumber</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>bgpSourceAsNumber</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>destinationIPv4PrefixLength</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>egressInterface</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>flowEndMilliseconds</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>flowStartMilliseconds</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>ipNextHopIPv4Address</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>octetDeltaCount</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>packetDeltaCount</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>sourceIPv4PrefixLength</ieName>
        </nonFlowKey>
        <nonFlowKey>
               <ieName>tcpControlBits</ieName>
        </nonFlowKey>
</rule>
2018-09-10 12:45:26 +01:00
Oliver Gasser 26d486439d
Merge pull request #115 from nickbroon/hash_stats
statEmptyBuckets should be initialized with the number of buckets in the hashtable
2018-09-10 13:31:42 +02:00
Oliver Gasser d6d61c5a80
Merge pull request #113 from nickbroon/zmq_minor_fix
split zsock_new_sub() into zsock_new() and zsock_connect()
2018-09-10 13:29:41 +02:00
Nicholas Brown 7b6f48f18d statEmptyBuckets should be initialized with the number of buckets in the hashtable 2018-09-10 10:20:12 +01:00
Nicholas Brown 187082a788 split zsock_new_sub() into zsock_new() and zsock_connect()
This allows calls set HWM socket options to happen on an unconnected
socket, thus working round ZMQ bug https://github.com/zeromq/libzmq/issues/2228

This works with both versions of ZMQ that do and do not have the bug.
2018-09-10 10:10:10 +01:00
Oliver Gasser aceda692cf
Merge pull request #111 from nickbroon/fixes_while_debugging
Correct indentation and braces so that it's readable
2018-03-23 12:57:04 +01:00
Nicholas Brown 77f2ac4df7 Correct indentation and braces so that it's readable
And disambiguate log messages.
2018-03-23 09:24:56 +00:00
Oliver Gasser b3b27e6091
Merge pull request #109 from nickbroon/sql_fix
fix sql module
2018-03-13 13:04:02 +01:00