package mnet
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=07233e57f836eadd9566dbc2c7e81a0da058c52c40e8cf38eb9b2f178a9fa537
sha512=e190d793c9950a85e3fc8865f26a222c2763ad8f2c2972cfb5fe10926f2ecc39d75b4f970065cafa9526c4d1edb8b3574dd4b37893fca6de144fe7ced4a23bb0
doc/mnet.ipv4/IPv4/Writer/index.html
Module IPv4.WriterSource
Efficient IPv4 payload composition.
A t value represents a payload to be sent in an IPv4 packet. Three constructors are provided depending on whether the data is already in memory as a string, as multiple strings, or should be written directly into the outgoing buffer. The writer handles fragmentation transparently when the payload exceeds the path MTU.
of_string ipv4 str creates a writer that sends str as the payload.
of_strings ipv4 strs creates a writer that sends the concatenation of strs as the payload. This avoids copying the strings into a single buffer.
into ipv4 ~len fn creates a writer that fills the payload by calling fn buf, where buf is a buffer of size len positioned after the IPv4 header. This is the zero-copy path for upper-layer protocols (like UDP's UDP.sendfn) that can write directly into the outgoing frame.