Commit graph

12680 commits

Author SHA1 Message Date
Benjamin Bannier
65bc817fcf Install include headers from src/3rdparty/.
This is a fixup commit for 72cbc7cd13
where we move some header files from `src/` to `src/3rdparty/` but
missed adding install rules for these header. Since some of these
headers are exposed in installed headers they need to be installed as
well.
2021-11-10 09:17:40 +01:00
Tim Wojtulewicz
0604df01e3 Merge remote-tracking branch 'origin/topic/bbannier/issue-1780'
* origin/topic/bbannier/issue-1780:
  Add Github action exercising pre-commit
  Add pre-commit config.
  Format code with `clang-format`
  Remove stale files `src/DebugCmdInfoConstants.*`
  Disable formatting for files in `testing/btest/plugins`
  Move 3rdparty source files to `3rdparty/`
2021-11-09 10:30:14 -07:00
Tim Wojtulewicz
8429ef746d Merge remote-tracking branch 'origin/topic/timw/1819-hashing-segfault'
* origin/topic/timw/1819-hashing-segfault:
  GH-1819: Handle recursive types when describing type in binary mode
2021-11-09 09:46:08 -07:00
Tim Wojtulewicz
9fdc70634f Merge remote-tracking branch 'origin/topic/timw/remove-false-teredo-test'
* origin/topic/timw/remove-false-teredo-test:
  Remove no-op false-teredo test
2021-11-09 09:28:43 -07:00
Johanna Amann
a011b4cb70 Packets with TSO: address review feedback.
This addresses review feedback of GH-1831 and additionally fixes one
case in which PayloadLen was used in a way that would have given
problematic results when TSO is enabled.
2021-11-09 15:11:27 +00:00
Benjamin Bannier
84e8000e62 Add Github action exercising pre-commit
This patch adds a Github action which exercises pre-commit linters for
commits to the `master` branch or for pull requests.  We adds this task
as a Github action since we expect it to finish quickly; running outside
of Cirrus makes it possible provide feedback quickly.
2021-11-09 07:20:18 +01:00
Benjamin Bannier
77e2e8278f Add pre-commit config.
This patch adds `clang-format` as only linter for now. This replaces the
previously used script from `auxil/run-clang-format` which we remove.

