Commit graph

9613 commits

Author SHA1 Message Date
Max Kellermann
e3c0da2e15 Type: remove unnecessary enum typedefs 2020-02-16 19:22:35 +01:00
Max Kellermann
b1fe483b05 Type: use C++ initializers 2020-02-16 19:22:35 +01:00
Max Kellermann
5b8bd26c72 Type: move code from BroType::BroType() to constexpr functions
Prepare to inline the constructor, which will one day be `constexpr`
(requires moving the `std::string name` field somewhere else).
2020-02-16 19:22:35 +01:00
Max Kellermann
411d048d24 Type: remove useless BroType destructor 2020-02-16 19:22:35 +01:00
Max Kellermann
4e438bf422 Obj: disallow copying BroObj
Copying a BroObj is dangerous, and should only be done with dedicated
(virtual) methods which are implemented by all derived classes.  This
commit avoids unintentional copies.
2020-02-16 19:22:35 +01:00
Max Kellermann
97f07fa727 Obj: use C++ initializers 2020-02-16 19:22:35 +01:00
Max Kellermann
2ac48ff1d4 Obj: make no_location constexpr
This ensures that the variable is initialized at compile time and may
allow the compiler to apply more initializations.
2020-02-16 19:22:35 +01:00
Jon Siwek
2a7f2e0217 Updating submodule(s).
[nomail]
2020-02-15 11:10:56 -08:00
Jon Siwek
0d97c721f2 Updating submodule(s).
[nomail]
2020-02-15 11:07:14 -08:00
Jon Siwek
11d8b8c040 Fix code format of various reporter btests 2020-02-14 22:03:11 -08:00
Jon Siwek
e896846752 Update libkqueue for a linux bugfix 2020-02-14 21:15:21 -08:00
Tim Wojtulewicz
47d813badc Merge remote-tracking branch 'MaxKellermann/eliminate_code
* MaxKellermann/eliminate_code:
  RE: make the RE_Matcher destructor non-virtual
  analyzer/protocol/smtp: remove unnecessary nullptr check
  analyzer/Manager: remove unnecessary clear() calls from destructor
  analyzer/protocol/http: remove unnecessary empty destructor
  iosource/pcap/Source: remove unused fields `last_hdr`, `last_data`
  iosource/Manager: eliminate two std::string copies
2020-02-14 16:17:31 -07:00
Jon Siwek
b1e96ab952 Fix various format specifiers 2020-02-14 11:10:41 -08:00
Tim Wojtulewicz
cf8496dc0a Merge remote-tracking branch 'MaxKellermann/includes'
* MaxKellermann/includes:
  broker: include cleanup
  file_analysis: include cleanup
  file_analysis/Analyzer: eliminate duplicate constructor
  probabilistic/Topk: include cleanup
  digest: eliminate the "Reporter.h" include
  Val: eliminate the "RE.h" include
  Val: eliminate the "BroString.h" include
  Val: eliminate the "CompHash.h" include
  Val: forward-declare class PDict, reduce includes
  Val: eliminate the "Scope.h" include
2020-02-14 10:30:13 -07:00
Jon Siwek
a5166086db Merge remote-tracking branch 'origin/topic/timw/dict-unit-tests'
* origin/topic/timw/dict-unit-tests:
  Reset the number of entries in a dict when calling Clear()
  Code cleanup in Dict.h
  Add unit testing for the public Dictionary API
2020-02-13 19:34:29 -08:00
Jon Siwek
33c13c3689 Merge remote-tracking branch 'origin/topic/timw/event-mgr-coverity'
* origin/topic/timw/event-mgr-coverity:
  Check for failure when registering event manager with iosource manager (Coverity 1419398)
