fn parse_mrt_table_dump_v2_ipv4_unicast<'a>(
    input: &'a [u8],
    header: &MRTHeader,
) -> IResult<&'a [u8], MRTTableDumpV2IPv4Unicast<'a>> {
    do_parse!(
        input,
        sequence_number: be_u32
            >> prefix_length: be_u8
            >> prefix: take!(prefix_octet_count(prefix_length))
            >> entry_count: be_u16
            >> rib_entries: call!(parse_rib_entries, entry_count)
            >> (MRTTableDumpV2IPv4Unicast {
                sequence_number,
                prefix_length,
                prefix,
                entry_count,
                rib_entries
            })
    )
}
// I had to break out of the macro here because it was grouching about lifetimes.
//named_args!(pub parse_mrt_table_dump_v2_ipv4_unicast<'a>(header: &'a MRTHeader)<MRTTableDumpV2IPv4Unicast>,
//
// This is ugly but the number of bytes for this part of the message is:
// length specific in header - sizeof(sequence_num) - sizeof(prefix_length) - prefix_octet_count - sizeof(entry_count)
//rib_entries:     take!(header.length - (size_of::<u32>() as u32) - (size_of::<u8>() as u32) - prefix_octet_count(prefix_length) - (size_of::<u16>() as u32))  >>
//rib_entries:     parse_rib_entry(input, header.length - (size_of::<u32>() as u32) - (size_of::<u8>() as u32) - prefix_octet_count(prefix_length) - (size_of::<u16>() as u32), entry_count) >>
I had to break out of the macro here because it was grouching about lifetimes.


I had to break out of the macro here because it was grouching about lifetimes .
fn parse_mrt_table_dump_v2_ipv4_unicast<'a>(
    input: &'a [u8],
    header: &MRTHeader,
) -> IResult<&'a [u8], MRTTableDumpV2IPv4Unicast<'a>> {
    do_parse!(
        input,
        sequence_number: be_u32
            >> prefix_length: be_u8
            >> prefix: take!(prefix_octet_count(prefix_length))
            >> entry_count: be_u16
            >> rib_entries: call!(parse_rib_entries, entry_count)
            >> (MRTTableDumpV2IPv4Unicast {
                sequence_number,
                prefix_length,
                prefix,
                entry_count,
                rib_entries
            })
    )
}
fn parse_mrt_table_dump_v2_ipv4_unicast < ' a > ( input : & ' a [ u8 ] , header : & MRTHeader , ) -> IResult < & ' a [ u8 ] , MRTTableDumpV2IPv4Unicast < ' a > > { do_parse ! ( input sequence_number be_u32 prefix_length be_u8 prefix take ( prefix_octet_count ( prefix_length ) ) entry_count be_u16 rib_entries call ( parse_rib_entries entry_count ) ( MRTTableDumpV2IPv4Unicast { sequence_number prefix_length prefix entry_count rib_entries } ) ) }
I had to break out of the macro here because it was grouching about lifetimes.
I had to break out of the macro here because it was grouching about lifetimes .
input
&'a [u8]
header
&MRTHeader