Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .ocamlformat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
version = 0.15.0
disable = true
2 changes: 1 addition & 1 deletion dune-project
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
(lang dune 1.0)
(lang dune 2.7)
(name tcpip)
2 changes: 1 addition & 1 deletion examples/ping/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(executables
(names ping)
(libraries cmdliner logs logs.fmt tcpip.icmpv4-socket))
(libraries cmdliner logs logs.fmt tcpip.icmpv4-socket tcpip.unix))
5 changes: 4 additions & 1 deletion src/icmp/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
(library
(name tcpip_icmpv4)
(public_name tcpip.icmpv4)
(instrumentation
(backend bisect_ppx))
(libraries mirage-protocols rresult logs tcpip mirage-profile tcpip.udp)
(preprocess (pps ppx_cstruct))
(preprocess
(pps ppx_cstruct))
(wrapped false))
9 changes: 6 additions & 3 deletions src/ipv4/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
(library
(name tcpip_ipv4)
(public_name tcpip.ipv4)
(libraries logs mirage-protocols ipaddr cstruct rresult tcpip
tcpip.udp mirage-random mirage-clock randomconv lru)
(preprocess (pps ppx_cstruct))
(instrumentation
(backend bisect_ppx))
(libraries logs mirage-protocols ipaddr cstruct rresult tcpip tcpip.udp
mirage-random mirage-clock randomconv lru)
(preprocess
(pps ppx_cstruct))
(wrapped false))
5 changes: 4 additions & 1 deletion src/ipv6/dune
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
(library
(name tcpip_ipv6)
(public_name tcpip.ipv6)
(instrumentation
(backend bisect_ppx))
(libraries logs mirage-protocols mirage-time mirage-net macaddr-cstruct
mirage-clock duration ipaddr cstruct rresult mirage-random tcpip
randomconv ethernet)
(preprocess (pps ppx_cstruct))
(preprocess
(pps ppx_cstruct))
(wrapped false))
6 changes: 4 additions & 2 deletions src/stack-direct/dune
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
(library
(name tcpip_stack_direct)
(public_name tcpip.stack-direct)
(libraries logs ipaddr lwt fmt mirage-time mirage-random
mirage-protocols mirage-stack mirage-net ethernet))
(instrumentation
(backend bisect_ppx))
(libraries logs ipaddr lwt fmt mirage-time mirage-random mirage-protocols
mirage-stack mirage-net ethernet))
29 changes: 23 additions & 6 deletions src/stack-unix/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,49 @@
(public_name tcpip.icmpv4-socket)
(modules icmpv4_socket)
(wrapped false)
(libraries lwt.unix ipaddr.unix cstruct-lwt tcpip.icmpv4
tcpip.ipv4 tcpip.ipv6 mirage-protocols))
(instrumentation
(backend bisect_ppx))
(libraries lwt.unix ipaddr.unix cstruct-lwt tcpip.icmpv4 tcpip.ipv4
tcpip.ipv6 mirage-protocols))

(library
(name udpv4_socket)
(public_name tcpip.udpv4-socket)
(modules udpv4_socket)
(wrapped false)
(instrumentation
(backend bisect_ppx))
(libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols))

(library
(name udpv6_socket)
(public_name tcpip.udpv6-socket)
(modules udpv6_socket)
(wrapped false)
(instrumentation
(backend bisect_ppx))
(libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols))

(library
(name tcp_socket_options)
(public_name tcpip.tcp_socket_options)
(modules tcp_socket_options)
(c_names tcp_socket_options_stubs)
(foreign_stubs
(language c)
(names tcp_socket_options_stubs)
(flags :standard))
(wrapped false)
(instrumentation
(backend bisect_ppx))
(libraries lwt.unix duration))

(library
(name tcpv4_socket)
(public_name tcpip.tcpv4-socket)
(modules tcpv4_socket tcp_socket)
(wrapped false)
(instrumentation
(backend bisect_ppx))
(libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols
tcp_socket_options))

Expand All @@ -41,6 +54,8 @@
(public_name tcpip.tcpv6-socket)
(modules tcpv6_socket)
(wrapped false)
(instrumentation
(backend bisect_ppx))
(libraries lwt.unix ipaddr.unix cstruct-lwt fmt mirage-protocols
tcpv4_socket tcp_socket_options))

Expand All @@ -49,6 +64,8 @@
(public_name tcpip.stack-socket)
(modules tcpip_stack_socket ipv4_socket ipv6_socket)
(wrapped false)
(libraries lwt.unix cstruct-lwt ipaddr.unix logs
tcpip.tcpv4-socket tcpip.udpv4-socket tcpip.ipv4 tcpip.ipv6 tcpip.icmpv4
mirage-protocols mirage-stack))
(instrumentation
(backend bisect_ppx))
(libraries lwt.unix cstruct-lwt ipaddr.unix logs tcpip.tcpv4-socket
tcpip.udpv4-socket tcpip.ipv4 tcpip.ipv6 tcpip.icmpv4 mirage-protocols
mirage-stack))
9 changes: 6 additions & 3 deletions src/tcp/dune
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
(library
(name tcp)
(public_name tcpip.tcp)
(instrumentation
(backend bisect_ppx))
(libraries logs mirage-protocols ipaddr cstruct lwt-dllist rresult
mirage-profile tcpip duration randomconv fmt mirage-time
mirage-clock mirage-random)
(preprocess (pps ppx_cstruct)))
mirage-profile tcpip duration randomconv fmt mirage-time mirage-clock
mirage-random)
(preprocess
(pps ppx_cstruct)))
9 changes: 8 additions & 1 deletion src/tcpip_checksum/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,19 @@
(name tcpip)
(public_name tcpip)
(modules tcpip_checksum)
(instrumentation
(backend bisect_ppx))
(libraries cstruct)
(wrapped false))

