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

DhcpClient

Struct DhcpClient 

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

DHCP client

Implementations§

Source§

impl DhcpClient

Source

pub fn new(mac_address: MacAddress) -> Self

Create a new DHCP client

Source

pub fn create_discover(&self) -> DhcpPacket

Create DHCP DISCOVER packet

Source

pub fn create_request( &self, offered_ip: Ipv4Address, server_id: Ipv4Address, ) -> DhcpPacket

Create DHCP REQUEST packet

Source

pub fn process_offer(&mut self, packet: &DhcpPacket) -> Result<(), KernelError>

Process DHCP OFFER – parse options and transition to Requesting.

Source

pub fn process_ack(&mut self, packet: &DhcpPacket) -> Result<(), KernelError>

Process DHCP ACK – configure network interface with obtained parameters.

Source

pub fn process_response(&mut self, data: &[u8]) -> Result<(), KernelError>

Process an incoming DHCP response packet.

Dispatches to process_offer or process_ack based on the message type option.

Source

pub fn state(&self) -> DhcpState

Get current DHCP state

Source

pub fn config(&self) -> Option<&DhcpConfig>

Get current configuration (if bound)

Source

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

Start DHCP negotiation – sends DISCOVER via UDP broadcast.

Auto Trait Implementations§

§

impl Freeze for DhcpClient

§

impl RefUnwindSafe for DhcpClient

§

impl Send for DhcpClient

§

impl Sync for DhcpClient

§

impl Unpin for DhcpClient

§

impl UnwindSafe for DhcpClient

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.