Function pnet::datalink::datalink_channel
[−]
pub fn datalink_channel(network_interface: &NetworkInterface, write_buffer_size: usize, read_buffer_size: usize, channel_type: DataLinkChannelType) -> Result<(Box<DataLinkSender>, Box<DataLinkReceiver>)>
Create a new (DataLinkSender, DataLinkReceiver) pair
This allows for sending and receiving packets at the data link layer.
A list of network interfaces can be retrieved using util::get_network_interfaces().
The buffer sizes should be large enough to handle the largest packet you wish to send or receive. Note that these parameters may be ignored, depending on the operating system.
The channel type specifies what layer to send and receive packets at, currently only layer 2 is supported.