Commit graph

212 commits

Author SHA1 Message Date
Tim Wojtulewicz
a3ba7f638b GH-386: Add clang-format config and scripts 2021-09-16 15:35:11 -07:00
Tim Wojtulewicz
0b342b7bfa Merge remote-tracking branch 'origin/topic/vern/CPP-workflow2'
* origin/topic/vern/CPP-workflow2:
  low-level coding style fixes
  support for standalone compiled scripts to export globals with module qualifiers
  updates for documentation of functionality for compiling scripts to C++
  fixes for standalone C++ scripts making types & variables/functions available
  fixed bug limiting availability of load_CPP() BiF
  updates to development helper scripts to support new workflow
  simpler workflow for -O gen-C++ ; also some hooks for -O gen-standalone-C++
  ReplaceBody now deletes a body if the replacement is nil
  removal of can't-actually-be-executed code
2021-07-01 08:46:53 -07:00
Vern Paxson
30cb91fe35 low-level coding style fixes 2021-06-29 15:17:34 -07:00
Vern Paxson
fb9c73fa86 fixed bug limiting availability of load_CPP() BiF 2021-06-04 17:03:50 -07:00
Vern Paxson
98f549d65d ReplaceBody now deletes a body if the replacement is nil 2021-06-04 16:56:29 -07:00
Vern Paxson
efd03d41f8 convert scopes to be managed using IntrusivePtr's 2021-05-30 17:20:29 -07:00
Jon Siwek
3e85375010 Fix various compiler/linter warnings in script_opt/CPP code 2021-05-05 16:55:05 -07:00
Vern Paxson
24e92fa54a hooks for activating the compiler & associated BiF 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
66fb3e0f56 low-level tidying / documentation tweaks 2021-05-05 16:50:29 -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
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
Vern Paxson
3e07564fb9 better method name: HasCopySemantics() 2021-03-24 15:03:03 -07:00
Vern Paxson
78f18b4fa6 support for subclassing ScriptFunc's, esp. for alternate lambda closures 2021-03-24 15:03:03 -07:00
Jon Siwek
8a8a983c49 Add missing zeek/ to header includes
Related to https://github.com/zeek/zeek/pull/1377
2021-01-29 19:16:29 -08:00
Tim Wojtulewicz
0618be792f Remove all of the random single-file deprecations
These are the changes that don't require a ton of changes to other files outside
of the original removal.
2021-01-27 10:52:40 -07:00
Jon Siwek
16942f3859 Merge remote-tracking branch 'origin/topic/vern/script-xform'
* origin/topic/vern/script-xform: (30 commits)
  Adjust some Reducer ref-counting and IntrusivePtr usage
  Fix reference counting in ListExpr inline/reduce methods
  Simplify WhileStmt::CondPredStmt()
  Use std::move() in Case::UpdateBody()
  Switch some Stmt transform/reduce logic to use IntrusivePtr
  Switch some Expr transform/reduce logic to use IntrusivePtr
  Adjust how some Expr::SetOpX() calls use std::move()
  Add missing header-includes to Reduce.h
  Add std::move() for args to an assign_to_index call
  Adjust memory management for &default argument expression type-check
  Use string for TempVar::name
  Switch AnalyOpt::only_func to optional<string>
  Fix a signed/unsigned comparison warning
  simplified some vestigial complexity I noticed when flipping through diffs
  canonicalization for an error message in one of the alternative test baselines
  baseline differences for "xform" alternative: changes generally reflect exposure of transformed code, or error propagation stopping earlier due to error now occurring in an assignment (to a temporary)
  new testing alternative for script transformation (= xform)
  bug in correctly inspecting test output file
  split bifs.string_utils into a non-error test and an only-errors test, to help control for differing error propagation
  logic for driving the script optimization process
  ...
