def _decode_next_layer(self, dict_, proto=None, length=None, *, version=<NUM_LIT:4>, ipv6_exthdr=None):
if self._onerror:<EOL><INDENT>next_ = beholder(self._import_next_layer)(self, proto, length, version=version)<EOL><DEDENT>else:<EOL><INDENT>next_ = self._import_next_layer(proto, length, version=version)<EOL><DEDENT>info, chain = next_.info, next_.protochain<EOL>layer = next_.alias.lower()<EOL>dict_[layer] = info<EOL>self._next = next_<EOL>if ipv6_exthdr is not None:<EOL><INDENT>for proto in reversed(ipv6_exthdr):<EOL><INDENT>chain = ProtoChain(proto.__class__, proto.alias, basis=chain)<EOL><DEDENT><DEDENT>self._protos = ProtoChain(self.__class__, self.alias, basis=chain)<EOL>return dict_<EOL>
Decode next layer extractor.

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

        Keyword Arguments:
            * version -- int, IP version (4 in default)
                            <keyword> 4 / 6
            * ext_proto -- ProtoChain, ProtoChain of IPv6 extension headers

        Returns:
            * dict -- current protocol with next layer extracted