bin/getaddr: move code to function main(), to ease code reuse

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>
bin/getaddr: print host given by reversing address, if an address was given

Signed-off-by: Nicolas Iooss <nicolas.iooss_git@polytechnique.org>