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

LoopbackDriver

Struct LoopbackDriver 

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

Loopback network device

Implementations§

Source§

impl LoopbackDriver

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Default for LoopbackDriver

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Driver for LoopbackDriver

Source§

fn name(&self) -> &str

Get driver name
Source§

fn supported_classes(&self) -> Vec<DeviceClass>

Get supported device classes
Source§

fn supports_device(&self, _device: &DeviceInfo) -> bool

Check if driver supports a device
Source§

fn probe(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>

Probe device
Source§

fn attach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>

Attach to device
Source§

fn detach(&mut self, _device: &DeviceInfo) -> Result<(), KernelError>

Detach from device
Source§

fn suspend(&mut self) -> Result<(), KernelError>

Suspend device
Source§

fn resume(&mut self) -> Result<(), KernelError>

Resume device
Source§

fn handle_interrupt(&mut self, _irq: u8) -> Result<(), KernelError>

Handle interrupt
Source§

fn read( &mut self, _offset: u64, _buffer: &mut [u8], ) -> Result<usize, KernelError>

Read from device
Source§

fn write(&mut self, _offset: u64, data: &[u8]) -> Result<usize, KernelError>

Write to device
Source§

fn ioctl(&mut self, cmd: u32, _arg: u64) -> Result<u64, KernelError>

Device control (ioctl)
Source§

impl NetworkDevice for LoopbackDriver

Source§

fn name(&self) -> &str

Get device name
Source§

fn get_config(&self) -> InterfaceConfig

Get interface configuration
Source§

fn set_config(&mut self, config: InterfaceConfig) -> Result<(), KernelError>

Set interface configuration
Source§

fn up(&mut self) -> Result<(), KernelError>

Bring interface up
Source§

fn down(&mut self) -> Result<(), KernelError>

Bring interface down
Source§

fn send_packet(&mut self, packet: NetworkPacket) -> Result<(), KernelError>

Send a packet
Source§

fn receive_packet(&mut self) -> Result<Option<NetworkPacket>, KernelError>

Receive a packet (non-blocking)
Source§

fn get_stats(&self) -> NetworkStats

Get interface statistics
Source§

fn reset_stats(&mut self)

Reset interface statistics
Check if link is up
Get link speed in Mbps

Auto Trait Implementations§

§

impl !Freeze for LoopbackDriver

§

impl !RefUnwindSafe for LoopbackDriver

§

impl Send for LoopbackDriver

§

impl Sync for LoopbackDriver

§

impl Unpin for LoopbackDriver

§

impl UnwindSafe for LoopbackDriver

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.