Answers for "packet sniffing with rust"

0

packet sniffing with rust

use pcap::Device;

fn main() {
    let mut cap = Device::lookup().unwrap().open().unwrap();

    while let Ok(packet) = cap.next() {
        println!("received packet! {:?}", packet);
    }
}
Posted by: Guest on December-06-2020

Browse Popular Code Answers by Language