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

Conflicts

None