@@ -17,6 +17,86 @@ pub struct InterfaceStatisticsBlock<'a> {
1717 pub block_len2 : u32 ,
1818}
1919
20+ impl < ' a > InterfaceStatisticsBlock < ' a > {
21+ /// Return the `isb_starttime` option value, if present
22+ ///
23+ /// The returned value is `(ts_high,ts_low)`. To convert to a full timestamp,
24+ /// use the [build_ts] function with the `ts_offset` and `resolution` values from
25+ /// the `InterfaceDescriptionBlock` matching `self.if_id`.
26+ ///
27+ /// If the option is present multiple times, the first value is returned.
28+ ///
29+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
30+ /// or `Some(Err(_))` if value is present but invalid
31+ pub fn isb_starttime ( & self ) -> Option < Result < ( u32 , u32 ) , PcapNGOptionError > > {
32+ options_get_as_ts ( & self . options , OptionCode :: IsbStartTime )
33+ }
34+
35+ /// Return the `isb_endtime` option value, if present
36+ ///
37+ /// The returned value is `(ts_high,ts_low)`. To convert to a full timestamp,
38+ /// use the [build_ts] function with the `ts_offset` and `resolution` values from
39+ /// the `InterfaceDescriptionBlock` matching `self.if_id`.
40+ ///
41+ /// If the option is present multiple times, the first value is returned.
42+ ///
43+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
44+ /// or `Some(Err(_))` if value is present but invalid
45+ pub fn isb_endtime ( & self ) -> Option < Result < ( u32 , u32 ) , PcapNGOptionError > > {
46+ options_get_as_ts ( & self . options , OptionCode :: IsbEndTime )
47+ }
48+
49+ /// Return the `isb_ifrecv` option value, if present
50+ ///
51+ /// If the option is present multiple times, the first value is returned.
52+ ///
53+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
54+ /// or `Some(Err(_))` if value is present but invalid
55+ pub fn isb_ifrecv ( & self ) -> Option < Result < u64 , PcapNGOptionError > > {
56+ options_get_as_u64_le ( & self . options , OptionCode :: IsbIfRecv )
57+ }
58+
59+ /// Return the `isb_ifdrop` option value, if present
60+ ///
61+ /// If the option is present multiple times, the first value is returned.
62+ ///
63+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
64+ /// or `Some(Err(_))` if value is present but invalid
65+ pub fn isb_ifdrop ( & self ) -> Option < Result < u64 , PcapNGOptionError > > {
66+ options_get_as_u64_le ( & self . options , OptionCode :: IsbIfDrop )
67+ }
68+
69+ /// Return the `isb_filteraccept` option value, if present
70+ ///
71+ /// If the option is present multiple times, the first value is returned.
72+ ///
73+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
74+ /// or `Some(Err(_))` if value is present but invalid
75+ pub fn isb_filteraccept ( & self ) -> Option < Result < u64 , PcapNGOptionError > > {
76+ options_get_as_u64_le ( & self . options , OptionCode :: IsbFilterAccept )
77+ }
78+
79+ /// Return the `isb_osdrop` option value, if present
80+ ///
81+ /// If the option is present multiple times, the first value is returned.
82+ ///
83+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
84+ /// or `Some(Err(_))` if value is present but invalid
85+ pub fn isb_osdrop ( & self ) -> Option < Result < u64 , PcapNGOptionError > > {
86+ options_get_as_u64_le ( & self . options , OptionCode :: IsbOsDrop )
87+ }
88+
89+ /// Return the `isb_usrdeliv` option value, if present
90+ ///
91+ /// If the option is present multiple times, the first value is returned.
92+ ///
93+ /// Returns `None` if option is not present, `Some(Ok(value))` if the value is present and valid,
94+ /// or `Some(Err(_))` if value is present but invalid
95+ pub fn isb_usrdeliv ( & self ) -> Option < Result < u64 , PcapNGOptionError > > {
96+ options_get_as_u64_le ( & self . options , OptionCode :: IsbUsrDeliv )
97+ }
98+ }
99+
20100impl < ' a , En : PcapEndianness > PcapNGBlockParser < ' a , En , InterfaceStatisticsBlock < ' a > >
21101 for InterfaceStatisticsBlock < ' a >
22102{
0 commit comments