# Path: pyisis/lib/util.py
# def cast_as (bufptr, ctype):
#     try:
#         return ctype.from_buffer(bufptr)
#     except TypeError:
#         return cast(bufptr, POINTER(ctype)).contents
# 
# def tlvrdb (val):
#     # In python3 byte strings return integers when indexed
#     return val


from ctypes import BigEndianStructure, create_string_buffer
from ctypes import c_uint8, c_uint16, c_uint32, sizeof
from pyisis.lib.util import cast_as, tlvrdb
import pyisis.clns as clns
import sys
        fmtstr = "{}"
        args = [self.psnp_header]
        if VERYVERBOSE:
            fmtstr += "\n  [{}\n   {}\n   {}]"
            args += [self.mac_header,
                     self.llc_header,
                     self.clns_header]
        return fmtstr.format(*args)                         # pylint: disable=W0142


PDU_FRAME_TYPES = {
    clns.PDU_TYPE_IIH_LAN_L1: IIHLANFrame,
    clns.PDU_TYPE_IIH_LAN_L2: IIHLANFrame,
    clns.PDU_TYPE_IIH_P2P: IIHP2PFrame,
    clns.PDU_TYPE_LSP_L1: LSPFrame,
    clns.PDU_TYPE_LSP_L2: LSPFrame,
    clns.PDU_TYPE_CSNP_L1: CSNPFrame,
    clns.PDU_TYPE_CSNP_L2: CSNPFrame,
    clns.PDU_TYPE_PSNP_L1: PSNPFrame,
    clns.PDU_TYPE_PSNP_L2: PSNPFrame,
}

PDU_PDU_TYPES = {
    clns.PDU_TYPE_IIH_LAN_L1: IIHLANPDU,
    clns.PDU_TYPE_IIH_LAN_L2: IIHLANPDU,
    clns.PDU_TYPE_IIH_P2P: IIHP2PPDU,
    clns.PDU_TYPE_LSP_L1: LSPPDU,
    clns.PDU_TYPE_LSP_L2: LSPPDU,
    clns.PDU_TYPE_CSNP_L1: CSNPPDU,
    clns.PDU_TYPE_CSNP_L2: CSNPPDU,

# Path: pyisis/lib/util.py
# def cast_as (bufptr, ctype):
#     try:
#         return ctype.from_buffer(bufptr)
#     except TypeError:
#         return cast(bufptr, POINTER(ctype)).contents
# 
# def tlvrdb (val):
#     # In python3 byte strings return integers when indexed
#     return val


# Path: pyisis/pdu.py
from ctypes import BigEndianStructure, create_string_buffer
from ctypes import c_uint8, c_uint16, c_uint32, sizeof
from pyisis.lib.util import cast_as, tlvrdb
import pyisis.clns as clns
import sys

        fmtstr = "{}"
        args = [self.psnp_header]
        if VERYVERBOSE:
            fmtstr += "\n  [{}\n   {}\n   {}]"
            args += [self.mac_header,
                     self.llc_header,
                     self.clns_header]
        return fmtstr.format(*args)                         # pylint: disable=W0142


PDU_FRAME_TYPES = {
    clns.PDU_TYPE_IIH_LAN_L1: IIHLANFrame,
    clns.PDU_TYPE_IIH_LAN_L2: IIHLANFrame,
    clns.PDU_TYPE_IIH_P2P: IIHP2PFrame,
    clns.PDU_TYPE_LSP_L1: LSPFrame,
    clns.PDU_TYPE_LSP_L2: LSPFrame,
    clns.PDU_TYPE_CSNP_L1: CSNPFrame,
    clns.PDU_TYPE_CSNP_L2: CSNPFrame,
    clns.PDU_TYPE_PSNP_L1: PSNPFrame,
    clns.PDU_TYPE_PSNP_L2: PSNPFrame,
}

PDU_PDU_TYPES = {
    clns.PDU_TYPE_IIH_LAN_L1: IIHLANPDU,
    clns.PDU_TYPE_IIH_LAN_L2: IIHLANPDU,
    clns.PDU_TYPE_IIH_P2P: IIHP2PPDU,
    clns.PDU_TYPE_LSP_L1: LSPPDU,
    clns.PDU_TYPE_LSP_L2: LSPPDU,
    clns.PDU_TYPE_CSNP_L1: CSNPPDU,
    clns.PDU_TYPE_CSNP_L2: CSNPPDU,

    clns.PDU_TYPE_PSNP_L1: PSNPPDU,