Inspired by earlier posting here [1] from a few years ago with a few fixes, but the snprintf() conversion there truncated IPv4 addresses in text output.
Compiles and runs on amd64. Nicely displays flows and counters obtained from one of my HP devices' sFlow data. Also appears to give proper tcpdump-formatted output. Testing, comments, etc. appreciated. Notes: The original code binds an upd6 socket, falling back to a v4 socket if no v6 is available. Since this disables reception of ipv4 UDP datagrams (if I read inet6(4) correctly), I added an '-4' option to allow binding to a v4-socket instead. I offered this upstream as well. Switched the code to snprintf() and strlcpy() as well. Regards, Rogier References: 1. ports@ -- Re: NEW: net/sflowtool http://marc.info/?l=openbsd-ports&m=111365220002485&w=2
sflowtool.tgz
Description: GNU Zip compressed data