pub fn write_tx_frame(&self, desc_list: &[(u16, u32, u16)], frame_len: usize) -> Vec<u8> {
            let mut frame = utils::rand::rand_alphanumerics(frame_len)
                .as_bytes()
                .to_vec();
            let prefix_len = vnet_hdr_len() + ETH_HLEN as usize;
            frame.splice(..prefix_len, vec![0; prefix_len]);

            let mut frame_slice = frame.as_slice();
            for &(index, len, _) in desc_list {
                let chunk_size = cmp::min(frame_slice.len(), len as usize);
                self.mem
                    .write_slice(
                        &frame_slice[..chunk_size],
                        GuestAddress::new(self.txq.dtable[index as usize].addr.get()),
                    )
                    .unwrap();
                frame_slice = &frame_slice[chunk_size..];
            }

            frame
        }
// Generates a frame of `frame_len` and writes it to the provided descriptor chain.
// Doesn't generate an error if the descriptor chain is longer than `frame_len`.
Generates a frame of `frame_len` and writes it to the provided descriptor chain.
Doesn't generate an error if the descriptor chain is longer than `frame_len`.
Generates a frame of ` frame_len ` and writes it to the provided descriptor chain . Doesn ' t generate an error if the descriptor chain is longer than ` frame_len ` .
pub fn write_tx_frame(&self, desc_list: &[(u16, u32, u16)], frame_len: usize) -> Vec<u8> {
            let mut frame = utils::rand::rand_alphanumerics(frame_len)
                .as_bytes()
                .to_vec();
            let prefix_len = vnet_hdr_len() + ETH_HLEN as usize;
            frame.splice(..prefix_len, vec![0; prefix_len]);
            let mut frame_slice = frame.as_slice();
            for &(index, len, _) in desc_list {
                let chunk_size = cmp::min(frame_slice.len(), len as usize);
                self.mem
                    .write_slice(
                        &frame_slice[..chunk_size],
                        GuestAddress::new(self.txq.dtable[index as usize].addr.get()),
                    )
                    .unwrap();
                frame_slice = &frame_slice[chunk_size..];
            }
            frame
        }
pub fn write_tx_frame ( & self , desc_list : & [ ( u16 , u32 , u16 ) ] , frame_len : usize ) -> Vec < u8 > { let mut frame = utils :: rand :: rand_alphanumerics ( frame_len ) . as_bytes ( ) . to_vec ( ) ; let prefix_len = vnet_hdr_len ( ) + ETH_HLEN as usize ; frame . splice ( .. prefix_len , vec ! [ 0 prefix_len ] ) ; let mut frame_slice = frame . as_slice ( ) ; for & ( index , len , _ ) in desc_list { let chunk_size = cmp :: min ( frame_slice . len ( ) , len as usize ) ; self . mem . write_slice ( & frame_slice [ .. chunk_size ] , GuestAddress :: new ( self . txq . dtable [ index as usize ] . addr . get ( ) ) , ) . unwrap ( ) ; frame_slice = & frame_slice [ chunk_size .. ] ; } frame }
Generates a frame of `frame_len` and writes it to the provided descriptor chain.
Generates a frame of ` frame_len ` and writes it to the provided descriptor chain .
&self
desc_list
&[(u16, u32, u16)]
frame_len
usize
&self
desc_list
&[(u16, u32, u16)]
frame_len
usize