Use Gnulib's `inet_ntop' and `inet_pton' modules.