pub fn parse_esp_encapsulated<'a>(i: &'a[u8]) -> IResult<&'a[u8],ESPData<'a>> {
    match peek!(i, be_u32) {
        IResult::Done(_,0)       => parse_ikev2_header(i).map(|x| ESPData::IKE(x)),
        IResult::Done(_,_)       => parse_esp_header(i).map(|x| ESPData::ESP(x)),
        IResult::Incomplete(inc) => IResult::Incomplete(inc),
        IResult::Error(err)      => IResult::Error(err),
    }
}
/// Parse an encapsulated ESP packet
///
/// The type of encapsulated data depends on the first field (`spi_index`): 0 is a forbidden SPI
/// index, and indicates that the header is an IKE header.
/// Any other value indicates an ESP header.
///
/// *Note: input is entirely consumed*
Parse an encapsulated ESP packet
The type of encapsulated data depends on the first field (`spi_index`): 0 is a forbidden SPI
index, and indicates that the header is an IKE header.
Any other value indicates an ESP header.

input is entirely consumed
Parse an encapsulated ESP packet The type of encapsulated data depends on the first field ( ` spi_index ` ) : 0 is a forbidden SPI index and indicates that the header is an IKE header . Any other value indicates an ESP header . input is entirely consumed
pub fn parse_esp_encapsulated<'a>(i: &'a[u8]) -> IResult<&'a[u8],ESPData<'a>> {
    match peek!(i, be_u32) {
        IResult::Done(_,0)       => parse_ikev2_header(i).map(|x| ESPData::IKE(x)),
        IResult::Done(_,_)       => parse_esp_header(i).map(|x| ESPData::ESP(x)),
        IResult::Incomplete(inc) => IResult::Incomplete(inc),
        IResult::Error(err)      => IResult::Error(err),
    }
}
pub fn parse_esp_encapsulated < ' a > ( i : & ' a [ u8 ] ) -> IResult < & ' a [ u8 ] , ESPData < ' a > > { match peek ! ( i be_u32 ) { IResult :: Done ( _ , 0 ) => parse_ikev2_header ( i ) . map ( | x | ESPData :: IKE ( x ) ) , IResult :: Done ( _ , _ ) => parse_esp_header ( i ) . map ( | x | ESPData :: ESP ( x ) ) , IResult :: Incomplete ( inc ) => IResult :: Incomplete ( inc ) , IResult :: Error ( err ) => IResult :: Error ( err ) , } }
Parse an encapsulated ESP packet
The type of encapsulated data depends on the first field (`spi_index`): 0 is a forbidden SPI
index, and indicates that the header is an IKE header.
Parse an encapsulated ESP packet The type of encapsulated data depends on the first field ( ` spi_index ` ) : 0 is a forbidden SPI index and indicates that the header is an IKE header .
i
&'a[u8]