package tcpip

  1. Overview
  2. Docs
OCaml TCP/IP networking stack, used in MirageOS

Install

dune-project
 Dependency

Authors

Maintainers

Sources

tcpip-v6.4.0.tbz
sha256=6e32bf540d291e9b7325cb3dd00df2f695533e009c46ea534d5518b9492c7348
sha512=2e9f9ca2eeac637599eb48e087b4632598539f1c76f9251758995c7eedeb723f8b951d557a2a53b85a58d50a04e68e15598581f88fca8997733e800fcfca422b

doc/tcpip.tcp/Tcp/Tcp_packet/Marshal/index.html

Module Tcp_packet.MarshalSource

Sourcetype error = string
Sourceval into_cstruct : pseudoheader:Cstruct.t -> payload:Cstruct.t -> t -> Cstruct.t -> (int, error) result

into_cstruct ~pseudoheader ~payload t buf attempts to write a valid TCP header representing t into buf at offset 0. pseudoheader and payload are required to calculate a correct checksum but are not otherwise reflected in the data written into buf -- buf will contain only a TCP header after a call to into_cstruct. Returns either the number of bytes written into the buffer on success; if the buffer supplied is too small to write the entire header, an error is returned.

Sourceval make_cstruct : pseudoheader:Cstruct.t -> payload:Cstruct.t -> t -> Cstruct.t

make_cstruct ~pseudoheader ~payload t allocates, fills, and and returns a buffer representing the TCP header corresponding to t. If t.options is non-empty, t.options will be concatenated onto the result as part of the header. A variable amount of memory (at least 20 bytes, and at most 60) will be allocated, but is not represented in the output. The checksum will be properly set to reflect the pseudoheader, header, options, and payload.

OCaml

Innovation. Community. Security.