package tcpip
Install
Dune Dependency
Authors
Maintainers
Sources
sha256=916e688aba897676c444db8129f4963ad739f8d1be631d9e009c6228b4b7d6ed
sha512=a8f5fa8f7e96758075c93211132839950477b756fba490207a7d630f2766757bbb44bbdd02e2b1f2b4a7d83d4d8b10d34cb03903bbd516e7d7c1a9a987eb1915
doc/tcpip.tcp/Tcp/Tcp_packet/Marshal/index.html
Module Tcp_packet.Marshal
Source
val 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.
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.