pub struct NamedEtherFace {
pub node_name: Name,
pub radio: RadioFaceMetadata,
/* private fields */
}Expand description
NDN face over raw Ethernet (AF_PACKET / Ethertype 0x8624).
Uses SOCK_DGRAM with a TPACKET_V2 mmap’d ring buffer for zero-copy
packet I/O. The kernel strips/builds the Ethernet header automatically:
recv() returns the NDN TLV payload directly; send() accepts the NDN
TLV payload and the kernel prepends the Ethernet frame header.
The MAC address is an internal implementation detail — above the face layer everything is NDN names. The node name is stable across channel switches and radio changes; only the internal MAC binding needs updating on mobility.
Requires CAP_NET_RAW or root.
Fields§
§node_name: NameNDN node name of the remote peer.
radio: RadioFaceMetadataRadio metadata for multi-radio strategies.
Implementations§
Source§impl NamedEtherFace
impl NamedEtherFace
Sourcepub fn new(
id: FaceId,
node_name: Name,
peer_mac: MacAddr,
iface: impl Into<String>,
radio: RadioFaceMetadata,
) -> Result<Self>
pub fn new( id: FaceId, node_name: Name, peer_mac: MacAddr, iface: impl Into<String>, radio: RadioFaceMetadata, ) -> Result<Self>
Create a new Ethernet face bound to iface.
Opens an AF_PACKET + SOCK_DGRAM socket, configures a TPACKET_V2 mmap
ring buffer, binds to the given network interface, and registers the
socket with the tokio reactor. Requires CAP_NET_RAW.
Sourcepub fn set_peer_mac(&mut self, mac: MacAddr)
pub fn set_peer_mac(&mut self, mac: MacAddr)
Update the peer MAC address (e.g. after a mobility event).
Trait Implementations§
Source§impl Face for NamedEtherFace
impl Face for NamedEtherFace
fn id(&self) -> FaceId
fn kind(&self) -> FaceKind
Source§async fn recv(&self) -> Result<Bytes, FaceError>
async fn recv(&self) -> Result<Bytes, FaceError>
Source§async fn send(&self, pkt: Bytes) -> Result<(), FaceError>
async fn send(&self, pkt: Bytes) -> Result<(), FaceError>
Source§fn remote_uri(&self) -> Option<String>
fn remote_uri(&self) -> Option<String>
udp4://192.168.1.1:6363). Returns None for face
types that don’t have a meaningful remote endpoint.Source§fn local_uri(&self) -> Option<String>
fn local_uri(&self) -> Option<String>
unix:///run/nfd/nfd.sock). Returns None for face
types that don’t expose local binding info.