Open cunha opened 7 years ago
Understood. I think the current interface is to blame (my fault). The interface takes care of setting the fields to store the flow identifier and the probe identifier.
I am not sure what the best approach is. Do you have ideas?
One approach is to keep these in an outer module. For example, if I want to send 1024 probes at the same time, there is no way to choose header field values to implement this (at least for ICMP). We could let the library's user choose how it wants to store the probe identifier, this way it would be natural to use the first bits in the sequence number to store the probe identifier like you did.
The problem is that the library needs to match the response with the probe. If the user can set the flow identifier in any way he wants, can the library do the matching without the user having to pass a function to extract the flow identifier?
I can't think a good way without passing a function, maybe pass the position (and length) of the identifier in the packet?
I don't think position + length does it because the identifier might be spread across multiple fields.
Is there a way to brute force and check all fields in the response?
See the discussion here: https://github.com/cunha/netlib/pull/15#discussion_r99783366