package cstruct

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

Install

Dune Dependency

Authors

Maintainers

Sources

v2.2.0.tar.gz
sha256=9d605469131a8a704d123dbedff7dc7f68ccb7e28e76ddafda745017e58217e1
md5=49f2fa14c95ecf3e55f76831e2548ab8

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

Conflicts

None

OCaml

Innovation. Community. Security.