pub fn parse_file<'a>(
        input: &'a [u8],
    ) -> IResult<
        &'a [u8],
        (
            global_header::GlobalHeader,
            std::vec::Vec<record::PcapRecord<'a>>,
        ),
    > {
        let header_res = global_header::GlobalHeader::parse(input);

        header_res.and_then(|r| {
            let (rem, header) = r;

            debug!(
                "Global header version {}.{}, with endianness {:?}",
                header.version_major(),
                header.version_minor(),
                header.endianness()
            );

            CaptureParser::parse_records(rem, header.endianness()).map(|records_res| {
                let (records_rem, records) = records_res;

                trace!("{} bytes left for record parsing", records_rem.len());

                (records_rem, (header, records))
            })
        })
    }
///
/// Parse a slice of bytes that start with libpcap file format header (https://wiki.wireshark.org/Development/LibpcapFileFormat)
///
Parse a slice of bytes that start with libpcap file format header
Parse a slice of bytes that start with libpcap file format header
pub fn parse_file<'a>(
        input: &'a [u8],
    ) -> IResult<
        &'a [u8],
        (
            global_header::GlobalHeader,
            std::vec::Vec<record::PcapRecord<'a>>,
        ),
    > {
        let header_res = global_header::GlobalHeader::parse(input);
        header_res.and_then(|r| {
            let (rem, header) = r;
            debug!(
                "Global header version {}.{}, with endianness {:?}",
                header.version_major(),
                header.version_minor(),
                header.endianness()
            );
            CaptureParser::parse_records(rem, header.endianness()).map(|records_res| {
                let (records_rem, records) = records_res;
                trace!("{} bytes left for record parsing", records_rem.len());
                (records_rem, (header, records))
            })
        })
    }
pub fn parse_file < ' a > ( input : & ' a [ u8 ] , ) -> IResult < & ' a [ u8 ] , ( global_header :: GlobalHeader , std :: vec :: Vec < record :: PcapRecord < ' a > > , ) , > { let header_res = global_header :: GlobalHeader :: parse ( input ) ; header_res . and_then ( | r | { let ( rem , header ) = r ; debug ! ( " " header version_major ( ) header version_minor ( ) header endianness ( ) ) ; CaptureParser :: parse_records ( rem , header . endianness ( ) ) . map ( | records_res | { let ( records_rem , records ) = records_res ; trace ! ( " " records_rem len ( ) ) ; ( records_rem , ( header , records ) ) } ) } ) }
Parse a slice of bytes that start with libpcap file format header (https://wiki.wireshark.org/Development/LibpcapFileFormat)
Parse a slice of bytes that start with libpcap file format header ( https : // wiki . wireshark . org / Development / LibpcapFileFormat )
input
&'a [u8]