std :: net::net_core
Struct std::NetIf
struct NetIf {
unsigned char mac[NET_MAC_LEN];
unsigned int ip4;
unsigned int gateway;
unsigned int netmask;
?fn int(&Erased, []const unsigned char) tx_fn;
?&Erased iface_ctx;
}Fields
hardware MAC address
assigned IPv4, numeric form (see net_ip4)
default gateway IPv4 (numeric form, see net_ip4)
subnet mask (numeric form, see net_ip4)
The driver's transmit and context, stored type-erased (one stack may run interfaces from different drivers); NetIf::new<T> is the only writer and always pairs T's thunk with a &T (see std/erased.h).
null for an interface with no driver
the &T
Methods
An interface whose tx() calls drv.transmit(frame). drv must outlive it.
Transmit a packet. Returns 0 on success.