package cstruct
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=9a78073392580e8349148fa3ab4b1b2e989dc9d30d07401b04c96b7c60f03e62
sha512=8d33fe6b3707a3994d0225cd33cadde0bb2ca834ef01096e3df33a08e4a8c6d02ebccddf558a73988b8a5595b65fdc10de61efbf872c6c9e55c719c7e19c463d
doc/cstruct/Cstruct_cap/BE/index.html
Module Cstruct_cap.BESource
Big-endian Byte Order
The following operations assume a big-endian byte ordering of the cstruct. If the machine-native byte ordering differs, then the get operations will reorder the bytes so that they are in machine-native byte order before returning the result, and the set operations will reorder the bytes so that they are written out in the appropriate order.
Network byte order is big-endian, so you may need these operations when dealing with raw frames, for example, in a userland networking stack.
get_uint32 t off returns the four bytes in t starting at offset off. t needs at least read capability rd.
get_uint64 t off returns the eight bytes in t starting at offset off. t needs at least read capability rd.
set_uint16 t off v sets the two bytes in t starting at offset off to the value v. t needs at least write capability wr.
set_uint32 t off v sets the four bytes in t starting at offset off to the value v. t needs at least write capability wr.