package tcpip
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=86ba5d92f9078bddc65312f63b5f4ce34fd2570d765433b23a226ab84d75a9c0
sha512=a348a597cf4ba1e19f7fc97d6d1cb980711d09b6944efacba91d23daf419fc8cb8a83a2d263bcc7b96ff5d37ad5dbfa4a3879db9ac4c0b35528b80acb87cf8f7
doc/tcpip.tcp/Tcp/Tcp_packet/Marshal/index.html
Module Tcp_packet.MarshalSource
val into_cstruct :
pseudoheader:Cstruct.t ->
payload:Cstruct.t ->
t ->
Cstruct.t ->
(int, error) resultinto_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.
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.