Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add enable/disable guessing using client IP/port #2569

Merged
merged 3 commits into from
Sep 27, 2024

Conversation

liwilson1
Copy link
Contributor

Add configurable options for whether to include client port or client IP in the flow's protocol guesses. This defaults to include both client port/IP if the protocol is not guessed with the server IP/port.

This is intended for when flow direction detection is enabled, so we know that sport = client port, dport = server port.

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

Link to the related issue:

Describe changes:

Hi, please let me know if there is a better way to do this. We would like to disable using client IP + port when deciding the flow->guessed_protocol_id and flow->guessed_protocol_id_by_ip values.

I've created two new config options that enable/disable using the client port/ip when the server port/ip returns unknown.

Add configurable options for whether to include client port or client IP
in the flow's protocol guesses. This defaults to include both client
port/IP if the protocol is not guessed with the server IP/port.

This is intended for when flow direction detection is enabled, so we
know that sport = client port, dport = server port.
Copy link
Collaborator

@IvanNardi IvanNardi left a comment

Choose a reason for hiding this comment

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

Overall, a good idea!
Other than the issue reported below, could you change the pcap used for the tests? We should use a trace triggering different results with and without this new configuration option

Remove 1kxun.pcap from both tests and use a link to:

  • iphone.pcap for disable_use_client_ip
  • bot.pcap for disable_use_client_ip

src/lib/ndpi_main.c Show resolved Hide resolved
src/lib/ndpi_main.c Show resolved Hide resolved
Add iphone.pcap for disable_use_client_ip
Add bot.pcap for disable_use_client_port
@liwilson1
Copy link
Contributor Author

I've assumed the bot.pcap was for disable_use_client_port

Copy link

sonarcloud bot commented Sep 27, 2024

@IvanNardi IvanNardi merged commit cdda369 into ntop:dev Sep 27, 2024
36 checks passed
@IvanNardi
Copy link
Collaborator

@liwilson1, thank you (I fixed the tests while merging; the instructions I gave you were confused, sorry)

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