smb: convert 'close' parser to function

pull/7186/head
Victor Julien 3 years ago
parent 54d34c96f5
commit b9cd502249

@ -772,14 +772,14 @@ pub struct SmbRequestCloseRecord<'a> {
pub fid: &'a[u8],
}
named!(pub parse_smb1_close_request_record<SmbRequestCloseRecord>,
do_parse!(
take!(1)
>> fid: take!(2)
>> (SmbRequestCloseRecord {
fid:fid,
}))
);
pub fn parse_smb1_close_request_record(i: &[u8]) -> IResult<&[u8], SmbRequestCloseRecord> {
let (i, _) = take(1_usize)(i)?;
let (i, fid) = take(2_usize)(i)?;
let record = SmbRequestCloseRecord {
fid,
};
Ok((i, record))
}
#[derive(Debug,PartialEq)]
pub struct SmbVersion<> {

Loading…
Cancel
Save