mirror of
https://github.com/GyulyVGC/sniffnet.git
synced 2026-10-24 08:02:12 +00:00
removed redudant clone()
This commit is contained in:
parent
f6a50e2491
commit
910314f7ee
1 changed files with 4 additions and 4 deletions
|
|
@ -65,8 +65,8 @@ pub fn sleep_and_write_report_loop(lowest_port: u16, highest_port: u16, interval
|
|||
}
|
||||
|
||||
let path_graph = &*format!("{}/bandwidth.svg", output_folder);
|
||||
let path_report = format!("{}/report.txt", output_folder.clone());
|
||||
let path_statistics = format!("{}/statistics.txt", output_folder.clone());
|
||||
let path_report = format!("{}/report.txt", output_folder);
|
||||
let path_statistics = format!("{}/statistics.txt", output_folder);
|
||||
|
||||
let time_origin = Local::now();
|
||||
let first_timestamp = time_origin.format("%d/%m/%Y %H:%M:%S").to_string();
|
||||
|
|
@ -93,7 +93,7 @@ pub fn sleep_and_write_report_loop(lowest_port: u16, highest_port: u16, interval
|
|||
let mut tot_received_packets_prev: i128 = 0;
|
||||
let mut max_received_packets_second: i128 = 0;
|
||||
|
||||
let mut output = BufWriter::new(File::create(path_report.clone()).expect("Error creating output file\n\r"));
|
||||
let mut output = BufWriter::new(File::create(path_report).expect("Error creating output file\n\r"));
|
||||
writeln!(output, "---------------------------------------------------------------------------------------------------------------------------------------------------------------------").expect("Error writing output file\n\r");
|
||||
writeln!(output, "| Src IP address | Src port | Dst IP address | Dst port | Layer 4 | Layer 7 | Packets | Bytes | Initial timestamp | Final timestamp |").expect("Error writing output file\n\r");
|
||||
writeln!(output, "---------------------------------------------------------------------------------------------------------------------------------------------------------------------").expect("Error writing output file\n\r");
|
||||
|
|
@ -121,7 +121,7 @@ pub fn sleep_and_write_report_loop(lowest_port: u16, highest_port: u16, interval
|
|||
write_statistics(output2.get_mut().try_clone().expect("Error cloning file handler\n\r"),
|
||||
device_name.clone(), first_timestamp.clone(),
|
||||
lowest_port, highest_port, network_layer.clone(),
|
||||
transport_layer.clone(), app_layer,
|
||||
transport_layer, app_layer,
|
||||
info_traffic.map.len(), all_packets,
|
||||
tot_received_packets+tot_sent_packets,
|
||||
info_traffic.app_protocols.clone());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue