package cstruct

  1. Overview
  2. No Docs

Description

Cstruct is a library and syntax extension to make it easier to access C-like structures directly from OCaml. It supports both reading and writing to these structures, and they are accessed via the Bigarray module.

An example pcap description using PPX extension points is:

[%%cstruct
type pcap_header = {
  magic_number: uint32_t;   (* magic number *)
  version_major: uint16_t;  (* major version number *)
  version_minor: uint16_t;  (* minor version number *)
  thiszone: uint32_t;       (* GMT to local correction *)
  sigfigs: uint32_t;        (* accuracy of timestamps *)
  snaplen: uint32_t;        (* max length of captured packets, in octets *)
  network: uint32_t;        (* data link type *)
} [@@little_endian]]

For Camlp4 support, please use a version of Cstruct that is <=1.9.0

Tags

org:mirage org:xapi-project

Published: 30 Apr 2016

Dependencies (7)

  1. conf-time
  2. base-bytes
  3. sexplib
  4. ocplib-endian
  5. ocamlbuild build & != "0.9.0"
  6. ocamlfind build
  7. ocaml >= "4.02.3" & < "4.04.0"

Dev Dependencies (1)

  1. ounit with-test

  1. albatross < "1.3.0"
  2. angstrom < "0.7.0"
  3. arakoon >= "1.8.6" & < "1.8.12"
  4. asn1-combinators >= "0.1.2" & != "0.2.0-1" & < "0.2.6"
  5. awa-mirage < "0.0.2"
  6. balancer
  7. buffer-pool
  8. capnp-rpc-net >= "1.1" & < "1.2.1"
  9. channel
  10. charrua-client < "0.9"
  11. charrua-core >= "0.3" & < "0.8"
  12. charrua-unix = "0.6"
  13. cohttp >= "0.9.7" & < "0.10.0"
  14. conduit >= "0.6.0" & < "0.15.2"
  15. conduit-async = "3.0.0"
  16. conduit-lwt = "3.0.0"
  17. conex < "0.10.0"
  18. conex-mirage-crypto
  19. conex-nocrypto
  20. cowabloga >= "0.0.5"
  21. crc
  22. crunch >= "2.0.0" & < "3.0.0"
  23. cstruct-lwt < "3.0.0"
  24. cstruct-unix < "3.0.0"
  25. datakit-ci >= "0.10.0" & < "0.12.4"
  26. datakit-client < "0.9.0"
  27. datakit-server < "0.9.0"
  28. depyt
  29. dns >= "0.18.0" & < "1.0.0"
  30. dream < "1.0.0~alpha2"
  31. duff < "0.3"
  32. eqaf >= "0.8"
  33. fat-filesystem >= "0.10.0" & < "0.12.1"
  34. frenetic < "2.0.0" | >= "3.2.0" & < "5.0.5"
  35. git >= "1.4.3" & < "1.6.0" | >= "2.0.0" & < "3.0.0"
  36. git-http < "1.11.0"
  37. git-mirage = "1.11.0"
  38. github-hooks >= "0.2.0"
  39. gluten-mirage < "0.3.0"
  40. gpt
  41. h2-mirage
  42. hacl-star >= "0.7.0"
  43. hex >= "0.2.0"
  44. hkdf < "1.0.3"
  45. hvsock < "1.0.0"
  46. io-page
  47. io-page-unix
  48. io-page-xen
  49. ipaddr-cstruct < "5.2.0"
  50. irmin >= "0.9.0" & < "2.0.0"
  51. irmin-git >= "2.3.0"
  52. irmin-indexeddb >= "0.3"
  53. key-parsers >= "0.5.0" & < "1.2.1"
  54. launchd
  55. letsencrypt = "0.2.5"
  56. letsencrypt-app < "0.4.0"
  57. macaddr-cstruct < "5.2.0"
  58. metrics-mirage
  59. mirage >= "0.7.2" & < "0.9.0" | >= "0.10.0" & < "2.4.0"
  60. mirage-block < "1.0.0"
  61. mirage-block-ccm < "1.1.0"
  62. mirage-block-combinators < "3.0.0"
  63. mirage-block-lwt
  64. mirage-block-ramdisk
  65. mirage-block-solo5 < "0.6.2"
  66. mirage-block-unix < "2.8.3"
  67. mirage-block-xen >= "1.4.0" & < "2.1.1"
  68. mirage-btrees
  69. mirage-channel-lwt
  70. mirage-clock-unix < "1.0.0"
  71. mirage-clock-xen < "1.0.0"
  72. mirage-conduit = "2.3.1"
  73. mirage-console-lwt
  74. mirage-console-solo5 >= "0.2.0"
  75. mirage-console-unix < "2.3.2"
  76. mirage-console-xen = "4.0.0"
  77. mirage-console-xen-backend >= "2.3.2" & < "2.3.4" | = "4.0.0"
  78. mirage-console-xen-cli
  79. mirage-dns != "2.6.0" & < "2.7.0"
  80. mirage-entropy < "0.5.0"
  81. mirage-entropy-unix
  82. mirage-entropy-xen
  83. mirage-flow < "1.2.0"
  84. mirage-flow-lwt
  85. mirage-flow-rawlink >= "1.1.0"
  86. mirage-fs >= "0.4.0" & < "1.0.0"
  87. mirage-fs-lwt
  88. mirage-fs-mem
  89. mirage-fs-unix < "1.4.1"
  90. mirage-kv-lwt
  91. mirage-nat < "2.2.4"
  92. mirage-net = "0.5.2"
  93. mirage-net-fd < "0.2.1"
  94. mirage-net-lwt
  95. mirage-net-macosx
  96. mirage-net-solo5
  97. mirage-net-unix < "2.1.0" | >= "2.2.1" & != "2.4.1"
  98. mirage-net-xen != "1.4.2" & < "1.7.0"
  99. mirage-profile = "0.7.0"
  100. mirage-protocols-lwt
  101. mirage-qubes != "0.2" & < "0.8.0"
  102. mirage-qubes-ipv4 < "0.9.3"
  103. mirage-random < "2.0.0"
  104. mirage-random-stdlib
  105. mirage-random-test
  106. mirage-solo5
  107. mirage-stack-lwt < "1.1.0"
  108. mirage-tc
  109. mirage-tcpip-unix
  110. mirage-tcpip-xen
  111. mirage-types-lwt < "3.4.0"
  112. mirage-unix < "0.9.4" | >= "2.5.0" & < "3.0.8"
  113. mirage-vnetif < "0.4.0"
  114. mirage-www < "0.4.0" | >= "1.1.0"
  115. mirage-xen < "2.0.0" | >= "2.6.0"
  116. monorobot
  117. mrt-format
  118. mstruct < "1.3.4"
  119. nbd >= "2.1.0" & < "4.0.3"
  120. nocrypto < "0.5.4"
  121. noise
  122. openflow < "0.2.0"
  123. otr >= "0.3.1" & < "0.3.9"
  124. ox < "1.1.1"
  125. pbkdf < "0.3.0" | = "1.1.0"
  126. pcap-format >= "0.4.0"
  127. ppx_cstruct < "3.0.1"
  128. protocol-9p < "0.5.1" | >= "0.6.0" & < "0.11.2"
  129. protocol-9p-tool = "0.12.0" | >= "2.0.0" & < "2.0.2"
  130. protocol-9p-unix < "0.11.2"
  131. qcow < "0.11.0"
  132. qcow-format
  133. qcow-tool
  134. randomconv < "0.2.0"
  135. rawlink >= "0.4" & < "0.6"
  136. resp-mirage = "0.10.0"
  137. rfc6287 >= "1.0.2" & < "1.0.4"
  138. salsa20 < "1.1.0"
  139. salsa20-core < "1.0.0"
  140. scrypt-kdf < "1.1.0"
  141. sendmail >= "0.4.1" & < "0.5.0"
  142. shared-block-ring < "2.3.0"
  143. shared-memory-ring >= "1.2.0" & < "2.0.0"
  144. slack
  145. ssh-agent
  146. tar < "2.0.0"
  147. tar-format >= "0.5.0"
  148. tar-mirage
  149. tar-unix < "2.0.0"
  150. tcpip < "2.3.0" | >= "2.7.0" & < "3.0.0"
  151. tls >= "0.7.1" & < "0.9.0"
  152. u2f = "0.1.1"
  153. vchan >= "2.1.0" & != "3.0.0" & < "6.0.1"
  154. vchan-unix >= "4.0.0"
  155. vchan-xen >= "4.0.0"
  156. vhd-format >= "0.8.0"
  157. vhd-format-lwt
  158. vhd-tool
  159. vmnet >= "1.1.0"
  160. websocket = "2.2"
  161. x509 < "0.6.3"
  162. xapi-rrd-transport
  163. xe
  164. xen-api-client >= "0.9.6"
  165. xen-block-driver >= "0.2.5"
  166. xen-gnt

Conflicts

None