Trait NetlinkConnection

Source
pub trait NetlinkConnection {
    // Required methods
    fn new() -> Result<Self, NetlinkError>
       where Self: Sized;
    fn qdiscs(&self) -> Result<Vec<TcMsg>, NetlinkError>;
    fn classes(&self, index: i32) -> Result<Vec<TcMsg>, NetlinkError>;
    fn links(&self) -> Result<Vec<LinkMsg>, NetlinkError>;
}
Expand description

A trait for a netlink connection.

This trait allows for mocking the netlink connection in tests.

Required Methods§

Source

fn new() -> Result<Self, NetlinkError>
where Self: Sized,

Create a new netlink connection. Initialize a new netlink socket and connect to the kernel.

Source

fn qdiscs(&self) -> Result<Vec<TcMsg>, NetlinkError>

Get all qdiscs from Netlink.

Source

fn classes(&self, index: i32) -> Result<Vec<TcMsg>, NetlinkError>

Get all classes from Netlink.

Get all links from Netlink.

Implementors§