Source code for pcapkit.protocols.data.internet.ipv6
# -*- coding: utf-8 -*-"""data model for Internet Protocol version 6"""fromtypingimportTYPE_CHECKINGfrompcapkit.corekit.infoclassimportinfo_finalfrompcapkit.protocols.data.protocolimportProtocolifTYPE_CHECKING:fromipaddressimportIPv6AddressfromtypingimportAnyfromtyping_extensionsimportLiteralfrompcapkit.const.reg.transtypeimportTransTypefrompcapkit.protocols.data.protocolimportPacket__all__=['IPv6',]
[docs]@info_finalclassIPv6(Protocol):"""Data model for Internet Protocol version 6. Important: Due to the preserved keyword conflict, please use :meth:`from_dict` to create an instance of this data model. """#: Version.version:'Literal[6]'#: Traffic class.#class: 'int'#: Flow label.label:'int'#: Payload length.payload:'int'#: Next header.next:'TransType'#: Hop limit.limit:'int'#: Source address.src:'IPv6Address'#: Destination address.dst:'IPv6Address'ifTYPE_CHECKING:#: Fragmented packet header & payload (from IPv6-Frag header).fragment:'Packet'#: Highest header protocol type (extension header excluded).protocol:'TransType'#: Header length (including extension headers).hdr_len:'int'#: Raw payload length (excluding extension headers).raw_len:'int'def__new__(cls,*args:'Any',**kwargs:'Any')->'IPv6':self=super().__new__(cls,*args,**kwargs)# NOTE: We cannot define ``class`` due to preserved keyword conflict.# Thus, we directly inject the information into the annotations.self.__annotations__['class']=int# pylint: disable=no-memberreturnself