pub struct MulticastEtherFace { /* private fields */ }Expand description
NDN face over multicast Ethernet (AF_PACKET / Ethertype 0x8624).
Joins the NDN multicast group on the specified interface so that frames
sent to NDN_ETHER_MCAST_MAC are received. Outgoing packets are always
sent to the multicast address.
Suitable for L2 neighbor discovery and local-subnet NDN communication
without IP. Mirrors MulticastUdpFace but at the link layer.
Requires CAP_NET_RAW or root. Linux only.
Implementations§
Source§impl MulticastEtherFace
impl MulticastEtherFace
Sourcepub fn new(id: FaceId, iface: impl Into<String>) -> Result<Self>
pub fn new(id: FaceId, iface: impl Into<String>) -> Result<Self>
Create a new multicast Ethernet face on iface.
Opens an AF_PACKET + SOCK_DGRAM socket, joins the NDN multicast
group (01:00:5e:00:17:aa), and sets up TPACKET_V2 ring buffers.
Sourcepub async fn recv_with_source(&self) -> Result<(Bytes, MacAddr), FaceError>
pub async fn recv_with_source(&self) -> Result<(Bytes, MacAddr), FaceError>
Receive the next NDN packet along with the sender’s MAC address.
This is the discovery-layer variant of Face::recv. The source MAC
is extracted from the TPACKET_V2 sockaddr_ll embedded in each ring
frame — no extra syscall is needed. Discovery protocols use this to
identify which peer sent a Hello packet and create a unicast face for it.
Trait Implementations§
Source§impl Face for MulticastEtherFace
impl Face for MulticastEtherFace
fn id(&self) -> FaceId
fn kind(&self) -> FaceKind
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.