Skip to content

Rework flow breed#2926

Merged
IvanNardi merged 1 commit into
ntop:devfrom
IvanNardi:breed
Sep 2, 2025
Merged

Rework flow breed#2926
IvanNardi merged 1 commit into
ntop:devfrom
IvanNardi:breed

Conversation

@IvanNardi

@IvanNardi IvanNardi commented Aug 1, 2025

Copy link
Copy Markdown
Collaborator

Right now, there is a static mapping between flow protocols
and flow breeds.
Make it dynamic: allow to have different flows, with the same
classification but differents breeds. This is the same logic that we
already have for categories....

Preliminary work to support breed in category lists.

API change from the app POV: to get the flow breed don't use anymore
ndpi_get_proto_breed(), but access directly struct ndpi_proto->breed

The functions ndpi_domain_classify_*() and
ndpi_get_host_domain_suffix() now have a u_int32_t parameter as
class_id (instead of u_int_16_t), with the following logic:

class_id = (breed << 16) | category

instead of the old:

class_id = category

Please note that this change is back-compatible: if you are not
interested into breeds, you don't need to update the application code.

@IvanNardi IvanNardi marked this pull request as draft August 1, 2025 15:47
@IvanNardi IvanNardi force-pushed the breed branch 7 times, most recently from 69d54af to 08691bd Compare August 2, 2025 14:52
@IvanNardi IvanNardi marked this pull request as ready for review August 2, 2025 14:53
@IvanNardi IvanNardi force-pushed the breed branch 3 times, most recently from 80f8268 to e199069 Compare August 7, 2025 15:05
Right now, there is, in essence, a static mapping between flow protocols
and flow breeds.
Make it dynamic: allow to have different flows, with the same
classification but differents breeds. This is the same logic that we
already have for categories....

Preliminary work to support breed in category lists.

API change from the app POV: to get the flow breed don't use anymore
`ndpi_get_proto_breed()`, but access directly `struct ndpi_proto->breed`

The functions `ndpi_domain_classify_*()` and
`ndpi_get_host_domain_suffix()` now have a `u_int32_t` parameter as
`class_id` (instead of `u_int_16_t`), with the following logic:
```
class_id = (breed << 16) | category
```
instead of the old:
```
class_id = category
```
Please note that this change is back-compatible: if you are not
interested into breeds, you don't need to update the application code.
@sonarqubecloud

sonarqubecloud Bot commented Sep 2, 2025

Copy link
Copy Markdown

@IvanNardi IvanNardi merged commit efccc7d into ntop:dev Sep 2, 2025
31 checks passed
@IvanNardi IvanNardi deleted the breed branch September 2, 2025 14:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant