_mpdu.py 文件源码

python
阅读 26 收藏 0 点赞 0 评论 0

项目:itamae 作者: wraith-wireless 项目源码 文件源码
def _iesubeltfsreq_(s,sid):
    """ :returns: parsed tfs request subelement """
    ret = s
    if sid == std.EID_TFS_SUBELEMENT_TFS:
        # there are one or more tclas elements folled by an option tclas
        # processing element
        ret = {}
        while s:
            eid,tlen = struct.unpack_from('=2B',s)
            if eid == std.EID_TCLAS:
                if not 'tclas' in ret: ret['tclas'] = []
                ret['tclas'].append(_parseie_(std.EID_TCLAS,s[:tlen]))
                s = s[2+tlen:]
            elif eid == std.EID_TCLAS_PRO:
                s['tclas-pro'] = _parseie_(std.EID_TCLAS_PRO,ret)
                # could use a break here but want to make sure
                # there are not hanging elements
                s = s[3:]
    elif sid == std.EID_TFS_SUBELEMENT_VEND:
        ret = _parseie_(std.EID_VEND_SPEC,s)
    return ret

# MSMT Pilot subelements Std Table 8-117
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号