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 tcpdump.cfg #92

Merged
merged 2 commits into from
Apr 3, 2019
Merged

Add tcpdump.cfg #92

merged 2 commits into from
Apr 3, 2019

Conversation

jtpereyda
Copy link
Contributor

Add a tcpdump.cfg to builtin configs. Tested with various permutations of -v, -e, -n, -S, -X.

Color design notes:

  1. The IP and Ethernet address colors are based on ip address --color. It also matches the IP color in ping.cfg.
  2. I didn't find any precedent for port number color, though blue seemed to go nicely with the magenta.
  3. The faint timestamp feels like a nice balance to me. It sort of highlights the start of the packet (helpful for multi-line packets) without drawing too much visual attention to itself. I tried bold but that seemed to add visual clutter.

Known limitations:

  1. Only the default timestamp format is supported.
  2. Transport layer protocols besides TCP and UDP not supported.
  3. Network layer protocols besides IPv4 and IPv6 not tested.
  4. Ditto for unusual link-layer protocols.

As an aside: More expressive filters could help this config; there are a few hacks to make it work right now. If one could configure overlapping patterns, that would help a lot. A major trouble is that after colors are added, the same expression cannot be used in a lookbehind -- apparently because the ANSI color codes are now inserted into the string.

@nicoulaj
Copy link
Owner

nicoulaj commented Apr 3, 2019

Thanks!

As an aside: More expressive filters could help this config; there are a few hacks to make it work right now. If one could configure overlapping patterns, that would help a lot. A major trouble is that after colors are added, the same expression cannot be used in a lookbehind -- apparently because the ANSI color codes are now inserted into the string.

Yes, I planned to rethink revamp the syntax for configs but can't find the time. There are several related issues: #2 #63 #64 #67

@nicoulaj nicoulaj merged commit aee10de into nicoulaj:master Apr 3, 2019
nicoulaj added a commit that referenced this pull request Jun 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants