import collections


def _get_default_policy(rules):
    """Get the default policy for each table/chain."""
    tables = collections.defaultdict(dict)
    current_table = None

    for rule in rules:
        if rule.startswith(b'*'):
            current_table = rule[1:]

        if rule.startswith(b':'):
            parts = rule[1:].split()
            tables[current_table][parts[0]] = parts[1]

    return tables