def get_interfaces(yaml):
    """Return a list of all interface and sub-interface names"""
    ret = []
    if not "interfaces" in yaml:
        return ret
    for ifname, iface in yaml["interfaces"].items():
        ret.append(ifname)
        if not "sub-interfaces" in iface:
            continue
        for subid, _sub_iface in iface["sub-interfaces"].items():
            ret.append(f"{ifname}.{int(subid)}")
    return ret