Commit Graph

1 Commits

Author SHA1 Message Date
Niels Widger 4585479ab0 sharkd: add hosts tap
Add `hosts:` tap to `tap` method of `sharkd` which returns a list of
resolved hostnames found in the capture file, thus providing the same
information as `tsharks -z hosts`.  The `hosts:` tap accepts an
optional list of comma-separated protocol names `ipv4`, `ip` (synonym
for `ipv4`) or `ipv6`.  For example, `hosts:ipv4` returns only IPv4
hosts, `hosts:ipv6` returns only IPv6 hosts and `hosts:ipv4,ipv6`
returns both IPv4 and IPv6 hosts.  If no protocol names are
given (i.e. if the request is just `host:`), both IPv4 and IPv6 hosts
are returned.  In the response, IPv4 and IPv6 hosts are returned in
separate `ipv4_hosts` and `ipv6_hosts` arrays containing objects with
`name` and `addr` fields.  Both arrays are sorted by the `name` field
of each object.
2023-09-22 20:52:19 +00:00