draios/sysdig — pull request #57 by kristopolous (2014-04-05 01:23:51+00:00)
Title: [9] resolve IP addresses into host names with asynch DNS lookups

This candidate branch has the following changes:

Inclusion of `netdb.h` in `event.cpp` for `gethostname()` resolution

Introduction of `char* sinsp_evt::get_binary_ipv4_as_host(void*
binary_address, char* buf)` to do what it says on the tin.

A code split at `PT_SOCKADDR` to use the above parameter is a flag
is set at runtime (see below)

Loris thinks that:
An introduction of a `PF_DNS` `param_fmt` should be the way to go here.
But I see that as another layer of indirection and I really don't
understand why it would be necessary.

An introduction of a bool `m_usedns` (initialized to false in the
constructor) inside of sinsp with a getter and setter.

An addition of a -u short and --url long opt (the flag referred to
above) to turn on the feature of doing DNS resolution.

Currently, the code to enable it is in line 633:

inspector->use_dns(true);

Which utilizes the function referred to above.