This requires the Python program `pre-commit`
(https://pypi.org/project/pre-commit/). With that one can then run
`clang-format` on the whole codebase with

    $ pre-commit run -a clang-format

or on just the staged files

    # Explicitly selecting linter.
    $ pre-commit run clang-format

    # Run all linters (currently just `clang-format`).
    $ pre-commit

`pre-commit` supports managing Git commit hooks so that linters are run
on commit. Linters can be installed with

    $ pre-commit install

The documentation at https://pre-commit.com/ covers these topics in
addition to more information.
2021-11-09 07:20:18 +01:00
Benjamin Bannier
4e16037acd Format code with clang-format
This patch formats files not conforming to the C++ formatting with
`clang-format`.
2021-11-09 07:20:18 +01:00
Benjamin Bannier
dafc9691c5 Remove stale files src/DebugCmdInfoConstants.*
The files generated from `src/DebugCmdInfoConstants.in` are placed in
`build/src/` by the build setup, and generated file in `src/` removed
here were unused and possibly out-of-date.
2021-11-09 07:20:18 +01:00
Benjamin Bannier
b23eb76043 Disable formatting for files in testing/btest/plugins
Files in that folder were previously not formatted. With this patch we
now disable formatting in that folder explicitly by adding a dedicated
`clang-format` config which deactivates any formatting changes.
2021-11-09 07:20:18 +01:00
Benjamin Bannier
72cbc7cd13 Move 3rdparty source files to 3rdparty/
This patch moves in-tree 3rdparty source files to `3rdparty/`. With that
we can remove special treatment of these files for `run-clang-format`.
2021-11-09 07:20:18 +01:00
Tim Wojtulewicz
e0b116154a GH-1819: Handle recursive types when describing type in binary mode 2021-11-08 15:19:57 -07:00
Christian Kreibich
c190c85bf0 Update doc submodule [nomail] [skip ci] 2021-11-08 09:08:20 -08:00
Vern Paxson
55b2ce7dbc Merge branch 'topic/vern/CPP-speedup' of github.com:zeek/zeek into topic/vern/CPP-speedup 2021-11-07 17:56:26 -08:00
Vern Paxson
3ea362be91 fix for case-sensitive file systems 2021-11-07 17:54:56 -08:00
Vern Paxson
0bdc268a00 geez sometimes it's signed sometimes it's not 2021-11-07 17:49:30 -08:00
Vern Paxson
ab1a29184c documentation updates 2021-11-07 17:05:21 -08:00
Vern Paxson
bb618bae30 remove -O add-C++ and -O update-C++ options 2021-11-07 17:02:18 -08:00
Vern Paxson
e1a760e674 extensive rewrite of generation & execution of run-time initialization 2021-11-07 17:00:19 -08:00
Vern Paxson
bc3bf4ea6c factoring out CPPEscape to be a standalone function 2021-11-07 16:57:52 -08:00
Vern Paxson
14abfc6831 removing unused SubNetType class 2021-11-07 16:56:57 -08:00
Tim Wojtulewicz
f2ea56379b Remove no-op false-teredo test 2021-11-05 15:51:22 -07:00
Florian Wilkens
cc9e38f58b add missing call to EVP_KDF_CTX_set_params 2021-11-05 22:03:29 +01:00
Christian Kreibich
1a6da54aed Update broker submodule [nomail] [skip ci] 2021-11-05 13:40:04 -07:00
Christian Kreibich
4974402be7 Merge branch 'topic/christian/ci-update'
* topic/christian/ci-update:
  Only push CI's Docker images when we're on the main repo
  Add macOS Monterey and drop Catalina in CI
  Add Fedora 35 to CI
2021-11-05 12:50:43 -07:00
Christian Kreibich
c39f33527a Update broker and zeek-archiver submodules [nomail] [skip ci] 2021-11-05 12:49:24 -07:00
Robin Sommer
34eaf42b92 Add new hook HookLoadFileExtended that allows plugins to supply Zeek script code to parse.
The new hooks works similar to the existing `HookLoadFile` but,
additionally, allows the plugin to return a string that contains the
code to be used for the file being loaded. If the plugin does so, the
content of any actual file on disk will be ignored (in fact, there
doesn't even need to be a file on disk in that case). This works for
both Zeek scripts and signatures.

There's a new test that covers the new functionality, testing loading
both scripts and signatures from memory. I also manually tested that the
debugger integration works, but I don't see much of a way to add a
regression test for that part.

We keep the existing hook as well for backwards compatibility. We could
decide to deprecate it, but not sure that buys us much, so left that
out.

Closes #1757.
2021-11-05 13:01:19 +01:00
Robin Sommer
1efaf8d7a4 Move logic to execute HookLoadFile for signatures into rule matcher code.
This (1) fixes an issue where signature files supplied on the command
line wouldn't pass through the hooks, and (2) prepares for allowing
hooks to supply the content of a signature file directly.
2021-11-05 12:58:38 +01:00
Christian Kreibich
f080a814c4 Merge branch 'fix-set-intersection' of github.com:/ynadji/zeek
* 'fix-set-intersection' of github.com:/ynadji/zeek:
  Curse you tabs!
  Remove unused tbl
  Add reverse order intersection check
  Fix C++ Intersection code
  Change set intersection test to be correct
2021-11-04 14:31:41 -07:00
Christian Kreibich
c1ebb279ca Only push CI's Docker images when we're on the main repo 2021-11-03 16:22:10 -07:00
Christian Kreibich
bac833a2f9 Add macOS Monterey and drop Catalina in CI 2021-11-03 16:22:06 -07:00
Christian Kreibich
f7d18eeb9e Add Fedora 35 to CI 2021-11-03 13:40:22 -07:00
Yacin Nadji
cdb52e6460 Curse you tabs! 2021-11-03 15:46:17 -04:00
Yacin Nadji
96c45a6c93 Remove unused tbl 2021-11-03 15:44:55 -04:00
Yacin Nadji
d426e285eb Add reverse order intersection check 2021-11-03 14:52:45 -04:00
Yacin Nadji
aacb812b9a Fix C++ Intersection code 2021-11-03 14:26:31 -04:00
Yacin Nadji
75e584cb73 Change set intersection test to be correct 2021-11-03 14:21:02 -04:00
Tim Wojtulewicz
a23a4c7d66 Merge remote-tracking branch 'origin/topic/timw/693-pcap-append'
* origin/topic/timw/693-pcap-append:
  GH-693: use pcap_dump_open_append where supported
2021-11-03 09:37:10 -07:00
Tim Wojtulewicz
4feb4198c7 Merge branch 'topic/timw/1781-git-blame-ignore-revs'
* topic/timw/1781-git-blame-ignore-revs:
  GH-1781: Add .git-blame-ignore-revs file
2021-11-03 09:35:27 -07:00
Christian Kreibich
4c7aac079f Update doc submodule [nomail] [skip ci] 2021-11-02 21:44:06 -07:00
Tim Wojtulewicz
ceaec09024 GH-693: use pcap_dump_open_append where supported 2021-11-02 17:09:39 -07:00
Tim Wojtulewicz
c2372ca9d8 GH-1781: Add .git-blame-ignore-revs file 2021-11-02 16:06:36 -07:00
Christian Kreibich
c25d5cecb2 Update btest submodule to 0.71 [nomail] [skip ci] 2021-11-01 12:10:39 -07:00
Tim Wojtulewicz
86e5aec477 Merge remote-tracking branch 'origin/topic/timw/myricom-fix'
* origin/topic/timw/myricom-fix:
  Fix issue with broken libpcaps that return repeat packets
2021-11-01 09:20:28 -07:00
Tim Wojtulewicz
b6444dce0c Fix issue with broken libpcaps that return repeat packets
This is apparently a problem with the Myricom version of libpcap, where
instead of returning a null or a zero if no packets are available, it
returns the previous packet. This causes Zeek to improperly parse the
packet and crash. We thought we had fixed this previously with a check
for a null packet but that fix was not enough.
2021-11-01 09:19:55 -07:00
Christian Kreibich
f1c81e3ab9 Update btest submodule to 0.70 [nomail] [skip ci] 2021-10-28 13:18:46 -07:00
Johanna Amann
e14b695497 Accept packets that use tcp segment offloading.
When checksum offloading is enabled, we now forward packets that
have 0 header lengths set - and assume that they have TSO enabled.

If checksum offloading is not enabled, we drop the packets.

Addresses GH-1829
2021-10-28 17:12:54 +02:00
Tim Wojtulewicz
20d1b89caa Merge remote-tracking branch 'origin/topic/timw/clang-format-update'
* origin/topic/timw/clang-format-update:
  Apply some missing clang-format changes
2021-10-21 17:24:02 -07:00
Tim Wojtulewicz
e63ea95664 Apply some missing clang-format changes 2021-10-21 16:38:57 -07:00
zeek-bot
34694e67ea Update doc submodule [nomail] [skip ci] 2021-10-21 00:34:50 +00:00