Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR RUST

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);
    }
}
Source by docs.rs #
 
PREVIOUS NEXT
Tagged: #packet #sniffing #rust
ADD COMMENT
Topic
Name
8+5 =