def subintfs(intf, names):
    """List all subinterfaces of an interface in a dictionary."""
    if not names:
        names = intf._subintfs
    subs = {}
    for name in names:
        subs[name] = getattr(intf, name)
    return subs
