Skip to content

feat: replace old readable string extraction with new filtered multi-string support#2787

Open
fabiodepin wants to merge 4 commits intontop:devfrom
fabiodepin:devNdpiHumanReadableString
Open

feat: replace old readable string extraction with new filtered multi-string support#2787
fabiodepin wants to merge 4 commits intontop:devfrom
fabiodepin:devNdpiHumanReadableString

Conversation

@fabiodepin
Copy link
Copy Markdown
Contributor

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

[ X ] I have signed the ntop Contributor License Agreement at https://github.com/ntop/legal/blob/main/individual-contributor-licence-agreement.md
[ X ] I have read the contributing guidelines at https://github.com/ntop/nDPI/blob/dev/CONTRIBUTING.md
[ ] I have updated the documentation (in doc/) to reflect the changes made (if applicable)

Link to the related issue:
References #2708

Describe changes:

Feat: add extract_readable_strings with advanced filtering; refactor string handling

  • Introduces a new function to retrieve multiple human-readable substrings from a payload, with optional filter callback support (e.g., for FQDN detection).
  • Replaces the old function with the new approach.
  • Increases size from 32 to 128 bytes to support longer string concatenations.
  • Renames all occurrences of to the correct spelling .
  • Replaces all calls to with , reflecting the new logic.

- Introduces a new function  to retrieve multiple
  human-readable substrings from a payload, with optional filter callback
  support (e.g., for FQDN detection).
- Replaces the old function  with the new
  approach.
- Increases  size from 32 to 128 bytes to support
  longer string concatenations.
- Renames all occurrences of  to the correct spelling .
- Replaces all calls to  with
  , reflecting the new logic.

References: ntop#2708
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud bot commented Apr 2, 2025

@IvanNardi
Copy link
Copy Markdown
Collaborator

@fabiodepin, could you take a look at the errors in the regression tests, please?

@fabiodepin
Copy link
Copy Markdown
Contributor Author

@fabiodepin, could you take a look at the errors in the regression tests, please?

Hi, sure. I'll check and get back to you.

* for short strings. These thresholds can be used to classify the randomness
* level of the string.
*/
static double calculate_entropy(const char *str) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no need to re-implement, already present in the library; see ndpi_entropy()

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@IvanNardi
Copy link
Copy Markdown
Collaborator

Any updates or can we close this PR?

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.

3 participants