'Return a mapping of interface names to the configuration of the
interface, which includes the ip address, netmask and broadcast addresses'

def get_all_ips(self):

    import netifaces
    all_ips = defaultdict(list)
    if hasattr(netifaces, 'AF_INET'):
        for x in netifaces.interfaces():
            try:
                for c in netifaces.ifaddresses(x).get(netifaces.AF_INET, []):
                    all_ips[x].append(c)
            except ValueError:
                from calibre import prints
                prints('Failed    to    get    IP    addresses    for    interface', x)
                import traceback
                traceback.print_exc()
    return dict(all_ips)
