def _import_next_layer(self, proto, length):
        """Import next layer extractor.

        Positional arguments:
            * proto -- str, next layer protocol name
            * length -- int, valid (not padding) length

        Returns:
            * bool -- flag if extraction of next layer succeeded
            * Info -- info of next layer
            * ProtoChain -- protocol chain of next layer
            * str -- alias of next layer

        Protocols:
            * ARP -- data link layer
            * RARP -- data link layer
            * VLAN -- data link layer
            * IPv4 -- internet layer
            * IPv6 -- internet layer
            * IPX -- internet layer

        """
        if length == 0:
            from pcapkit.protocols.null import NoPayload as Protocol
        elif self._sigterm:
            from pcapkit.protocols.raw import Raw as Protocol
        elif proto == 0x0806:
            from pcapkit.protocols.link.arp import ARP as Protocol
        elif proto == 0x8035:
            from pcapkit.protocols.link.rarp import RARP as Protocol
        elif proto == 0x8100:
            from pcapkit.protocols.link.vlan import VLAN as Protocol
        elif proto == 0x0800:
            from pcapkit.protocols.internet.ipv4 import IPv4 as Protocol
        elif proto == 0x86DD:
            from pcapkit.protocols.internet.ipv6 import IPv6 as Protocol
        elif proto == 0x8137:
            from pcapkit.protocols.internet.ipx import IPX as Protocol
        else:
            from pcapkit.protocols.raw import Raw as Protocol
        next_ = Protocol(self._file, length, error=self._onerror,
                         layer=self._exlayer, protocol=self._exproto)
        return next_
def _import_next_layer ( self , proto , length ) : if length == 0 : from pcapkit . protocols . null import NoPayload as Protocol elif self . _sigterm : from pcapkit . protocols . raw import Raw as Protocol elif proto == 0x0806 : from pcapkit . protocols . link . arp import ARP as Protocol elif proto == 0x8035 : from pcapkit . protocols . link . rarp import RARP as Protocol elif proto == 0x8100 : from pcapkit . protocols . link . vlan import VLAN as Protocol elif proto == 0x0800 : from pcapkit . protocols . internet . ipv4 import IPv4 as Protocol elif proto == 0x86DD : from pcapkit . protocols . internet . ipv6 import IPv6 as Protocol elif proto == 0x8137 : from pcapkit . protocols . internet . ipx import IPX as Protocol else : from pcapkit . protocols . raw import Raw as Protocol next_ = Protocol ( self . _file , length , error = self . _onerror , layer = self . _exlayer , protocol = self . _exproto ) return next_
Import next layer extractor.

        Positional arguments:
            * proto -- str, next layer protocol name
            * length -- int, valid (not padding) length

        Returns:
            * bool -- flag if extraction of next layer succeeded
            * Info -- info of next layer
            * ProtoChain -- protocol chain of next layer
            * str -- alias of next layer

        Protocols:
            * ARP -- data link layer
            * RARP -- data link layer
            * VLAN -- data link layer
            * IPv4 -- internet layer
            * IPv6 -- internet layer
            * IPX -- internet layer