alpha
Login
or
Join now
gazagnaire.org
/
ocaml-dhcp
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
DHCP wire format, client and server in pure OCaml
Star
0
Fork
0
Atom
Configure Feed
Issues
Pull Requests
Commits
Tags
Feed URL
Select the types of activity you want to include in your feed.
Overview
Issues
Pulls
Pipelines
ocaml-dhcp
/
c
/
at
main
12 files
Thomas Gazagnaire
dhcp: keep the transaction id and the addresses 32 bits wide under wire 1.2.0
9d ago
879649d4
Dhcp.3d
dhcp: keep the transaction id and the addresses 32 bits wide under wire 1.2.0 wire 1.2.0 decodes each fixed-width field to a carrier whose range is the field's, and a uint32be now yields a UInt32.t where it used to yield an Optint.t. The opcode, hardware type and length, hop count, seconds and flags word are small numbers, so they stay plain ints behind two mapped views; UInt8.v and UInt16.v refuse a value the field cannot hold at encode time. The transaction id, the four IPv4 address fields and the magic cookie do not. They use the whole unsigned 32-bit range, so they read through UInt32.to_int32 / of_int32 rather than Optint, whose signed view turns every address from 128.0.0.0 up into a negative number. The option casetype's code byte keeps its raw UInt8.t: a casetype dispatches in 3D only on a tag whose type is one of the integer descriptions, so a tag read through a mapped view would project as a split tag/body pair instead of a dispatch table.
1 week ago
Dhcp.c
dhcp: keep the transaction id and the addresses 32 bits wide under wire 1.2.0 wire 1.2.0 decodes each fixed-width field to a carrier whose range is the field's, and a uint32be now yields a UInt32.t where it used to yield an Optint.t. The opcode, hardware type and length, hop count, seconds and flags word are small numbers, so they stay plain ints behind two mapped views; UInt8.v and UInt16.v refuse a value the field cannot hold at encode time. The transaction id, the four IPv4 address fields and the magic cookie do not. They use the whole unsigned 32-bit range, so they read through UInt32.to_int32 / of_int32 rather than Optint, whose signed view turns every address from 128.0.0.0 up into a negative number. The option casetype's code byte keeps its raw UInt8.t: a casetype dispatches in 3D only on a tag whose type is one of the integer descriptions, so a tag read through a mapped view would project as a split tag/body pair instead of a dispatch table.
1 week ago
Dhcp.h
dhcp: keep the transaction id and the addresses 32 bits wide under wire 1.2.0 wire 1.2.0 decodes each fixed-width field to a carrier whose range is the field's, and a uint32be now yields a UInt32.t where it used to yield an Optint.t. The opcode, hardware type and length, hop count, seconds and flags word are small numbers, so they stay plain ints behind two mapped views; UInt8.v and UInt16.v refuse a value the field cannot hold at encode time. The transaction id, the four IPv4 address fields and the magic cookie do not. They use the whole unsigned 32-bit range, so they read through UInt32.to_int32 / of_int32 rather than Optint, whose signed view turns every address from 128.0.0.0 up into a negative number. The option casetype's code byte keeps its raw UInt8.t: a casetype dispatches in 3D only on a tag whose type is one of the integer descriptions, so a tag read through a mapped view would project as a split tag/body pair instead of a dispatch table.
1 week ago
Dhcp.provenance
dhcp: keep the transaction id and the addresses 32 bits wide under wire 1.2.0 wire 1.2.0 decodes each fixed-width field to a carrier whose range is the field's, and a uint32be now yields a UInt32.t where it used to yield an Optint.t. The opcode, hardware type and length, hop count, seconds and flags word are small numbers, so they stay plain ints behind two mapped views; UInt8.v and UInt16.v refuse a value the field cannot hold at encode time. The transaction id, the four IPv4 address fields and the magic cookie do not. They use the whole unsigned 32-bit range, so they read through UInt32.to_int32 / of_int32 rather than Optint, whose signed view turns every address from 128.0.0.0 up into a negative number. The option casetype's code byte keeps its raw UInt8.t: a casetype dispatches in 3D only on a tag whose type is one of the integer descriptions, so a tag read through a mapped view would project as a split tag/body pair instead of a dispatch table.
1 week ago
DhcpWrapper.c
dhcp: keep the transaction id and the addresses 32 bits wide under wire 1.2.0 wire 1.2.0 decodes each fixed-width field to a carrier whose range is the field's, and a uint32be now yields a UInt32.t where it used to yield an Optint.t. The opcode, hardware type and length, hop count, seconds and flags word are small numbers, so they stay plain ints behind two mapped views; UInt8.v and UInt16.v refuse a value the field cannot hold at encode time. The transaction id, the four IPv4 address fields and the magic cookie do not. They use the whole unsigned 32-bit range, so they read through UInt32.to_int32 / of_int32 rather than Optint, whose signed view turns every address from 128.0.0.0 up into a negative number. The option casetype's code byte keeps its raw UInt8.t: a casetype dispatches in 3D only on a tag whose type is one of the integer descriptions, so a tag read through a mapped view would project as a split tag/body pair instead of a dispatch table.
1 week ago
DhcpWrapper.h
dhcp: keep the transaction id and the addresses 32 bits wide under wire 1.2.0 wire 1.2.0 decodes each fixed-width field to a carrier whose range is the field's, and a uint32be now yields a UInt32.t where it used to yield an Optint.t. The opcode, hardware type and length, hop count, seconds and flags word are small numbers, so they stay plain ints behind two mapped views; UInt8.v and UInt16.v refuse a value the field cannot hold at encode time. The transaction id, the four IPv4 address fields and the magic cookie do not. They use the whole unsigned 32-bit range, so they read through UInt32.to_int32 / of_int32 rather than Optint, whose signed view turns every address from 128.0.0.0 up into a negative number. The option casetype's code byte keeps its raw UInt8.t: a casetype dispatches in 3D only on a tag whose type is one of the integer descriptions, so a tag read through a mapped view would project as a split tag/body pair instead of a dispatch table.
1 week ago
EverParse.h
ocaml-dhcp: wire up the c/ EverParse codegen for the fixed header The fixed header codec was not blocked after all -- only the variable-length options would be. Wire the c/ pipeline like ocaml-clcw/c: gen.exe (Wire_3d.main on Dhcp.Codec.header_codec) emits dune.inc, which drives DhcpHeader.3d and the EverParse C validators. The generated C is committed so the everparse toolchain is not a build-time dependency; its C test passes (2241 vectors validated).
3 months ago
EverParseEndianness.h
3d: regenerate the standalone C cross-build rules and headers Pick up the wire.3d change that builds and installs the standalone c/ verified parser per target (wire pinned at f13082a3). Every packages c/dune.inc is regenerated: the archive now builds in all contexts through the context toolchain (%{ocaml-config:c_compiler}, the ocaml-config partial linker, -print-prog-name binutils) instead of host-only, and installs unconditionally -- no empty placeholder. Each c/EverParseEndianness.h gains a freestanding __BYTE_ORDER__/__builtin_bswap* branch so it compiles for an OS-less target (a unikernel defines neither __linux__ nor __APPLE__). Verified: dune build -x unikraft ocaml-clcw/c/libclcw.a produces an aarch64 archive exporting only ClcwCheckClcw (the safe wrapper), with ClcwValidateClcw localized.
1 month ago
dune
ocaml-dhcp: Regenerate wire bindings
2 months ago
dune.inc
dhcp: keep the transaction id and the addresses 32 bits wide under wire 1.2.0 wire 1.2.0 decodes each fixed-width field to a carrier whose range is the field's, and a uint32be now yields a UInt32.t where it used to yield an Optint.t. The opcode, hardware type and length, hop count, seconds and flags word are small numbers, so they stay plain ints behind two mapped views; UInt8.v and UInt16.v refuse a value the field cannot hold at encode time. The transaction id, the four IPv4 address fields and the magic cookie do not. They use the whole unsigned 32-bit range, so they read through UInt32.to_int32 / of_int32 rather than Optint, whose signed view turns every address from 128.0.0.0 up into a negative number. The option casetype's code byte keeps its raw UInt8.t: a casetype dispatches in 3D only on a tag whose type is one of the integer descriptions, so a tag read through a mapped view would project as a split tag/body pair instead of a dispatch table.
1 week ago
gen.ml
root: bump wire pin and migrate to its new EverParse API Wire 0.9.0 at 19a5b45e consolidates the EverParse projection surface: mode:`Doc becomes mode:`Standalone, Everparse.doc becomes project ~mode:`Standalone, and struct_of_codec moves under Everparse.Raw. It also rejects a field subtraction or multiplication inside a constraint, which has no sound projection at the field's narrow width. The btree and tm header constraints are rewritten additively (an exact integer identity), so they project; their differential self-checks still agree with the OCaml codec on every input.
2 months ago
gen.mli
codec: commit the c/ codegen drivers' empty interfaces dune synthesizes an empty .mli for every executable's main module, and its write-file rule can race the cmi compile -- grpc hit that race and aborted the whole build on a missing gen.mli. Commit the interface dune would generate for every c/ codegen driver so the file exists before the compile, making the build order independent of dune's synthesis.
2 months ago