@@ -45,7 +45,7 @@ impl<'a> InterfaceDescriptionBlock<'a> {
4545 /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
4646 /// or `Some(Err(_))` if value is present but invalid
4747 pub fn if_name ( & self ) -> Option < Result < & str , PcapNGOptionError > > {
48- options_get_as_string ( & self . options , OptionCode :: IfName )
48+ options_get_as_str ( & self . options , OptionCode :: IfName )
4949 }
5050
5151 /// Return the `if_description` option value, if present
@@ -55,7 +55,7 @@ impl<'a> InterfaceDescriptionBlock<'a> {
5555 /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
5656 /// or `Some(Err(_))` if value is present but invalid
5757 pub fn if_description ( & self ) -> Option < Result < & str , PcapNGOptionError > > {
58- options_get_as_string ( & self . options , OptionCode :: IfDescription )
58+ options_get_as_str ( & self . options , OptionCode :: IfDescription )
5959 }
6060
6161 /// Return the `if_os` option value, if present
@@ -65,7 +65,7 @@ impl<'a> InterfaceDescriptionBlock<'a> {
6565 /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
6666 /// or `Some(Err(_))` if value is present but invalid
6767 pub fn if_os ( & self ) -> Option < Result < & str , PcapNGOptionError > > {
68- options_get_as_string ( & self . options , OptionCode :: IfOs )
68+ options_get_as_str ( & self . options , OptionCode :: IfOs )
6969 }
7070
7171 /// Return the `if_ipv4addr` option values, if present
@@ -140,6 +140,66 @@ impl<'a> InterfaceDescriptionBlock<'a> {
140140 Some ( res)
141141 }
142142 }
143+
144+ /// Return the `if_macaddr` option value, if present
145+ ///
146+ /// If the option is present multiple times, the first value is returned.
147+ ///
148+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
149+ /// or `Some(Err(_))` if value is present but invalid
150+ pub fn if_macaddr ( & self ) -> Option < Result < & [ u8 ] , PcapNGOptionError > > {
151+ options_get_as_bytes ( & self . options , OptionCode :: IfMacAddr )
152+ }
153+
154+ /// Return the `if_euiaddr` option value, if present
155+ ///
156+ /// If the option is present multiple times, the first value is returned.
157+ ///
158+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
159+ /// or `Some(Err(_))` if value is present but invalid
160+ pub fn if_euiaddr ( & self ) -> Option < Result < & [ u8 ] , PcapNGOptionError > > {
161+ options_get_as_bytes ( & self . options , OptionCode :: IfEuiAddr )
162+ }
163+
164+ /// Return the `if_speed` option value, if present
165+ ///
166+ /// If the option is present multiple times, the first value is returned.
167+ ///
168+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
169+ /// or `Some(Err(_))` if value is present but invalid
170+ pub fn if_speed ( & self ) -> Option < Result < u64 , PcapNGOptionError > > {
171+ options_get_as_u64_le ( & self . options , OptionCode :: IfSpeed )
172+ }
173+
174+ /// Return the `if_tsresol` option value, if present
175+ ///
176+ /// If the option is present multiple times, the first value is returned.
177+ ///
178+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
179+ /// or `Some(Err(_))` if value is present but invalid
180+ pub fn if_tsresol ( & self ) -> Option < Result < u8 , PcapNGOptionError > > {
181+ options_get_as_u8 ( & self . options , OptionCode :: IfTsresol )
182+ }
183+
184+ /// Return the `if_filter` option value, if present
185+ ///
186+ /// If the option is present multiple times, the first value is returned.
187+ ///
188+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
189+ /// or `Some(Err(_))` if value is present but invalid
190+ pub fn if_filter ( & self ) -> Option < Result < & str , PcapNGOptionError > > {
191+ options_get_as_str ( & self . options , OptionCode :: IfFilter )
192+ }
193+
194+ /// Return the `if_tsoffset` option value, if present
195+ ///
196+ /// If the option is present multiple times, the first value is returned.
197+ ///
198+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
199+ /// or `Some(Err(_))` if value is present but invalid
200+ pub fn if_tsoffset ( & self ) -> Option < Result < i64 , PcapNGOptionError > > {
201+ options_get_as_i64_le ( & self . options , OptionCode :: IfTsoffset )
202+ }
143203}
144204
145205impl < ' a , En : PcapEndianness > PcapNGBlockParser < ' a , En , InterfaceDescriptionBlock < ' a > >
0 commit comments