Source code for pcapkit.protocols.data.misc.pcap.header
# -*- coding: utf-8 -*-"""data models for global header of PCAP file"""fromtypingimportTYPE_CHECKINGfrompcapkit.corekit.infoclassimportinfo_finalfrompcapkit.protocols.data.dataimportDatafrompcapkit.protocols.data.protocolimportProtocolifTYPE_CHECKING:fromtyping_extensionsimportLiteralfrompcapkit.const.reg.linktypeimportLinkTypefrompcapkit.corekit.versionimportVersionInfo__all__=['Header','MagicNumber']
[docs]@info_finalclassMagicNumber(Data):"""Magic number of PCAP file."""#: Magic number sequence.data:'bytes'#: Byte order.byteorder:'Literal["big", "little"]'#: Nanosecond-timestamp resolution flag.nanosecond:'bool'ifTYPE_CHECKING:def__init__(self,data:'bytes',byteorder:'Literal["big", "little"]',nanosecond:'bool')->'None':...# pylint: disable=unused-argument,super-init-not-called,multiple-statements
[docs]@info_finalclassHeader(Protocol):"""Global header of PCAP file."""#: Magic number.magic_number:'MagicNumber'#: Version number.version:'VersionInfo'#: GMT to local correction.thiszone:'int'#: Accuracy of timestamps.sigfigs:'int'#: Max length of captured packets, in octets.snaplen:'int'#: Data link type.network:'LinkType'ifTYPE_CHECKING:def__init__(self,magic_number:'MagicNumber',version:'VersionInfo',# pylint: disable=unused-argument,super-init-not-called,multiple-statementsthiszone:'int',sigfigs:'int',snaplen:'int',network:'LinkType')->'None':...# pylint: disable=unused-argument