morpheus_network

Module stack

Source
Expand description

smoltcp integration layer.

This module provides the bridge between MorpheusX network device drivers and the smoltcp TCP/IP stack.

§Components

§Usage

use morpheus_network::stack::{NetInterface, NetConfig};
use morpheus_network::device::virtio::VirtioNetDevice;
use morpheus_network::device::hal::StaticHal;
use dma_pool::DmaPool;

// Initialize DMA pool from caves in our PE image
unsafe { DmaPool::init_from_caves(image_base, image_end) };

// Initialize HAL
StaticHal::init();

// Create device
let device = VirtioNetDevice::<StaticHal, _>::new(transport)?;

// Create interface with DHCP
let mut iface = NetInterface::new(device, NetConfig::dhcp());

// Poll until IP configured
while !iface.has_ip() {
    iface.poll(get_time_ms());
}

Re-exports§

Modules§

  • interface 🔒
    Full smoltcp network interface with TCP/IP stack.

Structs§

Enums§

Constants§

Statics§

Functions§