⚠️ VeridianOS Kernel Documentation - This is low-level kernel code. All functions are unsafe unless explicitly marked otherwise. no_std

TcpZeroCopySend

Struct TcpZeroCopySend 

Source
pub struct TcpZeroCopySend { /* private fields */ }
Expand description

TCP zero-copy send combining scatter-gather with TCP segmentation.

Collects data into a scatter-gather list and segments it into TCP MSS-sized chunks for transmission, avoiding intermediate copies where possible.

Implementations§

Source§

impl TcpZeroCopySend

Source

pub fn new(socket_id: usize, remote: SocketAddr) -> Self

Create a new TCP zero-copy send operation.

Source

pub fn set_mss(&mut self, mss: usize)

Set custom MSS (for path MTU discovery)

Source

pub fn add_buffer(&mut self, phys_addr: u64, length: usize)

Add data from a kernel buffer (physical address)

Source

pub fn add_user_buffer( &mut self, user_addr: u64, length: usize, ) -> Result<(), KernelError>

Add data from a user buffer (translates virtual to physical)

Source

pub fn execute(&self) -> Result<usize, KernelError>

Execute the zero-copy TCP send.

Assembles the scatter-gather data and sends it through the TCP stack, which handles segmentation into MSS-sized chunks, sequence numbers, and retransmission.

Source

pub fn total_length(&self) -> usize

Get total data size queued for sending

Source

pub fn segment_count(&self) -> usize

Get the number of scatter-gather segments

Auto Trait Implementations§

§

impl Freeze for TcpZeroCopySend

§

impl RefUnwindSafe for TcpZeroCopySend

§

impl Send for TcpZeroCopySend

§

impl Sync for TcpZeroCopySend

§

impl Unpin for TcpZeroCopySend

§

impl UnwindSafe for TcpZeroCopySend

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.