Function pnet_datalink::channel [] [src]

pub fn channel(
    network_interface: &NetworkInterface,
    configuration: Config
) -> Result<Channel>

Create a new datalink channel for sending and receiving data

This allows for sending and receiving packets at the data link layer.

A list of network interfaces can be retrieved using datalink::interfaces().

The configuration serves as a hint to the backend - some or all of it may be used or ignored, depending on which backend is used.

When matching on the returned channel, make sure to include a catch-all so that code doesn't break when new channel types are added.