use thiserror::Error;
#[derive(Error, Debug)]
pub enum Error {
#[error("I/O error talking to lldpd: {0}")]
Io(#[from] std::io::Error),
#[error("unexpected reply from lldpd: expected message type {expected}, got {got}")]
UnexpectedMessageType { expected: u32, got: u32 },
#[error("lldpd rejected the request (interface not found, or feature disabled)")]
RequestRejected,
#[error("malformed lldpd control-protocol message: {0}")]
Protocol(String),
}
pub type Result<T> = std::result::Result<T, Error>;