-
Notifications
You must be signed in to change notification settings - Fork 855
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
allow "tcp[tcpflags]" access to all flag bits, including tcp-ae #1210
base: master
Are you sure you want to change the base?
Conversation
If you reinterpret |
Probably yes, masking out the length field would be good. I didn't dig deep enough to fully grasp the details of handling the return value in arth* though; I don't claim to have a good handle on yacc/bison for that. This maybe something to generalize, to have access to other fields in a right-aligned way (e.g. tcp[offset], tcp[window], tcp[seq], tcp[ack], tcp[checksum], tcp[urgent]), but for now I just thought about the convinience of allowing direct access to all 12 bits of the TCP header flags. |
I think I understand now how to build such a dynamic structure in the parser; please let me know if this is the correct way to do it, and if the whitespace indentation is acceptable. |
I would suggest to interpret |
With this change, the tcp[tcpflags] expression creates that 12-bit value; I addeded "tcp-res, tcp-res1, tcp-res2 and tcp-res3" to check if any of the reserved flags are non-zero, or one specific flag is non-zero (e.g. "tcp[tcpflags] & tcp-res" would be non-zero if any of the three uppermost flag bits is set). The documentation would need to go to tcpdump.4.in for these 4 additional tokens. |
Presumably you meant "...would need to go to pcap-filter.manmisc.in ..." |
Thank you for waiting. Let me comment on the following aspects separately:
|
Agreed. Note that for logistical reasons, the adoption of AccECN as an RFC will not happen before the next IETF end of march, and probably a few weeks thereafter (change of the responsible Area Director will also happening). |
As discussed, please include only the changes that implement 12-bit |
…an section on compatibility
This is the adjacent patch to libpcap, to introduce the 9th TCP flag bit (tcp-ae).
Also handle tcp[tcpflags] specially to allow access to all TCP header flags without having to
revert to tcp[12:2] which is much less readable, so that existing scripts can easily be extended
to check for the AE flag in an easy to understand manner.