Commit graph

12374 commits

Author SHA1 Message Date
Vern Paxson
dd05beff50 fixed missing profiling for ?$ operator 2021-05-05 16:55:04 -07:00
Vern Paxson
72f62f398a FuncInfo now tracks priority; some tidying/widening of its accessors 2021-05-05 16:55:04 -07:00
Vern Paxson
8d2bb28f03 setting the stage for implementation of lambdas in compiled-to-C++ code 2021-05-05 16:55:04 -07:00
Vern Paxson
5efba9e115 Stmt tag for compiled-to-C++; Inliner knows to avoid it 2021-05-05 16:55:04 -07:00
Vern Paxson
8d10fd32d0 additional ScriptFunc constructor for compiled-to-C++ scripts 2021-05-05 16:55:04 -07:00
Vern Paxson
3796e2508b track current script body's priority as well as its AST 2021-05-05 16:55:04 -07:00
Vern Paxson
00d66f1ac2 method for reporting run-time errors in compiled-to-C++ scripts 2021-05-05 16:55:04 -07:00
Vern Paxson
cf79c05e3a tracking of expressions used to define/redef variables 2021-05-05 16:55:04 -07:00
Vern Paxson
1f15f53f4b VectorVal methods to leverage ZVal representation 2021-05-05 16:54:58 -07:00
Vern Paxson
e80ab06775 fix backtrace BiF to avoid iterator invalidation & support compiled code 2021-05-05 16:50:54 -07:00
Vern Paxson
1ede6a8424 accessors / friends needed for compiling-to-C++ 2021-05-05 16:50:54 -07:00
Vern Paxson
66fb3e0f56 low-level tidying / documentation tweaks 2021-05-05 16:50:29 -07:00
Tim Wojtulewicz
6454f59369 Merge remote-tracking branch 'origin/topic/timw/session-coverity'
* origin/topic/timw/session-coverity:
  Minor cleanup in IPAddr.h
  Fix a few Coverity warnings from the session manager work
2021-05-05 14:06:25 +00:00
Tim Wojtulewicz
9eebbd1633 Minor cleanup in IPAddr.h 2021-05-05 14:05:10 +00:00
Tim Wojtulewicz
36d5116628 Fix a few Coverity warnings from the session manager work
- Be explicit about setting the copied flag in session::Key. Coverity seems
  confused about when that flag is set if it gets set by default
  initialization. This should fix 1452757 and 1452759.
- Explicitly copy the fields in ConnKey instead of using memcpy. Fixes
  1452758.
2021-05-05 14:05:10 +00:00
Jon Siwek
b3fe264faf Update submodule(s) [nomail] [skip ci] 2021-05-04 18:32:54 -07:00
Johanna Amann
bfd589bc30 Split the code that handles X509 event hashing into its own file
This also improves documentation of this feature a bit.
2021-05-04 16:44:51 +01:00
Jon Siwek
932a83bb60 Merge remote-tracking branch 'origin/topic/vern/record-holes'
* origin/topic/vern/record-holes:
  switched RecordVal's to use std::optional for tracking missing fields
  added constructors for directly building ZVal's
2021-05-03 18:21:42 -07:00
Vern Paxson
09dc074a26 switched RecordVal's to use std::optional for tracking missing fields 2021-05-02 12:33:20 -07:00
Vern Paxson
e4ae853058 added constructors for directly building ZVal's 2021-05-02 12:32:40 -07:00
Jon Siwek
9e8eb30620 Add missing zeek/ prefix to a telemetry header's includes 2021-04-30 18:29:34 -07:00
zeek-bot
88b779be97 Update doc submodule [nomail] [skip ci] 2021-05-01 00:37:15 +00:00
Tim Wojtulewicz
72ba93d9a3 Merge remote-tracking branch 'origin/topic/jsiwek/gh-1534-better-duplicate-enum-error'
* origin/topic/jsiwek/gh-1534-better-duplicate-enum-error:
  GH-1534: Fix excessive coredump for duplicate enum definitions
