commit 0cafdeac9acdae38b3187f408c9a6bfd774c3671 Author: Michael Preisach Date: Tue May 15 09:43:31 2018 +0200 initial commit diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..fc6a415 --- /dev/null +++ b/src/main.rs @@ -0,0 +1,21 @@ +extern crate pcap; +extern crate regex; +extern crate pcap_file; + +use pcap::Device; + +fn main() { + let devices = Device::list().unwrap(); + + println!("Devices:"); + + for i in devices { + println!("Device {:?}", i); + } + + let mut cap = Device::lookup().unwrap().open().unwrap(); + + while let Ok(packet) = cap.next() { + println!("received packet! {:?}", packet); + } +} \ No newline at end of file