package cstruct

  1. Overview
  2. Docs
access C structures via a camlp4 extension

Install

Dune Dependency

Authors

Maintainers

Sources

v2.3.0.tar.gz
sha256=8b802e70c85879cd3b9bd4211d8c01e63f4dd4ac30288bd92d7a24d6c88b62eb
md5=f84097a0618715e2849542ee8e893454

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

Conflicts

None

OCaml

Innovation. Community. Security.