Commit graph

26 commits

Author SHA1 Message Date
Philippe Antoine
f7f8fbc116 scripts: setup app layer rustfmt mod.rs last
Otherwise rustfmt complains that parser.rs does not exist yet
2025-09-29 19:08:20 +02:00
Jason Ish
e8d7d3d83d scripts/setup-app-layer: fixes for name changes 2025-05-05 21:41:03 +02:00
Jason Ish
7321d7c7db rust/applayertemplate: replace rs_ naming with SC 2025-05-05 21:41:03 +02:00
Philippe Antoine
c32f2dee70 scripts: remove unused code in setup-app-layer
and fix typo
2025-04-07 06:57:45 +02:00
Philippe Antoine
2fa3a9fe62 template: rustfmt
and use generic logger callback prototype with later cast

and do some other small modifications so that the plugin
has less diff
2025-03-29 06:38:00 +01:00
Alice Akaki
7b350e9933 misc: fix name prefix in detect register functions 2025-02-21 14:57:14 +01:00
Philippe Antoine
ae1a4ef757 app-layer: make number of alprotos dynamic
Ticket: 5053

The names are now dynamically registered at runtime.
The AppProto alproto enum identifiers are still static for now.

This is the final step before app-layer plugins.
2025-01-13 13:35:13 +01:00
Philippe Antoine
96c8470cdd template: move detect keywords to pure rust
Ticket: 3195

Also remove unused src/tests/detect-template-buffer.c

Completes commit 4a7567b3f0
to remove references to template-rust
2024-10-12 11:03:38 +02:00
Philippe Antoine
3643b6ed4b output: generic simple tx json logger
Ticket: 3827
2024-04-13 08:50:18 +02:00
Philippe Antoine
0b6b015e26 output/alert: rewrite code for app-layer properties
Especially fix setup-app-layer script to not forget this part

This allows, for simple loggers, to have a unique definition
of the actual logging function with the jsonbuilder.
This way, alerts, files, and app-layer event can share the code
to output the same data.

Ticket: #3827
2023-11-20 21:53:13 +01:00
Philippe Antoine
6b9fce7728 app-layer: shorter code for proto string helpers 2023-05-05 10:34:33 +02:00
Philippe Antoine
e1046239ea scripts: fix setup app layer for output
using rust nowadays.

Also remove useless code about files that do not need changes
anymore
2023-05-05 10:34:33 +02:00
Philippe Antoine
5b2605bdfe debug: use AppProtoToString
instead of recoding it.
This way, setup-app-layer.py needs to patch one file less
2023-05-05 10:34:33 +02:00
Shivani Bhardwaj
21edf136a5 scripts: fix app-layer-protos.c setup
After the changes in the script in 05e16820de, the file
app-layer-protos.c was to be modified properly iff it was left unformatted.
However, the file was also formatted as a part of the same commit making
the lines split which broke the output of the script. Fix that by
looking for another pattern and changing the lines following that.
2022-12-20 16:17:11 +01:00
Jason Ish
0bb4546af4 setup-app-layer: rustfmt new rust files 2022-12-06 14:09:10 +01:00
Jason Ish
0b2d0324e5 setup-app-layer: set copyright year to current year
Ticket: 4939
2022-12-06 14:09:10 +01:00
Jason Ish
05e16820de templates: clang format cleanups
Cleanup the trivial clang-formatting issues in templates.  Length of
protocol names may require clang-format after new protocol generation.
2022-12-06 14:09:10 +01:00
Jason Ish
712d80107f setup-app-layer: remove generator for C parsers
Ticket: 4939
2022-12-06 14:09:10 +01:00
Jason Ish
50a787a9a3 app-layer-template-rust: remove C app-layer stub
Remove the app-layer-PROTO stub for Rust based parsers.  It is no longer
needed as Rust parsers now contain the registration function in Rust.

Ticket: 4939
2022-12-06 14:09:10 +01:00
Juliana Fajardini
c6a35d09b7 templates: fix typos
- *template*files[ch][rs]: fix typos
- scripts/setup-app-layer: fix typos
2021-04-01 15:47:09 +02:00
Juliana Fajardini
4748826dc7 scripts/setup-app-layer: fix Makefile.am patch
adjust lines for patching /src/Makefile.am, as current generated
Makefile wasn't building Suricata.
Add suggestion to run "./configure" before running "make".
Add --logger and --parser options to examples.
2021-04-01 15:46:46 +02:00
Jason Ish
13049ae09d scripts/setup-app-layer: fix rust generation
Fix Rust app-layer generation. Main parser file was being named
gopher.rs instead of the name of the protocol.
2020-10-03 19:52:53 +02:00
Victor Julien
0b5a2ab49b setup-app-layer: support tests in tests/ 2018-09-19 21:25:16 +02:00
Jason Ish
7ec7d85ecc setup-app-layer.py: integrate detect buffer setup
Add --detect to setup a detect buffer.

Obsoletes setup-app-layer-detect.sh.
2018-09-19 21:02:35 +02:00
Jason Ish
15922dcd8c setup-app-layer.py: attempt to cd into correct directory
- If in src, cd to ..
- Error out early if the current directory does not look like a
  Suricata source directory.
2018-09-19 21:00:51 +02:00
Jason Ish
e232fcc415 setup-app-layer: rewrite script in Python
The idea being that it is easier to read and maintain than
wrapping ed commands.

This script also merges the parser and logger setup into a single
script, but still allows just the parser, or just the logger
to be generated with flags, --logger and --parser.
2018-09-19 20:57:32 +02:00