fn parse_bgp_attr_payload(input: &[u8], code: u8, len: u16) -> IResult<&[u8], Vec<u8>> {
    let len = len as usize;
    Ok((&input[len..], input[0..len].to_vec()))
    //    match BGPPathAttrTypes::from_u8(code) {
    //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_ORIGIN) => {
    //            Ok( (&input[len..], vec![&input[0..len]]) );
    //        }
    //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_ASPATH) => {
    //            Ok( (&input[len..], vec![&input[0..len]]) );
    //        }
    //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_NEXTHOP) => {
    //            Ok( (&input[len..], vec![&input[0..len]]) );
    //        }
    //    }
    //    //Err("No matching attr code".to_string());
}
// logically:
// I have a length to read.
// that byte range may have multiple attributes, each to be parsed
I have a length to read.
that byte range may have multiple attributes, each to be parsed
I have a length to read . that byte range may have multiple attributes each to be parsed
fn parse_bgp_attr_payload(input: &[u8], code: u8, len: u16) -> IResult<&[u8], Vec<u8>> {
    let len = len as usize;
    Ok((&input[len..], input[0..len].to_vec()))
    //    match BGPPathAttrTypes::from_u8(code) {
    //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_ORIGIN) => {
    //            Ok( (&input[len..], vec![&input[0..len]]) );
    //        }
    //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_ASPATH) => {
    //            Ok( (&input[len..], vec![&input[0..len]]) );
    //        }
    //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_NEXTHOP) => {
    //            Ok( (&input[len..], vec![&input[0..len]]) );
    //        }
    //    }
    //    //Err("No matching attr code".to_string());
}
fn parse_bgp_attr_payload ( input : & [ u8 ] , code : u8 , len : u16 ) -> IResult < & [ u8 ] , Vec < u8 > > { let len = len as usize ; Ok ( ( & input [ len .. ] , input [ 0 .. len ] . to_vec ( ) ) ) //    match BGPPathAttrTypes::from_u8(code) { //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_ORIGIN) => { //            Ok( (&input[len..], vec![&input[0..len]]) ); //        } //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_ASPATH) => { //            Ok( (&input[len..], vec![&input[0..len]]) ); //        } //        Some(BGPPathAttrTypes::BGP_PATH_ATTR_NEXTHOP) => { //            Ok( (&input[len..], vec![&input[0..len]]) ); //        } //    } //    //Err("No matching attr code".to_string()); }
logically:
I have a length to read.
logically : I have a length to read .
input
&[u8]
code
u8
len
u16