Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/inetstack/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -294,6 +294,10 @@ impl NetworkTransport for SharedInetStack {
/// This implements the memory runtime trait for the inetstack. Other libOSes without a network runtime can directly
/// use OS memory but the inetstack requires specialized memory allocated by the lower-level runtime.
impl DemiMemoryAllocator for SharedInetStack {
fn max_buffer_size_bytes(&self) -> usize {
self.layer4_endpoint.max_buffer_size_bytes()
}

fn allocate_demi_buffer(&self, size: usize) -> Result<DemiBuffer, Fail> {
self.layer4_endpoint.allocate_demi_buffer(size)
}
Expand Down
4 changes: 4 additions & 0 deletions src/inetstack/protocols/layer2/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,10 @@ impl DerefMut for SharedLayer2Endpoint {
}

impl DemiMemoryAllocator for SharedLayer2Endpoint {
fn max_buffer_size_bytes(&self) -> usize {
self.layer1_endpoint.max_buffer_size_bytes()
}

fn allocate_demi_buffer(&self, size: usize) -> Result<DemiBuffer, Fail> {
self.layer1_endpoint.allocate_demi_buffer(size)
}
Expand Down
4 changes: 4 additions & 0 deletions src/inetstack/protocols/layer3/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,10 @@ impl DerefMut for SharedLayer3Endpoint {

/// Memory Runtime Trait Implementation for Layer 3.
impl DemiMemoryAllocator for SharedLayer3Endpoint {
fn max_buffer_size_bytes(&self) -> usize {
self.layer2_endpoint.max_buffer_size_bytes()
}

fn allocate_demi_buffer(&self, size: usize) -> Result<DemiBuffer, Fail> {
self.layer2_endpoint.allocate_demi_buffer(size)
}
Expand Down
4 changes: 4 additions & 0 deletions src/inetstack/protocols/layer4/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -394,6 +394,10 @@ impl Peer {
//======================================================================================================================

impl DemiMemoryAllocator for Peer {
fn max_buffer_size_bytes(&self) -> usize {
self.layer3_endpoint.max_buffer_size_bytes()
}

fn allocate_demi_buffer(&self, size: usize) -> Result<DemiBuffer, Fail> {
self.layer3_endpoint.allocate_demi_buffer(size)
}
Expand Down
Loading