(library
(name tcpip_unix)
(public_name tcpip.unix)
(modules tcpip_unix)
(c_names checksum_stubs)
(instrumentation
(backend bisect_ppx))
(foreign_stubs
(language c)
(names checksum_stubs)
(flags :standard))
(wrapped false))
5 changes: 4 additions & 1 deletion src/udp/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
(library
(name tcpip_udpv4)
(public_name tcpip.udp)
(instrumentation
(backend bisect_ppx))
(libraries mirage-protocols mirage-random rresult logs tcpip randomconv)
(preprocess (pps ppx_cstruct))
(preprocess
(pps ppx_cstruct))
(wrapped false))
5 changes: 3 additions & 2 deletions tcpip.opam
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ build: [
]
conflicts: [ "mirage-xen" {< "6.0.0"} ]
depends: [
"dune"
"dune" {>= "2.7.0"}
"bisect_ppx" {dev & >= "2.5.0"}
"ocaml" {>= "4.06.0"}
"rresult" {>= "0.5.0"}
"cstruct" {>= "3.2.0"}
Expand All @@ -28,7 +29,7 @@ depends: [
"mirage-clock" {>= "3.0.0"}
"mirage-random" {>= "2.0.0"}
"mirage-stack" {>= "2.1.0"}
"mirage-protocols" {>= "4.0.0"}
"mirage-protocols" {>= "4.0.0" & < "5.0.0"}
"mirage-time" {>= "2.0.0"}
"ipaddr" {>= "5.0.0"}
"macaddr" {>="4.0.0"}
Expand Down
24 changes: 9 additions & 15 deletions test/dune
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
(executables
(names test)
(libraries alcotest mirage-random-test lwt.unix logs
logs.fmt mirage-profile mirage-flow mirage-vnetif mirage-clock-unix
pcap-format duration mirage-random rresult mirage-protocols
mirage-stack arp arp-mirage ethernet tcpip.ipv4 tcpip.tcp tcpip.udp
tcpip.stack-direct tcpip.icmpv4 tcpip.udpv4-socket tcpip.tcpv4-socket
tcpip.icmpv4-socket tcpip.stack-socket tcpip.ipv6 ipaddr-cstruct
macaddr-cstruct tcpip.unix))

(alias
(name runtest)
(deps
(:< test.exe))
(test
(name test)
(libraries alcotest mirage-random-test lwt.unix logs logs.fmt mirage-profile
mirage-flow mirage-vnetif mirage-clock-unix pcap-format duration
mirage-random rresult mirage-protocols mirage-stack arp arp-mirage
ethernet tcpip.ipv4 tcpip.tcp tcpip.udp tcpip.stack-direct tcpip.icmpv4
tcpip.udpv4-socket tcpip.tcpv4-socket tcpip.icmpv4-socket
tcpip.stack-socket tcpip.ipv6 ipaddr-cstruct macaddr-cstruct tcpip.unix)
(action
(run %{<} -q -e --color=always)))
(run %{test} -q -e --color=always)))
2 changes: 1 addition & 1 deletion test/test_iperf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ let suite = [
test_tcp_iperf_two_stacks_uniform_packet_loss amt_quick 120.0;

"iperf with two stacks and uniform packet loss of packets with no payload", `Quick,
test_tcp_iperf_two_stacks_uniform_packet_loss_no_payload amt_quick 120.0;
test_tcp_iperf_two_stacks_uniform_packet_loss_no_payload amt_quick 240.0;

"iperf with two stacks and uniform packet loss of packets with no payload, longer", `Slow,
test_tcp_iperf_two_stacks_uniform_packet_loss_no_payload amt_slow 240.0;
Expand Down
4 changes: 2 additions & 2 deletions test/test_iperf_ipv6.ml
Original file line number Diff line number Diff line change
Expand Up @@ -250,8 +250,8 @@ let suite = [
"iperf with two stacks and uniform packet loss", `Quick,
test_tcp_iperf_ipv6_two_stacks_uniform_packet_loss amt_quick 120.0;

"iperf with two stacks and uniform packet loss of packets with no payload", `Quick,
test_tcp_iperf_ipv6_two_stacks_uniform_packet_loss_no_payload amt_quick 120.0;
"iperf with two stacks and uniform packet loss of packets with no payload", `Slow,
test_tcp_iperf_ipv6_two_stacks_uniform_packet_loss_no_payload amt_quick 240.0;

"iperf with two stacks and uniform packet loss of packets with no payload, longer", `Slow,
test_tcp_iperf_ipv6_two_stacks_uniform_packet_loss_no_payload amt_slow 240.0;
Expand Down