def util_mic_len(pkt):
    ''' Calculate the length of the attribute value field '''
    if (pkt.nwk_seclevel == 0):  # no encryption, no mic
        return 0
    elif (pkt.nwk_seclevel == 1):  # MIC-32
        return 4
    elif (pkt.nwk_seclevel == 2):  # MIC-64
        return 8
    elif (pkt.nwk_seclevel == 3):  # MIC-128
        return 16
    elif (pkt.nwk_seclevel == 4):  # ENC
        return 0
    elif (pkt.nwk_seclevel == 5):  # ENC-MIC-32
        return 4
    elif (pkt.nwk_seclevel == 6):  # ENC-MIC-64
        return 8
    elif (pkt.nwk_seclevel == 7):  # ENC-MIC-128
        return 16
    else:
        return 0
def util_mic_len ( pkt ) : if ( pkt . nwk_seclevel == 0 ) : return 0 elif ( pkt . nwk_seclevel == 1 ) : return 4 elif ( pkt . nwk_seclevel == 2 ) : return 8 elif ( pkt . nwk_seclevel == 3 ) : return 16 elif ( pkt . nwk_seclevel == 4 ) : return 0 elif ( pkt . nwk_seclevel == 5 ) : return 4 elif ( pkt . nwk_seclevel == 6 ) : return 8 elif ( pkt . nwk_seclevel == 7 ) : return 16 else : return 0
Calculate the length of the attribute value field