From 8a06c476c2ffd0fae4fb56d7c3703a319f8bc1df Mon Sep 17 00:00:00 2001 From: Mindy Preston Date: Mon, 19 Dec 2016 17:53:14 -0600 Subject: [PATCH] add verify_transport_checksum to ipv4_packet.unmarshal Add a function `verify_transport_checksum` to ipv4_packet.unmarshal. As the function needs to use Tcp_wire and Udp_wire, include the UDP and TCP sublibraries when building Ipv4. Also include some tests against pre-created packets with good checksums. --- _oasis | 4 +- _tags | 39 +++++++----- lib/META | 4 +- lib/ipv4/ipv4_packet.ml | 124 +++++++++++++++++++++---------------- lib/ipv4/ipv4_packet.mli | 3 + lib_test/test.ml | 5 +- lib_test/test_checksums.ml | 65 +++++++++++++++++++ myocamlbuild.ml | 6 +- setup.ml | 122 ++++++++++++++++++------------------ 9 files changed, 235 insertions(+), 137 deletions(-) create mode 100644 lib_test/test_checksums.ml diff --git a/_oasis b/_oasis index e7f0513d7..8c6acf6ce 100644 --- a/_oasis +++ b/_oasis @@ -58,7 +58,9 @@ Library ipv4 Modules: Static_ipv4, Ipv4_wire, Ipv4_packet InternalModules: Ipv4_common, Routing BuildDepends: logs,io-page,mirage-types,ipaddr,cstruct.ppx,lwt,result,rresult, - tcpip,tcpip.ethif,mirage-runtime + mirage-runtime, + tcpip,tcpip.ethif, + tcpip.udp, tcpip.tcp Library ipv6 CompiledObject: best diff --git a/_tags b/_tags index 3e3e3aa14..5153ffbe9 100644 --- a/_tags +++ b/_tags @@ -1,5 +1,5 @@ # OASIS_START -# DO NOT EDIT (digest: ea93b1247c81a923c5d4a356c985a73e) +# DO NOT EDIT (digest: a59f871cc3d4f9d3c94a803e4045a12e) # Ignore VCS directories, you can use the same kind of rule outside # OASIS_START/STOP if you want to exclude directories that contains # useless stuff for the build process @@ -56,22 +56,6 @@ true: annot, bin_annot : pkg_result : pkg_rresult : use_ethif -# Library ipv4 -"lib/ipv4/ipv4.cmxs": use_ipv4 -: pkg_cstruct -: pkg_cstruct.ppx -: pkg_io-page -: pkg_ipaddr -: pkg_logs -: pkg_lwt -: pkg_mirage-profile -: pkg_mirage-runtime -: pkg_mirage-types -: pkg_mirage-types-lwt -: pkg_result -: pkg_rresult -: use_ethif -: use_tcpip # Library ipv6 "lib/ipv6/ipv6.cmxs": use_ipv6 : pkg_cstruct @@ -152,6 +136,27 @@ true: annot, bin_annot : pkg_result : pkg_rresult : use_tcpip +# Library ipv4 +"lib/ipv4/ipv4.cmxs": use_ipv4 +: pkg_cstruct +: pkg_cstruct.ppx +: pkg_duration +: pkg_fmt +: pkg_io-page +: pkg_ipaddr +: pkg_logs +: pkg_lwt +: pkg_mirage-profile +: pkg_mirage-runtime +: pkg_mirage-types +: pkg_mirage-types-lwt +: pkg_randomconv +: pkg_result +: pkg_rresult +: use_ethif +: use_tcp +: use_tcpip +: use_udp # Library tcpip-stack-direct "lib/tcpip-stack-direct.cmxs": use_tcpip-stack-direct : pkg_fmt diff --git a/lib/META b/lib/META index 8f47ad091..52b96045c 100644 --- a/lib/META +++ b/lib/META @@ -1,5 +1,5 @@ # OASIS_START -# DO NOT EDIT (digest: 750319fb7d1ad0aa0cd18d6842562655) +# DO NOT EDIT (digest: bf264be3ca47d19f155f60298bbb98b7) version = "2.8.0" description = "Implementations for network-related module types from MirageOS." @@ -139,7 +139,7 @@ package "ipv4" ( description = "Implementations for network-related module types from MirageOS." requires = - "logs io-page mirage-types ipaddr cstruct.ppx lwt result rresult tcpip tcpip.ethif mirage-runtime" + "logs io-page mirage-types ipaddr cstruct.ppx lwt result rresult mirage-runtime tcpip tcpip.ethif tcpip.udp tcpip.tcp" archive(byte) = "ipv4.cma" archive(byte, plugin) = "ipv4.cma" archive(native) = "ipv4.cmxa" diff --git a/lib/ipv4/ipv4_packet.ml b/lib/ipv4/ipv4_packet.ml index e87257f55..74ab625d3 100644 --- a/lib/ipv4/ipv4_packet.ml +++ b/lib/ipv4/ipv4_packet.ml @@ -17,58 +17,6 @@ let pp fmt t = let equal p q = (p = q) -module Unmarshal = struct - type error = string - - let int_to_protocol = function - | 1 -> Some `ICMP - | 6 -> Some `TCP - | 17 -> Some `UDP - | _ -> None - - let of_cstruct buf = - let open Rresult in - let open Ipv4_wire in - let check_version buf = - let version n = (n land 0xf0) in - match get_ipv4_hlen_version buf |> version with - | 0x40 -> Result.Ok buf - | n -> Result.Error (Printf.sprintf "IPv4 presented with a packet that claims a different IP version: %x" n) - in - let size_check buf = - if (Cstruct.len buf < sizeof_ipv4) then Result.Error "buffer sent to IPv4 parser had size < 20" - else Result.Ok buf - in - let get_header_length buf = - let length_of_hlen_version n = (n land 0x0f) * 4 in - let hlen = get_ipv4_hlen_version buf |> length_of_hlen_version in - if (get_ipv4_len buf) < sizeof_ipv4 then - Result.Error (Printf.sprintf - "total length %d is smaller than minimum header length" - (get_ipv4_len buf)) - else if get_ipv4_len buf < hlen then - Result.Error (Printf.sprintf - "total length %d is smaller than stated header length %d" - (get_ipv4_len buf) hlen) - else if hlen < sizeof_ipv4 then Result.Error - (Printf.sprintf "IPv4 header claimed to have size < 20: %d" hlen) - else Result.Ok hlen - in - let parse buf options_end = - let payload_len = (get_ipv4_len buf) - options_end in - let src = Ipaddr.V4.of_int32 (get_ipv4_src buf) in - let dst = Ipaddr.V4.of_int32 (get_ipv4_dst buf) in - let proto = get_ipv4_proto buf in - let ttl = get_ipv4_ttl buf in - let options = - if options_end > sizeof_ipv4 then (Cstruct.sub buf sizeof_ipv4 (options_end - sizeof_ipv4)) - else (Cstruct.create 0) - in - let payload = Cstruct.sub buf options_end payload_len in - Result.Ok ({src; dst; proto; ttl; options;}, payload) - in - size_check buf >>= check_version >>= get_header_length >>= parse buf -end module Marshal = struct open Ipv4_wire @@ -125,3 +73,75 @@ module Marshal = struct unsafe_fill ~payload t buf; buf end +module Unmarshal = struct + type error = string + + let int_to_protocol = function + | 1 -> Some `ICMP + | 6 -> Some `TCP + | 17 -> Some `UDP + | _ -> None + + let of_cstruct buf = + let open Rresult in + let open Ipv4_wire in + let check_version buf = + let version n = (n land 0xf0) in + match get_ipv4_hlen_version buf |> version with + | 0x40 -> Result.Ok buf + | n -> Result.Error (Printf.sprintf "IPv4 presented with a packet that claims a different IP version: %x" n) + in + let size_check buf = + if (Cstruct.len buf < sizeof_ipv4) then Result.Error "buffer sent to IPv4 parser had size < 20" + else Result.Ok buf + in + let get_header_length buf = + let length_of_hlen_version n = (n land 0x0f) * 4 in + let hlen = get_ipv4_hlen_version buf |> length_of_hlen_version in + if (get_ipv4_len buf) < sizeof_ipv4 then + Result.Error (Printf.sprintf + "total length %d is smaller than minimum header length" + (get_ipv4_len buf)) + else if get_ipv4_len buf < hlen then + Result.Error (Printf.sprintf + "total length %d is smaller than stated header length %d" + (get_ipv4_len buf) hlen) + else if hlen < sizeof_ipv4 then Result.Error + (Printf.sprintf "IPv4 header claimed to have size < 20: %d" hlen) + else Result.Ok hlen + in + let parse buf options_end = + let payload_len = (get_ipv4_len buf) - options_end in + let src = Ipaddr.V4.of_int32 (get_ipv4_src buf) in + let dst = Ipaddr.V4.of_int32 (get_ipv4_dst buf) in + let proto = get_ipv4_proto buf in + let ttl = get_ipv4_ttl buf in + let options = + if options_end > sizeof_ipv4 then (Cstruct.sub buf sizeof_ipv4 (options_end - sizeof_ipv4)) + else (Cstruct.create 0) + in + let payload = Cstruct.sub buf options_end payload_len in + Result.Ok ({src; dst; proto; ttl; options;}, payload) + in + size_check buf >>= check_version >>= get_header_length >>= parse buf + + let verify_transport_checksum ~proto ~ipv4_header ~transport_packet = + (* note: it's not necessary to ensure padding to integral number of 16-bit fields here; ones_complement_list does this for us *) + let check ~proto ipv4_header len = + try + let ph = Marshal.pseudoheader ~src:ipv4_header.src ~dst:ipv4_header.dst ~proto len in + let calculated_checksum = Tcpip_checksum.ones_complement_list [ph ; transport_packet] in + 0 = compare 0x0000 calculated_checksum + with + | Invalid_argument _ -> false + in + match proto with + | `TCP -> (* checksum isn't optional in tcp, but pkt must be long enough *) + check ipv4_header ~proto (Cstruct.len transport_packet) + | `UDP -> + match Udp_wire.get_udp_checksum transport_packet with + | n when (=) 0 @@ compare n 0x0000 -> true (* no checksum supplied, so the check trivially passes *) + | _ -> + check ipv4_header ~proto (Cstruct.len transport_packet) + +end diff --git a/lib/ipv4/ipv4_packet.mli b/lib/ipv4/ipv4_packet.mli index 95aae3019..4b8c44043 100644 --- a/lib/ipv4/ipv4_packet.mli +++ b/lib/ipv4/ipv4_packet.mli @@ -20,6 +20,9 @@ module Unmarshal : sig val int_to_protocol : int -> protocol option val of_cstruct : Cstruct.t -> (t * Cstruct.t, error) Result.result + + val verify_transport_checksum : proto:([`TCP | `UDP]) -> ipv4_header:t -> + transport_packet:Cstruct.t -> bool end module Marshal : sig diff --git a/lib_test/test.ml b/lib_test/test.ml index 1b1b17581..f01809312 100644 --- a/lib_test/test.ml +++ b/lib_test/test.ml @@ -15,12 +15,13 @@ *) let suite = [ - "tcp_window" , Test_tcp_window.suite ; + "checksums" , Test_checksums.suite ; + "tcp_window" , Test_tcp_window.suite ; "udp" , Test_udp.suite ; "socket" , Test_socket.suite ; "icmpv4" , Test_icmpv4.suite ; "tcp_options" , Test_tcp_options.suite ; - "ip_options" , Test_ip_options.suite ; + "ip_options" , Test_ip_options.suite ; "rfc5961" , Test_rfc5961.suite ; "arp" , Test_arp.suite ; "connect" , Test_connect.suite ; diff --git a/lib_test/test_checksums.ml b/lib_test/test_checksums.ml new file mode 100644 index 000000000..62b1ed059 --- /dev/null +++ b/lib_test/test_checksums.ml @@ -0,0 +1,65 @@ +open Rresult + +let unwrap_ipv4 buf = Ipv4_packet.Unmarshal.of_cstruct buf |> R.reword_error R.msg |> R.error_msg_to_invalid_arg +let verify_ipv4_udp = Ipv4_packet.Unmarshal.verify_transport_checksum ~proto:`UDP +let verify_ipv4_tcp = Ipv4_packet.Unmarshal.verify_transport_checksum ~proto:`TCP + +let example_ipv4_udp = "\ +\x45\xb8\x00\x4c\xbf\x7c\x40\x00\x34\x11\xdf\x65\x90\x5c\x09\x16\ +\x0a\x89\x03\x0c\x00\x7b\x00\x7b\x00\x38\xf4\xfb\x24\x01\x03\xee\ +\x00\x00\x00\x00\x00\x00\x00\x43\x47\x50\x53\x00\xdc\x03\xd0\x04\ +\x53\x76\x73\x95\xdc\x03\xd0\x06\xcb\xd2\x4f\xfb\xdc\x03\xd0\x06\ +\xcd\x57\x43\xa0\xdc\x03\xd0\x06\xcd\xb6\x2e\x51" + +let example_ipv4_tcp = "\ +\x45\x00\x00\x34\x00\x00\x40\x00\x2d\x06\x47\x91\x93\x4b\x65\x53\ +\x0a\x89\x03\x0c\x01\xbb\xe5\xd0\x6f\x75\x20\x55\xf6\x5e\xdb\xef\ +\x80\x12\x72\x10\xad\x83\x00\x00\x02\x04\x05\x48\x01\x01\x04\x02\ +\x01\x03\x03\x08" + +let udp_ipv4_correct_positive () = + let buf = Cstruct.of_string example_ipv4_udp in + let (ipv4_header, transport_packet) = unwrap_ipv4 buf in + Alcotest.(check bool) "for a correct UDP checksum, return true" + true @@ verify_ipv4_udp ~ipv4_header ~transport_packet; + Lwt.return_unit + +let udp_ipv4_correct_negative () = + let buf = Cstruct.of_string example_ipv4_udp in + Cstruct.BE.set_uint32 buf ((Cstruct.len buf) - 4) 0x1234l; + let (ipv4_header, transport_packet) = unwrap_ipv4 buf in + Alcotest.(check bool) "mutating the packet w/o fixing checksum causes verification to fail" + false @@ verify_ipv4_udp ~ipv4_header ~transport_packet; + Lwt.return_unit + +let udp_ipv4_allows_zero () = + let buf = Cstruct.of_string example_ipv4_udp in + let (ipv4_header, transport_packet) = unwrap_ipv4 buf in + Udp_wire.set_udp_checksum transport_packet 0x0000; + Alcotest.(check bool) "0x0000 checksum is OK for UDP" + true @@ verify_ipv4_udp ~ipv4_header ~transport_packet; + Lwt.return_unit + +let tcp_ipv4_correct_positive () = + let buf = Cstruct.of_string example_ipv4_tcp in + let (ipv4_header, transport_packet) = unwrap_ipv4 buf in + Alcotest.(check bool) "for a correct TCP checksum, return true" + true @@ verify_ipv4_tcp ~ipv4_header ~transport_packet; + Lwt.return_unit + +let tcp_ipv4_correct_negative () = + let buf = Cstruct.of_string example_ipv4_tcp in + Cstruct.BE.set_uint32 buf ((Cstruct.len buf) - 4) 0x1234l; + let (ipv4_header, transport_packet) = unwrap_ipv4 buf in + Alcotest.(check bool) "mutating a TCP packet w/o fixing checksum causes verification to fail" + false @@ verify_ipv4_tcp ~ipv4_header ~transport_packet; + Lwt.return_unit + +let suite = +[ + "correct UDP IPV4 checksums are recognized", `Quick, udp_ipv4_correct_positive; + "incorrect UDP IPV4 checksums are recognized", `Quick, udp_ipv4_correct_negative; + "0x00 UDP checksum is valid", `Quick, udp_ipv4_allows_zero; + "correct TCP IPV4 checksums are recognized", `Quick, tcp_ipv4_correct_positive; + "incorrect TCP IPV4 checksums are recognized", `Quick, tcp_ipv4_correct_negative; +] diff --git a/myocamlbuild.ml b/myocamlbuild.ml index c9dfaf3cc..b4d943802 100644 --- a/myocamlbuild.ml +++ b/myocamlbuild.ml @@ -1,5 +1,5 @@ (* OASIS_START *) -(* DO NOT EDIT (digest: 65ba287fe6c51822cf527d9c15afdfb4) *) +(* DO NOT EDIT (digest: 61d522780b0d74636b2863a6585885db) *) module OASISGettext = struct (* # 22 "src/oasis/OASISGettext.ml" *) @@ -891,11 +891,11 @@ let package_default = ("tcpip_xen", ["lib"], []); ("ethif", ["lib/ethif"], []); ("arpv4", ["lib/arpv4"], []); - ("ipv4", ["lib/ipv4"], []); ("ipv6", ["lib/ipv6"], []); ("icmpv4", ["lib/icmp"], []); ("udp", ["lib/udp"], []); ("tcp", ["lib/tcp"], []); + ("ipv4", ["lib/ipv4"], []); ("tcpip-stack-direct", ["lib"], []); ("icmpv4-socket", ["unix"], []); ("udpv4-socket", ["unix"], []); @@ -937,7 +937,7 @@ let package_default = ("lib/udp", ["lib"]); ("lib/tcp", ["lib"]); ("lib/ipv6", ["lib"; "lib/ethif"]); - ("lib/ipv4", ["lib"; "lib/ethif"]); + ("lib/ipv4", ["lib"; "lib/ethif"; "lib/tcp"; "lib/udp"]); ("lib/icmp", ["lib"]); ("lib/arpv4", ["lib/ethif"]) ] diff --git a/setup.ml b/setup.ml index 14edd700f..d7211061a 100644 --- a/setup.ml +++ b/setup.ml @@ -1,7 +1,7 @@ (* setup.ml generated for the first time by OASIS v0.4.5 *) (* OASIS_START *) -(* DO NOT EDIT (digest: cb59a6855ee9a085b4d1cc4d2b00d784) *) +(* DO NOT EDIT (digest: 8c72a2938c5920ccc40070a439783dd1) *) (* Regenerated by OASIS v0.4.8 Visit http://oasis.forge.ocamlcore.org for more information and @@ -7688,14 +7688,14 @@ let setup_t = }); Library ({ - cs_name = "ipv4"; + cs_name = "ipv6"; cs_data = PropList.Data.create (); cs_plugin_data = [] }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "lib/ipv4"; + bs_path = "lib/ipv6"; bs_compiled_object = Best; bs_build_depends = [ @@ -7703,12 +7703,12 @@ let setup_t = FindlibPackage ("io-page", None); FindlibPackage ("mirage-types", None); FindlibPackage ("ipaddr", None); + FindlibPackage ("cstruct", None); FindlibPackage ("cstruct.ppx", None); FindlibPackage ("lwt", None); - FindlibPackage ("result", None); - FindlibPackage ("rresult", None); InternalLibrary "tcpip"; InternalLibrary "ethif"; + FindlibPackage ("duration", None); FindlibPackage ("mirage-runtime", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; @@ -7833,39 +7833,40 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])] }, { - lib_modules = - ["Static_ipv4"; "Ipv4_wire"; "Ipv4_packet"]; + lib_modules = ["Ipv6"; "Ndpv6"; "Ipv6_wire"]; lib_pack = false; - lib_internal_modules = ["Ipv4_common"; "Routing"]; + lib_internal_modules = []; lib_findlib_parent = Some "tcpip"; - lib_findlib_name = Some "ipv4"; + lib_findlib_name = Some "ipv6"; lib_findlib_directory = None; lib_findlib_containers = [] }); Library ({ - cs_name = "ipv6"; + cs_name = "icmpv4"; cs_data = PropList.Data.create (); cs_plugin_data = [] }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "lib/ipv6"; + bs_path = "lib/icmp"; bs_compiled_object = Best; bs_build_depends = [ FindlibPackage ("logs", None); - FindlibPackage ("io-page", None); FindlibPackage ("mirage-types", None); - FindlibPackage ("ipaddr", None); + FindlibPackage ("mirage-types-lwt", None); FindlibPackage ("cstruct", None); FindlibPackage ("cstruct.ppx", None); FindlibPackage ("lwt", None); + FindlibPackage ("ipaddr", None); + FindlibPackage ("result", None); + FindlibPackage ("rresult", None); + FindlibPackage ("mirage-profile", None); InternalLibrary "tcpip"; - InternalLibrary "ethif"; - FindlibPackage ("duration", None); - FindlibPackage ("mirage-runtime", None) + FindlibPackage ("mirage-runtime", None); + FindlibPackage ("fmt", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -7989,39 +7990,40 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])] }, { - lib_modules = ["Ipv6"; "Ndpv6"; "Ipv6_wire"]; + lib_modules = ["Icmpv4"; "Icmpv4_packet"; "Icmpv4_wire"]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "tcpip"; - lib_findlib_name = Some "ipv6"; + lib_findlib_name = Some "icmpv4"; lib_findlib_directory = None; lib_findlib_containers = [] }); Library ({ - cs_name = "icmpv4"; + cs_name = "udp"; cs_data = PropList.Data.create (); cs_plugin_data = [] }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "lib/icmp"; + bs_path = "lib/udp"; bs_compiled_object = Best; bs_build_depends = [ FindlibPackage ("logs", None); FindlibPackage ("mirage-types", None); FindlibPackage ("mirage-types-lwt", None); + FindlibPackage ("ipaddr", None); FindlibPackage ("cstruct", None); FindlibPackage ("cstruct.ppx", None); FindlibPackage ("lwt", None); - FindlibPackage ("ipaddr", None); FindlibPackage ("result", None); FindlibPackage ("rresult", None); FindlibPackage ("mirage-profile", None); InternalLibrary "tcpip"; FindlibPackage ("mirage-runtime", None); + FindlibPackage ("randomconv", None); FindlibPackage ("fmt", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; @@ -8146,24 +8148,24 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])] }, { - lib_modules = ["Icmpv4"; "Icmpv4_packet"; "Icmpv4_wire"]; + lib_modules = ["Udp"; "Udp_wire"; "Udp_packet"]; lib_pack = false; lib_internal_modules = []; lib_findlib_parent = Some "tcpip"; - lib_findlib_name = Some "icmpv4"; + lib_findlib_name = Some "udp"; lib_findlib_directory = None; lib_findlib_containers = [] }); Library ({ - cs_name = "udp"; + cs_name = "tcp"; cs_data = PropList.Data.create (); cs_plugin_data = [] }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "lib/udp"; + bs_path = "lib/tcp"; bs_compiled_object = Best; bs_build_depends = [ @@ -8177,9 +8179,11 @@ let setup_t = FindlibPackage ("result", None); FindlibPackage ("rresult", None); FindlibPackage ("mirage-profile", None); + FindlibPackage ("io-page", None); InternalLibrary "tcpip"; - FindlibPackage ("mirage-runtime", None); + FindlibPackage ("duration", None); FindlibPackage ("randomconv", None); + FindlibPackage ("mirage-runtime", None); FindlibPackage ("fmt", None) ]; bs_build_tools = [ExternalTool "ocamlbuild"]; @@ -8304,43 +8308,56 @@ let setup_t = bs_nativeopt = [(OASISExpr.EBool true, [])] }, { - lib_modules = ["Udp"; "Udp_wire"; "Udp_packet"]; - lib_pack = false; + lib_modules = + [ + "Options"; + "State"; + "Tcptimer"; + "Sequence"; + "Ack"; + "Window"; + "Segment"; + "User_buffer"; + "Pcb"; + "Flow"; + "Stats"; + "Wire"; + "Tcp_wire"; + "Tcp_packet" + ]; + lib_pack = true; lib_internal_modules = []; lib_findlib_parent = Some "tcpip"; - lib_findlib_name = Some "udp"; + lib_findlib_name = Some "tcp"; lib_findlib_directory = None; lib_findlib_containers = [] }); Library ({ - cs_name = "tcp"; + cs_name = "ipv4"; cs_data = PropList.Data.create (); cs_plugin_data = [] }, { bs_build = [(OASISExpr.EBool true, true)]; bs_install = [(OASISExpr.EBool true, true)]; - bs_path = "lib/tcp"; + bs_path = "lib/ipv4"; bs_compiled_object = Best; bs_build_depends = [ FindlibPackage ("logs", None); + FindlibPackage ("io-page", None); FindlibPackage ("mirage-types", None); - FindlibPackage ("mirage-types-lwt", None); FindlibPackage ("ipaddr", None); - FindlibPackage ("cstruct", None); FindlibPackage ("cstruct.ppx", None); FindlibPackage ("lwt", None); FindlibPackage ("result", None); FindlibPackage ("rresult", None); - FindlibPackage ("mirage-profile", None); - FindlibPackage ("io-page", None); - InternalLibrary "tcpip"; - FindlibPackage ("duration", None); - FindlibPackage ("randomconv", None); FindlibPackage ("mirage-runtime", None); - FindlibPackage ("fmt", None) + InternalLibrary "tcpip"; + InternalLibrary "ethif"; + InternalLibrary "udp"; + InternalLibrary "tcp" ]; bs_build_tools = [ExternalTool "ocamlbuild"]; bs_interface_patterns = @@ -8465,26 +8482,11 @@ let setup_t = }, { lib_modules = - [ - "Options"; - "State"; - "Tcptimer"; - "Sequence"; - "Ack"; - "Window"; - "Segment"; - "User_buffer"; - "Pcb"; - "Flow"; - "Stats"; - "Wire"; - "Tcp_wire"; - "Tcp_packet" - ]; - lib_pack = true; - lib_internal_modules = []; + ["Static_ipv4"; "Ipv4_wire"; "Ipv4_packet"]; + lib_pack = false; + lib_internal_modules = ["Ipv4_common"; "Routing"]; lib_findlib_parent = Some "tcpip"; - lib_findlib_name = Some "tcp"; + lib_findlib_name = Some "ipv4"; lib_findlib_directory = None; lib_findlib_containers = [] }); @@ -9778,7 +9780,7 @@ let setup_t = }; oasis_fn = Some "_oasis"; oasis_version = "0.4.8"; - oasis_digest = Some "7\145\199:\135H\214\194T\196\\s\184\160\001\163"; + oasis_digest = Some "\142z\004\204e\180\151\163\002\025\168\201\187mB("; oasis_exec = None; oasis_setup_args = []; setup_update = false @@ -9786,7 +9788,7 @@ let setup_t = let setup () = BaseSetup.setup setup_t;; -# 9790 "setup.ml" +# 9792 "setup.ml" let setup_t = BaseCompat.Compat_0_4.adapt_setup_t setup_t open BaseCompat.Compat_0_4 (* OASIS_STOP *)