Skip to main content

layer2_work

Function layer2_work 

Source
pub fn layer2_work(
    dst_mac: MacAddr,
    interface: NetworkInterface,
    payload: &[u8],
    payload_len: usize,
    ethernet_type: EtherType,
    layer_matchs: Vec<LayerMatch>,
    timeout: Option<Duration>,
    need_return: bool,
) -> Result<(Vec<u8>, Duration), PistolError>
Expand description

In order to prevent other threads from reading and discarding data packets that do not belong to them during the multi-threaded multi-packet sending process, and to improve the stability of the scan, I decided to put the reception of all data packets into one thread.