📜  使用 rust 代码示例进行数据包嗅探

📅  最后修改于: 2022-03-11 14:49:24.801000             🧑  作者: Mango

代码示例1
use pcap::Device;

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

    while let Ok(packet) = cap.next() {
        println!("received packet! {:?}", packet);
    }
}