]> git.ipfire.org Git - thirdparty/suricata.git/commit
detect: unify functions for multi-buffer
authorPhilippe Antoine <pantoine@oisf.net>
Thu, 8 Feb 2024 08:43:45 +0000 (09:43 +0100)
committerVictor Julien <victor@inliniac.net>
Fri, 24 May 2024 04:51:06 +0000 (06:51 +0200)
commitce16a56a1f75d6b52f4903f6be25ac6d01d03fb8
treeae7263d9bca3116820814156dc71c12e6615dedd
parent55bc5f2290cebf0989582aa25b4ccda5d041fcb2
detect: unify functions for multi-buffer

Ticket: 6575

Multi buffers keywords now use a single registration function
DetectAppLayerMultiRegister with a GetBuffer argument.

This GetBuffer function pointer is similar to the ones used by
single-buffer keyword, except that it takes an additional
parameter which is the index of the buffer to get.
Under the hood, an anonymous union between these 2 functions
pointers types is used.

In the end, this deduplicates code, especially the calls to
DetectEngineContentInspection
21 files changed:
src/detect-dns-answer-name.c
src/detect-dns-query-name.c
src/detect-dns-query.c
src/detect-engine-mpm.c
src/detect-engine-mpm.h
src/detect-engine-prefilter.c
src/detect-engine-prefilter.h
src/detect-engine.c
src/detect-engine.h
src/detect-http-header.c
src/detect-http2.c
src/detect-ike-vendor.c
src/detect-krb5-cname.c
src/detect-krb5-sname.c
src/detect-mqtt-subscribe-topic.c
src/detect-mqtt-unsubscribe-topic.c
src/detect-quic-cyu-hash.c
src/detect-quic-cyu-string.c
src/detect-tls-certs.c
src/detect-tls-subjectaltname.c
src/detect.h