/// Move a packet from one ring to another.
///
/// rx_slot_buf is the receipt slot to move from
/// tx_slot_buf is the transmission slot to move it into
Move a packet from one ring to another.
rx_slot_buf is the receipt slot to move from
tx_slot_buf is the transmission slot to move it into
Move a packet from one ring to another . rx_slot_buf is the receipt slot to move from tx_slot_buf is the transmission slot to move it into
fn move_packet(rx_slot_buf: (&mut netmap::RxSlot, &mut [u8]),
               tx_slot_buf: (&mut netmap::TxSlot, &mut [u8]))
               -> Result<(), error::BrokenRail> {
    // XXX: TODO: zero-copy when possible.
    let tgt_buf = &mut tx_slot_buf.1[0..rx_slot_buf.0.get_len() as usize];
    tgt_buf.copy_from_slice(rx_slot_buf.1);
    tx_slot_buf.0.set_len(rx_slot_buf.0.get_len());
    Ok(())
}
fn move_packet ( rx_slot_buf : ( & mut netmap :: RxSlot , & mut [ u8 ] ) , tx_slot_buf : ( & mut netmap :: TxSlot , & mut [ u8 ] ) ) -> Result < ( ) , error :: BrokenRail > { // XXX: TODO: zero-copy when possible. let tgt_buf = & mut tx_slot_buf . 1 [ 0 .. rx_slot_buf . 0 . get_len ( ) as usize ] ; tgt_buf . copy_from_slice ( rx_slot_buf . 1 ) ; tx_slot_buf . 0 . set_len ( rx_slot_buf . 0 . get_len ( ) ) ; Ok ( ( ) ) }
Move a packet from one ring to another.
Move a packet from one ring to another .
rx_slot_buf
(&mut netmap::RxSlot, &mut [u8])
tx_slot_buf
(&mut netmap::TxSlot, &mut [u8])