pub fn parse_esp_header<'a>(i: &'a[u8]) -> IResult<&'a[u8],ESPHeader<'a>> {
    do_parse!(
        i,
        spi_index:  take!(4) >>
        seq:        be_u32 >>
        data:       rest >>
        (
            ESPHeader{
                spi_index: spi_index,
                seq: seq,
                data: data
            }
        )
    )
}
/// Parse an ESP packet
///
/// The ESP header contains:
///
/// - the SPI index
/// - the sequence number
/// - the payload data (which can be encrypted)
///
/// *Note: input is entirely consumed*
Parse an ESP packet
The ESP header contains.

the SPI index
the sequence number
the payload data (which can be encrypted)

input is entirely consumed
Parse an ESP packet The ESP header contains . the SPI index the sequence number the payload data ( which can be encrypted ) input is entirely consumed
pub fn parse_esp_header<'a>(i: &'a[u8]) -> IResult<&'a[u8],ESPHeader<'a>> {
    do_parse!(
        i,
        spi_index:  take!(4) >>
        seq:        be_u32 >>
        data:       rest >>
        (
            ESPHeader{
                spi_index: spi_index,
                seq: seq,
                data: data
            }
        )
    )
}
pub fn parse_esp_header < ' a > ( i : & ' a [ u8 ] ) -> IResult < & ' a [ u8 ] , ESPHeader < ' a > > { do_parse ! ( i spi_index take ( 4 ) seq be_u32 data rest ( ESPHeader { spi_index spi_index seq seq data data } ) ) }
Parse an ESP packet
The ESP header contains:
Parse an ESP packet The ESP header contains :
i
&'a[u8]