Skip to main content

driver_net_proto/
lib.rs

1#![no_std]
2
3/// IPC opcodes for the network driver silo protocol.
4///
5/// A silo-hosted driver sends these to the kernel stub, which translates
6/// them into `net_core::NetworkDevice` calls on the backing hardware.
7pub mod opcodes {
8    pub const NET_SEND: u32 = 0x40;
9    pub const NET_RECV: u32 = 0x41;
10    pub const NET_MAC_ADDR: u32 = 0x42;
11    pub const NET_LINK_STATUS: u32 = 0x43;
12    pub const NET_LIST_IFACES: u32 = 0x44;
13}
14
15/// Packet header prepended to IPC-transported frames.
16#[repr(C)]
17#[derive(Clone, Copy)]
18pub struct NetIpcHeader {
19    pub opcode: u32,
20    pub iface_id: u16,
21    pub flags: u16,
22    pub payload_len: u32,
23}
24
25/// Response header from kernel to silo.
26#[repr(C)]
27#[derive(Clone, Copy)]
28pub struct NetIpcReply {
29    pub status: i32,
30    pub payload_len: u32,
31}