Skip to content

Commit

Permalink
feat: add some more debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
SkuldNorniern committed Mar 13, 2024
1 parent e4d7c3d commit c034dbb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/net/capture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ impl CaptureDevice {
let capture = initialize_capture(device.clone())?;
let name: Cow<'static, str> = Cow::Owned(device.name);
let desc: Cow<'static, str> = Cow::Owned(device.desc.unwrap_or("".to_string()));

debug!("Using device: {}", name);
debug!("Device description: {}", desc);
debug!("Addresses: {:?}", device.addresses);
Ok(CaptureDevice {
name,
desc,
Expand All @@ -46,7 +48,6 @@ impl Drop for CaptureDevice {
fn drop(&mut self) {
info!("Closing capture session for device {}", self.name);
// println!("Closing capture session for device {}", self.name);
// self.capture.;
}
}
pub fn find_device(identifier: &str) -> Result<Device, NetError> {
Expand Down Expand Up @@ -84,6 +85,8 @@ fn initialize_capture(device: Device) -> Result<Capture<Active>, PcapError> {
info!("Opening capture session for device {}", device.name);
Capture::from_device(device)?
.promisc(true)

// FEAT:TASK: set snaplen as a Flag from the CLI
.snaplen(1024)
.timeout(60000)
.immediate_mode(true)
Expand Down

0 comments on commit c034dbb

Please sign in to comment.