miniOS
x86_64 hobby kernel with SMP, VFS, and POSIX process model
Loading...
Searching...
No Matches
lwip_netif.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

void lwip_netif_init (void)
 Initialize lwIP stack and register eth0 netif.
void lwip_netif_poll (void)
 Poll the network interface and drive lwIP timers.
void net_poll_thread_fn (void *arg)
 Kernel thread function that drives lwIP polling.

Function Documentation

◆ lwip_netif_init()

void lwip_netif_init ( void )

Initialize lwIP stack and register eth0 netif.

Calls lwip_init(), netif_add() with QEMU static IPv4 config from net_config_get_active(), wires the RX callback to ethernet_input(), and calls lwip_port_attach() to connect the Ethernet seam. Must be called after net_observe_init() and before any socket operations.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ lwip_netif_poll()

void lwip_netif_poll ( void )

Poll the network interface and drive lwIP timers.

Calls lwip_port_poll() then sys_check_timeouts(). Must be called regularly (every ~10ms) to keep TCP retransmit and ARP aging alive. Also calls lwip_port_poll_timeouts(10) to feed the timeout accumulator.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ net_poll_thread_fn()

void net_poll_thread_fn ( void * arg)

Kernel thread function that drives lwIP polling.

Runs in an infinite loop: calls lwip_netif_poll() then sched_yield(). Receive callbacks call sched_wake_tid() to unblock threads sleeping in poll/select. Start via sched_create_thread(net_poll_thread_fn, NULL) after lwip_netif_init().

net_poll_thread_fn() - Dedicated kernel thread that drives lwIP polling.

Runs continuously, calling lwip_netif_poll() so that network receive callbacks fire even when userspace threads are sleeping in poll/select. Receive callbacks call sched_wake_tid() to unblock waiting threads.

Here is the call graph for this function:
Here is the caller graph for this function: