rawsock 0.3.0

Library for receiving and sending raw packets. While most crate wrap just one library, rawsock allows you to use pcap, wpcap, npcap and pf_ring (pfring) using a consistent API for all of them.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use std::fmt::{Display, Formatter, Error as FmtError};

/// Describes a network interface.
#[derive(Debug, Clone)]
pub struct InterfaceDescription {
    ///Interface name that can be used as an argument for open_interface() function.
    pub name: String,
    /// Human friendly interface description.
    pub description: String
}

impl Display for InterfaceDescription{
    fn fmt(&self, f: &mut Formatter) -> Result<(), FmtError> {
        write!(f, "{}, {}", &self.name, &self.description)
    }
}