from ipaddress import ip_network


def get_network_details(network):
    """Get the details about the network the IP address belongs to."""
    data = {}

    network_data = ip_network(network, strict=False)
    data["network"] = network
    data["netmask"] = network_data.netmask
    data["hostmask"] = network_data.hostmask
    data["total_hosts"] = network_data.num_addresses
    data["network_address"] = network_data.network_address
    data["broadcast_address"] = network_data.broadcast_address
    data["private"] = network_data.is_private

    return data