2021-04-30 09:42:40 -07:00
Tim Wojtulewicz
ad67d810be Merge remote-tracking branch 'origin/topic/jsiwek/fix-netbios-decode-bifs'
* origin/topic/jsiwek/fix-netbios-decode-bifs:
  Fixes to `decode_netbios_name` and `decode_netbios_name_type` BIFs
2021-04-30 09:40:46 -07:00
zeek-bot
db2180c1b8 Update doc submodule [nomail] [skip ci] 2021-04-30 00:28:42 +00:00
Jon Siwek
13f3cb377f GH-1534: Fix excessive coredump for duplicate enum definitions
An adequate error message was previously reported for duplicate enum
definitions, this just now prevents trying to access it as a constant in
subsequent parsing and further generating a coredump.
2021-04-29 15:20:09 -07:00
Tim Wojtulewicz
af3814792a Merge remote-tracking branch 'origin/topic/timw/1114-sessions-manager'
* origin/topic/timw/1114-sessions-manager:
  Rename ConnID and ConnIDKey
  Remove Session prefix from some session-related classes and files
  Move session code into new directory and into zeek::session namespace
  Move SessionKey into a separate file, added comments
  Review cleanup
  Rework stats to store handles to the counters
  Rename some connection-specific methods in Session and SessionManager
  Add deprecated version of Sessions.h
  Rename NetSessions to SessionManager
  Store a single map of Sessions instead of split maps of Connections.
  Convert session stats to use the new telemetry API
  Add test for get_conn_stats BIF before reworking session stats
  Add new Session base class
  Move packet filter out of NetSessions
  Move some code out of NetSessions
2021-04-29 11:29:59 -07:00
Tim Wojtulewicz
9684624a52 Rename ConnID and ConnIDKey 2021-04-29 11:09:35 -07:00
Tim Wojtulewicz
0b7ca5e7bc Remove Session prefix from some session-related classes and files 2021-04-29 11:09:35 -07:00
Tim Wojtulewicz
18c6aaaa33 Move session code into new directory and into zeek::session namespace 2021-04-29 11:09:35 -07:00
Tim Wojtulewicz
3ee171eb2d Move SessionKey into a separate file, added comments 2021-04-29 11:09:35 -07:00
Tim Wojtulewicz
c8844677f1 Review cleanup
- Add constructors for ConnIDKey, remove BuildConnIDKey()
- Rename protocol stats classes and move to implementation file
- Rename "num" field of protocol stats to "active"
- Explicitly delete copy operations for SessionKey
- Change argument for ProtocolStats methods to const-reference
- Make key validity methods in Session not be virtual
- Rename Session::ClearKey and Session::IsKeyValid
2021-04-29 11:09:35 -07:00
Tim Wojtulewicz
ca553fda27 Rework stats to store handles to the counters 2021-04-29 11:09:35 -07:00
Tim Wojtulewicz
63fd1611ca Rename some connection-specific methods in Session and SessionManager 2021-04-29 10:59:08 -07:00
Tim Wojtulewicz
f92f2e6fd4 Add deprecated version of Sessions.h 2021-04-29 10:24:45 -07:00
Tim Wojtulewicz
db1d753b35 Rename NetSessions to SessionManager
This also includes:
- Deprecating the NetSessions name.
- Renaming the zeek::sessions global to zeek::session_mgr and deprecating the old name.
- Renaming Sessions.{h,cc} to SessionManager.{h,cc}.
2021-04-29 10:24:45 -07:00
Tim Wojtulewicz
f7e3556a67 Store a single map of Sessions instead of split maps of Connections.
This commit also includes:
- Storing the transport protocol in ConnID and ConnIDKey to allow tcp and
  udp connections from the same IP/Port combinations. This happens in the
  core.cisco-fabric-path test, for example.