2021-01-14 15:15:22 -08:00
Vern Paxson
7f92a573d2 Remove BroValUnion by hoisting underlying Val subclass values into subclasses 2021-01-14 11:58:59 -07:00
Jon Siwek
ee4c259cd4 Merge branch 'master' into topic/vern/script-xform 2021-01-13 12:18:44 -08:00
Jon Siwek
b08112b2e7 Switch FuncType capture-list storage to optional<vector<Capture>>
May help clarify overall mem-mgmt/ownership semantics.
2021-01-11 15:57:58 -08:00
Jon Siwek
ab15a98b28 Fix memory leaks in lambda capture/frame management 2021-01-11 15:07:01 -08:00
Jon Siwek
614fade0a4 Merge branch 'master' into topic/vern/lambda-copy-semantics 2021-01-11 11:48:45 -08:00
Vern Paxson
8f001062bf support for rewriting script function bodies 2021-01-10 13:25:01 -08:00
Vern Paxson
eb1848c547 cleaner approach for localizing errors associated with duplicated ASTs: virtualize GetLocationInfo 2021-01-07 15:14:22 -08:00
Vern Paxson
80f7d36582 support for transmitting of capture-semantics closures via Broker, while keeping deprecated functionality 2021-01-04 14:29:07 -08:00
Vern Paxson
627fb8616e changes to ScriptFunc's to track captures, and LambdaExpr's to check/manage them 2021-01-04 14:07:41 -08:00
Vern Paxson
c42586af2c inlining of Zeek script functions 2020-11-19 16:16:59 -08:00
Tim Wojtulewicz
96d9115360 GH-1079: Use full paths starting with zeek/ when including files 2020-11-12 12:15:26 -07:00
Tim Wojtulewicz
cd06bf34c7 GH-1215: Remove dispatch_map from packet analysis, replace with BIF methods for registering dispatches 2020-11-02 19:03:25 +00:00
Jon Siwek
5ed13284c3 GH-165: Fix global initializations that indirectly use builtin types 2020-08-27 14:01:08 -07:00
Jon Siwek
4a8640d702 Improve how primary/top-level BIFs get initialized 2020-08-27 13:54:43 -07:00
Jon Siwek
1bbae2368d GH-1122: Allow initializing globals with calls to subdir BIFs 2020-08-27 12:20:37 -07:00
Tim Wojtulewicz
fe0c22c789 Base: Clean up explicit uses of namespaces in places where they're not necessary.
This commit covers all of the common and base classes.
2020-08-24 12:07:00 -07:00
Tim Wojtulewicz
0ac3fafe13 Move zeek::net namespace to zeek::run_state namespace.
This also moves all of the code from Net.{h,cc} to RunState.{h,cc} and marks Net.h as deprecated
2020-08-20 16:11:47 -07:00
Tim Wojtulewicz
01ce18894b Rename types in ZeekList.h to be consistent with the style guide 2020-08-20 16:11:47 -07:00
Tim Wojtulewicz
db36688bf0 Move a few smaller files to zeek namespaces 2020-08-20 16:11:46 -07:00
Tim Wojtulewicz
8d2d867a65 Move everything in util.h to zeek::util namespace.
This commit includes renaming a number of methods prefixed with bro_ to be prefixed with zeek_.
2020-08-20 16:00:33 -07:00
Tim Wojtulewicz
c9ab1f93e7 Move a few low-use classes to namespaces 2020-07-31 16:25:47 -04:00
Tim Wojtulewicz
bfab224d7c Move Reporter to zeek namespace 2020-07-31 16:22:41 -04:00
Tim Wojtulewicz
1248411a2f Use properly-sized loop variables or convert to ranged-for (bugprone-too-small-loop-variable) 2020-07-28 12:36:40 -07:00
Johanna Amann
da2c968ba0 Merge remote-tracking branch 'origin/topic/jsiwek/gh-1024-broker-store-handle-type-checks'
* origin/topic/jsiwek/gh-1024-broker-store-handle-type-checks:
  Improve Broker store API's handling of invalid arguments
  Add builtin_exception() functions
  GH-1024: fix crash on passing wrong types to Broker store API

This was a bit of a bigger merge since Zeek changed inbetween the time
of the PR and me actually merging it.

I put the new functions into the zeek::detail namespace -- since it
seems unlikely that those will be used by something external.

I also renamed them to fit better with the naming scheme of the new
error functions.

Fixes GH-1024
2020-07-14 00:05:09 +00:00
Tim Wojtulewicz
02cef05f93 Rename BroObj to Obj 2020-07-02 16:15:01 -07:00
Tim Wojtulewicz
a2bc42dd93 Move Func up to zeek namespace, rename BroFunc to ScriptFunc 2020-07-02 16:15:01 -07:00
Tim Wojtulewicz
86fdf0eaa9 Mark global val_mgr as deprecated and fix uses of it to use namespaced version 2020-07-02 16:15:00 -07:00
Tim Wojtulewicz
40ecede4ea Move Location to zeek::detail and BroObj to zeek 2020-06-30 21:12:26 -07:00
Tim Wojtulewicz
d6f1ea16ac Move Func and associated classes into zeek::detail namespace 2020-06-30 20:51:58 -07:00
Tim Wojtulewicz
937a462e70 Move Frame and Scope to zeek::detail namespace 2020-06-30 20:51:53 -07:00
Tim Wojtulewicz
64332ca22c Move all Val classes to the zeek namespaces 2020-06-30 20:48:09 -07:00