Skip to content

Commit

Permalink
Rename Checksum to Tcpip_checksum to avoid polluting the global modul…
Browse files Browse the repository at this point in the history
…e space too much
  • Loading branch information
avsm committed Feb 3, 2014
1 parent 1ffbba9 commit ae58565
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions _oasis
Expand Up @@ -19,15 +19,15 @@ Library ethif
Path: lib
Findlibparent: tcpip
Findlibname: ethif
Modules: Ethif, Arpv4, Checksum
Modules: Ethif, Arpv4, Tcpip_checksum
BuildDepends: tcpip,io-page,mirage-types,ipaddr,cstruct,cstruct.syntax,lwt.syntax,lwt

Library ipv4
CompiledObject: best
Path: lib
Findlibparent: tcpip
Findlibname: ipv4
Modules: Ipv4,Checksum
Modules: Ipv4, Tcpip_checksum
BuildDepends: io-page,mirage-types,ipaddr,cstruct,cstruct.syntax,lwt.syntax,lwt,tcpip

Library udpv4
Expand Down
4 changes: 2 additions & 2 deletions lib/ethif.mllib
@@ -1,6 +1,6 @@
# OASIS_START
# DO NOT EDIT (digest: a4c31223314dd9e58ea4b39aad9c3902)
# DO NOT EDIT (digest: 2b7c737ea78eec32e6ca6ff80e37b7f6)
Ethif
Arpv4
Checksum
Tcpip_checksum
# OASIS_STOP
2 changes: 1 addition & 1 deletion lib/ipv4.ml
Expand Up @@ -97,7 +97,7 @@ module Make(Ethif : V1_LWT.ETHIF) = struct
set_ipv4_len buf tlen;
set_ipv4_id buf (Random.int 65535); (* TODO *)
set_ipv4_csum buf 0;
let checksum = Checksum.ones_complement (Cstruct.sub buf 0 sizeof_ipv4) in
let checksum = Tcpip_checksum.ones_complement (Cstruct.sub buf 0 sizeof_ipv4) in
set_ipv4_csum buf checksum

(* We write a whole frame, truncated from the right where the
Expand Down
4 changes: 2 additions & 2 deletions lib/ipv4.mllib
@@ -1,5 +1,5 @@
# OASIS_START
# DO NOT EDIT (digest: 8b28693feceb1e79d8aadfb2e54f9ccf)
# DO NOT EDIT (digest: c82b9080a7392074bb86153d9c076fce)
Ipv4
Checksum
Tcpip_checksum
# OASIS_STOP
File renamed without changes.
File renamed without changes.
8 changes: 4 additions & 4 deletions setup.ml
@@ -1,7 +1,7 @@
(* setup.ml generated for the first time by OASIS v0.4.1 *)

(* OASIS_START *)
(* DO NOT EDIT (digest: 4f574bb08de2009b13a1000913590a6f) *)
(* DO NOT EDIT (digest: cd9371981b4305b55cb6e9d1813a2034) *)
(*
Regenerated by OASIS v0.4.1
Visit http://oasis.forge.ocamlcore.org for more information and
Expand Down Expand Up @@ -6674,7 +6674,7 @@ let setup_t =
bs_nativeopt = [(OASISExpr.EBool true, [])]
},
{
lib_modules = ["Ethif"; "Arpv4"; "Checksum"];
lib_modules = ["Ethif"; "Arpv4"; "Tcpip_checksum"];
lib_pack = false;
lib_internal_modules = [];
lib_findlib_parent = Some "tcpip";
Expand Down Expand Up @@ -6714,7 +6714,7 @@ let setup_t =
bs_nativeopt = [(OASISExpr.EBool true, [])]
},
{
lib_modules = ["Ipv4"; "Checksum"];
lib_modules = ["Ipv4"; "Tcpip_checksum"];
lib_pack = false;
lib_internal_modules = [];
lib_findlib_parent = Some "tcpip";
Expand Down Expand Up @@ -7254,7 +7254,7 @@ let setup_t =
};
oasis_fn = Some "_oasis";
oasis_version = "0.4.1";
oasis_digest = Some "ØRS[¹M\000\155\t\026ý÷#\130\018ê";
oasis_digest = Some "ÿ8<¦ÕF\027\159¹\017D\016 §";
oasis_exec = None;
oasis_setup_args = [];
setup_update = false
Expand Down
2 changes: 1 addition & 1 deletion tcp/pcb.ml
Expand Up @@ -82,7 +82,7 @@ module Make(Ipv4:V1_LWT.IPV4)(Time:V1_LWT.TIME)(Clock:V1.CLOCK)(Random:V1.RANDOM
set_pseudo_header_res pbuf 0;
set_pseudo_header_proto pbuf 6;
set_pseudo_header_len pbuf (Cstruct.lenv data);
Checksum.ones_complement_list (pbuf::data)
Tcpip_checksum.ones_complement_list (pbuf::data)

let verify_checksum id pkt =
true
Expand Down
2 changes: 1 addition & 1 deletion tcp/wire.ml
Expand Up @@ -38,7 +38,7 @@ let checksum ~src ~dst =
set_tcpv4_pseudo_header_res pbuf 0;
set_tcpv4_pseudo_header_proto pbuf 6;
set_tcpv4_pseudo_header_len pbuf (Cstruct.lenv data);
Checksum.ones_complement_list (pbuf::data)
Tcpip_checksum.ones_complement_list (pbuf::data)

type id = {
dest_port: int; (* Remote TCP port *)
Expand Down

0 comments on commit ae58565

Please sign in to comment.