- Lots of test updates. The reasons for these are two fold. First, with
  the change to only store a single map means that TCP, UDP, and ICMP
  connections are now mixed. When Zeek drains the map at shutdown, it drains
  each of those protocols together instead of separately. The second is
  because of how Sessions are stored in the map. We're now storing them
  keyed by the hash of the key stored by the Session objects, which causes
  them to again be in the map in a different order.
2021-04-29 10:24:45 -07:00
Tim Wojtulewicz
008e2cbaef Convert session stats to use the new telemetry API 2021-04-29 10:24:45 -07:00
Tim Wojtulewicz
114077fd93 Add test for get_conn_stats BIF before reworking session stats 2021-04-29 10:24:45 -07:00
Tim Wojtulewicz
8fbab9408a Add new Session base class
This is mostly code copied from the existing Connection class, as that class now
inherits from Session.
2021-04-29 10:24:45 -07:00
Tim Wojtulewicz
c752d76052 Move packet filter out of NetSessions 2021-04-29 10:24:45 -07:00
Tim Wojtulewicz
50713b3c2d Move some code out of NetSessions
- TCPStateStats update when a session is removed was moved to Connection
- Stepping Stone manager moved to a singleton object in SteppingStoneManager
2021-04-29 10:24:44 -07:00
Tim Wojtulewicz
14ffd9646f Merge remote-tracking branch 'origin/topic/bbannier/issue-1517'
* origin/topic/bbannier/issue-1517:
  Add basic testing for Geneve protocol analyzer
  GH-1517: Add Geneve decap support
2021-04-29 09:01:11 -07:00
Jon Siwek
aaabb75f66 Merge remote-tracking branch 'origin/topic/jsiwek/misc-table-stuff'
* origin/topic/jsiwek/misc-table-stuff:
  Add a fatal error condition for invalid Dictionary insertion distances
  Fix using clear_table() within an &expire_func
  Remove saving/restoring of value pointer after calling expire_func
  Avoid allocating a HashKey for no-op table expiry iterations
2021-04-28 13:49:31 -07:00
Jon Siwek
333957df22 Fix -Wsign-compare warnings in Debug{Cmds}.cc 2021-04-28 13:10:38 -07:00
Jon Siwek
ca873cdcb4 Update submodule(s) [nomail] 2021-04-28 12:53:05 -07:00
Tim Wojtulewicz
6b8699fbda Merge remote-tracking branch 'origin/topic/timw/1528-remove-queue'
* origin/topic/timw/1528-remove-queue:
  GH-1528: Remove broken Queue/PQueue class, replace with std::deque
2021-04-28 09:27:35 -07:00
Tim Wojtulewicz
9dee652444 GH-1528: Remove broken Queue/PQueue class, replace with std::deque 2021-04-28 09:26:51 -07:00
Jon Siwek
76fb1e7fd0 Fixes to decode_netbios_name and decode_netbios_name_type BIFs
Fixes to `decode_netbios_name`:

* Improve validation that input string is a NetBIOS encoding
  (32 bytes, with characters ranging from 'A' to 'P').  This helps
  prevent Undefined Behavior of left-shifting negative values.
  Invalid encodings now cause a return-value of an empty string.

* More liberal in what decoded characters are allowed.  Namely,
  spaces are now allowed (but any trailing null-bytes and spaces
  are trimmed, similar to before).

Fixes to `decode_netbios_name_type`:

* Improve validation that input string is a NetBIOS encoding
  (32 bytes, with characters ranging from 'A' to 'P').  This helps
  prevent Undefined Behavior of left-shifting negative values and
  a heap-buffer-overread when the input string is too small.
  Invalid encodings now cause a return-value of 256.
2021-04-27 15:27:04 -07:00
Benjamin Bannier
83ecbeea6d Add basic testing for Geneve protocol analyzer
The added pcap file was downloaded from an attachment to
https://gitlab.com/wireshark/wireshark/-/issues/10193 without explicit
license.
2021-04-27 11:21:29 +02:00