2020-02-13 17:15:00 -08:00
Max Kellermann
c6ffec02fc broker: include cleanup 2020-02-13 10:12:03 +01:00
Max Kellermann
0cf5799ca6 file_analysis: include cleanup 2020-02-13 10:12:03 +01:00
Max Kellermann
653b3f43e0 file_analysis/Analyzer: eliminate duplicate constructor 2020-02-13 10:12:03 +01:00
Max Kellermann
ace11e74d2 probabilistic/Topk: include cleanup 2020-02-13 10:12:03 +01:00
Max Kellermann
cceb8a1b0c RE: make the RE_Matcher destructor non-virtual
Nobody overrides it.
2020-02-13 09:17:30 +01:00
Max Kellermann
8a74ebf2a9 analyzer/protocol/smtp: remove unnecessary nullptr check 2020-02-13 09:17:08 +01:00
Max Kellermann
87d3192d9b analyzer/Manager: remove unnecessary clear() calls from destructor 2020-02-13 09:16:33 +01:00
Max Kellermann
a8da8cb8e2 analyzer/protocol/http: remove unnecessary empty destructor 2020-02-13 09:16:25 +01:00
Max Kellermann
d1dc70c90f iosource/pcap/Source: remove unused fields last_hdr, last_data 2020-02-13 09:16:15 +01:00
Max Kellermann
4b8b6ec559 iosource/Manager: eliminate two std::string copies 2020-02-13 09:16:00 +01:00
Max Kellermann
5215f4756b digest: eliminate the "Reporter.h" include 2020-02-13 09:13:59 +01:00
Max Kellermann
c78fa4bcf9 Val: eliminate the "RE.h" include 2020-02-13 09:13:59 +01:00
Max Kellermann
e98cf0a4a0 Val: eliminate the "BroString.h" include 2020-02-13 09:13:59 +01:00
Max Kellermann
728184ea93 Val: eliminate the "CompHash.h" include 2020-02-13 09:13:59 +01:00
Tim Wojtulewicz
12230ceb83 Check for failure when registering event manager with iosource manager (Coverity 1419398) 2020-02-12 16:39:00 -08:00
Max Kellermann
4aac78cf29 Val: forward-declare class PDict, reduce includes 2020-02-12 10:10:26 +01:00
Max Kellermann
dfac4572e7 Val: eliminate the "Scope.h" include 2020-02-12 10:10:26 +01:00
Jon Siwek
20eb0e15c7 Updating CHANGES and VERSION. 2020-02-12 00:20:08 -08:00
Jon Siwek
05d7f26b85 Merge branch 'ssh_kex' of https://github.com/MaxKellermann/zeek
* 'ssh_kex' of https://github.com/MaxKellermann/zeek:
  analyzer/protocol/ssh: fix crash vulnerability after duplicate KEX packet
2020-02-12 00:04:40 -08:00
Jon Siwek
2fb9753cc5 Merge remote-tracking branch 'origin/topic/timw/clang-tidy'
* origin/topic/timw/clang-tidy:
  fixup! Use string_view for a couple of Dbg methods
  Add a couple of missing #includes that clang-tidy complains about (clang-diagnostic-error)
  Fix missing namespace that was causing a build error
  Remove unnecessary const from return value (readability-const-return-type)
  Give real variable names to SegmentProfiler objects when defining them (bugprone-unused-raii)
  Mark a few clang-tidy findings as false-positive
  Use std::move in a few places instead of copying a pass-by-value argument (performance-unnecessary-value-param)
  Use const-references in lots of places (preformance-unnecessary-value-param)
  Use string_view for a couple of Dbg methods
  Use const references over copying variables (performance-unnecessary-copy-initialization, performance-for-range-copy)
  Use single-character version of string find() (performance-faster-string-find)
  Move constructors/operators should be marked noexcept to avoid the compiler picking the copy constructor instead (performance-noexcept-move-constructor)
2020-02-11 23:51:40 -08:00
Tim Wojtulewicz
1e499b0831 Reset the number of entries in a dict when calling Clear() 2020-02-11 20:29:06 -05:00
Tim Wojtulewicz
a69463ac46 Code cleanup in Dict.h 2020-02-11 20:28:49 -05:00
Tim Wojtulewicz
817eb2fd87 Add unit testing for the public Dictionary API 2020-02-11 20:16:42 -05:00
Tim Wojtulewicz
d69d0da62e fixup! Use string_view for a couple of Dbg methods 2020-02-11 14:11:22 -08:00
Tim Wojtulewicz
da7749fc43 Add a couple of missing #includes that clang-tidy complains about (clang-diagnostic-error) 2020-02-11 14:11:22 -08:00
Tim Wojtulewicz
9bfe162cad Fix missing namespace that was causing a build error 2020-02-11 14:11:22 -08:00
Tim Wojtulewicz
66c4a93383 Remove unnecessary const from return value (readability-const-return-type) 2020-02-11 14:11:22 -08:00
Tim Wojtulewicz
c5748e4494 Give real variable names to SegmentProfiler objects when defining them (bugprone-unused-raii)
The reason behind this one is that without a real variable name, the profile objects are immediately desctructed and the profiling only happens for the small window when they were valid. If the intention is to profile the method where they were defined, this doesn't actually happen.
2020-02-11 14:11:22 -08:00
Tim Wojtulewicz
3572e38ec2 Mark a few clang-tidy findings as false-positive 2020-02-11 14:11:22 -08:00
Tim Wojtulewicz
d23b15c08f Use std::move in a few places instead of copying a pass-by-value argument (performance-unnecessary-value-param) 2020-02-11 14:11:22 -08:00
Tim Wojtulewicz
5a237d3a3f Use const-references in lots of places (preformance-unnecessary-value-param) 2020-02-11 14:11:18 -08:00
Tim Wojtulewicz
92afe64525 Use string_view for a couple of Dbg methods 2020-02-11 11:02:08 -08:00
Tim Wojtulewicz
eda1b4a23e Use const references over copying variables (performance-unnecessary-copy-initialization, performance-for-range-copy) 2020-02-11 11:02:08 -08:00
Tim Wojtulewicz
c32566420a Use single-character version of string find() (performance-faster-string-find) 2020-02-11 11:02:08 -08:00