def read_header(self):
_magn = self._read_fileng(<NUM_LIT:4>)<EOL>if _magn == b'<STR_LIT>':<EOL><INDENT>lilendian = True<EOL>self._nsec = False<EOL>self._byte = '<STR_LIT>'<EOL><DEDENT>elif _magn == b'<STR_LIT>':<EOL><INDENT>lilendian = False<EOL>self._nsec = False<EOL>self._byte = '<STR_LIT>'<EOL><DEDENT>elif _magn == b'<STR_LIT>':<EOL><INDENT>lilendian = True<EOL>self._nsec = True<EOL>self._byte = '<STR_LIT>'<EOL><DEDENT>elif _magn == b'<STR_LIT>':<EOL><INDENT>lilendian = False<EOL>self._nsec = True<EOL>self._byte = '<STR_LIT>'<EOL><DEDENT>else:<EOL><INDENT>raise FileError(<NUM_LIT:5>, '<STR_LIT>', self._file.name)<EOL><DEDENT>_vmaj = self._read_unpack(<NUM_LIT:2>, lilendian=lilendian)<EOL>_vmin = self._read_unpack(<NUM_LIT:2>, lilendian=lilendian)<EOL>_zone = self._read_unpack(<NUM_LIT:4>, lilendian=lilendian, signed=True)<EOL>_acts = self._read_unpack(<NUM_LIT:4>, lilendian=lilendian)<EOL>_slen = self._read_unpack(<NUM_LIT:4>, lilendian=lilendian)<EOL>_type = self._read_protos(<NUM_LIT:4>)<EOL>_byte = self._read_packet(<NUM_LIT>)<EOL>self._file = io.BytesIO(_byte) <EOL>header = dict(<EOL>magic_number=dict(<EOL>data=_magn,<EOL>byteorder=self._byte,<EOL>nanosecond=self._nsec,<EOL>),<EOL>version_major=_vmaj,<EOL>version_minor=_vmin,<EOL>thiszone=_zone,<EOL>sigfigs=_acts,<EOL>snaplen=_slen,<EOL>network=_type,<EOL>packet=_byte,<EOL>)<EOL>return header<EOL>
Read global header of PCAP file.

        Structure of global header (C):
            typedef struct pcap_hdr_s {
                guint32 magic_number;   /* magic number */
                guint16 version_major;  /* major version number */
                guint16 version_minor;  /* minor version number */
                gint32  thiszone;       /* GMT to local correction */
                guint32 sigfigs;        /* accuracy of timestamps */
                guint32 snaplen;        /* max length of captured packets, in octets */
                guint32 network;        /* data link type */
            } pcap_hdr_t;