Commit Graph

20 Commits (c3d583349b234c8d73734d1cdc779bb3fb8384b4)

Author SHA1 Message Date
Jason Ish 06235a3232 ndpi: use flow access functions
To prevent direct access to the flow structure and be subject to changes
in its size.

Ticket: #8632
2 months ago
Jason Ish 038d4a21e3 ndpi: flow storage can fail, cleanup if it does 2 months ago
Jason Ish f739a8a73c ndpi: don't access flow storage directly
Remove the check for Flow.storage being NULL. With flex arrays, as long as the
flow is allocated, .storage will never be NULL. We do make sure the flow
is not NULL, and the storage functions are safe to the storage being
NULL.

Prevents NDPI from accessing this flow field to be less sensitive to ABI
changes with respect to data structure sizes.

Ticket: #8632
2 months ago
Jason Ish 336b50ae9e storage: prefix core API with SC 7 months ago
Jason Ish 67bd09ba2c thread/storage: prefix API with SC
In preparation for Rust bindings.
7 months ago
Jason Ish 137f59f542 flow/storage: prefix API with SC
In preparation for adding Rust bindings.
7 months ago
Jason Ish cd9993c568 storage: remove the size registration parameter
With the Alloc callback gone, the size is no longer needed.
7 months ago
Jason Ish f337cd573b storage: remove alloc callback as its unused
Remove the "Alloc" callback from the storage API, it was only being
used in tests without any real usage.
7 months ago
Antoine Abou Faysal 29834e3917 plugins/ndpi: guard against NULL f->storage in all callbacks 8 months ago
Victor Julien 28ba93e60c ndpi: minor optimization
Check protocol before doing more expensive work.
8 months ago
Victor Julien 278da4bc6a npdi: fix null pointer deref in detect keywords
Check for the existence of a flow before calling FlowGetStorageById() on it.

Ticket: #8308.
8 months ago
Lukas Sismis 400328c3c3 pcap-file: prep codebase for pcap_cnt move refactor
For an easier review process, this is a two-step change process,
in which pcap_cnt is first accessed by functions-to-be, implemented
as simple macros.

In the follow-up commit, the actual refactor is implemented with the new
function. The old macros are deleted.

Ticket: 7835
9 months ago
Philippe Antoine a2b5225612 rust: bindgen SCSigMatchAppendSMToList
Ticket: 7667
1 year ago
Philippe Antoine 13449344e8 rust: bindgen SCDetectHelperKeywordRegister
Ticket: 7667
1 year ago
Philippe Antoine 96afdce283 detect: rename SCSigTableElmt to SCSigTableAppLiteElmt 2 years ago
Jason Ish 155706f96b jsonbuilder: prefix C API with SC 2 years ago
Jason Ish 81915548de ndpi: ignore packets that have a different proto than the flow
This can happen when the flow is UDP, but an ICMP unreachable is
returned, which gets assigned to the same flow.

Reference: https://github.com/ntop/nDPI/issues/2762
2 years ago
Jason Ish 10ed6280ff ndpi: fix memory in keyword setup
- remove duplicate calls to ndpi_init_detection_module
- cleanup ndpi_init_detection_module when no longer needed
2 years ago
Jason Ish d3835bbb11 detect: split new keyword id from registration
Split DetectHelperKeywordRegister into 2 functions, one for acquiring
a new keyword ID, and another to perform the registration.

This makes it easier to do the traditional C keyword initialization
with a dynamic ID.
2 years ago
Alfredo Cardigliano dfd9ef5784 ndpi: initial implementation of nDPI plugin
Ticket: #7231
2 years ago