refactor(config): remove unimplemented measurement types
Remove NTP and TCP timestamp variants from the measurement type configuration since they are currently unimplemented and lead to runtime panics.
This commit is contained in:
3 files changed
-12
No files matched your search
@@ -66,8 +66,6 @@ impl From<FlexiBool> for bool {
|
|||||||
pub enum MeasurementType {
|
pub enum MeasurementType {
|
||||||
Icmp = 1,
|
Icmp = 1,
|
||||||
IcmpTimestamps,
|
IcmpTimestamps,
|
||||||
Ntp,
|
|
||||||
TcpTimestamps,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for MeasurementType {
|
impl Display for MeasurementType {
|
||||||
@@ -75,8 +73,6 @@ impl Display for MeasurementType {
|
|||||||
match self {
|
match self {
|
||||||
MeasurementType::Icmp => write!(f, "icmp"),
|
MeasurementType::Icmp => write!(f, "icmp"),
|
||||||
MeasurementType::IcmpTimestamps => write!(f, "icmp-timestamps"),
|
MeasurementType::IcmpTimestamps => write!(f, "icmp-timestamps"),
|
||||||
MeasurementType::Ntp => write!(f, "ntp"),
|
|
||||||
MeasurementType::TcpTimestamps => write!(f, "tcp-timestamps"),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -88,8 +84,6 @@ impl FromStr for MeasurementType {
|
|||||||
return match s.to_lowercase().as_str() {
|
return match s.to_lowercase().as_str() {
|
||||||
"icmp" => Ok(MeasurementType::Icmp),
|
"icmp" => Ok(MeasurementType::Icmp),
|
||||||
"icmp-timestamps" => Ok(MeasurementType::IcmpTimestamps),
|
"icmp-timestamps" => Ok(MeasurementType::IcmpTimestamps),
|
||||||
"ntp" => Ok(MeasurementType::Ntp),
|
|
||||||
"tcp-timestamps" => Ok(MeasurementType::TcpTimestamps),
|
|
||||||
&_ => Err(ConfigError::InvalidMeasurementType(s.to_string())),
|
&_ => Err(ConfigError::InvalidMeasurementType(s.to_string())),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -95,9 +95,6 @@ fn create_pinger(measurement_type: MeasurementType) -> (PingListenerBox, PingSen
|
|||||||
Box::new(PingerICMPTimestampListener {}),
|
Box::new(PingerICMPTimestampListener {}),
|
||||||
Box::new(PingerICMPTimestampSender {}),
|
Box::new(PingerICMPTimestampSender {}),
|
||||||
),
|
),
|
||||||
MeasurementType::Ntp | MeasurementType::TcpTimestamps => {
|
|
||||||
todo!()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -60,9 +60,6 @@ const INFLIGHT_PROBE_TTL: Duration = Duration::from_secs(30);
|
|||||||
fn open_socket(type_: MeasurementType) -> io::Result<IcmpSocket4> {
|
fn open_socket(type_: MeasurementType) -> io::Result<IcmpSocket4> {
|
||||||
match type_ {
|
match type_ {
|
||||||
MeasurementType::Icmp | MeasurementType::IcmpTimestamps => IcmpSocket4::new(),
|
MeasurementType::Icmp | MeasurementType::IcmpTimestamps => IcmpSocket4::new(),
|
||||||
_ => {
|
|
||||||
unimplemented!()
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user