pub struct Nic {
pub interface: NetworkInterface,
/* private fields */
}
Expand description
NIC Structure that supports Packetvisor
Fields§
§interface: NetworkInterface
Attached network interface information.
(ex. interface name
, L2-3 address
, etc.)
Implementations§
Source§impl Nic
impl Nic
Sourcepub fn new(
if_name: &str,
chunk_size: usize,
chunk_count: usize,
fq_size: usize,
cq_size: usize,
tx_size: usize,
rx_size: usize,
) -> Result<Nic, String>
pub fn new( if_name: &str, chunk_size: usize, chunk_count: usize, fq_size: usize, cq_size: usize, tx_size: usize, rx_size: usize, ) -> Result<Nic, String>
§Description
Attaching pv::Nic
to network interface
§Arguments
if_name
- network interface name
chunk_size
- total size of packet payload
chunk_count
- total count of chunk
fq_size
- filling ring size
cq_size
- completion ring size
tx_size
- tx ring size
rx_size
- rx ring size \
§Returns
On success, returns pv::Nic
bound to the network interface.
On failure, returns an error string.
Sourcepub fn alloc_packet(&self) -> Option<Packet>
pub fn alloc_packet(&self) -> Option<Packet>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Nic
impl RefUnwindSafe for Nic
impl !Send for Nic
impl !Sync for Nic
impl Unpin for Nic
impl UnwindSafe for Nic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more