package mnet

  1. Overview
  2. Docs
An implementation of TCP (Transmission Control Protocol) in OCaml for Miou & Solo5

Install

dune-project
 Dependency

Authors

Maintainers

Sources

mnet-0.0.1.tbz
sha256=c3151b243150c7b7412bf27b08107bed0e132f0a271d5f5b34bc0fdffed8ec3e
sha512=4a70d77ed42519a547f7b13e76ccfa05192514ca84e9dc9dcb97a5d141a8cc4551a669017a48290d70f01790a83fbeba53950a2d5f975e8e51e7daf3017d6b5e

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.

Sourcetype ipv4 = t
Sourcetype t
Sourceval of_string : ipv4 -> string -> t

of_string ipv4 str creates a writer that sends str as the payload.

Sourceval of_strings : ipv4 -> string list -> t

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.

Sourceval into : ipv4 -> len:int -> (Bstr.t -> unit) -> t

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.