tracepkt
tracepkt copied to clipboard
TCP packet support
How challenging do you think it would be to add TCP support? I'm diving into the code myself and looking at potential gotchas so I'm wondering what you think as well.
Currently, it filters using icmpid, which is a great trick, but that wouldn't work for TCP. For TCP, it may be possible using a FWMARK, however, those are lost when the routing across network namespaces. Instead, I'm guessing I'd need to possibly:
- Create a TCP socket on the python side
- Bind the source port before sending any packets
- Connect
- Track every time iptables modified the source/dest IPs
Alternatively, I guess I could track the TCP sequence numbers rather than the source/dest which might be more reliable.
What do you think?