@staticmethod
def read_all_classes(intf: str):
    qid_list = []
    tc_cmd = 'tc class show dev {}'.format(intf)
    args = argSplit(tc_cmd)
    try:
        output = subprocess.check_output(args)
        for ln in output.decode('utf-8').split('\n'):
            ln = ln.strip()
            if (not ln):
                continue
            tok = ln.split()
            if (len(tok) < 5):
                continue
            if (tok[1] != 'htb'):
                continue
            if (tok[3] == 'root'):
                continue
            qid_str = tok[2].split(':')[1]
            qid = int(qid_str, 16)
            pqid_str = tok[4].split(':')[1]
            pqid = int(pqid_str, 16)
            qid_list.append((qid, pqid))
            LOG.debug('TC-dump: %s qid %d pqid %d', ln, qid, pqid)
    except subprocess.CalledProcessError as e:
        LOG.error('failed extracting classids from tc %s', e)
    return qid_list
@staticmethod
def read_all_classes(intf: str):
    qid_list = []
    tc_cmd = 'tc class show dev {}'.format(intf)
    args = argSplit(tc_cmd)
    try:
        output = subprocess.check_output(args)
        for ln in output.decode('utf-8').split('\n'):
            ln = ln.strip()
            if (not ln):
                continue
            tok = ln.split()
            if (len(tok) < 5):
                continue
            if (tok[1] != 'htb'):
                continue
            if (tok[3] == 'root'):
                continue
            qid_str = tok[2].split(':')[1]
            qid = int(qid_str, 16)
            pqid_str = tok[4].split(':')[1]
            pqid = int(pqid_str, 16)
            qid_list.append((qid, pqid))
            LOG.debug('TC-dump: %s qid %d pqid %d', ln, qid, pqid)
    except subprocess.CalledProcessError as e:
        LOG.error('failed extracting classids from tc %s', e)
    return qid_list