diff --git a/src/log.rs b/src/log.rs index 61292b5..450edb9 100644 --- a/src/log.rs +++ b/src/log.rs @@ -1,8 +1,3 @@ -use static_init::dynamic; -use std::error::Error; -use std::fmt; -use std::str::FromStr; -use std::sync::{Arc, RwLock}; use std::time::SystemTime; use log::{Level, LevelFilter, Metadata, Record, SetLoggerError}; diff --git a/src/main.rs b/src/main.rs index b4c2180..1ce9c39 100644 --- a/src/main.rs +++ b/src/main.rs @@ -14,9 +14,8 @@ mod reflector_selector; mod utils; use crate::baseliner::{Baseliner, ReflectorStats}; -use ::log::{debug, error, info, Level, LevelFilter}; +use ::log::{debug, error, info}; use std::collections::HashMap; -use std::error::Error; use std::net::IpAddr; use std::process::ExitCode; use std::str::FromStr; @@ -27,8 +26,7 @@ use std::time::Duration; use std::{panic, process, thread}; use crate::config::{Config, MeasurementType}; -use crate::log::SimpleLogger; -use crate::netlink::{Netlink, Qdisc}; +use crate::netlink::Netlink; use crate::pinger::{PingListener, PingSender, SocketType}; use crate::pinger_icmp::{PingerICMPEchoListener, PingerICMPEchoSender}; use crate::pinger_icmp_ts::{PingerICMPTimestampListener, PingerICMPTimestampSender}; diff --git a/src/pinger.rs b/src/pinger.rs index d082081..ec067ec 100644 --- a/src/pinger.rs +++ b/src/pinger.rs @@ -83,7 +83,7 @@ pub trait PingListener { continue; } - let reply = match self.parse_packet(id, addr, buf, size) { + let reply = match self.parse_packet(id, addr, buf) { Ok(val) => val, Err(e) => { error!( @@ -104,7 +104,6 @@ pub trait PingListener { id: u16, reflector: IpAddr, buf: &[u8], - len: usize, ) -> Result>; } diff --git a/src/pinger_icmp_ts.rs b/src/pinger_icmp_ts.rs index 2c8e102..fc6a130 100644 --- a/src/pinger_icmp_ts.rs +++ b/src/pinger_icmp_ts.rs @@ -21,7 +21,6 @@ impl PingListener for PingerICMPTimestampListener { id: u16, reflector: IpAddr, buf: &[u8], - len: usize, ) -> Result> { match SlicedPacket::from_ip(buf) { Err(value) => warn!("Error parsing packet: {:?}", value), diff --git a/src/ratecontroller.rs b/src/ratecontroller.rs index 1b982dc..5f9646b 100644 --- a/src/ratecontroller.rs +++ b/src/ratecontroller.rs @@ -75,7 +75,7 @@ impl Ratecontroller { let sleep_time_ns = ((self.config.min_change_interval % 1.0) * 1e9) as u32; let sleep_time = Duration::new(sleep_time_s, sleep_time_ns); - let (start_s, start_ns) = Utils::get_current_time(); + let (start_s, _) = Utils::get_current_time(); let (mut lastchg_s, mut lastchg_ns) = Utils::get_current_time(); let mut lastchg_t = lastchg_s - start_s + lastchg_ns / 1e9; let mut lastdump_t = lastchg_t - 310.0; @@ -179,8 +179,8 @@ impl Ratecontroller { mut next_ul_rate, mut rx_load, mut tx_load, - mut up_utilisation, - mut down_utilisation, + up_utilisation, + down_utilisation, ): (f64, f64, f64, f64, f64, f64); rx_load = -1.0;