fn find_option_ipv4_list(
        &mut self,
        option: Options,
    ) -> Result<Option<Ipv4Addr>, Error<W::Error>> {
        let option_size: u8 = match self.seek_to_option(option)? {
            Some(len) => len,
            None => return Ok(None),
        };
        if option_size % 4 != 0 || option_size < 4 {
            warn!(
                "malformed option {} size is {} expected non-zero multiple of 4",
                option as u8, option_size
            );
            Ok(None)
        } else {
            let mut buf: [u8; 4] = [0; 4];
            self.reader.read_exact(&mut buf)?;
            Ok(Some(buf.into()))
        }
    }
// only returns the first ipv4 occurance in a list
only returns the first ipv4 occurance in a list
only returns the first ipv4 occurance in a list
fn find_option_ipv4_list(
        &mut self,
        option: Options,
    ) -> Result<Option<Ipv4Addr>, Error<W::Error>> {
        let option_size: u8 = match self.seek_to_option(option)? {
            Some(len) => len,
            None => return Ok(None),
        };
        if option_size % 4 != 0 || option_size < 4 {
            warn!(
                "malformed option {} size is {} expected non-zero multiple of 4",
                option as u8, option_size
            );
            Ok(None)
        } else {
            let mut buf: [u8; 4] = [0; 4];
            self.reader.read_exact(&mut buf)?;
            Ok(Some(buf.into()))
        }
    }
fn find_option_ipv4_list ( & mut self , option : Options , ) -> Result < Option < Ipv4Addr > , Error < W :: Error > > { let option_size : u8 = match self . seek_to_option ( option ) ? { Some ( len ) => len , None => return Ok ( None ) , } ; if option_size % 4 != 0 || option_size < 4 { warn ! ( " " option as u8 option_size ) ; Ok ( None ) } else { let mut buf : [ u8 ; 4 ] = [ 0 ; 4 ] ; self . reader . read_exact ( & mut buf ) ? ; Ok ( Some ( buf . into ( ) ) ) } }
only returns the first ipv4 occurance in a list
only returns the first ipv4 occurance in a list
&mut self
option
Options
&mut self
option
Options