[][src]Function pnet_transport::transport_channel

pub fn transport_channel(
    buffer_size: usize,
    channel_type: TransportChannelType
) -> Result<(TransportSender, TransportReceiver)>

Create a new (TransportSender, TransportReceiver) pair.

This allows for sending and receiving packets at the transport layer. The buffer size should be large enough to handle the largest packet you wish to receive.

The channel type specifies what layer to send and receive packets at, and the transport protocol you wish to implement. For example, Layer4(Ipv4(IpNextHeaderProtocols::Udp)) would allow sending and receiving UDP packets using IPv4; whereas Layer3(IpNextHeaderProtocols::Udp) would include the IPv4 Header in received values, and require manual construction of an IP header when sending.