use std::net::IpAddr;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Message {
RegisterAddr(RegisterAddr),
UnreachableAddr(UnreachableAddr),
NtpTaskShutdown(NtpTaskShutdown),
}
impl Message {
pub fn new_register_addr(addr: IpAddr) -> Self {
Message::RegisterAddr(RegisterAddr { addr })
}
pub fn new_unreachable_addr(addr: IpAddr) -> Self {
Message::UnreachableAddr(UnreachableAddr { addr })
}
pub fn new_ntp_task_shutdown(addr: IpAddr) -> Self {
Message::NtpTaskShutdown(NtpTaskShutdown { addr })
}
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct RegisterAddr {
pub addr: IpAddr,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct UnreachableAddr {
pub addr: IpAddr,
}
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct NtpTaskShutdown {
pub addr: IpAddr,
}