mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2025-12-23 22:29:01 -05:00
include device name in traffic preview thread's name to facilitate debugging
This commit is contained in:
@@ -70,6 +70,7 @@ fn handle_devices_and_previews(
|
|||||||
let capture_source = CaptureSource::Device(my_dev);
|
let capture_source = CaptureSource::Device(my_dev);
|
||||||
let capture_context = CaptureContext::new(&capture_source, None, &Filters::default());
|
let capture_context = CaptureContext::new(&capture_source, None, &Filters::default());
|
||||||
let my_link_type = capture_context.my_link_type();
|
let my_link_type = capture_context.my_link_type();
|
||||||
|
let thread_name = format!("thread_traffic_preview_{dev_name}");
|
||||||
let dev_info = DevInfo {
|
let dev_info = DevInfo {
|
||||||
name: dev_name,
|
name: dev_name,
|
||||||
my_link_type,
|
my_link_type,
|
||||||
@@ -78,7 +79,7 @@ fn handle_devices_and_previews(
|
|||||||
continue;
|
continue;
|
||||||
};
|
};
|
||||||
let _ = thread::Builder::new()
|
let _ = thread::Builder::new()
|
||||||
.name("thread_device_traffic_preview".to_string())
|
.name(thread_name)
|
||||||
.spawn(move || {
|
.spawn(move || {
|
||||||
packet_stream(cap, &pcap_tx, &dev_info);
|
packet_stream(cap, &pcap_tx, &dev_info);
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user