pub struct IesMerger { /* private fields */ }
Expand description
IesMerger is intended to be used to merge beacon and probe response IEs from scan results, as some IEs are only available on one frame type, or an IE may exist on both but contains more information on one frame type over the other.
IesMerger therefore has two purposes:
- Combine unique IEs from each one into a single IE block.
- Pick which IE to keep when the same type is available in multiple IE blocks but has different information: a. IesMerger knows about and uses custom logic for specific IE (e.g. for SSID, we prioritize non-hidden SSID over hidden SSID). b. In the general case, IesMerger keeps the IE that has more bytes (known use case: for WPS IE, the one in probe response contains more information). c. If the number of bytes are the same, IesMerger keeps the later one.
Implementations§
Source§impl IesMerger
impl IesMerger
pub fn new(ies: Vec<u8>) -> Self
pub fn merge(&mut self, ies: &[u8])
Sourcepub fn finalize(&mut self) -> Vec<u8> ⓘ
pub fn finalize(&mut self) -> Vec<u8> ⓘ
Build and return merged IEs, sorted by order of IeType.
Sourcepub fn buffer_overflow(&mut self) -> bool
pub fn buffer_overflow(&mut self) -> bool
Return a bool indicating whether an IE was not merged because it would have exceeded IesMerger’s buffer.
Sourcepub fn merge_ie_failures(&self) -> usize
pub fn merge_ie_failures(&self) -> usize
Return the number of times IesMerger decides to merge an IE but it fails to. This should never occur, but we keep a counter in case the assumption is violated.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for IesMerger
impl RefUnwindSafe for IesMerger
impl Send for IesMerger
impl Sync for IesMerger
impl Unpin for IesMerger
impl UnwindSafe for IesMerger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more