Skip to content

Conversation

fabiodepin
Copy link
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
Copy link

sonarqubecloud bot commented Apr 2, 2025

@IvanNardi
Copy link
Collaborator

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

@fabiodepin
Copy link
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
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
Collaborator

Choose a reason for hiding this comment

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

+1

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