Skip to content

Speed up category lookup in ndpi_get_category_id()#2869

Merged
IvanNardi merged 1 commit into
ntop:devfrom
0xA50C1A1:get_category_id
Jun 5, 2025
Merged

Speed up category lookup in ndpi_get_category_id()#2869
IvanNardi merged 1 commit into
ntop:devfrom
0xA50C1A1:get_category_id

Conversation

@0xA50C1A1

@0xA50C1A1 0xA50C1A1 commented Jun 5, 2025

Copy link
Copy Markdown
Contributor

Please sign (check) the below before submitting the Pull Request:

Describe changes:

Note: This replaces unnecessary PR #2868 - apologies for the duplicate effort.

@sonarqubecloud

sonarqubecloud Bot commented Jun 5, 2025

Copy link
Copy Markdown

@0xA50C1A1

Copy link
Copy Markdown
Contributor Author

@IvanNardi, I'm considering adding ndpi_get_breed_by_name() and modifying ndpi_get_proto_breed_name() to match ndpi_get_proto_name:

char* ndpi_get_proto_breed_name(struct ndpi_detection_module_struct *mod, ndpi_protocol_breed_t breed_id);

Would this API change be acceptable?

@IvanNardi IvanNardi merged commit 801b388 into ntop:dev Jun 5, 2025
30 of 31 checks passed
@0xA50C1A1 0xA50C1A1 deleted the get_category_id branch June 5, 2025 12:41
@IvanNardi

Copy link
Copy Markdown
Collaborator

@IvanNardi, I'm considering adding ndpi_get_breed_by_name() and modifying ndpi_get_proto_breed_name() to match ndpi_get_proto_name:

char* ndpi_get_proto_breed_name(struct ndpi_detection_module_struct *mod, ndpi_protocol_breed_t breed_id);

Would this API change be acceptable?

How exactly are you going to use the (new) first parameter?

@0xA50C1A1

Copy link
Copy Markdown
Contributor Author

@IvanNardi, I'm considering adding ndpi_get_breed_by_name() and modifying ndpi_get_proto_breed_name() to match ndpi_get_proto_name:

char* ndpi_get_proto_breed_name(struct ndpi_detection_module_struct *mod, ndpi_protocol_breed_t breed_id);

Would this API change be acceptable?

How exactly are you going to use the (new) first parameter?

Actually, never mind – I was just considering moving the breed names to a static array (similar to how categories are handled) and unifying the function signature for consistency. I guess there's not much point in that.

@IvanNardi

IvanNardi commented Jun 5, 2025 via email

Copy link
Copy Markdown
Collaborator

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.

2 participants