├── .gitignore ├── HOLDoc ├── .cvsignore ├── .gitignore ├── Makefile ├── countClauses ├── countHistoricClauses ├── hol_to_latex.ml ├── holdoc.mk.in ├── hostlts.tex ├── leftdisplay.sty ├── llncs.cls ├── lts_to_latex.ml ├── ltsmunge.sty ├── prooftree.tex ├── relink ├── src │ ├── .gitignore │ ├── HolDoc.sig │ ├── HolDoc.sml │ ├── INSTALL │ ├── Makefile │ ├── README │ ├── WISHLIST │ ├── examples │ │ ├── common │ │ │ ├── hol.imn │ │ │ └── holdoc.sty │ │ ├── lts │ │ │ ├── Holmakefile │ │ │ ├── LabelScript.sml │ │ │ ├── Makefile │ │ │ ├── Net_Hol_reln.sig │ │ │ ├── Net_Hol_reln.sml │ │ │ ├── Store.imn │ │ │ ├── StoreLTSScript.sml │ │ │ ├── TypeScript.sml │ │ │ ├── ValueScript.sml │ │ │ ├── doc-post.template │ │ │ ├── doc-pre.template │ │ │ └── ltsmunge.sty │ │ └── mng │ │ │ ├── Makefile │ │ │ ├── example1.mng │ │ │ ├── examples.imn │ │ │ └── examples.sty │ ├── holdoc-guide.txt │ ├── holdoc_init.ml │ ├── holdoc_init.mli │ ├── holdocmodel.ml │ ├── hollex.mli │ ├── hollex.mll │ ├── holparse.mly │ ├── holparsesupp.ml │ ├── holparsesupp.mli │ ├── holparsetools.ml │ ├── holparsetools.mli │ ├── mng_to_latex.ml │ ├── mngdump.ml │ ├── mngdump.mli │ ├── simpledump.ml │ ├── simpledump.mli │ ├── simplemngdump.ml │ └── simplemosmldump.ml ├── t1bchx.fd ├── t1bchy.fd └── tags.txt ├── LICENSE ├── README.md ├── demo-traces ├── Makefile ├── README ├── trace0038.epsilon ├── trace0241 ├── trace0241.out.html ├── trace1741 ├── trace1741.out.html ├── trace5000 ├── trace5000-extract.annotated.tex.inc ├── trace5000.annotated.tex.inc ├── trace5000.labels.tex ├── trace5000.out.html ├── trace5000aux ├── trace5000aux-inv ├── trace5000aux-inv.out.html ├── trace5001 ├── trace5001.out.html ├── trace5001aux ├── trace5001aux-inv ├── trace5001aux-inv.out.html ├── trace5002 ├── trace5002.annotated.tex.inc ├── trace5002.labels.tex ├── trace5002.out.html ├── trace5003 └── trace5003.out.html ├── dtrace ├── README.md ├── holtcp.d └── run_dtrace.sh ├── notes └── notes01-2015-09-02-new-instrumentation.txt ├── specification ├── .cvsignore ├── .gitignore ├── Chaining.sig ├── Chaining.sml ├── CheckTraces.sml ├── Evaluator.sml ├── GroundTrace.sig ├── GroundTrace.sml ├── GroundTraceMain.sml ├── Holmakefile ├── Holmakefile.public ├── LetComputeLib.sig ├── LetComputeLib.sml ├── LetComputeScript.sml ├── Makefile ├── NetEvalScript.sml ├── Net_Hol_reln.sig ├── Net_Hol_reln.sml ├── Net_fmap_analyse.sig ├── Net_fmap_analyse.sml ├── Phase.sig ├── Phase.sml ├── README ├── README.testing ├── TCP1_.imn ├── TCP1_LIBinterfaceScript.sml ├── TCP1_auxFnsScript.sml ├── TCP1_baseTypesScript.sml ├── TCP1_bettersScript.sml ├── TCP1_boundsInference.sml ├── TCP1_errorsScript.sml ├── TCP1_evalSupportScript.sml ├── TCP1_host0Script.sml ├── TCP1_hostLTSScript.sml ├── TCP1_hostTypesScript.sml ├── TCP1_net1Script.sml ├── TCP1_net1_to_netScript.sml ├── TCP1_netScript.sml ├── TCP1_netTypesScript.sml ├── TCP1_paramsScript.sml ├── TCP1_preHostTypesScript.sml ├── TCP1_rangeAnalysisScript.sml ├── TCP1_ruleidsScript.sml ├── TCP1_seq32PropsScript.sml ├── TCP1_signalsScript.sml ├── TCP1_timerPropsScript.sml ├── TCP1_timersScript.sml ├── TCP1_urgencyScript.sml ├── TCP1_utilPropsScript.sml ├── TCP1_utilsScript.sml ├── TraceFiles.sig ├── TraceFiles.sml ├── alldoc-between.template ├── alldoc-c-between.template ├── alldoc-c-post.template ├── alldoc-c-pre.template ├── alldoc-inc-between.template ├── alldoc-inc-post.template ├── alldoc-inc-pre.template ├── alldoc-post.template ├── alldoc-pre.template ├── alldoc.tex ├── doc-black.template ├── doc-inplace-post.template ├── doc-inplace-pre.template ├── doc-post.template ├── doc-pre.template ├── driveNet.sml ├── errata.txt ├── find_int_inst.sig ├── find_int_inst.sml ├── genstrings.sml ├── glossary.mng ├── ground_tickers.sig ├── ground_tickers.sml ├── hosthistory.xls ├── html_header ├── html_trailer ├── ifpdf.sty ├── incdemo.tex ├── inetheaders.inc ├── interactive-checking ├── invariants.txt ├── munge.mk.in ├── nocomment.imn ├── numrelnorm.sig ├── numrelnorm.sml ├── order_calc ├── poly-CheckTraces.ML ├── poly-genstrings.ML ├── position.txt ├── quant-check.ml ├── rationale.txt ├── rules.txt ├── tcp.sty ├── testEval.sml ├── testEval_utils.sml ├── tinydoc-pre.template └── trace_checker.sml ├── test ├── .gitignore ├── Makefile ├── Makefile.win ├── README ├── bsd │ ├── README │ ├── rawtcptest.c │ ├── rawtest1.ml │ ├── simple.ml │ ├── socktest1.ml │ └── socktest2.ml ├── common │ ├── Makefile │ ├── Makefile.win │ ├── README │ ├── examples │ │ ├── Makefile │ │ ├── server0 │ │ ├── server0_client0 │ │ ├── test.ml │ │ └── test_spec3.ml │ ├── hol2net.ml │ ├── hol2net.mli │ ├── holparselib.ml │ ├── holparselib.mli │ ├── holrender.ml │ ├── holrender.mli │ ├── holtypes.ml │ ├── holtypes.mli │ ├── lexer.mll │ ├── libcalls.ml │ ├── libcalls.mli │ ├── librender.ml │ ├── librender.mli │ ├── net2hol.ml │ ├── net2hol.mli │ ├── netconv.ml │ ├── netconv.mli │ ├── netipreass.ml │ ├── netipreass.mli │ ├── nettypes.ml │ ├── nettypes.mli │ ├── ntpheader.c │ ├── ntpheader.h │ ├── parser.mly │ ├── parserlib.ml │ ├── parserlib.mli │ ├── renderlib.ml │ ├── renderlib.mli │ ├── sock.ml │ ├── sock.mli │ ├── tcpcbparserlib.ml │ ├── tcpcbparserlib.mli │ ├── tcpcbrender.ml │ ├── tcpcbrender.mli │ ├── tcpcbtypes.ml │ └── tcpcbtypes.mli ├── doc │ ├── Makefile │ ├── merger.tex │ ├── protstack.fig │ ├── tcptest.tex │ ├── tracechecking.txt │ ├── tthee-arch.obj │ └── using-tthee.txt ├── dynamic │ ├── Makefile │ ├── README │ ├── ntp_spoof.c │ ├── socket_preload.c │ └── socket_preload.h ├── identtest │ ├── Makefile │ ├── Makefile.win │ ├── errors.ml │ ├── errors.mli │ ├── fileinject.c │ ├── injectslurp.ml │ ├── lexer.mll │ ├── parser.mly │ ├── pcapslurp.c │ ├── readslurp.ml │ ├── slurpinject.ml │ └── testfile ├── injector │ ├── Makefile │ ├── Makefile.win │ ├── README │ └── injector.ml ├── libd │ ├── Makefile │ ├── Makefile.win │ ├── README │ └── libd.ml ├── merge │ ├── Makefile │ ├── README │ └── mlogger.ml ├── mirror │ ├── Makefile │ └── mirror.ml ├── notes │ ├── 6.0-spec-changes.txt │ ├── auto-testing.txt │ ├── constraints.txt │ ├── cycles-request.txt │ ├── default-sysctls.txt │ ├── fds.txt │ ├── netfilter.txt │ ├── netsem1-network-info │ │ ├── bsd-hosts │ │ │ ├── bsd-install.txt │ │ │ ├── bsd-kernel-rebuild.txt │ │ │ ├── bsd-special-test-configuration.txt │ │ │ ├── bsd-sshd-login-problems.txt │ │ │ ├── in_systm.h.patch │ │ │ ├── ip_icmp.c.patch │ │ │ ├── ocaml-install.txt │ │ │ ├── rc.network.patch-emil │ │ │ ├── rc.network.patch-john │ │ │ ├── tcp_debug.c.patch │ │ │ └── tcp_debug.h.patch │ │ └── linux-hosts │ │ │ ├── installation-instructions.txt │ │ │ └── linux-special-test-configuration.txt │ ├── netsem2-network-info │ │ ├── adding-machines.txt │ │ ├── bsd-4.6-install-arp.txt │ │ ├── bsd-4.6-install-libgcc.txt │ │ ├── bsd-4.6-install.txt │ │ ├── bsd-4.6-ocaml.txt │ │ ├── bsd-4.6-software.txt │ │ ├── bsd-4.6-timekeeping.txt │ │ ├── bsd-6.0-install.txt │ │ ├── bsd │ │ │ ├── in_systm.h.patch │ │ │ ├── ip_icmp.c.patch │ │ │ ├── ntpd.patch │ │ │ ├── patches.tex │ │ │ ├── rc.conf.patch │ │ │ ├── routing.patch │ │ │ ├── tcp_debug.c.patch │ │ │ └── tcp_debug.h.patch │ │ ├── hosts │ │ ├── linux-install-info.txt │ │ ├── network-info.txt │ │ └── passwordless-ssh.txt │ ├── netsniffers.txt │ ├── nonfake-traces.txt │ ├── spec_notes.txt │ ├── sudoers │ ├── thalamus-move.txt │ ├── timestamps.txt │ ├── tracegen-journal-amgb2.txt │ └── winxpconfig_notes.txt ├── nssock │ ├── Makefile │ ├── Makefile.win │ ├── README │ ├── conv │ ├── ns_aux.c │ ├── ns_errors.c │ ├── ns_sockets.c │ ├── ns_sockets.h │ ├── ns_sockets_int.h │ ├── tsctime │ │ ├── COPYRIGHT │ │ ├── Makefile.win │ │ ├── TSCtime.c │ │ ├── TSCtime.h │ │ └── TSCtime_example.c │ ├── winconv │ └── winerrcodes.txt ├── ocamlext │ ├── Makefile │ ├── Makefile.win │ ├── README │ ├── parser_hack_script.ml │ ├── platform.ml │ ├── platform.mli │ ├── platformc.c │ ├── rawsock.ml │ ├── rawsock.mli │ ├── rawsockc.c │ ├── threadparsing.ml │ └── threadparsing.mli ├── ocamlhack │ ├── README │ ├── sockopt.c │ ├── unix.ml │ ├── unix.mli │ ├── unixLabels.ml │ └── unixLabels.mli ├── ocamllib │ ├── Makefile │ ├── Makefile.win │ ├── README │ ├── camlsupport.c │ ├── camlsupport.h │ ├── cst2constr.c │ ├── cst2constr.h │ ├── errmsg.c │ ├── libfunmappings.txt │ ├── ocamllib.ml │ ├── ocamllib.mli │ ├── ocamllibc.c │ ├── prnsupport.c │ ├── prnsupport.h │ ├── unixsupport.c │ ├── unixsupport.h │ ├── winerrmsg.c │ └── winsupport.c ├── scripts │ ├── Makefile │ ├── README │ ├── backup-data │ ├── bsd-script │ ├── build-diags │ ├── build-diags3 │ ├── build │ │ ├── README │ │ ├── dobuild │ │ ├── doconfig │ │ ├── fixperms │ │ ├── relinkhol98 │ │ ├── relinkwap │ │ ├── updatehol │ │ ├── updatewap │ │ ├── updatewap-noclean │ │ └── waprc.tpl │ ├── check │ │ ├── Makefile │ │ ├── Netsem │ │ │ ├── AnnotsParse.pm │ │ │ ├── LogParse.pm │ │ │ └── Util.pm │ │ ├── README │ │ ├── analyselog │ │ ├── annotations-2004-12-xmas-join.dat │ │ ├── annotations-2005-01-24.dat │ │ ├── annotations-2005-02-03.dat │ │ ├── appendtrailer │ │ ├── apply.ml │ │ ├── arch_first │ │ ├── blob.png │ │ ├── bsd_non-status-small-first │ │ ├── bsd_non-succeeded-small-first │ │ ├── bsd_non-succeeded-small-first-postpone │ │ ├── bsd_small_first │ │ ├── compress-results │ │ ├── coverage │ │ ├── coverage-rule-annot.dat │ │ ├── coverage-udp-and-tcp │ │ ├── coverage-udp-and-tcp-annot.dat │ │ ├── coverage-udp-and-tcp.dat │ │ ├── coveragecount.ml │ │ ├── dop │ │ ├── drivehshole │ │ ├── dummyclient │ │ ├── every_n │ │ ├── filter.ml │ │ ├── genmachines │ │ ├── hasphantom │ │ ├── histoplot-test-data.txt │ │ ├── histoplot.ml │ │ ├── histoplot2.ml │ │ ├── hotgunzip.c │ │ ├── hotgzip.c │ │ ├── hshole │ │ ├── hsholed │ │ ├── inprogressreport │ │ ├── inuse-test │ │ ├── inuse2.pl │ │ ├── kill-all-checkers │ │ ├── logpauses │ │ ├── machines-fornix.conf │ │ ├── machines-fs20.conf │ │ ├── machines-pb+fs20.conf │ │ ├── machines-pb.conf │ │ ├── machines-sensible.conf │ │ ├── machines-tcp-crashed.conf │ │ ├── machines-tcp.conf │ │ ├── machines-top.conf │ │ ├── machines-udp-notours.conf │ │ ├── machines-udp.conf │ │ ├── machines.conf │ │ ├── mktraceindex │ │ ├── notcomplete │ │ ├── notdone │ │ ├── ocheck │ │ ├── ocheck2 │ │ ├── otracechecker.ml │ │ ├── perstepcount │ │ ├── perstepcountgraph │ │ ├── prettynet │ │ ├── prettytrace │ │ ├── procpauses │ │ ├── progressdata │ │ ├── progressdata-auto │ │ ├── progressdata-chmod-auto │ │ ├── progressdata-fetch │ │ ├── regress │ │ ├── run-tcp-unsuccessful-selection.conf │ │ ├── run_0309.conf │ │ ├── run_1009.conf │ │ ├── run_20041112.conf │ │ ├── run_20050203.conf │ │ ├── run_20050206-rerescue.conf │ │ ├── run_20051123.conf │ │ ├── run_20051124.conf │ │ ├── run_20060109.conf │ │ ├── run_20060206.conf │ │ ├── run_20060214a.conf │ │ ├── run_20060221.conf │ │ ├── run_20060223.conf │ │ ├── run_20060328.conf │ │ ├── run_20060330.conf │ │ ├── run_20060601partial.conf │ │ ├── run_20060612.conf │ │ ├── run_20060614.conf │ │ ├── run_20060626.conf │ │ ├── run_20060703.conf │ │ ├── run_20060710.conf │ │ ├── run_20060802.conf │ │ ├── run_20060817.conf │ │ ├── run_20061129.conf │ │ ├── run_2308.conf │ │ ├── run_2608.conf │ │ ├── run_adhoc2.conf │ │ ├── run_billben.conf │ │ ├── run_demo.conf │ │ ├── run_demo_pb.conf │ │ ├── run_ephtraces2.conf │ │ ├── run_faketrace3 │ │ ├── run_firstnewtraces.conf │ │ ├── run_laurelhardy.conf │ │ ├── run_newfdformat.conf │ │ ├── run_pinkybrain.conf │ │ ├── run_routecmp.conf │ │ ├── run_short.conf │ │ ├── run_some.conf │ │ ├── run_tcp_3008 │ │ ├── run_tcp_3008.conf │ │ ├── run_tcp_next │ │ ├── run_xmas.conf │ │ ├── run_xmas_length_data.txt │ │ ├── run_xmas_length_data2.txt │ │ ├── run_xmas_lengths_graph.ps │ │ ├── run_xmas_pb.conf │ │ ├── run_xmas_remainder.conf │ │ ├── runbatch │ │ ├── runbatch.conf │ │ ├── runlengthsgraph │ │ ├── runlengthsgraph-tcp_p │ │ ├── runlengthsgraph-udp_p │ │ ├── runlengthsgraph_p │ │ ├── runlengthsgraph_xmas │ │ ├── runselection.conf │ │ ├── runtimegraph │ │ ├── runudp-pselect.conf │ │ ├── runudp.conf │ │ ├── runudp_failed.conf │ │ ├── startbatch │ │ ├── starthsholed │ │ ├── stepgraph │ │ ├── stepgraph-rezero.ml │ │ ├── stepgraph_p │ │ ├── stepgraphtimed │ │ ├── stepgraphtimed_p │ │ ├── stopbatch │ │ ├── timeanal │ │ ├── timesgraph │ │ ├── trace.css │ │ ├── trace.js │ │ ├── tracelen │ │ ├── tracetail │ │ ├── wloggraph │ │ ├── wrapper │ │ ├── wrapper.pl │ │ ├── xmas_diff_completes │ │ ├── xmas_join │ │ └── xmas_st_times │ ├── conflate-dir │ ├── distribute │ ├── lintperm │ ├── linux-script │ ├── packagetsc │ └── win │ │ ├── win-checkin.bat │ │ ├── win-fresh-build-helper.bat │ │ ├── win-fresh-build.bat │ │ ├── win-update-build.bat │ │ └── win-update.bat ├── slurp │ ├── Makefile │ ├── Makefile.win │ ├── README │ ├── debugrenderer.ml │ ├── debugrenderer.mli │ ├── oldtestcode.ml │ ├── pcapfile.ml │ ├── pcapfile.mli │ ├── pcapinterface.ml │ ├── pcapinterface.mli │ ├── pcapinterfacec.c │ ├── slurp.ml │ └── slurp.mli ├── tests │ ├── Makefile │ ├── Makefile.win │ ├── README │ ├── adhoc │ │ ├── Makefile │ │ ├── adhoc-1 │ │ │ ├── Makefile │ │ │ ├── adhoc-2.ml │ │ │ ├── run │ │ │ └── test │ │ ├── adhoc-2 │ │ │ ├── Makefile │ │ │ ├── adhoc-2.ml │ │ │ ├── run │ │ │ └── test │ │ ├── adhoc-thalamusjohn-2003-02-04T15-59-05+0000 │ │ │ ├── Makefile │ │ │ ├── test.ml │ │ │ └── test_output │ │ ├── bsd-selfconnect │ │ │ ├── Makefile │ │ │ └── selfconnect.c │ │ ├── ssh-johnemil-2002-11-11T14-15-50+0000 │ │ │ ├── README │ │ │ ├── slurp_trace │ │ │ ├── socket_trace │ │ │ ├── tcpdebug_trace │ │ │ └── trace │ │ └── ssh-johnemil-2003-03-20T11-59-18+0000 │ │ │ └── trace │ ├── autotest │ │ ├── Makefile │ │ ├── README │ │ ├── accept.ml │ │ ├── accept.mli │ │ ├── autotest.ml │ │ ├── bind.ml │ │ ├── bind.mli │ │ ├── bind_2.ml │ │ ├── bind_2.mli │ │ ├── bind_udp.ml │ │ ├── bind_udp.mli │ │ ├── close.ml │ │ ├── close.mli │ │ ├── common.ml │ │ ├── common.mli │ │ ├── common_udp.ml │ │ ├── common_udp.mli │ │ ├── connect.ml │ │ ├── connect.mli │ │ ├── connect_udp.ml │ │ ├── connect_udp.mli │ │ ├── deliver_icmp.ml │ │ ├── deliver_icmp.mli │ │ ├── deliver_in.ml │ │ ├── deliver_in.mli │ │ ├── deliver_in_3.ml │ │ ├── deliver_in_3.mli │ │ ├── demo.ml │ │ ├── demo.mli │ │ ├── disconnect.ml │ │ ├── disconnect.mli │ │ ├── double-ended-tests.txt │ │ ├── drivetest.ml │ │ ├── drivetest.mli │ │ ├── dual.ml │ │ ├── dual.mli │ │ ├── dualdriven.ml │ │ ├── dualdriven.mli │ │ ├── dualdriven_udp.ml │ │ ├── dualdriven_udp.mli │ │ ├── dup.ml │ │ ├── dup.mli │ │ ├── dupfd.ml │ │ ├── dupfd.mli │ │ ├── fileflags.ml │ │ ├── fileflags.mli │ │ ├── getifaddrs.ml │ │ ├── getifaddrs.mli │ │ ├── getnames.ml │ │ ├── getnames.mli │ │ ├── getsockerr.ml │ │ ├── getsockerr.mli │ │ ├── getsocklistening.ml │ │ ├── getsocklistening.mli │ │ ├── listen.ml │ │ ├── listen.mli │ │ ├── loopback.ml │ │ ├── loopback.mli │ │ ├── loss.ml │ │ ├── network.ml │ │ ├── network.mli │ │ ├── ntp_update │ │ ├── pselect.ml │ │ ├── pselect.mli │ │ ├── recv.ml │ │ ├── recv.mli │ │ ├── recv_from.ml │ │ ├── recv_from.mli │ │ ├── run │ │ ├── send.ml │ │ ├── send.mli │ │ ├── send_to.ml │ │ ├── send_to.mli │ │ ├── shutdown.ml │ │ ├── shutdown.mli │ │ ├── simple.ml │ │ ├── simple.mli │ │ ├── sockatmark_udp.ml │ │ ├── sockatmark_udp.mli │ │ ├── sockbopt.ml │ │ ├── sockbopt.mli │ │ ├── socket.ml │ │ ├── socket.mli │ │ ├── socknopt.ml │ │ ├── socknopt.mli │ │ ├── socktopt.ml │ │ ├── socktopt.mli │ │ ├── test │ │ ├── timers.ml │ │ └── timers.mli │ ├── common │ │ ├── Makefile │ │ ├── Makefile.win │ │ ├── testscommon.ml │ │ └── testscommon.mli │ ├── linkhack │ │ ├── README │ │ ├── instrumented.c │ │ ├── main.c │ │ └── wrapper.c │ ├── parser_test │ │ ├── Makefile │ │ ├── Makefile.win │ │ └── parser_test.ml │ └── tthee │ │ ├── Makefile │ │ ├── Makefile.win │ │ ├── tthee1 │ │ ├── Makefile │ │ ├── Makefile.win │ │ └── test.ml │ │ ├── tthee2 │ │ ├── Makefile │ │ ├── Makefile.win │ │ └── test.ml │ │ ├── tthee3 │ │ ├── Makefile │ │ ├── Makefile.win │ │ └── test.ml │ │ ├── tthee4 │ │ ├── Makefile │ │ ├── Makefile.win │ │ └── test.ml │ │ └── tthee5 │ │ ├── Makefile │ │ ├── Makefile.win │ │ └── test.ml ├── tthee │ ├── Makefile │ ├── Makefile.win │ ├── mergelib.ml │ ├── mergelib.mli │ ├── tthee.ml │ ├── tthee.mli │ ├── ttheehelper.ml │ └── ttheehelper.mli ├── utils │ ├── Makefile │ ├── Makefile.win │ ├── conflate │ │ ├── Makefile │ │ ├── conflate.ml │ │ └── example │ │ │ ├── README │ │ │ ├── brain │ │ │ ├── client0 │ │ │ ├── client0.epsilon │ │ │ ├── client0.out.html │ │ │ ├── pinky │ │ │ ├── result-pinky-brain │ │ │ ├── server0 │ │ │ ├── server0.epsilon │ │ │ ├── server0.out.html │ │ │ ├── server0_client0 │ │ │ ├── trace0595 │ │ │ ├── trace0595.aux │ │ │ ├── trace0595.aux.epsilon │ │ │ ├── trace0595.epsilon │ │ │ └── trace0595_trace0595.aux │ ├── custom_rsh │ │ ├── Makefile │ │ ├── Makefile.win │ │ ├── README │ │ ├── custom_rsh.ml │ │ ├── lexer.mll │ │ ├── parser.mly │ │ ├── parsetypes.ml │ │ ├── parsetypes.mli │ │ └── run.bat │ ├── custom_rsh2 │ │ ├── Makefile.win │ │ ├── README │ │ └── custom_rsh.c │ ├── diags │ │ ├── Makefile │ │ ├── README │ │ ├── latexdiag.ml │ │ ├── latexdiag.mli │ │ ├── mkdiag.ml │ │ ├── proof_of_concept │ │ │ ├── diagtest.tex │ │ │ └── test_diagram.tex │ │ └── templates │ │ │ ├── Makefile │ │ │ ├── generate_dummy_labels.ml │ │ │ ├── std_postamble.tex │ │ │ ├── std_postamble2.tex │ │ │ ├── std_postpostamble2.tex │ │ │ ├── std_preamble.tex │ │ │ ├── std_preamble2.tex │ │ │ ├── std_prepreamble2.tex │ │ │ └── traceXXXX.labels.mng │ ├── dlhack │ │ ├── README │ │ └── dlhack │ ├── holtcp.d │ ├── holtcpcb-v8 │ │ ├── Makefile │ │ ├── README │ │ └── holtcpcb-v8.c │ ├── holtcpcb │ │ ├── Makefile │ │ ├── README │ │ ├── holtcpcb.8 │ │ ├── holtcpcb.c │ │ └── holtcpcb_nc │ ├── ns_logger │ │ ├── Makefile │ │ ├── Makefile.win │ │ ├── README │ │ ├── logger.c │ │ └── tlogger.c │ ├── socktools │ │ ├── Makefile │ │ ├── Makefile.win │ │ ├── README │ │ ├── sockclient.c │ │ └── sockserv.c │ ├── theorytree.sml │ ├── timetest │ │ ├── ReadMe.txt │ │ ├── TextFile1.txt │ │ ├── TimeTest.cpp │ │ ├── TimeTest.ncb │ │ ├── TimeTest.sln │ │ ├── TimeTest.suo │ │ ├── TimeTest.vcproj │ │ ├── stdafx.cpp │ │ └── stdafx.h │ ├── tracediff │ │ ├── Makefile │ │ └── tracediff.ml │ └── tsccal │ │ ├── COPYRIGHT │ │ ├── Makefile.win │ │ ├── README │ │ └── TSCcal.cpp └── winxp │ ├── README │ ├── cr.bat │ └── rawtest.c └── unmaintained ├── Net ├── DocTools │ ├── .cvsignore │ ├── Makefile │ ├── README │ ├── a4labelsdraft.sty │ ├── abstestnet.fig │ ├── abstestnet2.fig │ ├── chasm-bridge.fig │ ├── chasm.fig │ ├── domakeindex │ ├── fixind │ ├── fuzzycloud.fig │ ├── infer.ml │ ├── leftdisplay.sty │ ├── llncs.cls │ ├── munge.ml │ ├── munge_lexer.mll │ ├── munge_ocaml.ml │ ├── parser.mly │ ├── protstack.fig │ ├── protstack2.fig │ ├── rebracket.ml │ ├── rules_lexer.mll │ ├── rules_parser.mly │ ├── rules_syntax.mli │ ├── rules_to_latex.ml │ ├── t1bchx.fd │ ├── testnet.fig │ ├── texpp │ ├── threadboxnet.fig │ ├── threadboxnet2.fig │ ├── typography-minicaml2.tex │ ├── typography-slides.tex │ ├── typography.tex │ ├── udpbib-long.bib │ ├── udpbib.bib │ └── wc_strip.ml └── TCP │ ├── Makefile │ ├── Notes1 │ ├── Makefile │ ├── TCP1_connection_states.txt │ ├── TCP1_level0-first-draft.jpg │ ├── TCP1_level0.fig │ ├── TCP1_level0.ml │ ├── TCP1_level0.txt │ ├── accept_1_draft_p.txt │ ├── accept_1_draft_s.sml │ ├── check-results-p.txt │ ├── check-run-progress.txt │ ├── confs.html │ ├── example_traces │ │ ├── bsd_close_wait_recv_data.ps │ │ ├── bsd_listen_getpeername.ps │ │ ├── bsd_recv_no_fail1.ps │ │ ├── bsd_recv_no_fail2.ps │ │ ├── bsd_rfc_bug_simopen.ps │ │ ├── fin_from_syn_sent.ps │ │ ├── into_fin_wait_2_bug.ps │ │ ├── linux_send_wildcard_port.ps │ │ └── send_no_return_error.ps │ ├── exec.txt │ ├── exec2.ml │ ├── exec3.ml │ ├── glossary.txt │ ├── interface.ml │ ├── levels.txt │ ├── linux-debug-tracing.txt │ ├── localcopy-TCP1_star.imn │ ├── makefig │ ├── mapping.txt │ ├── munge.mk │ ├── notes.txt │ ├── ntp.txt │ ├── pointers.txt │ ├── pointers2.txt │ ├── posix.txt │ ├── recv_11_draft_m.sml │ ├── rfcs.txt │ ├── running.txt │ ├── send_9_draft_m.sml │ ├── stevens-fig.ps │ ├── stream-level-plan.txt │ ├── tcp1.txt │ ├── tcp3.txt │ ├── tcp4.txt │ ├── tcp5-tcpv2-walkthrough.txt │ ├── tcp_input.c-annotated │ ├── tcp_input.c-counted │ ├── tcp_output.c-annotated │ ├── tcpv2.txt │ ├── things-which-arent-great-but.mng │ ├── things-which-arent-great-but.txt │ ├── timers.tex │ ├── todo.txt │ ├── traces.txt │ ├── whichimpl.txt │ └── windows.txt │ ├── README │ ├── README-tarball │ ├── Spec2 │ ├── .cvsignore │ ├── Holmakefile │ ├── Phase.sig │ ├── Phase.sml │ ├── TCP1_LIBinterfaceScript.sml │ ├── TCP1_auxFnsScript.sml │ ├── TCP1_baseTypesScript.sml │ ├── TCP1_errorsScript.sml │ ├── TCP1_evalSupportScript.sml │ ├── TCP1_host0Script.sml │ ├── TCP1_hostLTSScript.sml │ ├── TCP1_hostTypesScript.sml │ ├── TCP1_netTypesScript.sml │ ├── TCP1_paramsScript.sml │ ├── TCP1_ruleidsScript.sml │ ├── TCP1_signalsScript.sml │ ├── TCP1_timersScript.sml │ ├── TCP1_utilsScript.sml │ ├── Version.sig │ ├── Version.sml │ └── integer_word32Script.sml │ └── Spec3 │ ├── .cvsignore │ ├── GroundConflate.sml │ ├── Holmakefile │ ├── Makefile │ ├── Makefile.hol │ ├── TCP3_.imn │ ├── TCP3_absFunScript.sml │ ├── TCP3_auxFnsScript.sml │ ├── TCP3_bettersScript.sml │ ├── TCP3_host0Script.sml │ ├── TCP3_hostLTSScript.sml │ ├── TCP3_hostTypesScript.sml │ ├── TCP3_netScript.sml │ ├── TCP3_streamScript.sml │ ├── TCP3_streamTypesScript.sml │ ├── TCP3_urgencyScript.sml │ ├── abstract.tex │ ├── alldoc-between.template │ ├── alldoc-post.template │ ├── alldoc-pre.template │ ├── alldoc.tex │ ├── check-sketch.sml │ ├── evalAbsFun.ml │ ├── fastRulesScript.sml │ ├── fmapUtilsScript.sml │ ├── fmap_match.sig │ ├── fmap_match.sml │ ├── munge.mk.in │ ├── notes.txt │ ├── reachablestates.txt │ ├── stream_spec │ ├── Makefile │ ├── Spec1_send3.tex │ ├── Spec3_abs_hosts_one_sided.tex │ ├── Spec3_send3.tex │ ├── absFunCommute.fig │ ├── absFunCommute.pstex │ ├── absFunCommute.pstex_t │ ├── absFunCommute2.fig │ ├── absFunCommute2.pstex │ ├── absFunCommute2.pstex_t │ ├── absFunCommute3.fig │ ├── absFunCommute3.pstex │ ├── absFunCommute3.pstex_t │ ├── absFunCommute6.fig │ ├── absFunCommute6.fig.bak │ ├── absFunCommute6.pstex │ ├── absFunCommute6.pstex_t │ ├── abstract.txt │ ├── endpoint.fig │ ├── endpoint.pstex │ ├── endpoint.pstex_t │ ├── endtoend.fig │ ├── endtoend.pstex │ ├── endtoend.pstex_t │ ├── fm08_reviews.txt │ ├── generated │ │ ├── Makefile │ │ ├── Spec3_alldoc-inc.tex │ │ ├── Spec3_alldoc-inc.tex~ │ │ ├── TCP1_.imn │ │ ├── TCP1_auto.imn │ │ ├── alldoc-inc.tex │ │ └── alldoc-inc.tex~ │ ├── proof.sty │ ├── sigplanconf.cls │ ├── stream_spec.log │ ├── stream_spec.mng │ ├── stream_spec.mng~ │ ├── stream_spec.tex │ └── trace0963.tex │ ├── tcp.sty │ ├── todo │ ├── word32relnorm.sig │ └── word32relnorm.sml ├── README └── TCP-LEM └── Spec1 ├── Holmakefile.public ├── Makefile ├── TCP1_LIBinterface.lem ├── TCP1_auxFns.lem ├── TCP1_baseTypes.lem ├── TCP1_errors.lem ├── TCP1_evalSupport.lem ├── TCP1_host0.lem ├── TCP1_hostLTS.lem ├── TCP1_hostTypes.lem ├── TCP1_lemSupport.lem ├── TCP1_net.lem ├── TCP1_net1.lem ├── TCP1_netTypes.lem ├── TCP1_params.lem ├── TCP1_preHostTypes.lem ├── TCP1_ruleids.lem ├── TCP1_signals.lem ├── TCP1_timers.lem ├── TCP1_utils.lem └── old ├── HolDoc.sig ├── HolDoc.sml ├── Net_Hol_reln.sig ├── Net_Hol_reln.sml ├── Phase.sig ├── Phase.sml ├── VERSIONS-Spec1-public ├── Version.sig ├── Version.sml └── integer_word32.lem /.gitignore: -------------------------------------------------------------------------------- 1 | *Theory.sml 2 | *Theory.sig 3 | *.uo 4 | *.ui 5 | .HOLMK 6 | *~ 7 | -------------------------------------------------------------------------------- /HOLDoc/.cvsignore: -------------------------------------------------------------------------------- 1 | lts_to_latex 2 | *.cm[iox] 3 | .depend 4 | holdoc.mk 5 | 6 | -------------------------------------------------------------------------------- /HOLDoc/.gitignore: -------------------------------------------------------------------------------- 1 | .depend 2 | lts_to_latex 3 | *cmi 4 | *cmx 5 | *o 6 | -------------------------------------------------------------------------------- /HOLDoc/holdoc.mk.in: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT THIS MASTER FILE (holdoc.mk.in) - edit holdoc.mk instead. 2 | # holdoc.mk - user-specific configuration file for holdoc. 3 | 4 | # 5 | # Location of HOLDoc modules: 6 | # 7 | HOLDOCDIR=$(HOME)/WAP/HOLDoc 8 | 9 | -------------------------------------------------------------------------------- /HOLDoc/leftdisplay.sty: -------------------------------------------------------------------------------- 1 | 2 | \newskip\eqntopsep 3 | \eqntopsep 10pt plus 2\p@ minus 2\p@ 4 | 5 | \newskip\mathindent 6 | \mathindent 1.5em plus 0em minus 1.5em 7 | 8 | \def\[{\relax\ifmmode\@badmath 9 | \else% 10 | \@beginparpenalty\predisplaypenalty 11 | \@endparpenalty\postdisplaypenalty 12 | \begin{trivlist}\@topsep \eqntopsep 13 | \@topsepadd \eqntopsep 14 | \item[]\leavevmode 15 | \hbox to\linewidth\bgroup$ \displaystyle 16 | \hskip\mathindent\bgroup\fi} 17 | \def\]{\relax\ifmmode \egroup $\hfil \egroup 18 | \end{trivlist}% 19 | \else \@badmath \fi} 20 | 21 | 22 | -------------------------------------------------------------------------------- /HOLDoc/relink: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -ne 1 ]; then 4 | echo "Usage: $0 relative_or_absolute_path_to_new_HOLDoc_dir, or $0 -r to remove" 5 | exit 255 6 | fi 7 | 8 | NEWDIR="$1" 9 | 10 | if [ $NEWDIR = "-r" ] ; then 11 | echo "Deleting files." 12 | for f in holdoc-guide.txt holdoc_init.ml holdoc_init.mli holdoc_munge.ml holdoc_munge.mli HolDoc.sig HolDoc.sml hollex.mli hollex.mll hol_to_latex.ml lts_to_latex.ml Makefile mng_to_latex.ml README simpledump.ml simpletexdump.ml WISHLIST ; do 13 | rm $f 14 | done 15 | else 16 | echo "Linking files." 17 | for f in holdoc-guide.txt holdoc_init.ml holdoc_init.mli holdoc_munge.ml holdoc_munge.mli HolDoc.sig HolDoc.sml hollex.mli hollex.mll hol_to_latex.ml lts_to_latex.ml Makefile mng_to_latex.ml README simpledump.ml simpletexdump.ml WISHLIST ; do 18 | ln -s $NEWDIR/$f 19 | done 20 | fi 21 | 22 | echo "All done." 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /HOLDoc/src/.gitignore: -------------------------------------------------------------------------------- 1 | *.cmi 2 | *.cmx 3 | *.o 4 | .depend 5 | hollex.ml 6 | holparse.ml 7 | holparse.mli 8 | holparse.output 9 | mng_to_latex 10 | simplemngdump 11 | simplemosmldump 12 | -------------------------------------------------------------------------------- /HOLDoc/src/HolDoc.sig: -------------------------------------------------------------------------------- 1 | signature HolDoc = sig 2 | 3 | (* 4 | 5 | Code to automatically generate .imn information for theories at 6 | export time. Output is in file .imn. 7 | 8 | To get this to work it must be the last module opened (more 9 | accurately, it must override bossLib and HolKernel, and so must 10 | follow these two). 11 | 12 | *) 13 | 14 | include Abbrev 15 | val export_theory : unit -> unit 16 | val Define : term quotation -> thm 17 | val xDefine : string -> term quotation -> thm 18 | 19 | end; 20 | -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/Holmakefile: -------------------------------------------------------------------------------- 1 | INCLUDES=../.. 2 | 3 | -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/LabelScript.sml: -------------------------------------------------------------------------------- 1 | open HolKernel Parse boolLib 2 | 3 | open bossLib 4 | 5 | open HolDoc 6 | 7 | local open ValueTheory in end; 8 | 9 | val _ = new_theory "Label"; 10 | 11 | val _ = Hol_datatype` 12 | translabel = 13 | new of num 14 | | get of loc 15 | | set of (loc # num) 16 | | return of value 17 | `; 18 | 19 | val _ = export_theory(); -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/Net_Hol_reln.sig: -------------------------------------------------------------------------------- 1 | signature Net_Hol_reln = sig 2 | include Abbrev 3 | (* provides an inductive definition tool that copes with backwards *) 4 | (* implications (as well as forwards ones) *) 5 | val Net_Hol_reln : term quotation -> thm * thm * thm 6 | end; 7 | -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/Net_Hol_reln.sml: -------------------------------------------------------------------------------- 1 | structure Net_Hol_reln :> Net_Hol_reln = 2 | struct 3 | 4 | open Abbrev 5 | open HolKernel boolLib 6 | 7 | (* in abstract syntax term a, replace all occurrences of 8 | q <== p 9 | with 10 | p ==> q 11 | *) 12 | fun transfrom_revimp a = let 13 | open Absyn 14 | val t = transfrom_revimp 15 | in 16 | case a of 17 | APP(l1, APP(l2, IDENT(l3, "revimp"), p), q) => 18 | APP(l2, APP(l1, IDENT(l3, "==>"), t q), t p) 19 | (* locations are still wrong! Should use Absyn.locn_of_absyn to recreate *) 20 | | APP(loc, f,x) => APP (loc, t f, t x) 21 | | LAM(loc, vs, x) => LAM(loc, vs, t x) 22 | | TYPED(loc, x, pty) => TYPED(loc, t x, pty) 23 | | _ => a 24 | end 25 | 26 | fun Net_Hol_reln q = let 27 | open IndDefLib 28 | val a0 = Parse.Absyn q 29 | val a = transfrom_revimp a0 30 | val tm = term_of_absyn a 31 | in 32 | prim_Hol_reln InductiveDefinition.bool_monoset tm 33 | end; 34 | 35 | 36 | 37 | 38 | end (* struct *) 39 | -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/Store.imn: -------------------------------------------------------------------------------- 1 | (*[ NOECHO ]*) 2 | (*[ HOL_ID_ALIST 3 | NOTIN "\notin " 4 | ]*) 5 | (*[ ECHO ]*) 6 | -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/TypeScript.sml: -------------------------------------------------------------------------------- 1 | open HolKernel Parse boolLib 2 | 3 | open bossLib 4 | 5 | open HolDoc 6 | 7 | val _ = new_theory "Type"; 8 | 9 | val _ = Hol_datatype` 10 | loc = loc of num 11 | `; 12 | 13 | (* a handy utility: *) 14 | val _ = add_infix ("NOTIN", 450, RIGHT); 15 | val notin_def = Define `(x NOTIN s) = ~(x IN s)`; 16 | 17 | val _ = export_theory(); -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/ValueScript.sml: -------------------------------------------------------------------------------- 1 | open HolKernel Parse boolLib 2 | 3 | open bossLib 4 | 5 | open HolDoc 6 | 7 | local open TypeTheory in end; 8 | 9 | val _ = new_theory "Value"; 10 | 11 | val _ = Hol_datatype` 12 | value = 13 | VUnit of one 14 | | VNum of num 15 | | VLoc of loc 16 | `; 17 | 18 | val _ = export_theory(); -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/doc-post.template: -------------------------------------------------------------------------------- 1 | \begin{document} 2 | 3 | \section{Transition rules: \protect\jobname} 4 | 5 | \dumpallrules 6 | 7 | \end{document} 8 | -------------------------------------------------------------------------------- /HOLDoc/src/examples/lts/doc-pre.template: -------------------------------------------------------------------------------- 1 | \documentclass[10pt]{article} 2 | 3 | \usepackage{geometry} 4 | \usepackage{holdoc} 5 | \usepackage{ltsmunge} 6 | 7 | \makeatletter 8 | \newcommand{\ps@idstyle}{% 9 | \def\@evenhead{\thepage\hfil\slshape\rightmark}% 10 | \def\@oddhead{{\slshape\leftmark}\hfil\thepage}% 11 | \def\@evenfoot{\hfil\slshape\footnotesize Rule version: \rulesrcsid\hfil}% 12 | \let\@oddfoot\@evenfoot 13 | } 14 | \makeatother 15 | 16 | \pagestyle{idstyle} 17 | -------------------------------------------------------------------------------- /HOLDoc/src/examples/mng/examples.imn: -------------------------------------------------------------------------------- 1 | (*[ NOECHO ]*) 2 | (*[ C Example .imn file for example1.mng; intended to be used together 3 | with hol.imn ]*) 4 | (*[ NOINDENT (* this is usually required, otherwise line breaks within 5 | HOL delimiters will give rise to odd effects *) ]*) 6 | (*[ VAR_PREFIX_LIST x y e n ]*) 7 | (*[ AUX_LIST sqdist ]*) 8 | (*[ HOL_ID_ALIST 9 | t "\tau " (* IDs aren't subject to automatic indexing / priming, 10 | so it has to be done manually *) 11 | t' "\tau' " 12 | t1 "\tau_1 " 13 | t2 "\tau_2 " 14 | G "\Gamma" 15 | ]*) 16 | (*[ HOL_SYM_ALIST 17 | & "&" (* TeX hack! *) 18 | -> "\rightarrow " 19 | --> "\longrightarrow " 20 | |- "\vdash " 21 | ]*) 22 | (*[ HOL_CURRIED_ALIST 23 | SUB "\Msub" 3 false false 24 | (* SUB is rendered as \Msub, with three curried arguments; parens 25 | and commas are not treated specially, and multi-line arguments 26 | are not allowed *) 27 | ]*) 28 | (*[ ECHO ]*) 29 | -------------------------------------------------------------------------------- /HOLDoc/src/examples/mng/examples.sty: -------------------------------------------------------------------------------- 1 | % examples.sty -- munging support for MNG examples 2 | % 3 | % Keith Wansbrough, 2003 4 | 5 | \newcommand{\Msub}[3]{#3[#1/#2]} 6 | 7 | % 8 | % 9 | -------------------------------------------------------------------------------- /HOLDoc/src/hollex.mli: -------------------------------------------------------------------------------- 1 | (* hollex.mli -- (approximate) HOL lexer interface *) 2 | (* Keith Wansbrough 2001 *) 3 | 4 | open Holparsesupp 5 | open Holparse 6 | 7 | exception Mismatch of string (* mismatched delimiters *) 8 | exception BadChar of string (* bad character *) 9 | exception EOF (* attempt to read past (already-reported) EOF *) 10 | 11 | type hollexstate 12 | 13 | val token_init : mode -> Lexing.lexbuf -> hollexstate 14 | 15 | val token : hollexstate -> token 16 | 17 | val tokstream : mode -> in_channel -> token Stream.t 18 | 19 | val render_token : token -> string 20 | 21 | val print_token : delim list -> token -> string * delim list 22 | 23 | -------------------------------------------------------------------------------- /HOLDoc/src/holparsesupp.mli: -------------------------------------------------------------------------------- 1 | 2 | exception NeverHappen of string (* bad error *) 3 | 4 | type mode = 5 | ModeMosml 6 | | ModeHol 7 | | ModeText 8 | | ModeTex 9 | | ModeDir 10 | | ModeNone 11 | 12 | val render_mode : mode -> string 13 | 14 | type delim = 15 | | DelimHolTex (* delimit HOL within TeX *) 16 | | DelimHolTexMath (* etc *) 17 | | DelimHolMosml 18 | | DelimHolMosmlD 19 | | DelimText 20 | | DelimTex 21 | | DelimDir 22 | | DelimEOF 23 | 24 | type delim_info = { imode : mode; sopen : string; sclose : string } 25 | 26 | val delim_info : delim -> delim_info 27 | 28 | val make_indent : int -> string 29 | 30 | val pretty_pos : Lexing.lexbuf -> string 31 | -------------------------------------------------------------------------------- /HOLDoc/src/holparsetools.ml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/HOLDoc/src/holparsetools.ml -------------------------------------------------------------------------------- /HOLDoc/src/holparsetools.mli: -------------------------------------------------------------------------------- 1 | exception SyntaxError of string 2 | val parse : 3 | Holparsesupp.mode -> 4 | (('a -> Holparse.token) -> Lexing.lexbuf -> 'b) -> Lexing.lexbuf -> 'b 5 | val parse_chan : 6 | Holparsesupp.mode -> 7 | (('a -> Holparse.token) -> Lexing.lexbuf -> 'b) -> in_channel -> 'b 8 | val parse_fileargs_ext : 9 | (string * Arg.spec * string) list -> 10 | (unit -> unit) -> 11 | string -> 12 | Holparsesupp.mode -> 13 | (('a -> Holparse.token) -> Lexing.lexbuf -> 'b) -> 'b 14 | val parse_fileargs : 15 | Holparsesupp.mode -> 16 | (('a -> Holparse.token) -> Lexing.lexbuf -> 'b) -> 'b 17 | -------------------------------------------------------------------------------- /HOLDoc/src/mng_to_latex.ml: -------------------------------------------------------------------------------- 1 | (* mng_to_latex.ml -- turn .mng file into LaTeX code (with embedded typeset HOL) *) 2 | (* Keith Wansbrough 2001-2004 *) 3 | 4 | open Mngdump 5 | open Holparse 6 | open Holparsesupp 7 | open Holparsetools 8 | 9 | (* -------------------------------------------------------------------- *) 10 | (* Main program *) 11 | (* -------------------------------------------------------------------- *) 12 | 13 | let _ = 14 | let mngdoc = parse_fileargs ModeTex tex_main in 15 | (* NB: no trailing newline - we hope the first line of source is a comment already! *) 16 | print_string "%%%% AUTOGENERATED FILE (from MNG source) -- DO NOT EDIT! %%%% "; 17 | try 18 | rendertexdoc mngdoc; 19 | dump_unseen_strings () 20 | with 21 | BadArg e -> 22 | prerr_endline (format_badarg e) 23 | 24 | -------------------------------------------------------------------------------- /HOLDoc/src/simpledump.mli: -------------------------------------------------------------------------------- 1 | (* straightforward literal dumper - renders everything to 2 | the obvious string, except for directives which are 3 | processed as appropriate and elided. *) 4 | 5 | val dumptexdoc : Holdocmodel.texdoc -> string 6 | val dumptexdoc_content : Holdocmodel.texdoc_content -> string 7 | val dumptextdoc : Holdocmodel.textdoc -> string 8 | val dumptextdoc_content : Holdocmodel.textdoc_content -> string 9 | val dumpmosmldoc : Holdocmodel.mosmldoc -> string 10 | val dumpmosml_content : Holdocmodel.mosml_content -> string 11 | val dumpholdoc : Holdocmodel.holdoc -> string 12 | val dumphol_content : Holdocmodel.hol_content -> string 13 | val dumpdirective : Holdocmodel.directive -> string 14 | val dumpdirective_content : Holdocmodel.directive -> string 15 | -------------------------------------------------------------------------------- /HOLDoc/src/simplemngdump.ml: -------------------------------------------------------------------------------- 1 | open Holparse 2 | open Holparsesupp 3 | open Holparsetools 4 | open Simpledump 5 | 6 | let texdoc = parse_chan ModeTex tex_main stdin 7 | 8 | let s = dumptexdoc texdoc 9 | 10 | let _ = print_string s 11 | -------------------------------------------------------------------------------- /HOLDoc/src/simplemosmldump.ml: -------------------------------------------------------------------------------- 1 | open Holparse 2 | open Holparsesupp 3 | open Holparsetools 4 | open Simpledump 5 | 6 | let mosmldoc = parse_chan ModeMosml mosml_main stdin 7 | 8 | let s = dumpmosmldoc mosmldoc 9 | 10 | let _ = print_string s 11 | -------------------------------------------------------------------------------- /demo-traces/README: -------------------------------------------------------------------------------- 1 | demo traces - pulling into CVS all the demo traces and check output we 2 | use to make the paper 3 | 4 | Traces taken from: 5 | 6 | /usr/groups/tthee/batch/demo-traces/trace5000,5000aux-inv,5001,5001aux-inv,5002,5003 7 | 8 | Of these, the traces 9 | 10 | trace5000aux-inv, trace5001aux-inv 11 | 12 | are send/recv-inverted versions of the aux traces (workaround bug in 13 | the trace generation tools) which were generated by "make inv" in that batch/demo-traces directory. 14 | 15 | 16 | Check output (trace500xXYZ.out.html) taken from the check run: 17 | 18 | /usr/groups/tthee-scratch/check/check-2004-12-16T15\:07\:00+0000/*.out.html 19 | 20 | but should be taken from a new run, with config file check/run_demo.conf 21 | 22 | 23 | For traces trace0241 (single page) and trace1741 (multi-page) the 24 | trace and check output are respectively from: 25 | 26 | /usr/groups/tthee/batch/autotest-tcp-2004-10-01T16:28:00+0100 27 | /auto/groups/tthee-scratch/check/check-2004-12-16T20:04:23+0000 28 | 29 | -------------------------------------------------------------------------------- /dtrace/README.md: -------------------------------------------------------------------------------- 1 | # DTrace trace collection 2 | 3 | This contains the DTrace script collecting the trace from a packetdrill test. 4 | 5 | It requires a more-or-less current FreeBSD kernel (tested is r322062) with [one 6 | patch](https://github.com/hannesm/freebsd/commit/8c34c9340a301e25eed69460f1655a213ef51f1b) 7 | from gnn@ to copy out an mbuf chain. 8 | 9 | The shell script `run_dtrace.sh` does some postprocessing of the DTrace output, 10 | which is required since DTrace is not expressive enough. The `copyoutmbuf` 11 | function extracts a hexdump of the mbuf chain, which is then converted to a HOL 12 | trace using `hextotrace.ml`. 13 | 14 | The FreeBSD-CURRENT system under test should have some `sysctl` variables set: 15 | - `net.inet.tcp.sack.enable=0` (disable sack) 16 | - `net.inet.tcp.rfc3390=0` (initial window size, model has conditional, but dislikes it) 17 | - `net.inet.tcp.rfc3465=0` (accurate counting) 18 | 19 | The testsuite used is available at https://github.com/hannesm/tcp-testsuite 20 | (netsem branch) with a slightly modified packetdrill (TODO: find the 21 | modifications and put this online). 22 | -------------------------------------------------------------------------------- /dtrace/run_dtrace.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | ./holtcp.d > dtrace.out 4 | 5 | cat dtrace.out | \ 6 | sed -e 's/IP \([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\)/IP \1 \2 \3 \4/g' \ 7 | -e 's/SOME(IP 0 0 0 0)/NONE/g' \ 8 | -e 's/SOME(Port 0)/NONE/g' \ 9 | -e 's/SOME(-42, 0)/NONE/g' \ 10 | -e 's/t_rttseg := SOME(ts_seq(n2w 0).*/t_rttseg := NONE;/g' \ 11 | -e 's/ts_recent := TimeWindow(ts_seq(n2w 0).*/ts_recent := TimeWindowClosed;/g' >> trace.out 12 | 13 | rm dtrace.out 14 | 15 | ./hextotrace.native trace.out 16 | mv trace.out.tmp trace.out 17 | -------------------------------------------------------------------------------- /specification/.cvsignore: -------------------------------------------------------------------------------- 1 | .HOLMK 2 | *.ui *.uo *Theory.sig *Theory.sml 3 | *LTS-doc.ps *LTS-doc.tex *LTS.errs *LTS.tex 4 | TCP1_auto.imn TCP1_?*.imn NetEval.imn 5 | *.errs *.aux *.dvi *.log *.toc *.mk word16Lib.sml word32Lib.sml 6 | HolDoc.sml HolDoc.sig strings.sml 7 | glossary.ps 8 | *-doc.ps 9 | *-doc.tex 10 | *.tmp-tex 11 | *.tmp2-tex 12 | *.tmp3-tex 13 | alldoc.ps 14 | alldoc.pdf 15 | alldoc.tex 16 | alldoc.out 17 | alldoc-c.ps 18 | alldoc-c.pdf 19 | alldoc-c.tex 20 | alldoc-c.out 21 | alldoc-inc.tex 22 | *.idx 23 | *.ilg 24 | *.ind 25 | *-doc.pdf 26 | *.tob 27 | -------------------------------------------------------------------------------- /specification/.gitignore: -------------------------------------------------------------------------------- 1 | .hollogs 2 | hol.state 3 | strings.sml 4 | genstrings.exe 5 | genstrings.o 6 | trace_checker.exe 7 | CheckTraces.exe 8 | GroundTraces.exe 9 | .itc-info 10 | CheckTraces.o 11 | *.imn 12 | traces 13 | *.tmp2-tex 14 | *.idx 15 | *.ilg 16 | *.ind 17 | *.log 18 | *.pdf 19 | *.ps 20 | *.toc 21 | *.aux 22 | *.dvi 23 | *.tex-e 24 | *.tob 25 | -------------------------------------------------------------------------------- /specification/Chaining.sig: -------------------------------------------------------------------------------- 1 | signature Chaining = 2 | sig 3 | val norman_hardy : ('a * 'a -> order) -> ('a * 'a) list -> 'a list 4 | end; 5 | -------------------------------------------------------------------------------- /specification/GroundTrace.sig: -------------------------------------------------------------------------------- 1 | signature GroundTrace = 2 | sig 3 | 4 | val ground_trace : TextIO.outstream -> string -> bool 5 | 6 | end 7 | -------------------------------------------------------------------------------- /specification/GroundTraceMain.sml: -------------------------------------------------------------------------------- 1 | val args = CommandLine.arguments() 2 | 3 | val ok = ref true 4 | 5 | val _ = 6 | if null args then 7 | (TextIO.output(TextIO.stdErr, 8 | "Usage: "^CommandLine.name() ^ 9 | " tracefile1 tracefiles\n"); 10 | OS.Process.exit OS.Process.failure) 11 | else () 12 | -------------------------------------------------------------------------------- /specification/Holmakefile.public: -------------------------------------------------------------------------------- 1 | all: HolDoc.sml HolDoc.sig word16Theory.ui word16Theory.uo word32Theory.uo word32Theory.ui TCP1_net1Theory.uo 2 | 3 | word16Theory.ui word16Theory.uo : \ 4 | $(SIGOBJ)/wordFunctor.ui $(SIGOBJ)/wordFunctorLib.ui \ 5 | $(SIGOBJ)/bitsTheory.ui 6 | $(HOLDIR)/bin/mkword.exe 16 7 | 8 | word32Theory.uo word32Theory.ui : \ 9 | $(SIGOBJ)/wordFunctor.ui $(SIGOBJ)/wordFunctorLib.ui \ 10 | $(SIGOBJ)/bitsTheory.ui 11 | $(HOLDIR)/bin/mkword.exe 32 12 | 13 | HolDoc.sml HolDoc.sig : \ 14 | $(HOLDIR)/tools/holdoc/HolDoc.sml \ 15 | $(HOLDIR)/tools/holdoc/HolDoc.sig 16 | cp $(HOLDIR)/tools/holdoc/HolDoc.sml $(HOLDIR)/tools/holdoc/HolDoc.sig . 17 | -------------------------------------------------------------------------------- /specification/LetComputeLib.sig: -------------------------------------------------------------------------------- 1 | signature LetComputeLib = 2 | sig 3 | 4 | include Abbrev 5 | val CLET_t : term 6 | val value_t : term 7 | val pending_t : term 8 | 9 | val dest_clet : term -> term * term 10 | val is_clet : term -> bool 11 | 12 | val dest_pending : term -> term 13 | val is_pending : term -> bool 14 | 15 | val CLET_CONV : conv 16 | val pending_CONV : conv 17 | val CLET_ss : simpLib.ssfrag 18 | val CLET_UNWIND : conv 19 | 20 | val draw_out_fmaps : conv 21 | val structure_reduction_CONV : term HOLset.set -> conv 22 | val pending_structure_reduction_CONV : term HOLset.set -> conv 23 | val record_update_fns : string -> term list 24 | 25 | val cse_elim1_CONV : conv 26 | val cse_elim_CONV : conv 27 | 28 | val grounded_let_CONV : conv 29 | 30 | end; 31 | -------------------------------------------------------------------------------- /specification/Net_Hol_reln.sig: -------------------------------------------------------------------------------- 1 | signature Net_Hol_reln = sig 2 | include Abbrev 3 | (* provides an inductive definition tool that copes with backwards *) 4 | (* implications (as well as forwards ones) *) 5 | val Net_Hol_reln : term quotation -> thm * thm * thm 6 | end; 7 | -------------------------------------------------------------------------------- /specification/Net_Hol_reln.sml: -------------------------------------------------------------------------------- 1 | (* A HOL98 specification of TCP *) 2 | 3 | (* Support for inductive definitions in "rule" format: q <== p instead of p ==> q *) 4 | 5 | structure Net_Hol_reln :> Net_Hol_reln = 6 | struct 7 | 8 | open Abbrev 9 | open HolKernel boolLib 10 | 11 | (* in abstract syntax term a, replace all occurrences of 12 | q <== p 13 | with 14 | p ==> q 15 | *) 16 | fun transfrom_revimp a = let 17 | open Absyn 18 | val t = transfrom_revimp 19 | in 20 | case a of 21 | APP(l1, APP(l2, IDENT(l3, "revimp"), p), q) => 22 | APP(l2, APP(l1, IDENT(l3, "==>"), t q), t p) 23 | (* locations are still wrong! Should use Absyn.locn_of_absyn to recreate *) 24 | | APP(loc, f,x) => APP (loc, t f, t x) 25 | | LAM(loc, vs, x) => LAM(loc, vs, t x) 26 | | TYPED(loc, x, pty) => TYPED(loc, t x, pty) 27 | | _ => a 28 | end 29 | 30 | fun Net_Hol_reln q = let 31 | open IndDefLib 32 | val a0 = Parse.Absyn q 33 | val a = transfrom_revimp a0 34 | val tm = fst(term_of_absyn a) 35 | in 36 | Hol_reln `^tm` 37 | end; 38 | 39 | 40 | 41 | 42 | end (* struct *) 43 | -------------------------------------------------------------------------------- /specification/Net_fmap_analyse.sig: -------------------------------------------------------------------------------- 1 | signature Net_fmap_analyse = 2 | sig 3 | 4 | include Abbrev 5 | val fm_onestep : term list -> (thm list -> conv) -> conv 6 | val outermost_varkey_elim : term HOLset.set -> conv -> conv 7 | 8 | val single_simple : conv 9 | 10 | val last_call : term ref 11 | 12 | end; 13 | 14 | (* 15 | 16 | [fn_onestep ctxt kc vc t] tries to eliminate equalities over finite 17 | maps in term t. The conv parameters kc and vc are used to reduce 18 | equalities between keys and values in the finite maps respectively. 19 | The ctxt argument is a list of terms representing the current 20 | assumptions. It's assumed that these will have been fed into the 21 | provided conversions appropriately, so that they will make use of the 22 | assumptions. 23 | 24 | *) -------------------------------------------------------------------------------- /specification/Phase.sig: -------------------------------------------------------------------------------- 1 | signature Phase = sig 2 | 3 | exception PhaseRange 4 | 5 | (* for use in Script files *) 6 | val add_to_phase : int -> string -> unit 7 | val phase : int -> ('a -> HolKernel.thm) -> 'a -> HolKernel.thm 8 | val phase_x : int -> (string -> 'b -> HolKernel.thm) -> 9 | string -> 'b -> HolKernel.thm 10 | (* for use in Theory or other files *) 11 | val add_to_phase_imm : int -> HolKernel.thm -> unit 12 | val phase_imm : int -> HolKernel.thm -> HolKernel.thm 13 | (* read back the phase list *) 14 | val get_phase_list : int -> HolKernel.thm list 15 | 16 | end 17 | -------------------------------------------------------------------------------- /specification/TCP1_hostLTSScript.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/specification/TCP1_hostLTSScript.sml -------------------------------------------------------------------------------- /specification/TraceFiles.sig: -------------------------------------------------------------------------------- 1 | signature TraceFiles = 2 | sig 3 | include Abbrev 4 | val host_and_labels_from_file : string -> term * term list 5 | end 6 | -------------------------------------------------------------------------------- /specification/alldoc-between.template: -------------------------------------------------------------------------------- 1 | \part{THEORYNAME} 2 | \def\rulesrcsid{} 3 | -------------------------------------------------------------------------------- /specification/alldoc-c-between.template: -------------------------------------------------------------------------------- 1 | \dumpallrules 2 | \let\dumpallrules\relax 3 | 4 | \part{THEORYNAME} 5 | \def\rulesrcsid{} 6 | -------------------------------------------------------------------------------- /specification/alldoc-c-post.template: -------------------------------------------------------------------------------- 1 | \dumpallrules 2 | 3 | \def\rulesrcsid{} 4 | 5 | \backmatter 6 | 7 | \printindex 8 | 9 | \end{document} 10 | -------------------------------------------------------------------------------- /specification/alldoc-inc-between.template: -------------------------------------------------------------------------------- 1 | \let\dumpallrules\relax 2 | 3 | %% PART THEORYNAME 4 | 5 | \def\rulesrcsid{} 6 | -------------------------------------------------------------------------------- /specification/alldoc-inc-post.template: -------------------------------------------------------------------------------- 1 | \let\dumpallrules\relax 2 | 3 | \def\rulesrcsid{} 4 | 5 | -------------------------------------------------------------------------------- /specification/alldoc-inc-pre.template: -------------------------------------------------------------------------------- 1 | \RequirePackage{ltsmunge} 2 | \RequirePackage{tcp} 3 | 4 | \let\mignore\relax 5 | \newcommand{\mignore}[1]{} 6 | 7 | \def\rulesrcsid{} 8 | 9 | % load as late as possible 10 | \RequirePackage[pdfpagelabels,linktocpage,colorlinks,linkcolor=blue,pagecolor=blue]{hyperref} 11 | % Ugh, get rid of annoying warnings. We will hope that the substitutions 12 | % hyperref does to get a PDF-safe string for the various anchors are OK. 13 | \makeatletter 14 | \def\HyPsd@CatcodeWarning#1{} 15 | \makeatother 16 | 17 | \let\dumpallrules\relax 18 | -------------------------------------------------------------------------------- /specification/alldoc-post.template: -------------------------------------------------------------------------------- 1 | % -*-LaTeX-*- 2 | \def\rulesrcsid{} 3 | 4 | \backmatter 5 | 6 | \addcontentsline{toc}{chapter}{Index} 7 | 8 | \printindex 9 | 10 | \end{document} 11 | -------------------------------------------------------------------------------- /specification/doc-black.template: -------------------------------------------------------------------------------- 1 | % override definition of \tsunknown, making it black not red. 2 | \renewcommand{\tsunknown}[1]{\tsvar{#1}} 3 | -------------------------------------------------------------------------------- /specification/doc-inplace-post.template: -------------------------------------------------------------------------------- 1 | 2 | \end{document} 3 | -------------------------------------------------------------------------------- /specification/doc-inplace-pre.template: -------------------------------------------------------------------------------- 1 | \documentclass[10pt]{article} 2 | 3 | \usepackage{ltsmunge} 4 | %\usepackage{udpstuff} 5 | 6 | \usepackage{tcp} 7 | 8 | \usepackage[a4paper]{geometry} 9 | 10 | \makeatletter 11 | \newcommand{\ps@idstyle}{% 12 | \def\@evenhead{\thepage\hfil\slshape\rightmark}% 13 | \def\@oddhead{{\slshape\leftmark}\hfil\thepage}% 14 | \def\@evenfoot{\hfil\slshape\footnotesize Rule version: UNKNOWN\hfil}% 15 | \let\@oddfoot\@evenfoot 16 | } 17 | \makeatother 18 | 19 | \pagestyle{idstyle} 20 | 21 | \newcommand{\mignore}[1]{} 22 | 23 | \begin{document} 24 | 25 | \pagenumbering{roman} 26 | 27 | THIS DOCUMENT IS A CONFIDENTIAL DRAFT -- PLEASE DO NOT DISTRIBUTE. 28 | 29 | \tableofcontents 30 | 31 | \clearpage 32 | \pagenumbering{arabic} 33 | -------------------------------------------------------------------------------- /specification/doc-post.template: -------------------------------------------------------------------------------- 1 | \begin{document} 2 | 3 | \pagenumbering{roman} 4 | 5 | \title{TCP Specification\\ 6 | {\footnotesize\textit{\rulesrcsid}}\\ 7 | {\large THIS DOCUMENT IS A CONFIDENTIAL DRAFT -- PLEASE DO NOT DISTRIBUTE.}} 8 | \author{The Netsem Team\\ 9 | University of Cambridge Computer Laboratory} 10 | \date{\today} 11 | \maketitle 12 | 13 | 14 | \tableofcontents 15 | 16 | \clearpage 17 | \pagenumbering{arabic} 18 | 19 | \dumpallrules 20 | 21 | \end{document} 22 | -------------------------------------------------------------------------------- /specification/doc-pre.template: -------------------------------------------------------------------------------- 1 | \documentclass[10pt]{report} 2 | 3 | \usepackage{ltsmunge} 4 | %\usepackage{udpstuff} 5 | 6 | \usepackage{tcp} 7 | 8 | \usepackage[a4paper]{geometry} 9 | 10 | \makeatletter 11 | \newcommand{\ps@idstyle}{% 12 | \def\@evenhead{\thepage\hfil\slshape\rightmark}% 13 | \def\@oddhead{{\slshape\leftmark}\hfil\thepage}% 14 | \def\@evenfoot{\hfil\slshape\footnotesize Rule version: \rulesrcsid\hfil}% 15 | \let\@oddfoot\@evenfoot 16 | } 17 | \makeatother 18 | 19 | \pagestyle{idstyle} 20 | 21 | \newcommand{\mignore}[1]{} 22 | 23 | -------------------------------------------------------------------------------- /specification/find_int_inst.sig: -------------------------------------------------------------------------------- 1 | signature find_int_inst = 2 | sig 3 | 4 | include Abbrev 5 | val find_int_inst : term list -> {residue : term, redex : term} list 6 | 7 | end 8 | -------------------------------------------------------------------------------- /specification/genstrings.sml: -------------------------------------------------------------------------------- 1 | (* Render files as a MoSML string constants, in a module *) 2 | 3 | open TextIO 4 | 5 | fun renderfile f = let 6 | val n = OS.Path.file f 7 | val istr = TextIO.openIn f 8 | val _ = print ("val " ^ n ^ " = \"\\\n") 9 | val _ = 10 | while not (endOfStream istr) do let 11 | val line = valOf (inputLine istr) 12 | val line' = String.toString (String.extract(line,0,SOME (size line - 1))) 13 | in 14 | print ("\\" ^ line' ^ "\\n\\\n") 15 | end 16 | val _ = print "\\\"\n\n" 17 | val _ = TextIO.closeIn istr 18 | in 19 | () 20 | end 21 | 22 | fun main() = let 23 | in 24 | print "(* generated code; do not edit! *)\n"; 25 | print "structure strings = struct\n"; 26 | List.app renderfile (CommandLine.arguments ()); 27 | print "end (* struct *)\n"; 28 | print "(* eof *)\n" 29 | end 30 | -------------------------------------------------------------------------------- /specification/ground_tickers.sig: -------------------------------------------------------------------------------- 1 | signature ground_tickers = 2 | sig 3 | 4 | include Abbrev 5 | val time_analyse_hyps : term list -> {redex : term, residue : term} list * 6 | thm list 7 | 8 | end 9 | 10 | (* 11 | [time_analyse_hyps tlist] returns an instantiation for the hypotheses' 12 | tick variables, as well as a list of theorems demonstrating that the 13 | Time_Pass_ticker hypotheses all hold under this instantiation. 14 | 15 | *) -------------------------------------------------------------------------------- /specification/hosthistory.xls: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/specification/hosthistory.xls -------------------------------------------------------------------------------- /specification/html_header: -------------------------------------------------------------------------------- 1 | 2 | 3 | ${HEADING} 4 | 5 | 6 | 8 | 9 | 10 | 11 |

${HEADING}

12 | 13 | 17 | 18 |

[Show/hide variables and constraints.] 19 |

20 | -------------------------------------------------------------------------------- /specification/html_trailer: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /specification/incdemo.tex: -------------------------------------------------------------------------------- 1 | \documentclass[10pt]{article} 2 | 3 | \input{alldoc-inc} 4 | 5 | \begin{document} 6 | 7 | \title{Demo of use of alldoc-inc.tex} 8 | \maketitle 9 | 10 | \showrule{\defnfunupd} 11 | 12 | \end{document} 13 | -------------------------------------------------------------------------------- /specification/munge.mk.in: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT THIS MASTER FILE (munge.mk.in) - edit munge.mk instead. 2 | # munge.mk - user-specific configuration file for munging: 3 | 4 | # 5 | # Location of mng_to_latex: 6 | # 7 | HOLDOCDIR=${HOME}/WAP/HOLDoc 8 | 9 | -------------------------------------------------------------------------------- /specification/nocomment.imn: -------------------------------------------------------------------------------- 1 | (*[ NOCOMMENTS ]*) 2 | -------------------------------------------------------------------------------- /specification/numrelnorm.sig: -------------------------------------------------------------------------------- 1 | signature numrelnorm = 2 | sig 3 | 4 | include Abbrev 5 | val CANON_ss : simpLib.ssfrag 6 | val cache : Cache.cache 7 | val CANON_FORM_ARITH : thm list -> term -> thm 8 | 9 | end; 10 | -------------------------------------------------------------------------------- /specification/poly-CheckTraces.ML: -------------------------------------------------------------------------------- 1 | PolyML.SaveState.loadState "hol.state"; 2 | infix ++ fun p1 ++ p2 = OS.Path.concat(p1,p2); 3 | use (Systeml.HOLDIR ++ "tools-poly" ++ "prelude.ML"); 4 | Globals.interactive := false; 5 | Globals.print_thy_loads := true; 6 | PolyML.print_depth 0; 7 | load "DiskThms"; 8 | load "strings"; 9 | load "testEval"; 10 | use "CheckTraces.sml"; 11 | -------------------------------------------------------------------------------- /specification/poly-genstrings.ML: -------------------------------------------------------------------------------- 1 | use "genstrings.sml"; 2 | -------------------------------------------------------------------------------- /specification/position.txt: -------------------------------------------------------------------------------- 1 | For the moment, we are writing a spec that is loose enough to include 2 | BSD, but not too much looser than that. 3 | 4 | 5 | 6 | We also seem to be including a number of baroquenesses from BSD that 7 | will make white-box testing easier if we include them... ?? But not 8 | always (cf rcv_adv, requested_s_scale). 9 | 10 | 11 | 12 | Aiming to describe behaviour in response to *any* incoming segment, 13 | not just those generated by "good" TCPs. 14 | 15 | 16 | 17 | We're *NOT* writing a conformance spec for RFC1122 or anything like 18 | that; BSD clearly fails in a number of places here. 19 | 20 | 21 | 22 | (We're also noting down (but not speccing) places where BSD seems 23 | clearly weird or wrong.) 24 | -------------------------------------------------------------------------------- /specification/tcp.sty: -------------------------------------------------------------------------------- 1 | % tcp.sty -- extra stuff for TCP spec 2 | % 3 | \ProvidesPackage{tcp} 4 | 5 | \newcommand{\ie}{i.e.\@} 6 | \newcommand{\wasverb}[1]{\texttt{#1}} -------------------------------------------------------------------------------- /specification/tinydoc-pre.template: -------------------------------------------------------------------------------- 1 | \documentclass[10pt]{article} 2 | 3 | \usepackage{ltsmunge} 4 | %\usepackage{udpstuff} 5 | 6 | \usepackage[a2paper]{geometry} 7 | 8 | \makeatletter 9 | \newcommand{\ps@idstyle}{% 10 | \def\@evenhead{\thepage\hfil\slshape\rightmark}% 11 | \def\@oddhead{{\slshape\leftmark}\hfil\thepage}% 12 | \def\@evenfoot{\hfil\slshape\footnotesize Rule version: \rulesrcsid\hfil}% 13 | \let\@oddfoot\@evenfoot 14 | } 15 | \makeatother 16 | 17 | \pagestyle{idstyle} 18 | 19 | \newcommand{\mignore}[1]{} 20 | -------------------------------------------------------------------------------- /test/.gitignore: -------------------------------------------------------------------------------- 1 | *.cma 2 | *.cmi 3 | *.cmo 4 | *.cmx 5 | *.cmxa 6 | 7 | *.o 8 | *.a 9 | *.so 10 | 11 | .depend 12 | .dependc 13 | 14 | common/lexer.ml 15 | common/parser.ml 16 | common/parser.mli 17 | identtest/fileinject 18 | identtest/injectslurp 19 | identtest/lexer.ml 20 | identtest/parser.ml 21 | identtest/parser.mli 22 | identtest/pcapslurp 23 | identtest/slurpinject 24 | injector/injector 25 | libd/libd 26 | mirror/mirror 27 | ocamlext/parser_hack_script 28 | slurp/slurp 29 | tests/autotest/autotest 30 | 31 | -------------------------------------------------------------------------------- /test/Makefile.win: -------------------------------------------------------------------------------- 1 | MAKE=$(MAKE) /F Makefile.win $(MAKEFLAGS) 2 | 3 | all: 4 | cd nssock 5 | $(MAKE) all 6 | cd .. 7 | cd ocamllib 8 | $(MAKE) all 9 | cd .. 10 | cd ocamlext 11 | $(MAKE) all 12 | cd .. 13 | cd common 14 | $(MAKE) all 15 | cd .. 16 | cd libd 17 | $(MAKE) all 18 | cd .. 19 | cd slurp 20 | $(MAKE) all 21 | cd .. 22 | cd injector 23 | $(MAKE) all 24 | cd .. 25 | cd identtest 26 | $(MAKE) all 27 | cd .. 28 | cd utils 29 | $(MAKE) all 30 | cd .. 31 | cd tthee 32 | $(MAKE) all 33 | cd .. 34 | cd tests 35 | $(MAKE) all 36 | cd .. 37 | 38 | clean:: 39 | cd nssock 40 | $(MAKE) clean 41 | cd .. 42 | cd ocamllib 43 | $(MAKE) clean 44 | cd .. 45 | cd ocamlext 46 | $(MAKE) clean 47 | cd .. 48 | cd common 49 | $(MAKE) clean 50 | cd .. 51 | cd libd 52 | $(MAKE) clean 53 | cd .. 54 | cd slurp 55 | $(MAKE) clean 56 | cd .. 57 | cd injector 58 | $(MAKE) clean 59 | cd .. 60 | cd identtest 61 | $(MAKE) clean 62 | cd .. 63 | cd utils 64 | $(MAKE) clean 65 | cd .. 66 | cd tthee 67 | $(MAKE) clean 68 | cd .. 69 | cd tests 70 | $(MAKE) clean 71 | cd .. -------------------------------------------------------------------------------- /test/bsd/README: -------------------------------------------------------------------------------- 1 | The contents of this directory are DEPRECATED. Do not use! This 2 | directory contains various proof-of-concept and experimental code. 3 | 4 | rawtcptest: C code for the first raw sockets test on BSD we ever 5 | wrote. 6 | 7 | rawtest1: OCaml hack for using raw sockets to emit packets. 8 | 9 | simple, socktest1, socktest2: Experimentation with the OCaml sockets 10 | binding. 11 | -------------------------------------------------------------------------------- /test/bsd/simple.ml: -------------------------------------------------------------------------------- 1 | let x = 5 in 2 | let y = 6 in 3 | print_int(x*y);; 4 | -------------------------------------------------------------------------------- /test/bsd/socktest1.ml: -------------------------------------------------------------------------------- 1 | open Unix;; 2 | 3 | exception Fatal of string;; 4 | 5 | let sd = 6 | try socket PF_INET SOCK_STREAM 6 7 | with Unix_error(e,s1,s2) -> 8 | raise(Fatal("Error:"^(error_message(e))^s1^s2)) 9 | in 10 | let opt = setsockopt sd SO_KEEPALIVE true 11 | in 12 | if (getsockopt sd SO_KEEPALIVE) = true 13 | then print_endline("SO_KEEPALIVE") 14 | else print_endline("!SO_KEEPALIVE");; 15 | -------------------------------------------------------------------------------- /test/bsd/socktest2.ml: -------------------------------------------------------------------------------- 1 | open Unix;; 2 | 3 | exception Error of string;; 4 | 5 | let sd = 6 | try socket PF_INET SOCK_RAW 0 7 | with Unix_error(e, s1, s2) -> 8 | raise(Error("Error:" ^ error_message(e) ^ s1 ^ s2)) 9 | in 10 | let opt = ip_setsockopt sd IP_HDRINCL true 11 | in 12 | if (ip_getsockopt sd IP_HDRINCL) = true 13 | then print_endline("IP_HDRINCL") 14 | else print_endline("!IP_HDRINCL");; 15 | -------------------------------------------------------------------------------- /test/common/examples/test.ml: -------------------------------------------------------------------------------- 1 | open Parserlib;; 2 | open Renderlib;; 3 | 4 | let trace_contents fname = 5 | let inch = Unix.in_channel_of_descr (Unix.openfile fname [Unix.O_RDONLY] 0) in 6 | let env = Threadparsing.create_parse_env () in 7 | let result = ref [] in 8 | try 9 | let lexbuf = Lexing.from_channel inch in 10 | while true do 11 | let next = 12 | try 13 | Parser.main env Lexer.token lexbuf 14 | with 15 | Threadparsing.Parse_error -> 16 | print_endline ("Fatal: Parse error in file " ^ fname); 17 | (match !result with 18 | [] -> print_endline "(Failed to parse header information block)" 19 | | PARSE_RETURN(tco,_,_)::_ -> print_endline 20 | ("Last label parsed had timecomment: " ^ timecomment_option_to_string tco )); 21 | exit 1 22 | in (result := next::(!result)) 23 | done; [] 24 | with Lexer.Eof -> (* List.rev *) !result;; 25 | 26 | let _ = 27 | let [_;f] = Array.to_list Sys.argv in 28 | let _ = trace_contents f in 29 | () 30 | ;; 31 | 32 | -------------------------------------------------------------------------------- /test/common/examples/test_spec3.ml: -------------------------------------------------------------------------------- 1 | open Parserlib;; 2 | open Renderlib;; 3 | 4 | let trace_contents fname = 5 | let inch = Unix.in_channel_of_descr (Unix.openfile fname [Unix.O_RDONLY] 0) in 6 | let env = Threadparsing.create_parse_env () in 7 | let result = ref [] in 8 | try 9 | let lexbuf = Lexing.from_channel inch in 10 | while true do 11 | let next = 12 | try 13 | Parser.spec3main env Lexer.token lexbuf 14 | with 15 | Threadparsing.Parse_error -> 16 | print_endline ("Fatal: Parse error in file " ^ fname); 17 | (match !result with 18 | [] -> print_endline "(Failed to parse header information block)" 19 | | SPEC3_PARSE_RETURN(tco,_,_)::_ -> print_endline 20 | ("Last label parsed had timecomment: " ^ timecomment_option_to_string tco )); 21 | exit 1 22 | in 23 | let _ = print_string "Got one! \n" in 24 | (result := next::(!result)) 25 | done; [] 26 | with Lexer.Eof -> (* List.rev *) !result;; 27 | 28 | let _ = 29 | let [_;f] = Array.to_list Sys.argv in 30 | let _ = trace_contents f in 31 | () 32 | ;; 33 | 34 | -------------------------------------------------------------------------------- /test/common/hol2net.mli: -------------------------------------------------------------------------------- 1 | open Nettypes;; 2 | open Netconv;; 3 | open Holtypes;; 4 | 5 | val tcp_flatten: tcp_segment -> (uint * uint * uint list) 6 | 7 | val icmp_flatten: icmp_message_hol -> (uint * uint * uint list) 8 | 9 | val udp_flatten: udp_datagram_hol -> (uint * uint * uint list) 10 | 11 | val ip_encapsulate: uint -> uint -> uint -> uint list -> uint list 12 | 13 | val uint_list_to_string: uint list -> string 14 | -------------------------------------------------------------------------------- /test/common/librender.mli: -------------------------------------------------------------------------------- 1 | open Libcalls;; 2 | open Parserlib;; 3 | open Ocamllib;; 4 | open Printf;; 5 | open Int64;; 6 | open Unix;; 7 | 8 | exception Fatal of string;; 9 | 10 | (* no semicolon version *) 11 | val lh_return_to_string: libreturnstructure -> tid -> string;; 12 | val lh_call_to_string: libstructure -> tid -> string;; 13 | 14 | val lib_call_render: libstructure -> tid -> string;; 15 | val lib_call_render_call: libstructure -> string;; 16 | 17 | val lib_return_render: libreturnstructure -> tid -> string;; 18 | val lib_return_render_return: libreturnstructure -> string;; 19 | 20 | (* 21 | val lib_render_to_socket: file_descr -> ns_parse_data -> unit;; 22 | *) 23 | -------------------------------------------------------------------------------- /test/common/net2hol.mli: -------------------------------------------------------------------------------- 1 | open Nettypes;; 2 | open Netconv;; 3 | 4 | val skip_ip_eth_header: char list -> char list 5 | 6 | val skip_loopback_header: char list -> iface -> char list 7 | 8 | val parse_ip_packet: char list -> ip_packet 9 | 10 | val parse_tcp_datagram: ip_packet -> tcp_datagram 11 | 12 | val parse_icmp_message: ip_packet -> icmp_datagram 13 | 14 | val parse_udp_datagram: ip_packet -> udp_datagram 15 | -------------------------------------------------------------------------------- /test/common/netipreass.mli: -------------------------------------------------------------------------------- 1 | open Nettypes;; 2 | open Netconv;; 3 | 4 | type fragment = { 5 | f_p : ip_packet; 6 | f_ts : timestamp; 7 | } 8 | 9 | (* unique datagram identifier *) 10 | type ip_uniq = { 11 | ipu_id : uint; 12 | ipu_src : uint; 13 | ipu_dst : uint; 14 | ipu_p : uint; 15 | } 16 | 17 | type defrag_chain = { 18 | dfc_uniq : ip_uniq; (* unique identifier of all fragments in chain *) 19 | dfc_ts : timestamp; (* invariant: earliest timestamp in dfc_data *) 20 | dfc_data : fragment list; (* invariant: in reverse order of arrival; nonempty *) 21 | } 22 | 23 | type reass_frag = { 24 | rf_off : int; 25 | rf_dlen : int; 26 | rf_mf : bool; 27 | rf_data : char list; 28 | } 29 | 30 | type defrag_state = defrag_chain list (* set of defrag chains *) 31 | 32 | val ip_input: defrag_state -> timestamp -> ip_packet -> defrag_state * ip_packet option 33 | 34 | (* FIXME tjr surely this should be defrag_chain list? *) 35 | val init_ip_input_state: 'a list 36 | 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /test/common/ntpheader.h: -------------------------------------------------------------------------------- 1 | #ifndef WIN32 2 | #include 3 | #include 4 | #include 5 | #else 6 | #include 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | #ifndef WIN32 13 | extern void printNTPheader(int outfd); 14 | #else 15 | extern void printNTPheader(SOCKET outfd); 16 | #endif 17 | -------------------------------------------------------------------------------- /test/common/parserlib.mli: -------------------------------------------------------------------------------- 1 | open Ocamllib;; 2 | open Holtypes;; 3 | open Tcpcbtypes;; 4 | open Libcalls;; 5 | 6 | type time = int64;; 7 | val time_base_us: int64;; 8 | 9 | type libcall = tid * libstructure;; 10 | type libreturn = tid * libreturnstructure;; 11 | type tcptrace = tcpaction * tracesid * traceaddr * tcpstate * tcpcb;; 12 | type duration = DURATION of time * time 13 | 14 | type ns_parse_data = 15 | HOLSNDMSG of holmsg 16 | | HOLLOOPMSG of holmsg 17 | | HOLRCVMSG of holmsg 18 | | LIBCALL of libcall 19 | | LIBRETURN of libreturn 20 | | TCPTRACE of tcptrace 21 | | HOLEPSILON of duration 22 | | HOLABSTIME of time * time 23 | 24 | type timecomment = 25 | TIMECOMMENT of time * string 26 | ;; 27 | 28 | 29 | type ns_parse_return = 30 | PARSE_RETURN of timecomment option * string list option * ns_parse_data 31 | ;; 32 | 33 | 34 | type spec3_parse_data = 35 | | HOLLN1_HOST of string * ns_parse_data (* expect e.g. no HOLEPSILON in the parse_data *) 36 | | HOLLN1_EPSILON of duration 37 | | HOLLN1_ABSTIME of time * time 38 | 39 | type spec3_parse_return = 40 | SPEC3_PARSE_RETURN of timecomment option * string list option * spec3_parse_data 41 | -------------------------------------------------------------------------------- /test/common/renderlib.mli: -------------------------------------------------------------------------------- 1 | open Nettypes;; 2 | open Parserlib;; 3 | 4 | (* FIXME remove this in favour of going via string functions *) 5 | val render_nsparsemsg_to_chan: out_channel -> ns_parse_return -> uint -> string -> string option -> unit;; 6 | 7 | (* FIXME used in mkdiag.ml strangely, aim to remove when understand mkdiag code, and replace with timecomment_option_to_string *) 8 | val render_timestamp: uint -> uint -> string 9 | 10 | (* 11 | val duration_to_string: duration -> string 12 | *) 13 | 14 | val timecomment_option_to_string: timecomment option -> string 15 | 16 | val lh_epsilon_to_string: duration -> string 17 | 18 | val ns_parse_return_to_string: ns_parse_return -> string 19 | val spec3_parse_return_to_string: spec3_parse_return -> string 20 | -------------------------------------------------------------------------------- /test/common/sock.ml: -------------------------------------------------------------------------------- 1 | open Unix;; 2 | (*open ThreadUnix;;*) 3 | 4 | exception Fatal of string;; 5 | 6 | let write sd str = 7 | let len = String.length str in 8 | let rec trysend c s = 9 | match c with 10 | 0 -> 11 | raise(Fatal("Cannot send/write data to connected socket\n")) 12 | | n -> 13 | let strlen = String.length s in 14 | let lensent = (*ThreadUnix.*)write sd s 0 strlen in 15 | if(lensent != strlen) then 16 | trysend (c-1) (String.sub s (lensent-1) (strlen-lensent)) 17 | else 18 | () 19 | in 20 | trysend 10 str;; 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/common/sock.mli: -------------------------------------------------------------------------------- 1 | open Unix;; 2 | 3 | val write: file_descr -> string -> unit 4 | -------------------------------------------------------------------------------- /test/common/tcpcbrender.mli: -------------------------------------------------------------------------------- 1 | open Tcpcbtypes;; 2 | open Nettypes;; 3 | open Parserlib;; 4 | open Printf;; 5 | open Unix;; 6 | open Sock;; 7 | 8 | val taddr_render: traceaddr -> string 9 | 10 | val tstate_render: tcpstate -> string 11 | 12 | val tsact_render: tcpaction -> string 13 | 14 | val render_ts_recent: tswindow -> string 15 | 16 | val tcpcb_render: tcpcb -> string 17 | 18 | val tcpcb_trace_to_string : tcpaction -> tracesid -> traceaddr -> tcpstate -> tcpcb -> string 19 | 20 | val tcpcb_trace_render: tcpaction -> tracesid -> traceaddr -> tcpstate -> tcpcb -> string 21 | 22 | (* 23 | val tcpcb_trace_render_to_socket: file_descr -> ns_parse_data -> unit 24 | 25 | *) 26 | -------------------------------------------------------------------------------- /test/doc/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for TCP Test documentation 2 | 3 | all : protstack.eps tthee-arch.eps tcptest.ps 4 | 5 | clean : 6 | rm -f *.{aux,log,dvi,toc} tthee-arch.eps protstack.eps tcptest.ps *~ 7 | 8 | %.eps : %.obj 9 | tgif -print -eps $< 10 | 11 | %.dvi : %.tex 12 | latex $< 13 | 14 | %.ps : %.dvi 15 | dvips -Pcmz -Pamz -j0 $< 16 | 17 | %.eps : %.fig 18 | fig2dev -L eps $< $*.eps 19 | 20 | -------------------------------------------------------------------------------- /test/doc/tcptest.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/test/doc/tcptest.tex -------------------------------------------------------------------------------- /test/dynamic/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | MKLIB=ar 3 | NSSOCKPATH=../nssock/ 4 | NSSOCKLIB=nssock 5 | NTPLIB=ntpspoof 6 | 7 | OSTYPE=$(shell uname -o) 8 | 9 | all: sockpreload.so 10 | 11 | libntpspoof.a: 12 | $(CC) -c ntp_spoof.c 13 | $(MKLIB) -r $@ ntp_spoof.o 14 | 15 | sockpreload.so: libntpspoof.a socket_preload.c ../nssock/libnssock.a 16 | if [ $(OSTYPE) = "FreeBSD" ]; then \ 17 | $(CC) -I $(NSSOCKPATH) -L $(NSSOCKPATH) -L. -o sockpreload.so \ 18 | -shared -static socket_preload.c -l$(NSSOCKLIB) \ 19 | -lntpspoof 20 | else \ 21 | $(CC) -I $(NSSOCKPATH) -L $(NSSOCKPATH) -L. -o sockpreload.so \ 22 | -shared -static socket_preload.c -l$(NSSOCKLIB) \ 23 | -lntpspoof -ldl 24 | fi 25 | 26 | clean: 27 | rm -f *.o sockpreload.so 28 | 29 | realclean: clean 30 | 31 | depend: 32 | -------------------------------------------------------------------------------- /test/dynamic/README: -------------------------------------------------------------------------------- 1 | A wrapper around the nssock library (nssock/), that effectively 2 | renames each ns_* call to be the name of the real socket call it wraps 3 | around. This is used to attach an instrumented sockets implementation to 4 | existing applications that use the sockets library in glibc. 5 | 6 | Effectively you get: 7 | 8 | Application (e.g. Mozilla) 9 | ------------- 10 | socket_preload 11 | ------------- 12 | nssock 13 | ------------- 14 | glibc 15 | 16 | and when the application is run, you get a trace of all the socket 17 | calls and their returns (in HOL label format). Funky! 18 | 19 | This requires some cleverness to link as the socket functions in 20 | socket_preload are IDENTICALLY named to those in glibc. 21 | 22 | As all of this is a little tricky, a script in Test/utils/dlhack has 23 | been written that will attach all this to an application on your 24 | behalf. It is also a good tutorial on how to do this stuff! 25 | -------------------------------------------------------------------------------- /test/dynamic/ntp_spoof.c: -------------------------------------------------------------------------------- 1 | void printNTPheader(int outfd) 2 | { 3 | return; 4 | } 5 | -------------------------------------------------------------------------------- /test/identtest/errors.ml: -------------------------------------------------------------------------------- 1 | exception Parse_error of string;; 2 | -------------------------------------------------------------------------------- /test/identtest/errors.mli: -------------------------------------------------------------------------------- 1 | exception Parse_error of string;; 2 | -------------------------------------------------------------------------------- /test/identtest/lexer.mll: -------------------------------------------------------------------------------- 1 | { 2 | open Parser 3 | exception Eof 4 | } 5 | 6 | rule token = parse 7 | [' ' '\t' '\n'] { token lexbuf } (* skip blanks *) 8 | | "*-" { SEP } 9 | | "*Comment=" { COMMENT } 10 | | "*Length=" { LENGTH } 11 | | "*Data=" { DATA } 12 | | ['A'-'Z' 'a'-'z' '0'-'9' '_']* 13 | { STRING(Lexing.lexeme lexbuf) } 14 | -------------------------------------------------------------------------------- /test/injector/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLINCL=-I ../common -I ../ocamlext -I $(OCAMLPATH)/../lib/ocaml \ 2 | -I ../ocamllib 3 | 4 | REQLIBS=$(OCAMLPATH)/../lib/ocaml/unix.cma \ 5 | $(OCAMLPATH)/../lib/ocaml/threads/threads.cma \ 6 | ../ocamlext/rawsock.cma ../ocamlext/platform.cma \ 7 | ../ocamllib/ocamllib.cma ../ocamlext/threadparsing.cma \ 8 | ../common/nscommon.cma 9 | NSSOCKLIB=../nssock/libnssock.a 10 | NTPLIB=../common/libntplib.a 11 | 12 | OCAMLC=$(OCAMLPATH)/ocamlc 13 | OCAMLLEX$(OCAMLPATH)/=ocamllex 14 | OCAMLYACC=$(OCAMLPATH)/ocamlyacc 15 | OCAMLDEP=$(OCAMLPATH)/ocamldep 16 | RM=rm -f 17 | 18 | OBJS=injector.cmo 19 | 20 | all: injector 21 | 22 | injector: $(OBJS) $(REQLIBS) $(NSSOCKLIB) $(NTPLIB) 23 | $(OCAMLC) -o $@ -custom $(OCAMLINCL) $(NSSOCKLIB) $(REQLIBS) \ 24 | $(NTPLIB) $(OBJS) -ccopt -L../ocamllib 25 | 26 | depend: 27 | $(OCAMLDEP) *.mli *.ml > .depend 28 | 29 | clean: 30 | $(RM) *.[oa] *.cm[oiax] injector 31 | 32 | realclean: clean 33 | $(RM) .depend 34 | 35 | 36 | .SUFFIXES:.ml .mli .cmo .cmi 37 | .mli.cmi: 38 | $(OCAMLC) -thread -c -custom $(OCAMLINCL) $< 39 | .ml.cmo: 40 | $(OCAMLC) -thread -c -custom $(OCAMLINCL) $< 41 | 42 | 43 | -include .depend -------------------------------------------------------------------------------- /test/libd/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLINCL=-I ../common -I ../ocamllib -I $(OCAMLPATH)/../lib/ocaml \ 2 | -I ../ocamlext 3 | OCAMLLIB=$(OCAMLPATH)/../lib/ocaml 4 | 5 | REQLIBS=$(OCAMLLIB)/unix.cma $(OCAMLLIB)/threads/threads.cma \ 6 | ../ocamllib/ocamllib.cma ../ocamlext/threadparsing.cma \ 7 | ../ocamlext/platform.cma ../common/nscommon.cma 8 | NSSOCKLIB=../nssock/libnssock.a ../ocamlext/platform.a 9 | NTPLIB=../common/libntplib.a 10 | 11 | OCAMLC=$(OCAMLPATH)/ocamlc 12 | OCAMLDEP=$(OCAMLPATH)/ocamldep 13 | RM=rm -f 14 | 15 | OBJS=libd.cmo 16 | 17 | all: libd 18 | 19 | libd: $(OBJS) $(NSSOCKLIB) $(NTPLIB) $(REQLIBS) 20 | $(OCAMLC) -thread -o $@ -custom $(OCAMLINCL) $(REQLIBS) $(NSSOCKLIB) \ 21 | $(NTPLIB) $(OBJS) 22 | 23 | depend: 24 | $(OCAMLDEP) *.mli *.ml > .depend 25 | 26 | clean: 27 | $(RM) *.[oa] *.cm[oiax] libd 28 | 29 | realclean: clean 30 | $(RM) .depend 31 | 32 | .SUFFIXES:.ml .mli .cmo .cmi 33 | .mli.cmi: 34 | $(OCAMLC) -thread -c -custom $(OCAMLINCL) $< 35 | .ml.cmo: 36 | $(OCAMLC) -thread -c -custom $(OCAMLINCL) $< 37 | 38 | -include .depend 39 | -------------------------------------------------------------------------------- /test/libd/Makefile.win: -------------------------------------------------------------------------------- 1 | OCAMLOPT=ocamlopt 2 | RM=del /F /Q 3 | 4 | OCAMLINCL=-I ../common -I "$(OCAMLLIB)" -I ../ocamllib -I ../ocamlext 5 | CLIBS=-cclib /link -cclib /LIBPATH:../ocamllib/ -cclib /NODEFAULTLIB:LIBC.lib ../common/libntplib.lib ../ocamlext/platformc.lib 6 | 7 | REQLIBS="$(OCAMLLIB)/unix.cmxa" "$(OCAMLLIB)/threads/threads.cmxa" \ 8 | "../ocamllib/ocamllib.cmxa" ../common/nettypes.cmx \ 9 | ../common/netconv.cmx ../common/libcalls.cmx \ 10 | ../common/sock.cmx ../common/librender.cmx \ 11 | ../common/holparselib.cmx ../common/parserlib.cmx \ 12 | ../common/tcpcbparserlib.cmx ../ocamlext/threadparsing.cmxa \ 13 | ../ocamlext/platform.cmxa ../common/parser.cmx \ 14 | ../common/lexer.cmx 15 | NSSOCKLIB=../nssock/libnssock.lib 16 | 17 | FILES=libd.cmx 18 | 19 | all: libd.exe 20 | 21 | libd.exe: $(FILES) 22 | $(OCAMLOPT) -thread -o $@ $(REQLIBS) $(FILES:.ml=.cmx) $(CLIBS) 23 | 24 | clean: 25 | $(RM) *.o *.a *.cmo *.cmi *.cma *.cmx *.cmx *.cmxa *.obj *.lib 26 | $(RM) libd.exe 27 | 28 | 29 | .SUFFIXES:.ml .cmx 30 | .ml.cmx: 31 | $(OCAMLOPT) -thread -c $(OCAMLINCL) $< 32 | 33 | -------------------------------------------------------------------------------- /test/merge/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLC=$(OCAMLPATH)/ocamlc 2 | OCAMLDEP=$(OCAMLPATH)/ocamldep 3 | OCAMLLIBDIR=$(OCAMLPATH)/../lib/ocaml 4 | OCAMLCOPT=-I $(OCAMLLIBDIR) -I ../ocamlext -I ../common -I ../ocamllib -I ../nssock 5 | OCAMLREQLIBS=$(OCAMLLIBDIR)/unix.cma $(OCAMLLIBDIR)/threads/threads.cma \ 6 | ../ocamlext/platform.cma ../ocamllib/ocamllib.cma ../nssock/libnssock.a \ 7 | ../common/libntplib.a ../ocamlext/threadparsing.cma ../common/nscommon.cma 8 | RM=rm -f 9 | 10 | OBJS=mlogger.cmo 11 | 12 | all: mlogger 13 | 14 | mlogger: $(OBJS) 15 | $(OCAMLC) -thread -o $@ -custom $(OCAMLCOPT) $(OCAMLREQLIBS) $(OBJS) 16 | 17 | depend: 18 | $(OCAMLDEP) *.mli *.ml > .depend 19 | 20 | clean: 21 | $(RM) *.cmo *.cmi *.o mlogger 22 | 23 | realclean: clean 24 | $(RM) .depend 25 | 26 | .SUFFIXES:.ml .cmo 27 | .ml.cmo: 28 | $(OCAMLC) -thread -c -custom $(OCAMLCOPT) $< 29 | 30 | -include .depend -------------------------------------------------------------------------------- /test/merge/README: -------------------------------------------------------------------------------- 1 | The contents of this directory are DEPRECATED. Do not use! 2 | This tool attempted merging before Tthee superceded it -------------------------------------------------------------------------------- /test/mirror/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLC=$(OCAMLPATH)/ocamlc 2 | OCAMLDEP=$(OCAMLPATH)/ocamldep 3 | RM=rm -f 4 | 5 | OCAMLDIR=$(OCAMLPATH)/../lib/ocaml 6 | OCAMLLIBS=$(OCAMLDIR)/unix.cma $(OCAMLDIR)/threads/threads.cma \ 7 | ../ocamllib/ocamllib.cma ../ocamlext/threadparsing.cma \ 8 | ../common/nscommon.cma ../ocamlext/platform.cma 9 | OCAMLINCL=-I $(OCAMLDIR)/lib/ocaml -I ../ocamlext -I ../common \ 10 | -I ../ocamllib 11 | OTHERLIBS=../nssock/libnssock.a ../common/libntplib.a 12 | 13 | all: mirror 14 | 15 | mirror: mirror.cmo 16 | $(OCAMLC) -o $@ -custom $(OCAMLINCL) $(OCAMLLIBS) $(OTHERLIBS) mirror.cmo 17 | 18 | depend: 19 | $(OCAMLDEP) *.mli *.ml > .depend 20 | 21 | clean: 22 | $(RM) *.o *.cm[oi] mirror 23 | 24 | realclean: clean 25 | $(RM) .depend 26 | 27 | .SUFFIXES:.ml .mli .cmi .cmo 28 | .mli.cmi: 29 | $(OCAMLC) -c $(OCAMLINCL) -thread $(OCAMLLIBS) $< 30 | .ml.cmo: 31 | $(OCAMLC) -c $(OCAMLINCL) -thread $(OCAMLLIBS) $< 32 | 33 | -include .depend 34 | -------------------------------------------------------------------------------- /test/notes/6.0-spec-changes.txt: -------------------------------------------------------------------------------- 1 | When we were trying to make the spec work for FreeBSD 6.0, some things were 2 | changed temporarily and found to work, but then changed back when we started 3 | working with 4.6 again because we hadn't made them parameterisable yet. These 4 | are things which should be reintroduced if we start working with FreeBSD 6.0 5 | again: 6 | 7 | Change defaults: 8 | 9 | SO_RCVBUF default on FreeBSD changed to 65536 10 | 11 | HZ changed from 100 to 1000 (changed from FreeBSD 5.4-6.0) 12 | 13 | Change logic: 14 | 15 | Additional logic in calculate_buf_sizes for rfc3390 (see FreeBSD-5.4 16 | tcp_input.c, line 3139) 17 | 18 | Something needs to be done about silly window avoidance in 19 | make_syn_segment, make_syn_ack_segment, make_ack_segment and 20 | bsd_make_phantom_segment. This may technically be a bug in the spec even 21 | under 4.6, but didn't come up in previous tests against 4.6 traces. 22 | -------------------------------------------------------------------------------- /test/notes/constraints.txt: -------------------------------------------------------------------------------- 1 | For extracting lists of constraints from a directory of processed traces the following command may be useful: 2 | 3 | grep '^[[:digit:]]\+\.' *.out.html | sed -e 's/[^ ]\+//' 4 | -------------------------------------------------------------------------------- /test/notes/fds.txt: -------------------------------------------------------------------------------- 1 | 2 | For testing purposes, it would be nice to keep the low numbered FDs (fds >= 3) free. This was originally requested by KW. 3 | 4 | A lot of the test code is written in OCAML and is by default compiled using ocamlc into bytecode. Using the OCAML bytecode interpreter to execute it consumes some low numbered file descriptors to link in the required libraries and the bytecode progrom being executed. 5 | 6 | A solution to this may be to use the ocamlopt compiler (i.e., native code compiler) instead. 7 | -------------------------------------------------------------------------------- /test/notes/netsem1-network-info/bsd-hosts/bsd-sshd-login-problems.txt: -------------------------------------------------------------------------------- 1 | For sshd to function correctly, all hosts connecting to a server and the server itself must have fully qualified hostname entries in the server's /etc/hosts file. 2 | 3 | Without such entries a pending ssh client connect just hangs with no helpful debug output. 4 | -------------------------------------------------------------------------------- /test/notes/netsem1-network-info/bsd-hosts/in_systm.h.patch: -------------------------------------------------------------------------------- 1 | *** in_systm.h Tue Feb 4 11:05:14 2003 2 | --- in_systm.h Tue Feb 4 11:08:25 2003 3 | *************** 4 | *** 57,62 **** 5 | --- 57,63 ---- 6 | 7 | #ifdef _KERNEL 8 | n_time iptime __P((void)); 9 | + void iptime_usec __P((struct timeval*)); 10 | #endif 11 | 12 | #endif 13 | -------------------------------------------------------------------------------- /test/notes/netsem1-network-info/bsd-hosts/ip_icmp.c.patch: -------------------------------------------------------------------------------- 1 | *** ip_icmp.c Tue Feb 4 10:56:23 2003 2 | --- ip_icmp.c Tue Feb 4 12:47:24 2003 3 | *************** 4 | *** 776,781 **** 5 | --- 776,790 ---- 6 | return (htonl(t)); 7 | } 8 | 9 | + 10 | + void 11 | + iptime_usec(atv) 12 | + struct timeval *atv; 13 | + { 14 | + getmicrotime(atv); 15 | + } 16 | + 17 | + 18 | #if 1 19 | /* 20 | * Return the next larger or smaller MTU plateau (table from RFC 1191) 21 | -------------------------------------------------------------------------------- /test/notes/netsem1-network-info/bsd-hosts/rc.network.patch-emil: -------------------------------------------------------------------------------- 1 | *** rc.network Tue Jun 11 05:20:09 2002 2 | --- rc.network Mon Aug 4 14:01:13 2003 3 | *************** 4 | *** 525,530 **** 5 | --- 525,536 ---- 6 | esac 7 | echo '.' 8 | 9 | + ## Added by SMB ## 10 | + echo -n " Making the kernel timecounter more accurate." 11 | + sysctl kern.timecounter.method=1 12 | + echo -n " Adding some routing entries" 13 | + route add -net 192.168.0.0 192.168.1.14 255.255.255.0 14 | + route delete default 15 | # Let future generations know we made it. 16 | # 17 | network_pass1_done=YES 18 | -------------------------------------------------------------------------------- /test/notes/netsem1-network-info/bsd-hosts/rc.network.patch-john: -------------------------------------------------------------------------------- 1 | *** rc.network Tue Jun 11 05:20:09 2002 2 | --- rc.network Mon Aug 4 14:01:13 2003 3 | *************** 4 | *** 525,530 **** 5 | --- 525,539 ---- 6 | esac 7 | echo '.' 8 | 9 | + ## Added by SMB ## 10 | + echo -n "Polluting ARP cache with pscyhe entry." 11 | + arp -s 192.168.0.99 12:34:56:df:84:f4 pub 12 | + arp -s 192.168.0.88 12:34:56:df:84:ff pub 13 | + echo -n " Making the kernel timecounter more accurate." 14 | + sysctl kern.timecounter.method=1 15 | + echo -n " Adding some routing entries" 16 | + route add -net 192.168.1.0 192.168.0.14 255.255.255.0 17 | + route delete default 18 | # Let future generations know we made it. 19 | # 20 | network_pass1_done=YES 21 | -------------------------------------------------------------------------------- /test/notes/netsem1-network-info/bsd-hosts/tcp_debug.c.patch: -------------------------------------------------------------------------------- 1 | *** tcp_debug.c Tue Feb 4 11:05:30 2003 2 | --- tcp_debug.c Tue Feb 4 11:19:28 2003 3 | *************** 4 | *** 104,110 **** 5 | AF_INET; 6 | if (tcp_debx == TCP_NDEBUG) 7 | tcp_debx = 0; 8 | ! td->td_time = iptime(); 9 | td->td_act = act; 10 | td->td_ostate = ostate; 11 | td->td_tcb = (caddr_t)tp; 12 | --- 104,111 ---- 13 | AF_INET; 14 | if (tcp_debx == TCP_NDEBUG) 15 | tcp_debx = 0; 16 | ! /*td->td_time = iptime(); */ 17 | ! iptime_usec(&(td->td_time)); 18 | td->td_act = act; 19 | td->td_ostate = ostate; 20 | td->td_tcb = (caddr_t)tp; 21 | -------------------------------------------------------------------------------- /test/notes/netsem1-network-info/bsd-hosts/tcp_debug.h.patch: -------------------------------------------------------------------------------- 1 | *** tcp_debug.h Tue Feb 4 11:05:23 2003 2 | --- tcp_debug.h Tue Feb 4 11:09:13 2003 3 | *************** 4 | *** 38,44 **** 5 | #define _NETINET_TCP_DEBUG_H_ 6 | 7 | struct tcp_debug { 8 | ! n_time td_time; 9 | short td_act; 10 | short td_ostate; 11 | caddr_t td_tcb; 12 | --- 38,44 ---- 13 | #define _NETINET_TCP_DEBUG_H_ 14 | 15 | struct tcp_debug { 16 | ! struct timeval td_time; 17 | short td_act; 18 | short td_ostate; 19 | caddr_t td_tcb; 20 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd-4.6-install-arp.txt: -------------------------------------------------------------------------------- 1 | Since psyche doesn't really exist, attempts to send ethernet packets to it 2 | will generally fail due to the inability to determine the correct ethernet 3 | address to send them to. We get around this by adding a fake entry to the ARP 4 | cache on each of the machines on the test network, by adding the following 5 | line to /etc/rc.network, just above the "let future generations know we made 6 | it" comment: 7 | 8 | arp -s 192.168.13.199 12:34:56:df:84:f4 pub 9 | 10 | I don't think there's any significance at all to the ethernet address chosen, 11 | but at the moment all the machines on the network are using the ones above. 12 | Also note that it would theoretically be sufficient to do this on one machine 13 | and specify the 'pub' option allowing it to act as an ARP server for this 14 | address, but specifying it on every machine will hopefully avoid any nasty 15 | surprises later on when we start changing the network topology or similar. 16 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd-4.6-ocaml.txt: -------------------------------------------------------------------------------- 1 | Installing OCaml 2 | 3 | OCaml 3.08 basically builds out-of-the-box on the FreeBSD 4.6 machines. Make 4 | sure to do 'configure -prefix=/usr/groups/netsem/ocaml-3.08 -with-pthreads'. 5 | 6 | The netsem1 install documentation suggests lots of tweaks to the configuration 7 | which look like they're redundant with the switching of linuxthreads for 8 | pthreads described earlier (but bear this in mind as a candidate if it turns 9 | out not to work). 10 | 11 | Suggest symlinking /usr/groups/netsem/ocaml to /usr/groups/netsem/ocaml-3.08. 12 | 13 | Once OCaml is installed, we need to also make copies of various bits of the 14 | build tree for later use, so copy the otherlibs, config and byterun 15 | directories from the build directory into /usr/groups/netsem/ocaml-3.08. 16 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd/in_systm.h.patch: -------------------------------------------------------------------------------- 1 | --- in_systm.h.orig Wed Nov 30 16:43:22 2005 2 | +++ in_systm.h Wed Nov 30 16:46:34 2005 3 | @@ -53,6 +53,7 @@ typedef u_int32_t n_time; /* ms since 0 4 | 5 | #ifdef _KERNEL 6 | n_time iptime(void); 7 | +void iptime_usec __P((struct timeval*)); 8 | #endif 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd/ip_icmp.c.patch: -------------------------------------------------------------------------------- 1 | --- ip_icmp.c.orig Wed Nov 30 17:01:25 2005 2 | +++ ip_icmp.c Thu Dec 1 09:47:40 2005 3 | @@ -782,6 +782,13 @@ iptime() 4 | return (htonl(t)); 5 | } 6 | 7 | +void 8 | +iptime_usec(atv) 9 | + struct timeval *atv; 10 | +{ 11 | + microtime(atv); 12 | +} 13 | + 14 | /* 15 | * Return the next larger or smaller MTU plateau (table from RFC 1191) 16 | * given current value MTU. If DIR is less than zero, a larger plateau 17 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd/ntpd.patch: -------------------------------------------------------------------------------- 1 | --- /etc/rc.d/ntpd.orig Thu Dec 1 12:37:04 2005 2 | +++ /etc/rc.d/ntpd Thu Dec 1 14:34:12 2005 3 | @@ -12,6 +12,7 @@ 4 | . /etc/rc.subr 5 | 6 | name=ntpd 7 | +command_args="-g" 8 | rcvar=`set_rcvar` 9 | command="/usr/sbin/${name}" 10 | pidfile="/var/run/${name}.pid" 11 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd/patches.tex: -------------------------------------------------------------------------------- 1 | \section{BSD Patches} 2 | 3 | The following patches need to be applied to BSD v. 6.0 4 | 5 | \begin{verb} 6 | in_systm.h.patch 7 | ip_icmp.c.patch 8 | ntpd.patch 9 | rc.conf.patch 10 | routing.patch 11 | tcp_debug.c.patch 12 | tcp_debug.h.patch 13 | end{verb} 14 | 15 | \verb!tcp_debug.h.patch! also needs to be applied to \verb!/usr/include/netinet/tcp_debug.h! 16 | 17 | Patches were (mostly) generated with 18 | 19 | \begin{verb} 20 | diff -urNp /absolute/path/to/file.orig /absolute/path/to/file 21 | \end{verb} 22 | 23 | Patches can be applied with 24 | 25 | \begin{verb} 26 | patch /absolute/path/to/file file.patch 27 | \end{verb} 28 | 29 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd/rc.conf.patch: -------------------------------------------------------------------------------- 1 | --- /etc/rc.conf.orig Thu Dec 1 12:35:22 2005 2 | +++ /etc/rc.conf Thu Dec 1 12:36:37 2005 3 | @@ -12,3 +12,7 @@ sshd_enable="YES" 4 | # -- sysinstall generated deltas -- # Tue Nov 8 14:49:01 2005 5 | ifconfig_xl0="inet 192.168.13.102 netmask 255.255.255.0" 6 | hostname="ken.netsem2" 7 | + 8 | +# added by tjr22 to enable ntpd 9 | +ntpd_enable="YES" 10 | + 11 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd/routing.patch: -------------------------------------------------------------------------------- 1 | --- /etc/rc.d/routing.orig Thu Dec 1 12:27:28 2005 2 | +++ /etc/rc.d/routing Thu Dec 1 12:28:41 2005 3 | @@ -158,6 +158,9 @@ options_start() 4 | ;; 5 | esac 6 | 7 | +# added by tjr 2005-12-01, psyche.netsem2 arp info 8 | +arp -s 192.168.13.199 12:34:56:df:84:f4 9 | + 10 | echo '.' 11 | } 12 | 13 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd/tcp_debug.c.patch: -------------------------------------------------------------------------------- 1 | *** tcp_debug.c Tue Feb 4 11:05:30 2003 2 | --- tcp_debug.c Tue Feb 4 11:19:28 2003 3 | *************** 4 | *** 104,110 **** 5 | AF_INET; 6 | if (tcp_debx == TCP_NDEBUG) 7 | tcp_debx = 0; 8 | ! td->td_time = iptime(); 9 | td->td_act = act; 10 | td->td_ostate = ostate; 11 | td->td_tcb = (caddr_t)tp; 12 | --- 104,111 ---- 13 | AF_INET; 14 | if (tcp_debx == TCP_NDEBUG) 15 | tcp_debx = 0; 16 | ! /*td->td_time = iptime(); */ 17 | ! iptime_usec(&(td->td_time)); 18 | td->td_act = act; 19 | td->td_ostate = ostate; 20 | td->td_tcb = (caddr_t)tp; 21 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/bsd/tcp_debug.h.patch: -------------------------------------------------------------------------------- 1 | *** tcp_debug.h Tue Feb 4 11:05:23 2003 2 | --- tcp_debug.h Tue Feb 4 11:09:13 2003 3 | *************** 4 | *** 38,44 **** 5 | #define _NETINET_TCP_DEBUG_H_ 6 | 7 | struct tcp_debug { 8 | ! n_time td_time; 9 | short td_act; 10 | short td_ostate; 11 | caddr_t td_tcb; 12 | --- 38,44 ---- 13 | #define _NETINET_TCP_DEBUG_H_ 14 | 15 | struct tcp_debug { 16 | ! struct timeval td_time; 17 | short td_act; 18 | short td_ostate; 19 | caddr_t td_tcb; 20 | -------------------------------------------------------------------------------- /test/notes/netsem2-network-info/hosts: -------------------------------------------------------------------------------- 1 | ::1 localhost.netsem2 localhost 2 | 127.0.0.1 localhost.netsem2 localhost 3 | 4 | 192.168.13.101 alf.netsem2 alf 5 | 192.168.13.102 ken.netsem2 ken 6 | 192.168.13.103 jan.netsem2 jan 7 | 192.168.13.104 ada.netsem2 ada 8 | 192.168.13.105 dag.netsem2 dag 9 | 192.168.13.106 tom.netsem2 tom 10 | 11 | 192.168.13.199 psyche.netsem2 psyche 12 | 192.168.13.200 fornix.cl.cam.ac.uk fornix 13 | 192.168.13.201 zonule.cl.cam.ac.uk zonule 14 | -------------------------------------------------------------------------------- /test/notes/nonfake-traces.txt: -------------------------------------------------------------------------------- 1 | Here's how to get a list of test descriptions for all the traces in the 2 | current directory which contain a trace of the auxiliary host as well. As of 3 | writing (24/4/06), it looks like all of the traces for which an .aux file 4 | exists are "genuine", ie. don't make use of the injector. This isn't 5 | guaranteed in general; one can check by greeping for the existence of the 6 | strings "Injector: not running" and "Injector: running on" in the trace files 7 | in question. 8 | 9 | head -n 2 `echo *.aux | sed d -e 's/\.aux//g'` | sed -ne '/Description/ p' 10 | -------------------------------------------------------------------------------- /test/notes/sudoers: -------------------------------------------------------------------------------- 1 | Update written by SMB 2004-09-17 (from memory): 2 | 3 | If we ever need to run the slurper or any libpcap based application on 4 | a Computer Lab managed machine, then this can be achieved by having 5 | something similar to the following in the sudoers file: it allows 6 | applications to run with CAPABILITY_NET_ADMIN, a Linux network 7 | administration capability that includes network sniffing 8 | permissions. We thus don't have to have root privs! 9 | 10 | ----- 11 | 12 | # sudoers file. 13 | # 14 | # This file MUST be edited with the 'visudo' command as root. 15 | # 16 | # See the man page for details on how to write a sudoers file. 17 | # 18 | 19 | # Host alias specification 20 | 21 | # User alias specification 22 | 23 | # Cmnd alias specification 24 | 25 | # User privilege specification 26 | root ALL=(ALL) ALL 27 | smb50 ALL=/sbin/execcap cap_net_admin=eip [!-]* 28 | smb50 ALL=/sbin/execcap cap_net_admin=eip /usr/sbin/tcpdump 29 | -------------------------------------------------------------------------------- /test/nssock/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CCOPTS=-c -Wall -DNDEBUG -fPIC 3 | MKDEP=$(CC) -M 4 | MKLIB=ar 5 | MKLIBOPTS=-q 6 | 7 | OFILES=ns_aux.o ns_errors.o ns_sockets.o 8 | LIBOUT=libnssock.a 9 | 10 | all: libnssock.a 11 | 12 | libnssock.a: $(OFILES) 13 | $(MKLIB) $(MKLIBOPTS) $(LIBOUT) $(OFILES) 14 | 15 | depend: 16 | $(MKDEP) *.c > .depend 17 | 18 | clean: 19 | rm -f *.[oa] 20 | 21 | realclean: clean 22 | rm -f .depend 23 | 24 | .SUFFIXES: .c .o 25 | 26 | .c.o: 27 | $(CC) $(CCOPTS) $< 28 | 29 | -include .depend 30 | -------------------------------------------------------------------------------- /test/nssock/Makefile.win: -------------------------------------------------------------------------------- 1 | CCOPTS=/O2 /Ob1 /Oy /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_CONSOLE" \ 2 | /GF /FD /EHsc /ML /GS /Gy /W4 /nologo /c /Wp64 /Zi /TC 3 | 4 | MKLIB=lib 5 | MKLIBOPTS=/NOLOGO /NODEFAULTLIB 6 | REQLIBS=WS2_32.lib 7 | 8 | RM=del /Q /F 9 | 10 | CFILES=ns_aux.c ns_errors.c ns_sockets.c tsctime/TSCtime.c 11 | 12 | all: libnssock.lib 13 | 14 | libnssock.lib: $(CFILES:.c=.obj) 15 | $(MKLIB) $(MKLIBOPTS) /OUT:$@ $(CFILES:.c=.obj) $(REQLIBS) /NODEFAULTLIB 16 | 17 | tsctime/TSCtime.obj: tsctime/TSCtime.c 18 | $(CC) $(CCOPTS) /Fotsctime/TSCtime.obj $(CCINCL) tsctime/TSCtime.c 19 | 20 | clean: 21 | $(RM) *.obj *.lib *.idb 22 | 23 | .SUFFIXES: .c .obj 24 | .c.obj: 25 | $(CC) $(CCOPTS) $(CCINCL) $< 26 | 27 | -------------------------------------------------------------------------------- /test/nssock/conv: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | 3 | print(" switch(errno) {\n"); 4 | while(<>) { 5 | if(/#define\s+(E[A-Z0-9_]+)\s+([0-9]+)/) { 6 | print " case $2:\n sprintf(str, \"$1\");\n break;\n" 7 | } 8 | } 9 | print(" }"); 10 | -------------------------------------------------------------------------------- /test/nssock/ns_sockets_int.h: -------------------------------------------------------------------------------- 1 | #ifndef ns_sockets_int_h 2 | #define ns_sockets_int_h 3 | 4 | extern char *geterrmsg(char *dest, int errcode); 5 | 6 | #if defined(SO_ACCEPTCON) && !defined(SO_ACCEPTCONN) 7 | #define SO_ACCEPTCONN SO_ACCEPTCON 8 | #endif 9 | 10 | #ifndef WIN32 11 | extern int min(int a, int b); 12 | #endif 13 | 14 | extern int delimit_print(char *dest, unsigned int destsize, 15 | const unsigned char *buf, size_t len); 16 | extern void print(char *str); 17 | extern int calc_iovec_len(struct iovec *vec, size_t iovlen); 18 | extern void iovec_print(char *buf, unsigned int buflen, 19 | struct iovec *vec, size_t iovlen); 20 | extern void iovec_printtail(char *buf, unsigned int buflen, 21 | struct iovec *vec, size_t iovlen, 22 | unsigned int start); 23 | extern char *ns_getcurrenttime_first(char *dest, int size); 24 | extern char *ns_getcurrenttime_last(char *dest, int size); 25 | 26 | #endif 27 | -------------------------------------------------------------------------------- /test/nssock/tsctime/Makefile.win: -------------------------------------------------------------------------------- 1 | # Sample Windows makefile for TSCtime. 2 | # 3 | # $Id: Makefile.win,v 1.1 2003/09/25 17:07:23 kw217 Exp $ 4 | # 5 | # Use nmake /f Makefile.win to build. 6 | 7 | CCOPTS=/O2 /Ob1 /Oy /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_CONSOLE" \ 8 | /GF /FD /EHsc /ML /GS /Gy /W4 /nologo /c /Wp64 /Zi /TC 9 | LINK=link.exe 10 | LDFLAGS=/NOLOGO /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /MACHINE:IX86 \ 11 | kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \ 12 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 13 | 14 | RM=del /Q /F 15 | 16 | CFILES=TSCtime_example.c TSCtime.c 17 | 18 | all: TSCtime.obj TSCtime_example.c 19 | 20 | clean: 21 | $(RM) *.obj TSCtime.obj 22 | 23 | TSCtime_example.exe: TSCtime_example.obj TSCtime.obj 24 | $(LINK) TSCtime_example.obj TSCtime.obj $(LDFLAGS) /OUT:TSCtime_example.exe 25 | 26 | .SUFFIXES: .c .obj 27 | .c.obj: 28 | $(CC) $(CCOPTS) $< 29 | 30 | -------------------------------------------------------------------------------- /test/nssock/tsctime/TSCtime_example.c: -------------------------------------------------------------------------------- 1 | // main.cpp : Defines the entry point for the console application. 2 | // 3 | 4 | // An example of the use of TSCtime. 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | #include "TSCtime.h" 12 | 13 | int _tmain(int argc, _TCHAR* argv[]) 14 | { 15 | const DWORD trialmsec = 10000; 16 | 17 | printf("Gidday, planet!\n"); 18 | 19 | // recalibrate 20 | recalibrate(); 21 | 22 | // get start time 23 | ULONGLONG then = gethectonanotime_last(); 24 | 25 | // get later times 26 | Sleep(trialmsec); 27 | ULONGLONG now = gethectonanotime_first(); 28 | 29 | ULONGLONG delta = now - then; 30 | printf("Time delta was %I64u.%07I64usec.\n", 31 | delta/10000000uI64,delta%10000000uI64); 32 | printf("Time since epoch is %I64u.%07I64usec\n",now/10000000uI64,now%10000000uI64); 33 | 34 | printf("BTW, then was %I64u.%07I64usec after the base time.\n",(then-basest)/1000000uI64,(then-basest)%10000000uI64); 35 | 36 | _getch(); 37 | return 0; 38 | } 39 | 40 | 41 | -------------------------------------------------------------------------------- /test/nssock/winconv: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | 3 | print(" switch(errno) {\n"); 4 | while(<>) { 5 | if(/#define\s+([A-Z0-9_]+)\s+/) { 6 | print " case $1:\n sprintf(str, \"$1\");\n break;\n" 7 | } 8 | } 9 | print(" }"); 10 | -------------------------------------------------------------------------------- /test/ocamlext/platform.mli: -------------------------------------------------------------------------------- 1 | 2 | type platform = 3 | WIN32 4 | | LINUX 5 | | BSD 6 | | UNKNOWN;; 7 | 8 | val check_platform: unit -> platform 9 | val gethostname: unit -> string 10 | val gettimeofday: unit -> string 11 | val getdecenttimeofday: unit -> int64 12 | 13 | val getpty: unit -> Unix.file_descr * Unix.file_descr 14 | 15 | (* Binding of POSIX threads pthread_cond_timedwait 16 | (absolute deadline, time since epoch) *) 17 | val condition_abs_timedwait: Condition.t -> Mutex.t -> float -> unit 18 | 19 | (* Alternate binding of POSIX threads pthread_cond_timedwait 20 | (relative deadline, time to wait) *) 21 | val condition_rel_timedwait: Condition.t -> Mutex.t -> float -> unit 22 | 23 | val win32_terminate_process: int -> int -> unit 24 | 25 | val win32_in_channel_of_descr: Unix.file_descr -> int * in_channel 26 | 27 | val win32_free_open_handle: int -> unit -------------------------------------------------------------------------------- /test/ocamlext/rawsock.ml: -------------------------------------------------------------------------------- 1 | open Unix;; 2 | 3 | external raw_socket: socket_domain -> int -> file_descr = "raw_socket" 4 | 5 | external raw_sockopt_hdrincl: file_descr -> unit = "raw_sockopt_hdrincl" 6 | 7 | external raw_sendto: file_descr -> string -> string -> unit = "raw_sendto" 8 | -------------------------------------------------------------------------------- /test/ocamlext/rawsock.mli: -------------------------------------------------------------------------------- 1 | open Unix;; 2 | 3 | val raw_socket: socket_domain -> int -> file_descr 4 | 5 | val raw_sockopt_hdrincl: file_descr -> unit 6 | 7 | val raw_sendto: file_descr -> string -> string (*ip addr*) -> unit 8 | -------------------------------------------------------------------------------- /test/ocamlhack/README: -------------------------------------------------------------------------------- 1 | THIS DIRECTORY IS DEPRECATED!! 2 | 3 | This is a copy of OCAML's Unix library hacked to support RAW 4 | sockets. It is the original proof of concept (created by SMB). Do not 5 | use in a live environment -- use the RAW socket extensions in 6 | Net/TCP/Test/ocamlext 7 | 8 | 9 | -------------------------------------------------------------------------------- /test/ocamlhack/unixLabels.ml: -------------------------------------------------------------------------------- 1 | (***********************************************************************) 2 | (* *) 3 | (* Objective Caml *) 4 | (* *) 5 | (* Jacques Garrigue, Kyoto University RIMS *) 6 | (* *) 7 | (* Copyright 2001 Institut National de Recherche en Informatique et *) 8 | (* en Automatique. All rights reserved. This file is distributed *) 9 | (* under the terms of the GNU Library General Public License, with *) 10 | (* the special exception on linking described in file ../../LICENSE. *) 11 | (* *) 12 | (***********************************************************************) 13 | 14 | (* $Id: unixLabels.ml,v 1.1 2002/08/02 14:15:19 smb50 Exp $ *) 15 | 16 | (* Module [UnixLabels]: labelled Unix module *) 17 | 18 | include Unix 19 | -------------------------------------------------------------------------------- /test/ocamllib/README: -------------------------------------------------------------------------------- 1 | Notes on ocaml interface to nssock: 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | 4 | ######### 5 | TODO: 6 | - getsockerr() --> how should the errors be raised? 7 | 8 | IMPROVEMENTS: 9 | - how should our exception handling work? 10 | ######### 11 | 12 | * type `ip` is currently an abstract type ==> will actually be whatever the native code defines it as, but this doesn't matter in the ocaml world. 13 | 14 | * need to be careful with option types (especially the returning of from the native code). There is a very subtle difference between the representation of a value containing something of type 'a and a value containing something of type 'a option. 15 | - in theory it is possible to get the return value wrong in the native interface and for things to break in bad ways 16 | 17 | * some socket calls are actually ocaml wrappers that do some munging before a call to a private native call (i.e., private = a native call not exported in the libraries interface) 18 | 19 | - uses a copy of Xavier's unix and windows error handling code (to raise exceptions via callbacks from C to ocaml) 20 | 21 | -------------------------------------------------------------------------------- /test/ocamllib/camlsupport.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | CAMLprim value copy_string_len(char const *s, int len) 9 | { 10 | CAMLparam0(); 11 | CAMLlocal1(res); 12 | 13 | res = alloc_string(len); 14 | memmove(String_val(res), s, len); 15 | CAMLreturn(res); 16 | } 17 | -------------------------------------------------------------------------------- /test/ocamllib/camlsupport.h: -------------------------------------------------------------------------------- 1 | #ifndef CAMLSUPPORT_H 2 | #define CAMLSUPPORT_H 3 | 4 | extern CAMLprim value copy_string_len(char const *s, int len); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /test/ocamllib/cst2constr.h: -------------------------------------------------------------------------------- 1 | /***********************************************************************/ 2 | /* */ 3 | /* Objective Caml */ 4 | /* */ 5 | /* Xavier Leroy, projet Cristal, INRIA Rocquencourt */ 6 | /* */ 7 | /* Copyright 1996 Institut National de Recherche en Informatique et */ 8 | /* en Automatique. All rights reserved. This file is distributed */ 9 | /* under the terms of the GNU Library General Public License, with */ 10 | /* the special exception on linking described in file ../../LICENSE. */ 11 | /* */ 12 | /***********************************************************************/ 13 | 14 | /* $Id: cst2constr.h,v 1.2 2002/09/25 11:23:22 smb50 Exp $ */ 15 | 16 | #ifdef __STDC__ 17 | value cst_to_constr(int n, int *tbl, int size); 18 | #else 19 | value cst_to_constr(); 20 | #endif 21 | -------------------------------------------------------------------------------- /test/ocamllib/prnsupport.h: -------------------------------------------------------------------------------- 1 | #ifndef PRN_SUPPORT_H 2 | #define PRN_SUPPORT_H 3 | 4 | extern char *delimit_str(char *dest, unsigned int destsize, 5 | const unsigned char *buf, size_t len); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /test/scripts/bsd-script: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | OCAMLPATH=/usr/groups/netsem/ocaml/bin 4 | 5 | export -p PATH=$OCAMLPATH:$PATH 6 | export -p OCAMLPATH=$OCAMLPATH 7 | 8 | # Build 9 | cd /home/Net/TCP/Test 10 | if ! make "$@" >build-log 2>&1; then 11 | exit 1 12 | fi 13 | 14 | # BSD custom component build 15 | cd /home/Net/TCP/Test/utils/holtcpcb-v8 16 | if ! make realclean depend all >>../../build-log 2>&1; then 17 | exit 1 18 | fi 19 | 20 | cd /home/Net/TCP/Test 21 | 22 | # Set permission correctly on executables 23 | chown root:wheel utils/holtcpcb-v8/holtcpcb-v8 24 | chmod +s utils/holtcpcb-v8/holtcpcb-v8 25 | chown root:wheel slurp/slurp 26 | chmod +s slurp/slurp 27 | chown root:wheel injector/injector 28 | chmod +s injector/injector 29 | chown root:wheel libd/libd 30 | chmod +s libd/libd 31 | -------------------------------------------------------------------------------- /test/scripts/build/dobuild: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . `dirname $0`/waprc 4 | 5 | umask 007 6 | exec $HOLDIR/bin/build -symlink -expk 7 | -------------------------------------------------------------------------------- /test/scripts/build/doconfig: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . `dirname $0`/waprc 4 | 5 | umask 007 6 | cd $HOLDIR 7 | exec mosml < $HOLDIR/tools/smart-configure.sml 8 | -------------------------------------------------------------------------------- /test/scripts/build/fixperms: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . `dirname $0`/waprc 4 | 5 | for f in "$HOLSRC" "$HOLLOC" "$HOLDIR" "$WAPSRC" "$WAPLOC" "$WAPDIR" ; do 6 | chgrp -R netsem "$f" 7 | chmod -R ug=rwX,o-rwx "$f" 8 | find "$f" -type d -print0 | xargs -0 chmod g+s 9 | done 10 | -------------------------------------------------------------------------------- /test/scripts/build/relinkhol98: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . `dirname $0`/waprc 4 | 5 | export HOLLOC 6 | export HOLDIR 7 | 8 | umask 007 9 | mkdir -p $HOLDIR 10 | cd $HOLDIR 11 | lndir $HOLSRC 12 | find $HOLLOC -type f -print | perl -pe 's/\Q$ENV{HOLLOC}\E/$ENV{HOLDIR}/' | xargs rm -f __rm_food 13 | lndir $HOLLOC 14 | find . -follow -printf '' 2>&1 | cut -c 7- | cut -d: -f1 | xargs rm -f __rm_food 15 | -------------------------------------------------------------------------------- /test/scripts/build/relinkwap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | . `dirname $0`/waprc 4 | 5 | umask 007 6 | mkdir -p $WAPDIR 7 | mkdir -p $WAPLOC 8 | cd $WAPDIR 9 | lndir $WAPSRC 10 | #find $WAPLOC -type f -print | perl -pe 's/\Q$ENV{WAPLOC}\E/$ENV{WAPDIR}/' | xargs rm -f __rm_food 11 | find $WAPLOC -type f -print | sed -s "s#${WAPLOC}#${WAPDIR}#" | xargs rm -f __rm_food 12 | lndir $WAPLOC 13 | find . -follow -printf '' 2>&1 | cut -c 7- | cut -d: -f1 | xargs rm -f __rm_food 14 | -------------------------------------------------------------------------------- /test/scripts/build/updatehol: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | umask 002 6 | 7 | . `dirname $0`/waprc 8 | 9 | pushd . 10 | if [ -d $HOLSRC ]; then 11 | cd $HOLSRC 12 | cvs update -APd 13 | else 14 | echo "hol98 tree at $HOLSRC not found; checking out again from SourceForge..." 15 | sleep 5 16 | cd `dirname $HOLSRC` 17 | cvs -d :pserver:anonymous@hol.cvs.sourceforge.net:/cvsroot/hol co -d `basename $HOLSRC` hol98 18 | fi 19 | popd 20 | 21 | cd `dirname $0` 22 | 23 | ./relinkhol98 24 | ./doconfig 25 | ./dobuild 26 | 27 | -------------------------------------------------------------------------------- /test/scripts/build/updatewap: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | umask 007 6 | 7 | . `dirname $0`/waprc 8 | 9 | echo '' 10 | echo "Updating in $WAPSRC:" 11 | echo '' 12 | 13 | (cd $WAPSRC 14 | cvs update -APd) 15 | 16 | cd `dirname $0` 17 | 18 | echo '' 19 | echo "About to blow away build tree $WAPDIR/, Ctrl-C to cancel (5 seconds):" 20 | echo '' 21 | sleep 5 22 | 23 | echo '' 24 | echo "Blowing away build tree $WAPDIR:" 25 | echo '' 26 | sleep 2 27 | 28 | rm -rf $WAPDIR 29 | 30 | echo '' 31 | echo "Relinking in $WAPDIR:" 32 | echo '' 33 | 34 | ./relinkwap 35 | 36 | echo '' 37 | echo "About to Holmake clean in $WAPDIR/TCP/Spec1, Ctrl-C to cancel (5 seconds):" 38 | echo '' 39 | sleep 5 40 | 41 | cd $WAPDIR/TCP/Spec1 42 | 43 | echo '' 44 | echo "Making clean in $WAPDIR/TCP/Spec1:" 45 | echo '' 46 | sleep 2 47 | 48 | rm -rf .HOLMK 49 | $HOLDIR/bin/Holmake clean 50 | 51 | echo '' 52 | echo "Cleaned." 53 | echo "Rebuilding in $WAPDIR/TCP/Spec1:" 54 | echo '' 55 | 56 | $HOLDIR/bin/Holmake --fast 57 | 58 | cd $WAPDIR/TCP/Test 59 | make clean depend 60 | make all 61 | 62 | -------------------------------------------------------------------------------- /test/scripts/build/updatewap-noclean: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | 5 | umask 007 6 | 7 | . `dirname $0`/waprc 8 | 9 | echo '' 10 | echo "Updating in $WAPSRC:" 11 | echo '' 12 | 13 | (cd $WAPSRC 14 | cvs update -APd) 15 | 16 | cd `dirname $0` 17 | 18 | echo '' 19 | echo "Relinking in $WAPDIR:" 20 | echo '' 21 | 22 | ./relinkwap 23 | 24 | echo '' 25 | echo "Rebuilding in $WAPDIR:" 26 | echo '' 27 | 28 | cd $WAPDIR/TCP/Spec1 29 | $HOLDIR/bin/Holmake --fast 30 | 31 | cd $WAPDIR/TCP/Test 32 | make clean depend 33 | make all 34 | 35 | -------------------------------------------------------------------------------- /test/scripts/build/waprc.tpl: -------------------------------------------------------------------------------- 1 | # machine-specific configuration file for WAP building tools 2 | 3 | HOLSRC=/local/scratch/kw217/hol98-src 4 | HOLLOC=/local/scratch/kw217/hol98-local 5 | HOLDIR=/local/scratch/kw217/hol98 6 | 7 | WAPSRC=/homes/kw217/WAP/Net 8 | WAPLOC=/local/scratch/kw217/WAP-local 9 | WAPDIR=/local/scratch/kw217/WAP/Net 10 | 11 | -------------------------------------------------------------------------------- /test/scripts/check/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/test/scripts/check/README -------------------------------------------------------------------------------- /test/scripts/check/appendtrailer: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # append trailer to output of trace checker when checking is aborted 4 | 5 | if [ $# -ne 3 ] ; then 6 | echo "$0 expects to find outdir, trace filename, and reason for abort on command line." 7 | exit 255 8 | fi 9 | 10 | OUTDIR=$1 11 | TRACE="`basename $2`" 12 | REASON=$3 13 | OUTFILE="$OUTDIR/$TRACE.out.html" 14 | echo "" >> $OUTFILE 15 | echo "==Trace $TRACE $REASON" >>$OUTFILE 16 | cat <<'EOF' >>$OUTFILE 17 | 18 | 24 | 25 | 26 | 27 | 28 | EOF 29 | -------------------------------------------------------------------------------- /test/scripts/check/blob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/test/scripts/check/blob.png -------------------------------------------------------------------------------- /test/scripts/check/compress-results: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | for d in $@; do 4 | cd $d 5 | if ! gzip -q --best *; then 6 | cd - 7 | echo "FAILED in $d" 8 | exit 1 9 | fi 10 | cd - 11 | done 12 | 13 | -------------------------------------------------------------------------------- /test/scripts/check/coverage: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # this counts the number of times each rule is used in a successful trace 4 | # 5 | # usage: execute in a check directory; rule coverage data appears on stdout 6 | # 7 | # eg ~/Net/TCP/Test/scripts/check/coverage > coverage.dat 8 | 9 | BINDIR=`dirname $0` 10 | 11 | cat ~/Net/TCP/Spec1/TCP1_ruleids.imn |grep accept | sed -e 's/ /\n/g' | sort > /tmp/coverage.ruleids.$$ 12 | 13 | grep "TRANSITION" *.out.html | sed -e 's/ SID / /g' | cut -d' ' -f9 > /tmp/coverage.ruleusage.$$ 14 | 15 | $BINDIR/coveragecount -rules /tmp/coverage.ruleids.$$ -usage /tmp/coverage.ruleusage.$$ 16 | 17 | -------------------------------------------------------------------------------- /test/scripts/check/dop: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TRACE="$1" 4 | BTRACE=`basename $TRACE` 5 | 6 | echo "Processing $BTRACE ($TRACE)..." 7 | 8 | # cd /usr/groups/tthee/local/Net-alt/TCP/Spec1 9 | 10 | mv $BTRACE.out.html $BTRACE.out.html-OLD-$$ 2> /dev/null 11 | mv $BTRACE.out.html.size-log $BTRACE.out.html.size-log-OLD-$$ 2> /dev/null 12 | 13 | ./CheckTraces.exe --timing $TRACE < /dev/null >> dop-log.$$ 2>&1 & 14 | 15 | ../Test/scripts/check/logpauses $BTRACE.out.html < /dev/null >> dop-log.$$ 2>&1 & 16 | 17 | ps auxwww | grep $USER 18 | 19 | -------------------------------------------------------------------------------- /test/scripts/check/drivehshole: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | my $sourcehost = shift; 6 | 7 | my $targethost = 'localhost'; 8 | my $targetbaseport = 22700; 9 | 10 | die "unrecognised host name format" unless ($sourcehost =~ /^pccl([0-9]{3})\./); 11 | my $targetport = $1 + $targetbaseport; 12 | 13 | print "Trying $targethost:$targetport\n"; 14 | 15 | exec("./hshole",$targethost,$targetport,@ARGV); 16 | die "Couldn't exec: $!\n"; 17 | 18 | -------------------------------------------------------------------------------- /test/scripts/check/dummyclient: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | while true; do 3 | sleep 1; 4 | head -c1 /dev/random | od -b | head -1 | grep -q '3$' 5 | if [ $? -eq 0 ] ; then 6 | echo "Simulating crash before Ready." 7 | exit 11 8 | fi 9 | echo Ready. 10 | read FILE 11 | if [ "$FILE" = "" -o "$FILE" = "quit" ]; then 12 | echo Bye. 13 | exit 0 14 | fi 15 | echo Processing $FILE... 16 | sleep 2 17 | head -c1 /dev/random | od -b | head -1 | grep -q '3$' 18 | if [ $? -eq 0 ] ; then 19 | echo "Simulating crash during processing." 20 | exit 22 21 | fi 22 | done 23 | -------------------------------------------------------------------------------- /test/scripts/check/every_n: -------------------------------------------------------------------------------- 1 | #! /bin/bash 2 | 3 | set -e 4 | umask 0007 5 | 6 | if [ $# -lt 3 ] ; then 7 | echo "Usage: $0 n directory [output]" 8 | echo " n - the interleave parameter (every nth trace first)" 9 | echo " directory - the directory containing the trace files" 10 | echo " output - output filename (default: runselection.conf)" 11 | exit 255 12 | fi 13 | 14 | N=$1 15 | INDIR=$2 16 | TRACES="$INDIR/trace????" 17 | 18 | RUNBATCHCONF=runbatch.conf 19 | 20 | if [[ $3 != "" ]]; then 21 | OUTPUT=$3 22 | else 23 | OUTPUT=runselection.conf 24 | fi 25 | 26 | #-=-=-=-=-=-=-=- 27 | 28 | index=0 29 | declare -a names 30 | 31 | for f in $TRACES; do 32 | names[$index]=$f; 33 | index=$(($index + 1)) 34 | done 35 | 36 | TRACES="" 37 | 38 | for(( i=0 ; $i<$N ; i=$i+1 )); do 39 | for(( index2=0+$i ; $index2<$index; index2=$index2+$N )); do 40 | TRACES="$TRACES ${names[$index2]}" 41 | done 42 | done 43 | 44 | cp -f $RUNBATCHCONF $OUTPUT 45 | echo $T 46 | echo "" >> $OUTPUT 47 | echo TRACES=\"$TRACES\" >> $OUTPUT 48 | -------------------------------------------------------------------------------- /test/scripts/check/hasphantom: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # return true if the input contains a phantom segment, i.e., one with -SYN,-ACK,-RST 4 | # WARNING: probably fragile! 5 | 6 | use strict; 7 | 8 | my $mergeindex; 9 | while (<>) { 10 | $mergeindex = $_ if /Merge Index/; 11 | next unless /Lh_senddatagram\(TCP/; 12 | my $st = 0; 13 | my $fin = ""; 14 | while (<>) { 15 | last if /^\s+\|>\)/; 16 | $st++ if (/ACK\s*:=\s*F;/); 17 | $st++ if (/SYN\s*:=\s*F;/); 18 | $st++ if (/RST\s*:=\s*F;/); 19 | $fin = $_ if (/FIN/); 20 | } 21 | if ($st == 3) { 22 | print $mergeindex; 23 | print $fin; 24 | exit 0; # TRUE 25 | } 26 | } 27 | exit 1; # FALSE 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /test/scripts/check/histoplot-test-data.txt: -------------------------------------------------------------------------------- 1 | 123 2 | 323 3 | 4343 4 | 343 5 | 222 6 | 233 7 | 4342 8 | 21 9 | 1 10 | 093 11 | 4324 12 | 32 13 | 4444 14 | 394 15 | 3495 16 | 3496 17 | 1022 -------------------------------------------------------------------------------- /test/scripts/check/inuse-test: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | echo $0 $@ 4 | echo -n "Enter return code and press ENTER (0 for in use, 1 for not in use)..." 5 | read EXIT 6 | echo "OK, exiting." 7 | exit $EXIT 8 | 9 | -------------------------------------------------------------------------------- /test/scripts/check/kill-all-checkers: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # Kill all CheckTraces.exe on donated machine. Must be run as user who 4 | # started the check run, or root. 5 | 6 | # Default signal is -9; can be changed by giving a signal on command 7 | # line. 8 | 9 | SIGNAL=${1:--9} 10 | 11 | INUSE_CONF_DIR=/usr/groups/tthee/conf 12 | INUSE_MPHIL_MACH="`hosts mphil`" 13 | 14 | MACHINES="" 15 | 16 | echo "Getting list of donated machines" 17 | 18 | # Get the list of donated machines 19 | cd $INUSE_CONF_DIR 20 | for f in *; do 21 | if /usr/bin/ssh $f "echo -n" >/dev/null; then 22 | MACHINES="${MACHINES} $f" 23 | fi 24 | done 25 | cd - 26 | 27 | # Donated machines + mphil machines 28 | ALL_MACHINES="`echo $MACHINES $INUSE_MPHIL_MACH | sed "s/[\t' ']*//"`" 29 | 30 | # ---------------------------------------------------------------------- 31 | 32 | for f in $ALL_MACHINES; do 33 | echo -n "Killing $f with $SIGNAL..." 34 | ssh $f "killall $SIGNAL CheckTraces.exe" 35 | echo "Done" 36 | done; -------------------------------------------------------------------------------- /test/scripts/check/logpauses: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # typ: $0 trace0439.out.html 4 | 5 | while true; do 6 | stat -c %s $1 >> $1.size-log 7 | sleep 10 8 | done 9 | -------------------------------------------------------------------------------- /test/scripts/check/machines-udp.conf: -------------------------------------------------------------------------------- 1 | # ------------------------------------------------------------ 2 | # This file is auto-generated by genmachines. DO NOT EDIT!!! 3 | # ------------------------------------------------------------ 4 | # Scanned machines: 5 | # striatum.cl.cam.ac.uk: 4 cpus, 2392Mhz, 2063892KB memory 6 | 7 | # ------------------------------------------------------------ 8 | # Set the machines to be used 9 | # NB: machines with less that 255000KB total memory or with 10 | # processors slower than 600MHz have not been selected. 11 | # ------------------------------------------------------------ 12 | 13 | PTCMACHINES=" -jstriatum.cl.cam.ac.uk:4=/usr/groups/tthee/local/Net/TCP/Test/scripts/check/inuse2.pl -jstem.cl.cam.ac.uk:2=/usr/groups/tthee/local/Net/TCP/Test/scripts/check/inuse2.pl" 14 | 15 | # ------------------------------------------------------------ 16 | # END OF AUTOGENERATED FILE 17 | # ------------------------------------------------------------ 18 | -------------------------------------------------------------------------------- /test/scripts/check/ocheck: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | HERE="`dirname $0`" 3 | if ( echo $HERE | grep -v -q '^/' ) ; then 4 | HERE="`pwd`/$HERE" 5 | fi 6 | echo $HERE 7 | 8 | "$HERE/otracechecker" -j1 -jthalamus:1 -jstriatum:1 -jcortex:1 -c "$HERE/dummyclient" \; -y -w3 "$@" 9 | -------------------------------------------------------------------------------- /test/scripts/check/ocheck2: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | `dirname $0`/ocheck /usr/groups/tthee/batch/current/trace00[01]? 3 | -------------------------------------------------------------------------------- /test/scripts/check/perstepcount: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | my $content = ''; 6 | my $n = -1; 7 | 8 | print "# step K1 K1a K3k\n"; 9 | 10 | while (<>) { 11 | if (/^==Step\s+(\S+)/) { 12 | my $nextn = $1; 13 | my @a = ($content =~ m/K1/g); my $a = scalar(@a); 14 | my @b = ($content =~ m/K1a/g); my $b = scalar(@b); 15 | my @c = ($content =~ m/K3k/g); my $c = scalar(@c); 16 | print "$n $a $b $c\n"; 17 | $content = ''; 18 | $n = $nextn; 19 | } else { 20 | $content .= $_; 21 | } 22 | } 23 | 24 | my @a = ($content =~ m/K1/g); my $a = scalar(@a); 25 | my @b = ($content =~ m/K1a/g); my $b = scalar(@b); 26 | my @c = ($content =~ m/K3k/g); my $c = scalar(@c); 27 | print "$n $a $b $c\n"; 28 | -------------------------------------------------------------------------------- /test/scripts/check/perstepcountgraph: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | BINDIR=`dirname $0` 4 | 5 | $BINDIR/perstepcount "$@" > /tmp/perstepcount.$$ 6 | gnuplot -persist < progress.ps 10 | chmod 664 progress.* 11 | sleep 600 12 | done 13 | -------------------------------------------------------------------------------- /test/scripts/check/progressdata-chmod-auto: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # repeatedly patch the permissions for the results of the progressdata script in current check directory 4 | 5 | umask 002 6 | cd /usr/groups/tthee/check/current 7 | while true; do 8 | #echo "regenerating" 9 | chmod 664 progress.* 10 | sleep 600 11 | done 12 | -------------------------------------------------------------------------------- /test/scripts/check/progressdata-fetch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # repeatedly get the progress graph from the current check directory 4 | 5 | 6 | # use wget and ghostview -watch instead of http autoreload to avoid 7 | # firing up multiple ghostviews (could use image embedded in html 8 | # instead) 9 | 10 | # cd /tmp ; ghostview -watch -scale -3 -antialias -spartan -geometry 820x768-0+0 progress.ps & 11 | # 12 | # that doesn't work in the script for reasons that are obscure to me, so just 13 | # cd /tmp 14 | # gg progress.ps 15 | # instead 16 | 17 | while true; do 18 | wget -r -N --http-user=netsem --http-passwd=pepito --output-document /tmp/progress.ps http://www.cl.cam.ac.uk/users/pes20/tthee/check/current/progress.ps 19 | touch /tmp/progress.ps 20 | # wget doesn't seem to leave a decent timestamp for ghostview -watch to pick up on, hence the touch... 21 | # was running wget with -N too 22 | sleep 300 23 | done 24 | -------------------------------------------------------------------------------- /test/scripts/check/run_xmas_lengths_graph.ps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/test/scripts/check/run_xmas_lengths_graph.ps -------------------------------------------------------------------------------- /test/scripts/check/startbatch: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # start a batch file, passing the appropriate config file option to runbatch 4 | 5 | # ensure readable 6 | umask 002 7 | 8 | HERE="`echo $0 | sed -e 's/startbatch$//'`" 9 | CONFFILE=$HERE/runbatch.conf 10 | 11 | function usage () { 12 | echo "Usage: $0" 13 | echo " or: $0 -f conffile" 14 | exit 3 15 | } 16 | 17 | if [ $# -eq 2 ]; then 18 | if [ $1 = '-f' ]; then 19 | CONFFILE=$2 20 | else 21 | usage 22 | fi 23 | else if [ $# -ne 0 ]; then 24 | usage 25 | fi 26 | fi 27 | 28 | if dialog --inputbox "Please enter a reason:" 20 70 2> /tmp/$$.dresult; then 29 | REASON=`cat /tmp/$$.dresult` 30 | rm /tmp/$$.dresult 31 | clear 32 | $HERE/runbatch $CONFFILE "$REASON" < /dev/null > startbatch.errs 2>&1 & 33 | else 34 | clear 35 | echo "Cancelled. No job killed." 36 | fi 37 | 38 | -------------------------------------------------------------------------------- /test/scripts/check/starthsholed: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # starts up the hsholed daemon, along with an ssh tunnel to the right place 4 | # to be run on a CL PWF machine only! 5 | 6 | use strict; 7 | 8 | my $sourcehost = `hostname -f`; 9 | my $sourceport = 20784; 10 | 11 | my $targethost = 'thalamus.cl.cam.ac.uk'; 12 | my $targetbaseport = 22700; 13 | 14 | die "unrecognised host name format" unless ($sourcehost =~ /^pccl([0-9]{3})\./); 15 | my $targetport = $1 + $targetbaseport; 16 | 17 | print "Establishing tunnel from $targethost:$targetport to $sourcehost:$sourceport.\n"; 18 | 19 | system("/usr/bin/ssh -Nf -R $targetport:127.0.0.1:$sourceport $targethost &") != -1 20 | or die "Couldn't start ssh tunnel: $!\n"; 21 | 22 | exec("./hsholed"); 23 | die "Couldn't start hsholed: $!\n"; 24 | 25 | -------------------------------------------------------------------------------- /test/scripts/check/stepgraph: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TITLE=`basename $1` 4 | grep ^==Step "$@" | cut -d' ' -f2 > /tmp/stepgraph.$$ 5 | cat < () 30 | -------------------------------------------------------------------------------- /test/scripts/check/stepgraph_p: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | TITLE=`basename $1` 4 | grep ^==Step "$@" | cut -d' ' -f2 > /tmp/stepgraph.$$ 5 | cat < /tmp/$$.dresult; then 6 | JOB=`cat /tmp/$$.dresult` 7 | if dialog --inputbox "Please enter a reason:" 20 70 2> /tmp/$$.dresult; then 8 | REASON=`cat /tmp/$$.dresult` 9 | clear 10 | MACHINE=`echo $JOB | sed -e 's/^.*@//'` 11 | echo "Killing job $JOB on machine $MACHINE..." 12 | KILLSTRING="Killed by `whoami`@`hostname` on `date`. 13 | $REASON" 14 | echo "$KILLSTRING" | ssh $MACHINE "cat > $FIFODIR/$JOB" 15 | echo "Done. Cleanup operations may take a minute or two to complete." 16 | else 17 | clear 18 | echo "Cancelled. No job killed." 19 | fi 20 | else 21 | clear 22 | echo "Cancelled. No job killed." 23 | fi 24 | rm /tmp/$$.dresult 25 | 26 | -------------------------------------------------------------------------------- /test/scripts/check/trace.css: -------------------------------------------------------------------------------- 1 | DIV.tracehead { font-weight: 700 } 2 | DIV.tracetail { font-weight: 700; 3 | background-color: #ff6060 } 4 | DIV.tracetail PRE { font-weight: 500 } 5 | DIV.newvars PRE { background-color: #c0c0ff; 6 | display: none } 7 | DIV.newcons PRE { background-color: #e0e0ff; 8 | display: none } 9 | SPAN.shvc { color: blue; 10 | text-decoration: underline } 11 | DIV.verhead { background-color: #c0ffc0 } 12 | /* DIV.vertab */ 13 | -------------------------------------------------------------------------------- /test/scripts/check/tracelen: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | # run as "tracelen trace????" in the same directory as the traces. 4 | # Generates a lookup table of trace lengths (well, maximum merge indices). 5 | 6 | use strict; 7 | 8 | open OUT, ">tracelengths.dat" 9 | or die "Couldn't open output file: $!\n"; 10 | 11 | foreach my $tracefile (@ARGV) { 12 | open IN, "<$tracefile" 13 | or die "Couldn't open trace file $tracefile: $!\n"; 14 | my $mergeindex = "-1"; 15 | while () { 16 | next unless /^\(\* Merge Index: (\d+) \*\)/; 17 | $mergeindex = $1; 18 | } 19 | print OUT "$tracefile $mergeindex\n"; 20 | close IN 21 | or die "Couldn't close trace file $tracefile: $!\n"; 22 | } 23 | 24 | close OUT 25 | or die "Couldn't close output file: $!\n"; 26 | 27 | -------------------------------------------------------------------------------- /test/scripts/check/tracetail: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | my $tracewanted = $ARGV[0]; 6 | 7 | open LOG, ") { 14 | next unless /^==(Crashed|Completed|Processing)\s+\S+(\[\d+\])\s+"[^\"]*\/([^\"\/]*)"/; 15 | if ($3 eq $tracewanted) { 16 | if ($1 eq "Processing") { 17 | $startpos = tell(LOG) - length($_); 18 | } else { 19 | $tag = $2; 20 | $endpos = tell(LOG); 21 | last; 22 | } 23 | } 24 | } 25 | 26 | if (defined($tag)) { 27 | seek(LOG,$startpos,0); 28 | while (tell(LOG)<$endpos) { 29 | $_ = ; 30 | print if /\Q$tag\E/; 31 | } 32 | } 33 | 34 | close LOG 35 | or die "Can't close log file: $!\n"; 36 | 37 | -------------------------------------------------------------------------------- /test/scripts/check/wloggraph: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BINDIR=`dirname $0` 4 | 5 | 6 | # wlogs | grep "acute/paper" > /homes/pes20/tmp/wlogs-Netsem 7 | 8 | cat /homes/pes20/tmp/wlogs-all9 | grep -i "Netsem" | grep "poster" | cut -d '[' -f2 | cut -c1-11 > /tmp/wlogs-dates.$$ 9 | 10 | #cat /homes/pes20/tmp/wlogs-all9 | cut -d '[' -f2 | cut -c1-11 > /tmp/wlogs-dates.$$ 11 | 12 | /homes/pes20/Net/TCP/Test/scripts/check/histoplot2 /tmp/wlogs-dates.$$ > /tmp/wlogs-histo.$$ 13 | 14 | 15 | 16 | cat < $f.net 32 | else 33 | $CONFLATEDIR/conflate $f > $f.net 34 | fi 35 | 36 | done 37 | -------------------------------------------------------------------------------- /test/scripts/linux-script: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | OCAMLPATH=/usr/groups/netsem/ocaml/bin 4 | 5 | export -p PATH=$OCAMLPATH:$PATH 6 | export -p OCAMLPATH=$OCAMLPATH 7 | 8 | # Build 9 | cd /home/Net/TCP/Test 10 | if ! make "$@" >build-log 2>&1; then 11 | exit 1 12 | fi 13 | 14 | # Set permission correctly on executables 15 | chown root:wheel slurp/slurp 16 | chmod +s slurp/slurp 17 | chown root:wheel injector/injector 18 | chmod +s injector/injector 19 | chown root:wheel libd/libd 20 | chmod +s libd/libd 21 | 22 | -------------------------------------------------------------------------------- /test/scripts/packagetsc: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | CURDIR=`pwd` 4 | TEST=$CURDIR/.. 5 | TMP1=/tmp/tsc.$$ 6 | DIR=tsctime 7 | TMP=$TMP1/$DIR 8 | mkdir -p $TMP/tsccal 9 | (cd $TEST/utils/tsccal 10 | cp -a COPYRIGHT README TSCcal.cpp Makefile.win $TMP/tsccal/) 11 | 12 | mkdir -p $TMP/tsctime 13 | (cd $TEST/nssock/tsctime 14 | cp -a COPYRIGHT TSCtime.h TSCtime.c TSCtime_example.c Makefile.win $TMP/tsctime/) 15 | 16 | cd $TMP1 17 | rm -f $CURDIR/tsctime.zip 18 | zip -r $CURDIR/tsctime.zip $DIR 19 | 20 | rm -rf $TMP1 21 | -------------------------------------------------------------------------------- /test/scripts/win/win-checkin.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | D: 3 | cd\Net\TCP\Test 4 | "D:\Program Files\GNU\WinCVS 1.2\cvs" -d \\elmer\grp-th1\netsem\cvs ci -m "%*" 5 | -------------------------------------------------------------------------------- /test/scripts/win/win-fresh-build-helper.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | D: 3 | cd\ 4 | 5 | D:\windows\system32\net stop "Netsem TThee CustomRSH" 6 | 7 | rmdir /Q/S Net 8 | 9 | "D:\Program Files\GNU\WinCVS 1.2\cvs" -d \\elmer\grp-th1\netsem\cvs co Net/TCP/Test 10 | 11 | cd\Net\TCP\Test 12 | nmake /f Makefile.win clean 13 | nmake /f Makefile.win all 14 | 15 | D:\windows\system32\net start "Netsem TThee CustomRSH" 16 | 17 | -------------------------------------------------------------------------------- /test/scripts/win/win-fresh-build.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | move /Y D:\Net\TCP\Test\scripts\win\win-fresh-build-helper.bat D:\ 3 | D: 4 | cd\ 5 | win-fresh-build-helper.bat 6 | 7 | -------------------------------------------------------------------------------- /test/scripts/win/win-update-build.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | D: 3 | cd\Net\TCP\Test 4 | "D:\Program Files\GNU\WinCVS 1.2\cvs" -d \\elmer\grp-th1\netsem\cvs update -Pd 5 | 6 | D:\windows\system32\net stop "Netsem TThee CustomRSH" 7 | 8 | nmake /f Makefile.win clean 9 | nmake /f Makefile.win all 10 | 11 | 12 | D:\windows\system32\net start "Netsem TThee CustomRSH" 13 | 14 | -------------------------------------------------------------------------------- /test/scripts/win/win-update.bat: -------------------------------------------------------------------------------- 1 | @ECHO OFF 2 | D: 3 | cd\Net\TCP\Test 4 | "D:\Program Files\GNU\WinCVS 1.2\cvs" -d \\elmer\grp-th1\netsem\cvs update -Pd 5 | 6 | -------------------------------------------------------------------------------- /test/slurp/README: -------------------------------------------------------------------------------- 1 | To build: libpcap must be installed in /usr/groups/netsem/ix86_linux-glibc-2.3.2-27.9 under the include and lib subdirectories. This path is specifed in the X86_PATH variable at the top of Makefile 2 | 3 | slurp/ : an Ocaml program that uses libpcap to sniff ("slurp") the 4 | network for packets that match a filter, rendering them to a TCP or 5 | UNIX domain socket. 6 | 7 | Usage: slurp [-h hostip] iface TCP ip port [filter] 8 | slurp [-h hostip] iface UNIX socket [filter] 9 | where iface is the interface to sniff on 10 | ip and port specify the socket to output HOL labels to 11 | sockets specifies the UNIX domain socket to output HOL labels to 12 | filter is an option filter string (enclosed in double quotes) 13 | TCP selects output to TCP socket mode 14 | UNIX selects output to UNIX domain socket mode 15 | -------------------------------------------------------------------------------- /test/slurp/debugrenderer.mli: -------------------------------------------------------------------------------- 1 | open Nettypes;; 2 | 3 | val render_tcp_datagram: tcp_datagram -> unit 4 | -------------------------------------------------------------------------------- /test/slurp/oldtestcode.ml: -------------------------------------------------------------------------------- 1 | (* ********* *) 2 | (* test code *) 3 | (* ********* *) 4 | 5 | (* here's a good capture command, to run on kurt (Linux): 6 | 7 | # tcpdump -p -i eth0 -s 65535 -c 10 tcp and not host kurt 8 | 9 | *) 10 | 11 | (* 12 | let chan = open_in "dump.dmp" 13 | let pcap_chars = 14 | let rec loop cs = 15 | match 16 | (try Some (input_char chan) with 17 | End_of_file -> 18 | None) with 19 | Some c -> loop (c::cs) 20 | | None -> cs 21 | in List.rev (loop []) 22 | 23 | let pfh,c = parse_pcap_file_header pcap_chars 24 | 25 | let rec loop c st = match c with 26 | [] -> 27 | () 28 | | _ -> 29 | let (ts,ip),c = parse_pcapfile_ip_packet pfh c in 30 | match ip_input st ts ip with 31 | (st,Some ip) -> 32 | let tcp = parse_tcp_datagram ip in 33 | let _ = printf "\n----TCP datagram:----\n" in 34 | let _ = render_tcp_datagram tcp in 35 | let _ = print_newline () in 36 | loop c st 37 | | (st,None) -> 38 | let _ = printf "\n----fragment----\n" in 39 | let _ = print_newline () in 40 | loop c st 41 | 42 | let _ = loop c init_ip_input_state 43 | *) 44 | -------------------------------------------------------------------------------- /test/slurp/pcapfile.mli: -------------------------------------------------------------------------------- 1 | open Nettypes;; 2 | open Netconv;; 3 | open Net2hol;; 4 | open Netipreass;; 5 | open Holtypes;; 6 | 7 | type pcap_file_header = { 8 | magic : uint; (* uint32: magic number *) 9 | endian : endianness; (* -- endianness *) 10 | version_major : uint; (* uint16: major version number *) 11 | version_minor : uint; (* uint16: minor version number *) 12 | thiszone : sint; (* int32: GMT to local correction *) 13 | sigfigs : uint; (* uint32: accuracy of timestamps *) 14 | snaplen : uint; (* uint32: max length of saved portion of each packet *) 15 | linktype : uint; (* uint32: data link type LINKTYPE_* *) 16 | } 17 | 18 | type pcap_pkthdr = { 19 | tstamp : timestamp; 20 | caplen : uint; 21 | len : uint; 22 | } 23 | 24 | val parse_pcap_file_header: char list -> pcap_file_header * char list 25 | 26 | val parse_pcapfile_ip_packet: pcap_file_header -> char list -> (timestamp * ip_packet) * char list 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | -------------------------------------------------------------------------------- /test/slurp/slurp.mli: -------------------------------------------------------------------------------- 1 | (* slurp.mli - slurps in a lib_pcap (tcpdump) dump file / stream *) 2 | (* 2002-07-29.. *) 3 | (* Time-stamp: <2002-07-29 17:07:05 kw217@astrocyte.cl.cam.ac.uk> *) 4 | open Nettypes;; 5 | open Netconv;; 6 | 7 | 8 | 9 | 10 | (* read in the file header off the input channel *) 11 | (*val slurp_header : in_channel -> pcap_file_header*) 12 | 13 | (* read the next segment off the input channel *) 14 | (*val slurp : pcap_file_header -> in_channel -> (timestamp * tcp_segment)*) 15 | 16 | (* build an IP packet from a tcp_segment datum *) 17 | (*val build : tcp_segment -> string*) 18 | 19 | 20 | -------------------------------------------------------------------------------- /test/tests/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=parser_test common tthee autotest adhoc 2 | 3 | all:: 4 | for i in $(SUBDIRS); do \ 5 | if [ -d $$i ]; then \ 6 | cd $$i && $(MAKE) all; \ 7 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 8 | fi; \ 9 | fi; \ 10 | done 11 | 12 | clean:: 13 | for i in $(SUBDIRS); do \ 14 | if [ -d $$i ]; then \ 15 | cd $$i && $(MAKE) clean; \ 16 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 17 | fi; \ 18 | fi; \ 19 | done 20 | 21 | realclean:: 22 | for i in $(SUBDIRS); do \ 23 | if [ -d $$i ]; then \ 24 | cd $$i && $(MAKE) realclean; \ 25 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 26 | fi; \ 27 | fi; \ 28 | done 29 | 30 | depend:: 31 | for i in $(SUBDIRS); do \ 32 | if [ -d $$i ]; then \ 33 | cd $$i && $(MAKE) depend; \ 34 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 35 | fi; \ 36 | fi; \ 37 | done -------------------------------------------------------------------------------- /test/tests/Makefile.win: -------------------------------------------------------------------------------- 1 | MAKE=$(MAKE) /F Makefile.win $(MAKEFLAGS) 2 | 3 | all:: 4 | cd parser_test 5 | $(MAKE) all 6 | cd .. 7 | cd common 8 | $(MAKE) all 9 | cd .. 10 | cd tthee 11 | $(MAKE) all 12 | cd .. 13 | 14 | clean:: 15 | cd parser_test 16 | $(MAKE) clean 17 | cd .. 18 | cd common 19 | $(MAKE) clean 20 | cd .. 21 | cd tthee 22 | $(MAKE) clean 23 | cd .. 24 | -------------------------------------------------------------------------------- /test/tests/adhoc/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=adhoc-1 2 | 3 | all:: 4 | for i in $(SUBDIRS); do \ 5 | if [ -d $$i ]; then \ 6 | cd $$i && $(MAKE) all; \ 7 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 8 | fi; \ 9 | fi; \ 10 | done 11 | 12 | clean:: 13 | for i in $(SUBDIRS); do \ 14 | if [ -d $$i ]; then \ 15 | cd $$i && $(MAKE) clean; \ 16 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 17 | fi; \ 18 | fi; \ 19 | done 20 | 21 | realclean:: 22 | for i in $(SUBDIRS); do \ 23 | if [ -d $$i ]; then \ 24 | cd $$i && $(MAKE) realclean; \ 25 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 26 | fi; \ 27 | fi; \ 28 | done 29 | 30 | depend:: 31 | for i in $(SUBDIRS); do \ 32 | if [ -d $$i ]; then \ 33 | cd $$i && $(MAKE) depend; \ 34 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 35 | fi; \ 36 | fi; \ 37 | done -------------------------------------------------------------------------------- /test/tests/adhoc/adhoc-1/run: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | DIRPATH=/usr/groups/tthee/adhoc 4 | FILENAME=adhoc-2-`date -Iseconds` 5 | 6 | TEMPNAME=$DIRPATH/temp-$FILENAME 7 | REALNAME=$DIRPATH/$FILENAME 8 | 9 | mkdir $TEMPNAME 10 | 11 | echo "Re-enabling ntp updates..." 12 | ssh john.netsem "echo -n glia: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' glia" 13 | ssh john.netsem "echo -n john: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' john" 14 | ssh john.netsem "echo -n emil: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' emil" 15 | ssh john.netsem "echo -n alan: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' alan" 16 | ssh john.netsem "echo -n kurt: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' kurt" 17 | 18 | ./adhoc-2 $TEMPNAME && mv $TEMPNAME $REALNAME 19 | -------------------------------------------------------------------------------- /test/tests/adhoc/adhoc-1/test: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | DIRNAME=/usr/groups/tthee/adhoc/adhoc-2-scratch 4 | 5 | mkdir $DIRNAME 6 | rm -r $DIRNAME/* 7 | 8 | echo "Not re-enabling ntp updates..." 9 | # ssh john.netsem "echo -n glia: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' glia" 10 | # ssh john.netsem "echo -n john: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' john" 11 | # ssh john.netsem "echo -n emil: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' emil" 12 | # ssh john.netsem "echo -n alan: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' alan" 13 | # ssh john.netsem "echo -n kurt: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' kurt" 14 | 15 | ./adhoc-2 $DIRNAME 16 | -------------------------------------------------------------------------------- /test/tests/adhoc/adhoc-2/run: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | DIRPATH=/usr/groups/tthee/adhoc 4 | FILENAME=adhoc-2-`date -Iseconds` 5 | 6 | TEMPNAME=$DIRPATH/temp-$FILENAME 7 | REALNAME=$DIRPATH/$FILENAME 8 | 9 | mkdir $TEMPNAME 10 | 11 | echo "Re-enabling ntp updates..." 12 | ssh john.netsem "echo -n glia: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' glia" 13 | ssh john.netsem "echo -n john: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' john" 14 | ssh john.netsem "echo -n emil: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' emil" 15 | ssh john.netsem "echo -n alan: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' alan" 16 | ssh john.netsem "echo -n kurt: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' kurt" 17 | 18 | ./adhoc-2 $TEMPNAME && mv $TEMPNAME $REALNAME 19 | -------------------------------------------------------------------------------- /test/tests/adhoc/adhoc-2/test: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | DIRNAME=/usr/groups/tthee/adhoc/adhoc-2-scratch 4 | 5 | mkdir $DIRNAME 6 | rm -r $DIRNAME/* 7 | 8 | echo "Not re-enabling ntp updates..." 9 | # ssh john.netsem "echo -n glia: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' glia" 10 | # ssh john.netsem "echo -n john: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' john" 11 | # ssh john.netsem "echo -n emil: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' emil" 12 | # ssh john.netsem "echo -n alan: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' alan" 13 | # ssh john.netsem "echo -n kurt: && ntpdc -c 'keyid 1' -c 'passwd netsemkey' -c 'addserver astrocyte' kurt" 14 | 15 | ./adhoc-2 $DIRNAME 16 | -------------------------------------------------------------------------------- /test/tests/adhoc/bsd-selfconnect/Makefile: -------------------------------------------------------------------------------- 1 | 2 | all: selfconnect 3 | 4 | clean: 5 | rm -f selfconnect 6 | -------------------------------------------------------------------------------- /test/tests/adhoc/ssh-johnemil-2002-11-11T14-15-50+0000/README: -------------------------------------------------------------------------------- 1 | How the tests were produced: 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | 4 | Private network with only john and emil plugged into the hub. 5 | 6 | On john (FreeBSD v4.6 RELEASE with custom kernel (tcp_debug enabled)), the following processes were started in order: 7 | - utils/ns_logger/ns_logger 127.0.0.1 2000 > socket_trace 8 | - utils/ns_logger/ns_logger 127.0.0.1 2001 > slurp_trace 9 | - slurp/slurp -h 192.168.0.12 ep0 TCP 127.0.0.1 2001 "(ip src 192.168.0.12) or (ip dst 192.168.012)" 10 | - /utils/holtcpcb/holtcpcb -F -n > tcpdebug_trace 11 | 12 | The command: 13 | - env NS_ADDR=127.0.0.1 NS_PORT=2000 NS_DEBUG=1 utils/socktools/sockclient 192.168.0.13 22 14 | 15 | was executed to connect to emil's ssh port. Then 16 | - q 17 | followed by enter was typed. This not only sends 'q' to emil but also closes sockclient (tearing the ssh connection down nicely first). 18 | 19 | After a few seconds holtcpcb and slurp were killed and the output files (socket_trace, slurp_trace and tcpdebug_trace) checked and archived. 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /test/tests/adhoc/ssh-johnemil-2002-11-11T14-15-50+0000/socket_trace: -------------------------------------------------------------------------------- 1 | (* ns_socket library initialised: connected to 127.0.0.1:2000 *) 2 | (* Date: Mon Nov 11 16:55:35 2002 Host: john *) 3 | (* BEGIN *) 4 | (* 1037033735.399304 *) Lh_call (TID 13420, socket()); 5 | (* 1037033735.404365 *) Lh_return (TID 13420, OK(FD 4)); 6 | (* 1037033735.404557 *) Lh_call (TID 13420, setsockbopt(FD 4, SO_REUSEADDR, T)); 7 | (* 1037033735.404683 *) Lh_return (TID 13420, OK(one)); 8 | (* 1037033735.404943 *) Lh_call (TID 13420, connect(FD 4, IP 192 168 0 13, Port 22)); 9 | (* 1037033735.406568 *) Lh_return (TID 13420, OK(one)); 10 | (* 1037033737.118213 *) Lh_call (TID 13420, send(FD 4, "q\x00a", [])); 11 | (* 1037033737.118959 *) Lh_return (TID 13420, OK("")); 12 | (* 1037033737.120083 *) Lh_call (TID 13420, close(FD 4)); 13 | (* 1037033737.120452 *) Lh_return (TID 13420, OK(one)); 14 | -------------------------------------------------------------------------------- /test/tests/autotest/accept.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: accept() *) 3 | (* Steve Bishop - Created 20030430 *) 4 | (* $Id: accept.mli,v 1.3 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_accept_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/bind.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: bind() *) 3 | (* Steve Bishop - Created 20030503 *) 4 | (* $Id $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Our libraries *) 8 | open Common;; 9 | open Simple;; 10 | 11 | (* do_bind_tests handle host_pair_list test_type = bool *) 12 | (* For each pair of hosts in host_pair_list perform a suite of tests designed *) 13 | (* to test the bind() system call. For more information on the tests *) 14 | (* refer to the auto-testing documentation *) 15 | val do_bind_tests: autotest_handle -> (host_info * host_info) list -> 16 | test_type -> bool;; 17 | -------------------------------------------------------------------------------- /test/tests/autotest/bind_2.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: bind() *) 3 | (* Steve Bishop - Created 20030717 *) 4 | (* $Id: bind_2.mli,v 1.2 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_bind_2_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/bind_udp.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: bind() UDP *) 3 | (* Matthew Fairbairn - Created 20040116 *) 4 | (* $Id: bind_udp.mli,v 1.1 2004/02/17 21:47:03 mf266 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | 10 | (* Our libraries *) 11 | open Nettypes 12 | open Tthee 13 | open Ttheehelper 14 | open Ocamllib 15 | open Libcalls 16 | open Common 17 | open Dual 18 | open Dualdriven_udp 19 | open Common_udp 20 | 21 | val do_bind_udp_tests: autotest_handle -> host_info list -> test_type -> bool 22 | -------------------------------------------------------------------------------- /test/tests/autotest/close.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: close() *) 3 | (* Steve Bishop - Created 20030430 *) 4 | (* $Id: close.mli,v 1.2 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_close_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/connect.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: connect() *) 3 | (* Steve Bishop - Created 20030627 *) 4 | (* $Id: connect.mli,v 1.5 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_connect_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/connect_udp.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: connect() UDP *) 3 | (* Matthew Fairbairn - Created 20040116 *) 4 | (* $Id: connect_udp.mli,v 1.1 2004/02/17 21:47:03 mf266 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | 10 | (* Our libraries *) 11 | open Nettypes 12 | open Tthee 13 | open Ttheehelper 14 | open Ocamllib 15 | open Libcalls 16 | open Common 17 | open Dual 18 | open Dualdriven_udp 19 | open Common_udp 20 | 21 | val do_connect_udp_tests: autotest_handle -> host_info list -> test_type -> bool 22 | -------------------------------------------------------------------------------- /test/tests/autotest/deliver_icmp.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: deliver_icmp *) 3 | (* Matthew Fairbairn - Created 20040419 *) 4 | (* $Id: deliver_icmp.mli,v 1.1 2004/04/19 16:42:38 mf266 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | 10 | (* Our libraries *) 11 | open Nettypes 12 | open Tthee 13 | open Ttheehelper 14 | open Ocamllib 15 | open Libcalls 16 | open Common 17 | open Dual 18 | open Dualdriven_udp 19 | open Common_udp 20 | 21 | val do_deliver_icmp_tests: autotest_handle -> host_info list -> test_type -> bool 22 | -------------------------------------------------------------------------------- /test/tests/autotest/deliver_in.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: deliver_in *) 3 | (* Steve Bishop - Created 20030725 *) 4 | (* $Id: deliver_in.mli,v 1.2 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_deliver_in_tests: autotest_handle -> host_info list -> test_type -> bool 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/deliver_in_3.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: deliver_in_3 *) 3 | (* Steve Bishop - Created 20030922 *) 4 | (* $Id: deliver_in_3.mli,v 1.2 2004/01/08 17:37:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_deliver_in_3_tests: autotest_handle -> host_info list -> test_type -> bool 20 | 21 | val get_deliver_in_3_test_descriptions: unit -> unit 22 | 23 | (* ---------------------------------------------------------------------- *) 24 | (* -*-*- THE END -*-*- *) 25 | (* ---------------------------------------------------------------------- *) 26 | -------------------------------------------------------------------------------- /test/tests/autotest/demo.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: demo *) 3 | (* ---------------------------------------------------------------------- *) 4 | 5 | (* Our libraries *) 6 | open Common;; 7 | open Simple;; 8 | 9 | val do_demo_tests: autotest_handle -> host_info list -> 10 | test_type -> bool;; 11 | -------------------------------------------------------------------------------- /test/tests/autotest/disconnect.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: disconnect() UDP *) 3 | (* Matthew Fairbairn - Created 20040116 *) 4 | (* $Id: disconnect.mli,v 1.1 2004/02/17 21:47:03 mf266 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | 10 | (* Our libraries *) 11 | open Nettypes 12 | open Tthee 13 | open Ttheehelper 14 | open Ocamllib 15 | open Libcalls 16 | open Common 17 | open Dual 18 | open Dualdriven_udp 19 | open Common_udp 20 | 21 | val do_disconnect_tests: autotest_handle -> host_info list -> test_type -> bool 22 | -------------------------------------------------------------------------------- /test/tests/autotest/drivetest.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: socket driver test *) 3 | (* Steve Bishop - Created 20030430 *) 4 | (* $Id: drivetest.mli,v 1.3 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread 9 | open Printf 10 | 11 | (* Our libraries *) 12 | open Nettypes 13 | open Tthee 14 | open Ttheehelper 15 | open Ocamllib 16 | open Libcalls 17 | open Common 18 | open Dual 19 | open Dualdriven 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | 23 | val do_driver_tests: autotest_handle -> host_info list -> test_type -> bool;; 24 | -------------------------------------------------------------------------------- /test/tests/autotest/dup.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: dup() *) 3 | (* Steve Bishop - Created 20030430 *) 4 | (* $Id: dup.mli,v 1.3 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_dup_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/dupfd.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: dupfd() *) 3 | (* Steve Bishop - Created 20030430 *) 4 | (* $Id: dupfd.mli,v 1.3 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_dupfd_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/fileflags.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: get/setfileflags() *) 3 | (* Steve Bishop - Created 20030721 *) 4 | (* $Id: fileflags.mli,v 1.2 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_fileflags_tests: autotest_handle -> host_info list -> test_type -> bool 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/getifaddrs.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: getifaddrs() UDP *) 3 | (* Matthew Fairbairn - Created 20040116 *) 4 | (* $Id: getifaddrs.mli,v 1.1 2004/02/17 21:47:03 mf266 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | 10 | (* Our libraries *) 11 | open Nettypes 12 | open Tthee 13 | open Ttheehelper 14 | open Ocamllib 15 | open Libcalls 16 | open Common 17 | open Dual 18 | open Dualdriven_udp 19 | open Common_udp 20 | 21 | val do_getifaddrs_tests: autotest_handle -> host_info list -> test_type -> bool 22 | -------------------------------------------------------------------------------- /test/tests/autotest/getnames.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: getsockname(), getpeername() *) 3 | (* Steve Bishop - Created 20030626 *) 4 | (* $Id: getnames.mli,v 1.2 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_getnames_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/getsockerr.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: getsockerr() *) 3 | (* Steve Bishop - Created 20030721 *) 4 | (* $Id: getsockerr.mli,v 1.2 2003/09/23 14:23:51 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_getsockerr_tests: autotest_handle -> host_info list -> test_type -> bool 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/getsocklistening.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: getsocklistening() *) 3 | (* Steve Bishop - Created 20030626 *) 4 | (* $Id: getsocklistening.mli,v 1.2 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_getsocklistening_tests: autotest_handle -> host_info list -> 20 | test_type -> bool 21 | 22 | (* ---------------------------------------------------------------------- *) 23 | (* -*-*- THE END -*-*- *) 24 | (* ---------------------------------------------------------------------- *) 25 | -------------------------------------------------------------------------------- /test/tests/autotest/listen.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: listen() *) 3 | (* Steve Bishop - Created 20030430 *) 4 | (* $Id: listen.mli,v 1.4 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_listen_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/loopback.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: loopback *) 3 | (* Steve Bishop - Created 20031009 *) 4 | (* $Id: loopback.mli,v 1.1 2003/10/10 14:05:10 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_loopback_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/network.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: network *) 3 | (* ---------------------------------------------------------------------- *) 4 | 5 | (* Our libraries *) 6 | open Common;; 7 | open Simple;; 8 | 9 | val do_network_tests: autotest_handle -> host_info list -> 10 | test_type -> bool;; 11 | -------------------------------------------------------------------------------- /test/tests/autotest/pselect.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: pselect() *) 3 | (* Matthew Fairbairn - Created 20040621 *) 4 | (* ---------------------------------------------------------------------- *) 5 | 6 | (* Ocaml libraries *) 7 | open Thread;; 8 | 9 | (* Our libraries *) 10 | open Nettypes 11 | open Tthee 12 | open Ttheehelper 13 | open Ocamllib 14 | open Libcalls 15 | open Common 16 | open Dual 17 | open Dualdriven_udp 18 | open Common_udp 19 | 20 | val do_pselect_tests: autotest_handle -> host_info list -> test_type -> bool 21 | -------------------------------------------------------------------------------- /test/tests/autotest/recv.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: recv() *) 3 | (* Steve Bishop - Created 20030708 *) 4 | (* $Id: recv.mli,v 1.2 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_recv_tests: autotest_handle -> host_info list -> test_type -> bool 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/recv_from.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: recv() UDP *) 3 | (* Matthew Fairbairn - Created 20040116 *) 4 | (* $Id: recv_from.mli,v 1.1 2004/02/19 12:21:49 mf266 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | 10 | (* Our libraries *) 11 | open Nettypes 12 | open Tthee 13 | open Ttheehelper 14 | open Ocamllib 15 | open Libcalls 16 | open Common 17 | open Dual 18 | open Dualdriven_udp 19 | open Common_udp 20 | 21 | val do_recv_from_tests: autotest_handle -> host_info list -> test_type -> bool 22 | -------------------------------------------------------------------------------- /test/tests/autotest/send.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: send() *) 3 | (* Steve Bishop - Created 20030707 *) 4 | (* $Id: send.mli,v 1.3 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_send_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/send_to.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: send() UDP *) 3 | (* Matthew Fairbairn - Created 20040116 *) 4 | (* $Id: send_to.mli,v 1.1 2004/02/17 21:47:04 mf266 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | 10 | (* Our libraries *) 11 | open Nettypes 12 | open Tthee 13 | open Ttheehelper 14 | open Ocamllib 15 | open Libcalls 16 | open Common 17 | open Dual 18 | open Dualdriven_udp 19 | open Common_udp 20 | 21 | val do_send_to_tests: autotest_handle -> host_info list -> test_type -> bool 22 | -------------------------------------------------------------------------------- /test/tests/autotest/shutdown.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: shutdown() *) 3 | (* Steve Bishop - Created 20030709 *) 4 | (* $Id: shutdown.mli,v 1.2 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_shutdown_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/sockatmark_udp.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: sockatmark() UDP *) 3 | (* Matthew Fairbairn - Created 20040116 *) 4 | (* $Id: sockatmark_udp.mli,v 1.1 2004/02/17 21:47:04 mf266 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | 10 | (* Our libraries *) 11 | open Nettypes 12 | open Tthee 13 | open Ttheehelper 14 | open Ocamllib 15 | open Libcalls 16 | open Common 17 | open Dual 18 | open Dualdriven_udp 19 | open Common_udp 20 | 21 | val do_sockatmark_udp_tests: autotest_handle -> host_info list -> test_type -> bool 22 | -------------------------------------------------------------------------------- /test/tests/autotest/sockbopt.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: getsockbopt()/setsockbopt() *) 3 | (* Steve Bishop - Created 20030702 *) 4 | (* $Id: sockbopt.mli,v 1.2 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_sockbopt_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/socket.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Common Code *) 3 | (* Steve Bishop - Created 20030430 *) 4 | (* $Id: socket.mli,v 1.6 2006/06/06 15:05:03 amgb2 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Unix;; 10 | open ThreadUnix;; 11 | 12 | (* Our libraries *) 13 | open Common;; 14 | 15 | (* do_socket_tests autotest_handle host_list test_type = bool *) 16 | (* For each host in host_list perform a suite of tests designed to test *) 17 | (* the socket() system call. For more information on the tests refer *) 18 | (* to the auto-testing documentation *) 19 | val do_socket_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | 22 | -------------------------------------------------------------------------------- /test/tests/autotest/socknopt.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: getsocknopt()/setsocknopt() *) 3 | (* Steve Bishop - Created 20030702 *) 4 | (* $Id: socknopt.mli,v 1.2 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_socknopt_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/socktopt.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: getsocktopt()/setsocktopt() *) 3 | (* Steve Bishop - Created 20030702 *) 4 | (* $Id: socktopt.mli,v 1.2 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_socktopt_tests: autotest_handle -> host_info list -> test_type -> bool;; 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/autotest/timers.mli: -------------------------------------------------------------------------------- 1 | (* ---------------------------------------------------------------------- *) 2 | (* Netsem Tthee Automated Tests Code: timers *) 3 | (* Steve Bishop - Created 20030801 *) 4 | (* $Id: timers.mli,v 1.2 2003/09/23 14:23:52 smb50 Exp $ *) 5 | (* ---------------------------------------------------------------------- *) 6 | 7 | (* Ocaml libraries *) 8 | open Thread;; 9 | open Printf;; 10 | 11 | (* Our libraries *) 12 | open Nettypes;; 13 | open Tthee;; 14 | open Ttheehelper;; 15 | open Libcalls;; 16 | open Common;; 17 | open Dual;; 18 | 19 | val do_timer_tests: autotest_handle -> host_info list -> test_type -> bool 20 | 21 | (* ---------------------------------------------------------------------- *) 22 | (* -*-*- THE END -*-*- *) 23 | (* ---------------------------------------------------------------------- *) 24 | -------------------------------------------------------------------------------- /test/tests/common/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLLIBDIR=$(OCAMLPATH)/../lib/ocaml 2 | 3 | OCAMLC=$(OCAMLPATH)/ocamlc 4 | OCAMLOPT=$(OCAMLPATH)/ocamlopt 5 | OCAMLMKLIB=$(OCAMLPATH)/ocamlmklib 6 | OCAMLDEP=$(OCAMLPATH)/ocamldep 7 | 8 | OCAMLREQLIBS=$(OCAMLLIBDIR)/unix.cmxa $(OCAMLLIBDIR)/threads/threads.cmxa\ 9 | ../../ocamllib/ocamllibnative.cmxa ../../ocamlext/threadparsing.cmxa\ 10 | ../../common/nscommon.cmxa ../../ocamlext/platform.cmxa \ 11 | ../../tthee/tthee.cmxa 12 | 13 | LIBPATHS=-cclib -L../../nssock -cclib -L../../ocamlext/ 14 | OCAMLCOPT=-I $(OCAMLLIBDIR) -I ../../common -I ../../ocamlext\ 15 | -I ../../tthee -I ../../ocamllib 16 | RM=rm -f 17 | 18 | TARGETS=testscommon.cmx 19 | 20 | all: test 21 | 22 | test: $(TARGETS) 23 | 24 | clean: 25 | $(RM) test *.cm[oaix] *.cmxa *.o 26 | 27 | realclean: clean 28 | $(RM) .depend 29 | 30 | depend: .depend 31 | 32 | .SUFFIXES:.ml .mli .cmi .cmx 33 | 34 | .ml.cmx: 35 | $(OCAMLOPT) -thread -c $(OCAMLCOPT) $< 36 | 37 | .mli.cmi: 38 | $(OCAMLOPT) -thread -c $(OCAMLCOPT) $< 39 | 40 | .depend: *.mli *.ml 41 | $(OCAMLDEP) *.mli *.ml > $@ 42 | 43 | -include .depend 44 | -------------------------------------------------------------------------------- /test/tests/linkhack/README: -------------------------------------------------------------------------------- 1 | DEPRECATED. 2 | 3 | A quick test written to test dynamic linking. Now deprecated as the 4 | knowledge is incorporated into Test/dynamic and Test/utils/dlhack. 5 | -------------------------------------------------------------------------------- /test/tests/linkhack/instrumented.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | int init = 0; 9 | 10 | typedef int (*socket_ptr_t)(int, int, int); 11 | static socket_ptr_t real_socket; 12 | 13 | void initialise() 14 | { 15 | void *handle = NULL; 16 | 17 | if ((handle = dlopen("/lib/libc.so.6", RTLD_LAZY)) == NULL) 18 | { 19 | printf("%s\n", dlerror()); 20 | exit(1); 21 | } 22 | 23 | if ((real_socket = dlsym(handle, "socket")) == NULL) 24 | { 25 | printf("%s\n", dlerror()); 26 | exit(1); 27 | } 28 | } 29 | 30 | int ns_socket(int domain, int type, int protocol) 31 | { 32 | if(init == 0) 33 | initialise(); 34 | 35 | fprintf(stderr, "ns_socket CALLED.\n"); 36 | return real_socket(domain, type, protocol); 37 | } 38 | -------------------------------------------------------------------------------- /test/tests/linkhack/main.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int main() 6 | { 7 | printf("Got a socket FD %d\n\n", socket(AF_INET, SOCK_STREAM, 0)); 8 | return 0; 9 | } 10 | -------------------------------------------------------------------------------- /test/tests/linkhack/wrapper.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int socket(int domain, int type, int protocol) 6 | { 7 | fprintf(stderr, "Dynamically linked socket call\n"); 8 | return ns_socket(domain,type,protocol); 9 | } 10 | -------------------------------------------------------------------------------- /test/tests/parser_test/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLINCL=-I ../../common -I ../../ocamllib \ 2 | -I $(OCAMLPATH)/../lib/ocaml \ 3 | -I ../../ocamlext 4 | OCAMLLIB=$(OCAMLPATH)/../lib/ocaml 5 | 6 | REQLIBS=$(OCAMLLIB)/unix.cma $(OCAMLLIB)/threads/threads.cma \ 7 | ../../ocamllib/ocamllib.cma ../../ocamlext/threadparsing.cma \ 8 | ../../ocamlext/platform.cma ../../common/nscommon.cma 9 | NSSOCKLIB=../../nssock/libnssock.a ../../ocamlext/platform.a 10 | NTPLIB=../../common/libntplib.a 11 | 12 | OCAMLC=$(OCAMLPATH)/ocamlc 13 | OCAMLDEP=$(OCAMLPATH)/ocamldep 14 | RM=rm -f 15 | 16 | FILES=parser_test.cmo 17 | 18 | all: parser_test 19 | 20 | parser_test: $(FILES) 21 | $(OCAMLC) -o $@ -custom $(OCAMLINCL) $(REQLIBS) $(NSSOCKLIB) \ 22 | $(NTPLIB) $(FILES) 23 | 24 | depend: 25 | $(OCAMLDEP) *.mli *.ml > .depend 26 | 27 | clean: 28 | $(RM) *.o *.a *.cmo *.cmi *.cma *.cmxo *.cmxa 29 | $(RM) parser_test 30 | 31 | realclean: clean 32 | $(RM) .depend 33 | 34 | 35 | .SUFFIXES:.ml .mli .cmo .cmi 36 | .mli.cmi: 37 | $(OCAMLC) -thread -c -custom $(OCAMLINCL) $< 38 | .ml.cmo: 39 | $(OCAMLC) -thread -c -custom $(OCAMLINCL) $< 40 | 41 | -include .depend 42 | -------------------------------------------------------------------------------- /test/tests/parser_test/parser_test.ml: -------------------------------------------------------------------------------- 1 | open Parserlib;; 2 | open Unix;; 3 | 4 | let parsepacket fname = 5 | let fd = Unix.openfile fname [O_RDONLY] 0 in 6 | let ch = Unix.in_channel_of_descr fd in 7 | let env = Threadparsing.create_parse_env () in 8 | try let lexbuf = Lexing.from_channel ch in 9 | while true do 10 | let result = 11 | Parser.main env Lexer.token lexbuf 12 | in 13 | match result with 14 | PARSE_RETURN(_,_,r) -> 15 | (match r with 16 | HOLSNDMSG(_) -> prerr_endline "HOLSNDMSG" 17 | | HOLRCVMSG(_) -> prerr_endline "HOLRCVMSG" 18 | | HOLLOOPMSG(_) -> prerr_endline "HOLLOOPMSG" 19 | | LIBCALL(_) -> prerr_endline "LIBCALL" 20 | | LIBRETURN(_) -> prerr_endline "LIBRETURN" 21 | | TCPTRACE(_) -> prerr_endline "TCPTRACE" 22 | | HOLEPSILON(_) -> prerr_endline "HOLEPSILON" 23 | | HOLABSTIME(_) -> prerr_endline "HOLABSTIME" 24 | ) 25 | done 26 | with Lexer.Eof -> 27 | exit 0;; 28 | 29 | let t = Thread.create parsepacket (Array.get (Sys.argv) 1) in 30 | Thread.join t 31 | 32 | -------------------------------------------------------------------------------- /test/tests/tthee/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=tthee1 tthee2 tthee3 tthee4 tthee5 2 | 3 | all:: 4 | for i in $(SUBDIRS); do \ 5 | if [ -d $$i ]; then \ 6 | cd $$i && $(MAKE) all; \ 7 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 8 | fi; \ 9 | fi; \ 10 | done 11 | 12 | clean:: 13 | for i in $(SUBDIRS); do \ 14 | if [ -d $$i ]; then \ 15 | cd $$i && $(MAKE) clean; \ 16 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 17 | fi; \ 18 | fi; \ 19 | done 20 | 21 | realclean:: 22 | for i in $(SUBDIRS); do \ 23 | if [ -d $$i ]; then \ 24 | cd $$i && $(MAKE) realclean; \ 25 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 26 | fi; \ 27 | fi; \ 28 | done 29 | 30 | depend:: 31 | for i in $(SUBDIRS); do \ 32 | if [ -d $$i ]; then \ 33 | cd $$i && $(MAKE) depend; \ 34 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 35 | fi; \ 36 | fi; \ 37 | done -------------------------------------------------------------------------------- /test/tests/tthee/Makefile.win: -------------------------------------------------------------------------------- 1 | MAKE=$(MAKE) /F Makefile.win $(MAKEFLAGS) 2 | 3 | all:: 4 | cd tthee1 5 | $(MAKE) all 6 | cd .. 7 | cd tthee2 8 | $(MAKE) all 9 | cd .. 10 | 11 | clean:: 12 | cd tthee1 13 | $(MAKE) clean 14 | cd .. 15 | cd tthee2 16 | $(MAKE) clean 17 | cd .. -------------------------------------------------------------------------------- /test/tthee/Makefile.win: -------------------------------------------------------------------------------- 1 | OCAMLC=ocamlc 2 | OCAMLOPT=ocamlopt 3 | OCAMLMKLIB=ocamlmklib 4 | OCAMLDEP=ocamldep 5 | RM=del /Q /F 6 | 7 | OCAMLCFLAGS=-I "$(OCAMLLIB)" -I ../common -I ../ocamlext -I ../ocamllib 8 | OCAMLREQLIBS= 9 | 10 | TARGETS=mergelib.cmx tthee.cmx ttheehelper.cmx 11 | INTERFS=mergelib.cmi tthee.cmi ttheehelper.cmi 12 | 13 | all: tthee.cmxa 14 | 15 | tthee.cmxa: $(INTERFS) $(TARGETS) 16 | $(OCAMLOPT) -thread -a -o $@ $(TARGETS) 17 | 18 | clean: 19 | $(RM) $(INTERFS) $(TARGETS) *.cma *.cmx 20 | $(RM) *.cmxa *.o *.a *.cmi *.obj *.lib 21 | $(RM) .depend 22 | 23 | depend: .depend 24 | 25 | .SUFFIXES:.ml .mli .cmi .cmx 26 | 27 | .ml.cmx: 28 | $(OCAMLOPT) -thread -c $(OCAMLCFLAGS) $< 29 | 30 | .mli.cmi: 31 | $(OCAMLOPT) -thread -c $(OCAMLCFLAGS) $< 32 | 33 | .depend: *.mli *.ml 34 | $(OCAMLDEP) *.mli *.ml > $@ 35 | 36 | !IF EXIST(.depend) 37 | !INCLUDE .depend 38 | !ENDIF -------------------------------------------------------------------------------- /test/tthee/mergelib.mli: -------------------------------------------------------------------------------- 1 | open Unix;; 2 | open Nettypes;; 3 | open Parserlib;; 4 | 5 | type merge_input = 6 | MESSAGE of ns_parse_return 7 | | FINISH;; 8 | 9 | (* Write merger file header to the specified channel *) 10 | val writeMergeHeader: out_channel -> unit;; 11 | 12 | (* Write our merger header's footer to the specified channel *) 13 | val writeMergeHeaderFooter: out_channel -> unit;; 14 | 15 | (* Write a custom string to the file header *) 16 | val writeCustomHeader: out_channel -> string -> unit;; 17 | 18 | val string_of_time: time -> string;; 19 | 20 | (* generateEpsilonTransition (time in us) (time in us) *) 21 | (* Generate an epsilon transition from the specified times *) 22 | val generateEpsilonTransition: time -> time -> string;; 23 | 24 | (* Given a list of parsed messages pick the minimum *) 25 | (* with respect to the timestamp ordering *) 26 | val findMinimum: (ns_parse_return * time * string option) list -> (ns_parse_return * time * string option) ;; 27 | 28 | 29 | -------------------------------------------------------------------------------- /test/tthee/ttheehelper.mli: -------------------------------------------------------------------------------- 1 | open Tthee;; 2 | open Nettypes;; 3 | 4 | type ip = (int*int*int*int);; 5 | 6 | (* IP address constructors *) 7 | val string_ip: ip -> string;; 8 | val hol_ip: ip -> uint;; 9 | 10 | (* Command socket helpers *) 11 | val cmd_tcp_create: ip -> int -> Tthee.sock_type;; 12 | 13 | (* Slurper helpers *) 14 | (* create_filter hostip1 hostip2 = string *) 15 | val create_filter: ip -> ip -> string option;; 16 | 17 | (* create_virutal filter hostip1 hostip2 virtualip broadcast_ip multicast_ip unused_ip = string *) 18 | val create_virtual_filter: ip -> ip -> ip -> ip -> ip -> ip -> string option;; 19 | -------------------------------------------------------------------------------- /test/utils/Makefile: -------------------------------------------------------------------------------- 1 | SUBDIRS=ns_logger socktools diags conflate tracediff 2 | 3 | all:: 4 | for i in $(SUBDIRS); do \ 5 | if [ -d $$i ]; then \ 6 | cd $$i && $(MAKE) all; \ 7 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 8 | fi; \ 9 | fi; \ 10 | done 11 | 12 | clean:: 13 | for i in $(SUBDIRS); do \ 14 | if [ -d $$i ]; then \ 15 | cd $$i && $(MAKE) clean; \ 16 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 17 | fi; \ 18 | fi; \ 19 | done 20 | 21 | realclean:: 22 | for i in $(SUBDIRS); do \ 23 | if [ -d $$i ]; then \ 24 | cd $$i && $(MAKE) realclean; \ 25 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 26 | fi; \ 27 | fi; \ 28 | done 29 | 30 | depend:: 31 | for i in $(SUBDIRS); do \ 32 | if [ -d $$i ]; then \ 33 | cd $$i && $(MAKE) depend; \ 34 | if [ $$? -eq 0 ] ; then true && cd ..; else exit 1; \ 35 | fi; \ 36 | fi; \ 37 | done 38 | -------------------------------------------------------------------------------- /test/utils/Makefile.win: -------------------------------------------------------------------------------- 1 | MAKE=$(MAKE) /F Makefile.win $(MAKEFLAGS) 2 | 3 | all:: 4 | cd ns_logger 5 | $(MAKE) all 6 | cd .. 7 | cd socktools 8 | $(MAKE) all 9 | cd .. 10 | cd custom_rsh2 11 | $(MAKE) all 12 | cd .. 13 | cd tsccal 14 | $(MAKE) all 15 | cd .. 16 | 17 | clean:: 18 | cd ns_logger 19 | $(MAKE) clean 20 | cd .. 21 | cd socktools 22 | $(MAKE) clean 23 | cd .. 24 | cd custom_rsh2 25 | $(MAKE) clean 26 | cd .. 27 | cd tsccal 28 | $(MAKE) clean 29 | cd .. 30 | 31 | -------------------------------------------------------------------------------- /test/utils/conflate/example/README: -------------------------------------------------------------------------------- 1 | server0 and client0 are two spec1 traces. 2 | 3 | laurel and hardy are example inputs from the adhoc-2 test on the freebsd-4.6 4 | machines. bill/ben and pinky/brain are the results of an older version of the 5 | test on the linux and freebsd-4.6 machines respectively, which are retained 6 | because they demonstrate an error in the TCP specification to do with the 7 | behaviour of listening sockets whose backlog queue length limit is 0. 8 | -------------------------------------------------------------------------------- /test/utils/custom_rsh/Makefile: -------------------------------------------------------------------------------- 1 | OCAMLC=$(OCAMLPATH)/ocamlc 2 | OCAMLOPT=$(OCAMLPATH)/ocamlopt 3 | OCAMLLEX=$(OCAMLPATH)/ocamllex 4 | OCAMLYACC=$(OCAMLPATH)/ocamlyacc 5 | OCAMLFLAGS=-thread -I $(OCAMLPATH)/../lib/ocaml -I . 6 | OCAMLLIBS=unix.cmxa threads.cmxa 7 | RM=rm -f 8 | 9 | all: custom_rsh 10 | 11 | custom_rsh: 12 | $(OCAMLLEX) lexer.mll 13 | $(OCAMLYACC) parser.mly 14 | $(OCAMLOPT) -c $(OCAMLFLAGS) parsetypes.mli parsetypes.ml 15 | $(OCAMLOPT) -c $(OCAMLFLAGS) parser.mli 16 | $(OCAMLOPT) -c $(OCAMLFLAGS) parser.ml 17 | $(OCAMLOPT) -c $(OCAMLFLAGS) lexer.ml 18 | $(OCAMLOPT) -c $(OCAMLFLAGS) custom_rsh.ml 19 | $(OCAMLOPT) -o $@ $(OCAMLFLAGS) $(OCAMLLIBS) parsetypes.cmx parser.cmx lexer.cmx custom_rsh.cmx 20 | 21 | clean: 22 | $(RM) *.cm* *.o* parser.mli custom_rsh parser.ml lexer.ml 23 | 24 | realclean: depend 25 | 26 | depend: -------------------------------------------------------------------------------- /test/utils/custom_rsh/Makefile.win: -------------------------------------------------------------------------------- 1 | OCAMLC=ocamlc 2 | OCAMLOPT=ocamlopt 3 | OCAMLLEX=ocamllex 4 | OCAMLYACC=ocamlyacc 5 | OCAMLFLAGS= -thread -I "$(OCAMLLIB)" -I . -I "../../ocamlext" 6 | OCAMLLIBS=unix.cmxa threads.cmxa platform.cmxa 7 | RM=del /q f 8 | CLIBS=-cclib /link -cclib /NODEFAULTLIB:LIBC.lib ../../ocamlext/platformc.lib 9 | 10 | all: custom_rsh.exe 11 | 12 | custom_rsh.exe: 13 | $(OCAMLLEX) lexer.mll 14 | $(OCAMLYACC) parser.mly 15 | $(OCAMLOPT) -c $(OCAMLFLAGS) parsetypes.mli parsetypes.ml 16 | $(OCAMLOPT) -c $(OCAMLFLAGS) parser.mli 17 | $(OCAMLOPT) -c $(OCAMLFLAGS) parser.ml 18 | $(OCAMLOPT) -c $(OCAMLFLAGS) lexer.ml 19 | $(OCAMLOPT) -c $(OCAMLFLAGS) custom_rsh.ml 20 | $(OCAMLOPT) -o $@ $(OCAMLFLAGS) $(OCAMLLIBS) parsetypes.cmx parser.cmx lexer.cmx custom_rsh.cmx $(CLIBS) 21 | 22 | clean: 23 | $(RM) *.cm* *.o* parser.mli custom_rsh.exe parser.ml lexer.ml 24 | -------------------------------------------------------------------------------- /test/utils/custom_rsh/README: -------------------------------------------------------------------------------- 1 | THIS TOOL IS DEPRECATED. 2 | 3 | Use custom_rsh2 instead! 4 | 5 | -------------------------------------------------------------------------------- /test/utils/custom_rsh/lexer.mll: -------------------------------------------------------------------------------- 1 | { 2 | open Parser (* The type token is defined in parser.mli *) 3 | exception Eof 4 | 5 | let debug s = ();; 6 | } 7 | 8 | rule token = parse 9 | [' ' '\t'] { token lexbuf } (* skip blanks *) 10 | | ['\n' ] { debug "EOL"; EOL } 11 | | "[" { debug "LSQBRKT"; LSQBRKT } 12 | | "]" { debug "RSQBRKT"; RSQBRKT } 13 | | "=" { debug "EQUALS"; EQUALS } 14 | | ";" { debug "SC"; SC } 15 | | "EXEC_LIBD" { debug "LIBD"; LIBD } 16 | | "EXEC_HOLTCPCB" { debug "HOLTCPCB"; HOLTCPCB } 17 | | "EXEC_SLURP" { prerr_endline "SLURP"; debug "SLURP"; SLURP } 18 | | "EXEC_INJECTOR" { debug "INJECTOR"; INJECTOR } 19 | | ['a'-'z' 'A'-'Z' '0'-'9' ':' '\\' '/' '.' '-' '(' ')' '_' '{' '}' '\"']+ { debug ("STRING: " ^(Lexing.lexeme lexbuf)); STRING(Lexing.lexeme lexbuf) } 20 | | eof { raise Eof } 21 | -------------------------------------------------------------------------------- /test/utils/custom_rsh/parser.mly: -------------------------------------------------------------------------------- 1 | %{ 2 | open Parsetypes;; 3 | %} 4 | 5 | %token EOL 6 | %token LSQBRKT RSQBRKT EQUALS SC 7 | %token LIBD HOLTCPCB SLURP INJECTOR 8 | %token STRING 9 | 10 | %token EOL 11 | 12 | %start main /* the entry point */ 13 | %type main 14 | %% 15 | 16 | main: 17 | program environment args EOL { ($1,$2,$3) } 18 | ;; 19 | 20 | program: 21 | LIBD { EXEC_LIBD } 22 | | HOLTCPCB { EXEC_HOLTCPCB } 23 | | SLURP { EXEC_SLURP } 24 | | INJECTOR { EXEC_INJECTOR } 25 | ;; 26 | 27 | environment: 28 | LSQBRKT RSQBRKT { [] } 29 | | LSQBRKT env_inner RSQBRKT { $2 } 30 | ;; 31 | 32 | env_inner: 33 | STRING EQUALS STRING SC { [($1, $3)] } 34 | | STRING EQUALS STRING SC env_inner { ($1, $3)::$5 } 35 | ;; 36 | 37 | args: 38 | LSQBRKT RSQBRKT { [] } 39 | | LSQBRKT args_inner RSQBRKT { $2 } 40 | ;; 41 | 42 | args_inner: 43 | string SC { [$1] } 44 | | string SC args_inner { $1::$3 } 45 | 46 | string: 47 | STRING { $1 } 48 | | STRING string { $1^" "^$2 } 49 | ;; 50 | -------------------------------------------------------------------------------- /test/utils/custom_rsh/parsetypes.ml: -------------------------------------------------------------------------------- 1 | type program = 2 | EXEC_LIBD 3 | | EXEC_HOLTCPCB 4 | | EXEC_SLURP 5 | | EXEC_INJECTOR;; 6 | 7 | type parse_ret = program * (string * string) list * string list;; 8 | -------------------------------------------------------------------------------- /test/utils/custom_rsh/parsetypes.mli: -------------------------------------------------------------------------------- 1 | type program = 2 | EXEC_LIBD 3 | | EXEC_HOLTCPCB 4 | | EXEC_SLURP 5 | | EXEC_INJECTOR;; 6 | 7 | type parse_ret = program * (string * string) list * string list;; 8 | -------------------------------------------------------------------------------- /test/utils/custom_rsh/run.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set EXEC_LIBD=D:/Net/TCP/Test/libd/libd.exe 3 | set EXEC_SLURP=D:/Net/TCP/Test/slurp/slurp.exe 4 | set EXEC_INJECTOR=D:/Net/TCP/Test/injector/injector.exe 5 | set EXEC_HOLTCPCB= 6 | 7 | D: 8 | cd \Net\TCP\Test\utils\custom_rsh 9 | custom_rsh 0.0.0.0 100 10 | -------------------------------------------------------------------------------- /test/utils/custom_rsh2/Makefile.win: -------------------------------------------------------------------------------- 1 | 2 | CFLAGS= /W3 /O2 /D "WIN32" /D "DEBUG" 3 | CLIBS= /MT ws2_32.lib 4 | 5 | all: custom_rsh.exe 6 | 7 | custom_rsh.exe: 8 | $(CC) $(CFLAGS) /Fe$@ custom_rsh.c $(CLIBS) 9 | 10 | clean: 11 | del /q /f *.obj custom_rsh.exe 12 | 13 | realclean: clean 14 | 15 | depend: -------------------------------------------------------------------------------- /test/utils/custom_rsh2/README: -------------------------------------------------------------------------------- 1 | This is a custom_rsh tool designed to run on Windows. It is run as a 2 | Windows service using srvany.exe (a WinXP program that will 3 | wrap-aroudn and run any non-interactive win32 program as a Windows 4 | service). 5 | 6 | It listens on a specific IP and port for instruction from tthee to 7 | run or kill one or more of the tools: libd, slurper, or injector with 8 | different command-line arguments. 9 | 10 | Sorry: this is all a bit hacked and undocumented, but it does work :-) 11 | 12 | -------------------------------------------------------------------------------- /test/utils/diags/templates/Makefile: -------------------------------------------------------------------------------- 1 | traceXXXX.labels.mng: generate_dummy_labels.ml 2 | ocaml generate_dummy_labels.ml > traceXXXX.labels.mng 3 | -------------------------------------------------------------------------------- /test/utils/diags/templates/std_postamble.tex: -------------------------------------------------------------------------------- 1 | 2 | % End document 3 | \end{document} 4 | 5 | -------------------------------------------------------------------------------- /test/utils/diags/templates/std_postamble2.tex: -------------------------------------------------------------------------------- 1 | %} 2 | %} 3 | -------------------------------------------------------------------------------- /test/utils/diags/templates/std_postpostamble2.tex: -------------------------------------------------------------------------------- 1 | %\caption{Foo} 2 | %\end{figure} 3 | % End document 4 | \end{document} 5 | -------------------------------------------------------------------------------- /test/utils/diags/templates/std_prepreamble2.tex: -------------------------------------------------------------------------------- 1 | % -*-LaTeX-*- 2 | \documentclass[oneside,notitlepage]{report} 3 | 4 | \usepackage{graphics} 5 | 6 | % Magic to capture RCSID: 7 | {\catcode`\$=9\gdef\rcsid{$Id: std_prepreamble2.tex,v 1.3 2004/12/18 14:41:31 pes20 Exp $}} 8 | 9 | % Get a decent sized page and enable graphics modes 10 | \usepackage[a4paper,margin=15mm]{geometry} 11 | 12 | %use same geometry as tr 13 | \geometry{% 14 | a4paper, 15 | % letterpaper, 16 | dvips, 17 | twoside, 18 | twosideshift=0mm, 19 | left=25.4mm, right=25.4mm, 20 | top=20mm, bottom=30mm, 21 | headheight=\baselineskip, 22 | headsep=10mm, footskip=10mm, %should be equal 23 | % 24 | %20pc (3.33in) wide and 54pc (9in) tall with a column gutter of 2pc (0.33in) 25 | % so 7in wide, 9in tall. 26 | % 177.8mm 228.6 27 | % leaving from a4: 32.2mm 68.4mm 28 | % dividing by 2: 16.1mm ... 29 | % left=16.1mm, right=16.1mm, 30 | % top=20mm, bottom=28.4mm, 31 | } 32 | 33 | 34 | \usepackage{graphics} 35 | \usepackage{color} 36 | \pagestyle{empty} 37 | 38 | \begin{document} 39 | %\begin{figure} 40 | -------------------------------------------------------------------------------- /test/utils/dlhack/README: -------------------------------------------------------------------------------- 1 | Usage: ./dlhack application application_args 2 | 3 | Start the application with the specified arguments but with its socket calls dynamically relinked to go through our instrumented sockets library in order to produce a trace of the applications behaviour. 4 | 5 | Effectively you get: 6 | 7 | Application (e.g. Mozilla) 8 | ------------- 9 | socket_preload 10 | ------------- 11 | nssock 12 | ------------- 13 | glibc 14 | 15 | See Test/dynamic for information on the socket_preload library and look at the dlhack script here for insight to what is going on and how it works. 16 | 17 | `man dlopen` will be of assistance in understanding how all this works. 18 | 19 | 20 | $Id: README,v 1.1 2004/09/17 16:09:33 smb50 Exp $ 21 | 22 | -------------------------------------------------------------------------------- /test/utils/dlhack/dlhack: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | CVSID="\$Id: dlhack,v 1.2 2004/01/13 15:53:47 smb50 Exp $" 3 | 4 | # -------------------------- 5 | # User configurable options 6 | # -------------------------- 7 | 8 | USE_IP=127.0.0.1 9 | USE_PORT=2345 10 | SOCK_DEBUG=0 11 | 12 | LOGGER_TOOL=$NETSEM_TOOLS_PATH/utils/ns_logger/logger 13 | SOCK_LIB=$NETSEM_TOOLS_PATH/dynamic/sockpreload.so 14 | 15 | # ------------ 16 | # Do the work 17 | # ------------ 18 | 19 | OUTFILE=$1 20 | shift 21 | 22 | echo 23 | echo "Netsem dlhack: $CVSID" 24 | echo "Starting logger on $USE_IP:$USE_PORT" 25 | echo "Output file: $OUTFILE" 26 | echo "Application: $@" 27 | echo 28 | 29 | # Give user the chance to see what's about to happen 30 | sleep 3 31 | 32 | # Start the ns_logger tool 33 | $LOGGER_TOOL $USE_IP $USE_PORT >$OUTFILE & 34 | LOGGER_TOOL_PID=$! 35 | 36 | # Start the application in the LD_PRELOAD environment 37 | env NS_ADDR=$USE_IP NS_PORT=$USE_PORT NS_DEBUG=$SOCK_DEBUG NS_DYNAMICLINK=1 LD_PRELOAD=$SOCK_LIB "$@" 38 | 39 | echo "Finished... tidying up" 40 | 41 | # Wait 42 | sleep 1 43 | 44 | # Send SIGKILL (just in case) 45 | kill -9 $LOGGER_TOOL_PID 2&>/dev/null 46 | -------------------------------------------------------------------------------- /test/utils/holtcpcb-v8/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | CFILES=holtcpcb-v8.c 3 | RM=rm -f 4 | 5 | NTPLIBDIR=../../common/ 6 | NTPLIB=ntplib 7 | 8 | all: holtcpcb-v8 9 | 10 | holtcpcb-v8: $(CFILES:.c=.o) 11 | $(CC) -L $(NTPLIBDIR) -o $@ $(CFILES:.c=.o) -l$(NTPLIB) 12 | 13 | clean: 14 | $(RM) $(CFILES:.c=.o) holtcpcb 15 | 16 | realclean: clean 17 | 18 | depend: 19 | 20 | .SUFFIXES:.c .o 21 | 22 | .c.o: 23 | $(CC) -Wall -c $< 24 | 25 | -------------------------------------------------------------------------------- /test/utils/holtcpcb/Makefile: -------------------------------------------------------------------------------- 1 | CC=gcc 2 | CFILES=holtcpcb.c 3 | RM=rm -f 4 | 5 | NTPLIBDIR=../../common/ 6 | NTPLIB=ntplib 7 | 8 | all: holtcpcb 9 | 10 | holtcpcb: $(CFILES:.c=.o) 11 | $(CC) -L $(NTPLIBDIR) -o $@ $(CFILES:.c=.o) -l$(NTPLIB) 12 | 13 | realclean: clean 14 | 15 | clean: 16 | $(RM) $(CFILES:.c=.o) holtcpcb 17 | 18 | depend: 19 | 20 | .SUFFIXES:.c .o 21 | 22 | .c.o: 23 | $(CC) -Wall -c $< 24 | 25 | -------------------------------------------------------------------------------- /test/utils/holtcpcb/holtcpcb_nc: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | holtcpcb $@ | nc $NC_IP $NC_PORT 4 | -------------------------------------------------------------------------------- /test/utils/ns_logger/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | 3 | all: logger tlogger 4 | 5 | logger: logger.c 6 | $(CC) -o $@ logger.c 7 | 8 | tlogger: tlogger.c 9 | $(CC) -o $@ tlogger.c 10 | 11 | clean: 12 | rm -f *.o logger tlogger 13 | 14 | realclean: clean 15 | 16 | depend: 17 | -------------------------------------------------------------------------------- /test/utils/ns_logger/Makefile.win: -------------------------------------------------------------------------------- 1 | CFILES=logger.c 2 | 3 | all: logger.exe 4 | 5 | logger.exe: $(CFILES) 6 | $(CC) /D "WIN32" $(CFILES) ws2_32.lib 7 | 8 | clean: 9 | del /q /f *.obj logger.exe *.idb -------------------------------------------------------------------------------- /test/utils/ns_logger/README: -------------------------------------------------------------------------------- 1 | Accepts incoming TCP connections and echo's any received data to the console. -------------------------------------------------------------------------------- /test/utils/socktools/Makefile: -------------------------------------------------------------------------------- 1 | CC=cc 2 | NSSOCKPATH=../../nssock/ 3 | NSSOCKLIB=nssock 4 | NTPLIBPATH=../../common/ 5 | NTPLIB=ntplib 6 | 7 | SERVERC=sockserv.c 8 | SERVEROUT=sockserv 9 | 10 | CLIENTC=sockclient.c 11 | CLIENTOUT=sockclient 12 | 13 | #add -ldl on Linux 14 | LDFLAGS= 15 | 16 | all: build-server build-client 17 | 18 | build-server: $(SERVERC) ../../nssock/libnssock.a ../../common/libntplib.a 19 | $(CC) -I $(NSSOCKPATH) -L $(NSSOCKPATH) -L $(NTPLIBPATH) \ 20 | -o $(SERVEROUT) $(SERVERC) -l$(NSSOCKLIB) -l$(NTPLIB) $(LDFLAGS) 21 | 22 | build-client: $(CLIENTC) 23 | $(CC) -I $(NSSOCKPATH) -L $(NSSOCKPATH) -L $(NTPLIBPATH) \ 24 | -o $(CLIENTOUT) $(CLIENTC) -l$(NSSOCKLIB) -l$(NTPLIB) $(LDFLAGS) 25 | 26 | clean: 27 | rm -f *.o $(CLIENTOUT) $(SERVEROUT) 28 | 29 | realclean: clean 30 | 31 | depend: 32 | -------------------------------------------------------------------------------- /test/utils/socktools/Makefile.win: -------------------------------------------------------------------------------- 1 | NSSOCKPATH=../../nssock/ 2 | NSSOCKLIB=libnssock.lib 3 | NTPLIBPATH=../../common/ 4 | NTPLIB=libntplib.lib 5 | 6 | # CFLAGS= /O2 /D "WIN32" /I $(NSSOCKPATH) /I $(NTPLIBPATH) 7 | CFLAGS=/O2 /Ob1 /Oy /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_CONSOLE" \ 8 | /GF /FD /EHsc /ML /GS /Gy /W4 /nologo /c /Wp64 /Zi /TC \ 9 | /I $(NSSOCKPATH) /I $(NTPLIBPATH) 10 | 11 | CLIBS= /link /LIBPATH:../../nssock/ /LIBPATH:../../common/ /NODEFAULTLIB:LIBC.lib 12 | 13 | SERVERC=sockserv.c 14 | CLIENTC=sockclient.c 15 | 16 | all: sockserv.exe sockclient.exe 17 | 18 | sockserv.exe: $(SERVERC) 19 | $(CC) $(CFLAGS) /Fe$@ $(SERVERC) $(CLIBS) $(NSSOCKLIB) $(NTPLIB) 20 | 21 | sockclient.exe: $(CLIENTC) 22 | $(CC) $(CFLAGS) /Fe$@ $(CLIENTC) $(CLIBS) $(NSSOCKLIB) $(NTPLIB) 23 | 24 | clean: 25 | del /q /f *.obj sockclient.exe sockserv.exe 26 | -------------------------------------------------------------------------------- /test/utils/socktools/README: -------------------------------------------------------------------------------- 1 | sockclient - a telnet-line client that performs no translation and uses no specical telnet control codes. 2 | 3 | sockserv - a TCP echo-back-to-sender server 4 | -------------------------------------------------------------------------------- /test/utils/timetest/ReadMe.txt: -------------------------------------------------------------------------------- 1 | This directory contains a Visual Studio Solution. It is old code that 2 | was used for playing around with the timestamp counter and 3 | QueryPerformanceCounter, and has been superseded by TSCcal and 4 | TSCtime. 5 | 6 | Enjoy. 7 | 8 | --KW 8-) 9 | -------------------------------------------------------------------------------- /test/utils/timetest/TimeTest.ncb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/test/utils/timetest/TimeTest.ncb -------------------------------------------------------------------------------- /test/utils/timetest/TimeTest.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 7.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TimeTest", "TimeTest.vcproj", "{291D6C5E-8943-4FAF-83EF-1614AAD72447}" 3 | EndProject 4 | Global 5 | GlobalSection(SolutionConfiguration) = preSolution 6 | ConfigName.0 = Debug 7 | ConfigName.1 = Release 8 | EndGlobalSection 9 | GlobalSection(ProjectDependencies) = postSolution 10 | EndGlobalSection 11 | GlobalSection(ProjectConfiguration) = postSolution 12 | {291D6C5E-8943-4FAF-83EF-1614AAD72447}.Debug.ActiveCfg = Debug|Win32 13 | {291D6C5E-8943-4FAF-83EF-1614AAD72447}.Debug.Build.0 = Debug|Win32 14 | {291D6C5E-8943-4FAF-83EF-1614AAD72447}.Release.ActiveCfg = Release|Win32 15 | {291D6C5E-8943-4FAF-83EF-1614AAD72447}.Release.Build.0 = Release|Win32 16 | EndGlobalSection 17 | GlobalSection(ExtensibilityGlobals) = postSolution 18 | EndGlobalSection 19 | GlobalSection(ExtensibilityAddIns) = postSolution 20 | EndGlobalSection 21 | EndGlobal 22 | -------------------------------------------------------------------------------- /test/utils/timetest/TimeTest.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/test/utils/timetest/TimeTest.suo -------------------------------------------------------------------------------- /test/utils/timetest/stdafx.cpp: -------------------------------------------------------------------------------- 1 | // stdafx.cpp : source file that includes just the standard includes 2 | // TimeTest.pch will be the pre-compiled header 3 | // stdafx.obj will contain the pre-compiled type information 4 | 5 | #include "stdafx.h" 6 | 7 | // TODO: reference any additional headers you need in STDAFX.H 8 | // and not in this file 9 | -------------------------------------------------------------------------------- /test/utils/timetest/stdafx.h: -------------------------------------------------------------------------------- 1 | // stdafx.h : include file for standard system include files, 2 | // or project specific include files that are used frequently, but 3 | // are changed infrequently 4 | // 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | // TODO: reference additional headers your program requires here 13 | -------------------------------------------------------------------------------- /test/utils/tsccal/Makefile.win: -------------------------------------------------------------------------------- 1 | # Windows makefile for TSCcal 2 | # 3 | # $Id: Makefile.win,v 1.4 2003/09/25 17:08:00 kw217 Exp $ 4 | # 5 | # Use nmake /f Makefile.win to build. 6 | 7 | CFLAGS=/O2 /Ob1 /Oy /D "WIN32" /D "NDEBUG" /D "_MBCS" /D "_CONSOLE" \ 8 | /GF /FD /EHsc /ML /GS /Gy /W4 /c /nologo /Wp64 /Zi /TP 9 | LINK=link.exe 10 | LDFLAGS=/NOLOGO /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /MACHINE:IX86 \ 11 | kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib \ 12 | advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib 13 | 14 | all: TSCcal.exe 15 | 16 | TSCcal.obj: TSCcal.cpp 17 | $(CC) $(CFLAGS) TSCcal.cpp $(CLIBS) 18 | 19 | TSCcal.exe: TSCcal.obj 20 | $(LINK) TSCcal.obj $(LDFLAGS) /OUT:TSCcal.exe 21 | 22 | clean: 23 | del /q /f *.obj TSCcal.exe 24 | 25 | realclean: clean 26 | 27 | depend: 28 | -------------------------------------------------------------------------------- /test/winxp/README: -------------------------------------------------------------------------------- 1 | The contents of this directory are DEPRECATED. Do not use! This 2 | directory contains various proof-of-concept and experimental code. 3 | 4 | rawtest: C code that implements raw socket sending on WinXP. 5 | -------------------------------------------------------------------------------- /test/winxp/cr.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | cl rawtest.c ws2_32.lib 3 | 4 | rawtest -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/.cvsignore: -------------------------------------------------------------------------------- 1 | tmp-*.tex 2 | rebracket 3 | munge 4 | munge_ocaml 5 | infer 6 | rules_to_latex 7 | wc_strip 8 | munge_lexer.ml 9 | rules_lexer.ml 10 | rules_parser.ml 11 | rules_parser.mli 12 | rules_parser.output 13 | tmp-rules.tex 14 | *.cmi 15 | *.cmo 16 | *.aux 17 | *.dvi 18 | *.log 19 | *.ps 20 | *.pstex *.pstex_t 21 | *.toc 22 | *.ind *.idx *.ilg 23 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/a4labelsdraft.sty: -------------------------------------------------------------------------------- 1 | %NAME: a4labelsdraft.sty 2 | % "moretext" document style option. 3 | % Jean-Francois Lamy, July 86 4 | % 5 | % Redefines the margins so that they are more in line with 6 | % what we are used to see. 7 | % 8 | % [Minimally modified for LaTeX2e, Alexander Holt, August 1994] 9 | 10 | \NeedsTeXFormat{LaTeX2e} 11 | \ProvidesPackage{a4labelsdraft}[1998/04/30] 12 | \RequirePackage{a4} 13 | 14 | 15 | % mods for 10 pt 16 | \oddsidemargin 0.25 in % Left margin on odd-numbered pages. 17 | \evensidemargin 0.0 in % Left margin on even-numbered pages. 18 | \marginparwidth 1 in % Width of marginal notes. 19 | \textwidth 6.00 in % Width of text line. 20 | \textheight 626pt % default=646pt 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/domakeindex: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | makeindex typography 4 | mv typography.ind typography.ind.orig 5 | cat typography.ind.orig | fixind | infer | rebracket | munge > typography.ind 6 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/fixind: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | while (<>) { 4 | s/\[XX\[/[[/g; 5 | s/\]XX\]/]]/g; 6 | print; 7 | } 8 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/leftdisplay.sty: -------------------------------------------------------------------------------- 1 | 2 | \newskip\eqntopsep 3 | \eqntopsep 10pt plus 2\p@ minus 2\p@ 4 | 5 | \newskip\mathindent 6 | \mathindent 1.5em plus 0em minus 1.5em 7 | 8 | \def\[{\relax\ifmmode\@badmath 9 | \else% 10 | \@beginparpenalty\predisplaypenalty 11 | \@endparpenalty\postdisplaypenalty 12 | \begin{trivlist}\@topsep \eqntopsep 13 | \@topsepadd \eqntopsep 14 | \item[]\leavevmode 15 | \hbox to\linewidth\bgroup$ \displaystyle 16 | \hskip\mathindent\bgroup\fi} 17 | \def\]{\relax\ifmmode \egroup $\hfil \egroup 18 | \end{trivlist}% 19 | \else \@badmath \fi} 20 | 21 | 22 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/munge.ml: -------------------------------------------------------------------------------- 1 | (* File munge.ml *) 2 | 3 | (* This does sundry syntax munging to all parts of 4 | stdin between <[ ... ]> (and doesn't echo the delimiters) *) 5 | 6 | let _ = 7 | try 8 | let lexbuf = Lexing.from_channel stdin in 9 | let _ = Munge_lexer.munge lexbuf in () 10 | with Munge_lexer.Eof -> 11 | exit 0 12 | 13 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/munge_ocaml.ml: -------------------------------------------------------------------------------- 1 | (* File munge_ocaml.ml *) 2 | 3 | (* This does sundry ocaml source syntax munging to all parts of 4 | stdin after open Udplange;; *) 5 | 6 | let _ = 7 | try 8 | let lexbuf = Lexing.from_channel stdin in 9 | let _ = Munge_lexer.munge_ocaml lexbuf in () 10 | with Munge_lexer.Eof -> 11 | exit 0 12 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/rebracket.ml: -------------------------------------------------------------------------------- 1 | (* File rebracket.ml *) 2 | 3 | (* this converts [[ and ]] to $<[ and ]>$ *) 4 | 5 | let _ = 6 | try 7 | let lexbuf = Lexing.from_channel stdin in 8 | let _ = Munge_lexer.rebracket lexbuf in () 9 | with Munge_lexer.Eof -> 10 | exit 0 11 | 12 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/rules_syntax.mli: -------------------------------------------------------------------------------- 1 | type r = 2 | Out of string 3 | | In of string 4 | | Tau 5 | | Equal 6 | 7 | type t = 8 | Section of string * string (* name,comment *) 9 | | Subsection of string * string (* name,comment *) 10 | | Rule of string * string * string * r * string * string * string 11 | (* name, annot, lhs, relation, rhs, cond, comment *) 12 | 13 | -------------------------------------------------------------------------------- /unmaintained/Net/DocTools/wc_strip.ml: -------------------------------------------------------------------------------- 1 | (* File wc_strip.ml *) 2 | 3 | (* this hackily removes \[..\], [[...]], \... and whichversion.1..whichversion.2 *) 4 | 5 | let _ = 6 | try 7 | let lexbuf = Lexing.from_channel stdin in 8 | let _ = Munge_lexer.wc lexbuf in () 9 | with Munge_lexer.Eof -> 10 | exit 0 11 | 12 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=bash 2 | .SUFFIXES: 3 | 4 | ################################################################################ 5 | # export Spec1 and Spec3 in a single tarball 6 | 7 | # want to use the sub makes 8 | all: 9 | rm -rf tarball-Spec-1-and-3-public* 10 | rm -rf Spec1/tarball-Spec1-public* 11 | rm -rf Spec3/tarball-Spec3-public* 12 | mkdir tarball-Spec-1-and-3-public 13 | #cd Spec1 && Holmake HolDoc.sml HolDoc.sig && make tarball-Spec1-public 14 | cd Spec1 && make tarball-Spec1-public 15 | cd Spec3 && make tarball-Spec3-public 16 | mv Spec1/tarball-Spec1-public/Spec1 tarball-Spec-1-and-3-public 17 | mv Spec3/tarball-Spec3-public/Spec3 tarball-Spec-1-and-3-public 18 | cp README tarball-Spec-1-and-3-public 19 | cp LICENSE-spec-public tarball-Spec-1-and-3-public 20 | tar -cvz -f tarball-Spec-1-and-3-public.tar.gz tarball-Spec-1-and-3-public 21 | 22 | install: 23 | cp tarball-Spec-1-and-3-public.tar.gz ~/public_html/Netsem 24 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Notes1/TCP1_level0-first-draft.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/Net/TCP/Notes1/TCP1_level0-first-draft.jpg -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Notes1/levels.txt: -------------------------------------------------------------------------------- 1 | LEVELS of implementation: 2 | ~~~~~~~~~~~~~~~~~~~~~~~~~ 3 | 4 | 0: POSIX alone 5 | 6 | 1: POSIX + sock-visible TCP states + networky streamy thing 7 | 8 | 1': like 1, but in a reliable world (useless) 9 | 1'': small frag of 1 in a reliable world (might be useful) 10 | 11 | 2: POSIX + wire-format TCP states and messages, 12 | nondeterministic flow control 13 | 14 | 3: (virtual node :-)): a particular algorithm, deterministic. 15 | 16 | 3.1: 2 + flow control algorithms, but in other places still nondet 17 | 3.2: refinement of 3.1 which is deterministic in all the 18 | algorithmic places. 19 | 20 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Notes1/linux-debug-tracing.txt: -------------------------------------------------------------------------------- 1 | I guess one of the linux networking lists would be a better place 2 | to ask this. Anyway, you can get cwnd through the TCP socket 3 | monitoring 4 | interface using the "ss"-tool from iproute2 5 | (http://developer.osdl.org/dev/iproute2) or by getsockopt(TCP_INFO). 6 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Notes1/munge.mk: -------------------------------------------------------------------------------- 1 | 2 | # munge.mk - user-specific configuration file for munging: 3 | # 4 | 5 | # 6 | # Location of mng_to_latex: 7 | # 8 | #MNGTOLATEXDIR=/usr/groups/tthee/local/hol98/tools/holdoc 9 | MNGTOLATEXDIR=$(HOME)/HOLDoc 10 | 11 | HOLMNGDIR=../../HOLDoc 12 | 13 | MNGTOLATEX=${MNGTOLATEXDIR}/mng_to_latex 14 | 15 | # 16 | # Path(s) to miscellaneous TeXery required 17 | # 18 | EXTRATEXINPUTS+=$(MNGTOLATEXDIR):$(HOLMNGDIR) 19 | 20 | # 21 | # Location of various standard programs: 22 | # 23 | # you can safely replace hugelatex with latex, 24 | # if it's not on your system... 25 | LATEX=hugelatex 26 | DVIPS=dvips 27 | 28 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Notes1/pointers.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/Net/TCP/Notes1/pointers.txt -------------------------------------------------------------------------------- /unmaintained/Net/TCP/README-tarball: -------------------------------------------------------------------------------- 1 | # To build the NetSem TCP specifications: 2 | # 3 | # Version 2.01 of mosml was used, with the patched gc_ctrl.c from Mar 5, 2008 4 | # 5 | # The version of HOL used was that of 2008-01-01 (svn checkout from sourceforge) 6 | # 7 | # There are two specifications: the protocol-level specification and the service-level specification. These live in 8 | # directories Spec1 and Spec3 respectively. 9 | # 10 | # Changelog: 11 | # 12 | # 2011-11-17 Updated licenses, checked HOL compilation on i386 kubuntu 10.10 system. 13 | # 14 | 15 | 16 | # Unpack tarball-spec-public.tar.gz to tmp by typing 17 | tar -C /tmp -xvzf tarball-spec-public.tar.gz 18 | 19 | # check that Spec1 is accepted by HOL 20 | cd /tmp/tarball-spec-public/Spec1 21 | Holmake --holmakefile Holmakefile.public 22 | 23 | # check that Spec3 is accepted by HOL 24 | cd /tmp/tarball-spec-public/Spec3 25 | Holmake TCP3_absFunTheory.uo 26 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec2/.cvsignore: -------------------------------------------------------------------------------- 1 | .HOLMK 2 | *.ui *.uo *Theory.sig *Theory.sml 3 | *LTS-doc.ps *LTS-doc.tex *LTS.errs *LTS.tex 4 | TCP1_auto.imn TCP1_?*.imn NetEval.imn 5 | *.errs *.aux *.dvi *.log *.toc *.mk word16Lib.sml word32Lib.sml 6 | HolDoc.sml HolDoc.sig strings.sml 7 | glossary.ps 8 | *-doc.ps 9 | *-doc.tex 10 | *.tmp-tex 11 | *.tmp2-tex 12 | *.tmp3-tex 13 | alldoc.ps 14 | alldoc.pdf 15 | alldoc.tex 16 | alldoc.out 17 | alldoc-c.ps 18 | alldoc-c.pdf 19 | alldoc-c.tex 20 | alldoc-c.out 21 | alldoc-inc.tex 22 | *.idx 23 | *.ilg 24 | *.ind 25 | *-doc.pdf 26 | *.tob 27 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec2/Phase.sig: -------------------------------------------------------------------------------- 1 | signature Phase = sig 2 | 3 | exception PhaseRange 4 | 5 | (* for use in Script files *) 6 | val add_to_phase : int -> string -> unit 7 | val phase : int -> ('a -> HolKernel.thm) -> 'a -> HolKernel.thm 8 | val phase_x : int -> (string -> 'b -> HolKernel.thm) -> 9 | string -> 'b -> HolKernel.thm 10 | (* for use in Theory or other files *) 11 | val add_to_phase_imm : int -> HolKernel.thm -> unit 12 | val phase_imm : int -> HolKernel.thm -> HolKernel.thm 13 | (* read back the phase list *) 14 | val get_phase_list : int -> HolKernel.thm list 15 | 16 | end 17 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec2/TCP1_hostLTSScript.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/Net/TCP/Spec2/TCP1_hostLTSScript.sml -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec2/Version.sig: -------------------------------------------------------------------------------- 1 | signature Version = sig 2 | 3 | val register : string -> string -> string -> unit 4 | val registerTheory : string -> string -> string -> unit 5 | val get : unit -> (string * string * string) list 6 | val getString : unit -> string 7 | val getTable : unit -> string 8 | 9 | end; 10 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/.cvsignore: -------------------------------------------------------------------------------- 1 | *.imn 2 | trace0595 3 | sample-check 4 | 5 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/Holmakefile: -------------------------------------------------------------------------------- 1 | INCLUDES = ../../../../specification 2 | 3 | all: check_3trace evalAbsFun.exe GroundConflate.exe 4 | 5 | # Just make the theory files, not the checker. Sufficient to build alldoc. 6 | just_theories: TCP3_absFunTheory.uo 7 | 8 | # FIXME TCP3_urgencyTheory added by tjr- should this be here? 9 | check_3trace: check-sketch.uo TCP3_urgencyTheory.uo TCP3_bettersTheory.uo fastRulesTheory.uo 10 | $(HOLMOSMLC) -o $@ $< 11 | 12 | word32relnorm.uo: word32relnorm.sml word32relnorm.ui 13 | $(HOLMOSMLC) -c Overlay.ui GenRelNorm.ui $< 14 | 15 | evalAbsFun.sml: evalAbsFun.ml 16 | cp evalAbsFun.ml evalAbsFun.sml # horrible- but couldn't get mosml to compile .ml file 17 | 18 | evalAbsFun.exe: evalAbsFun.uo 19 | $(HOLMOSMLC) -o $@ $< #evalAbsFun.uo 20 | # rm evalAbsFun.sml 21 | 22 | 23 | GroundConflate.exe: GroundConflate.uo 24 | $(HOLMOSMLC) -o $@ $< 25 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/TCP3_hostLTSScript.sml: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/Net/TCP/Spec3/TCP3_hostLTSScript.sml -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/alldoc-between.template: -------------------------------------------------------------------------------- 1 | \part{THEORYNAME} 2 | \def\rulesrcsid{} 3 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/alldoc-post.template: -------------------------------------------------------------------------------- 1 | % -*-LaTeX-*- 2 | \def\rulesrcsid{} 3 | 4 | \backmatter 5 | 6 | %\bibliographystyle{alpha} 7 | \bibliographystyle{abbrv} 8 | \bibliography{tr} 9 | 10 | \addcontentsline{toc}{chapter}{Index} 11 | 12 | \printindex 13 | 14 | 15 | 16 | \end{document} 17 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/munge.mk.in: -------------------------------------------------------------------------------- 1 | # DO NOT EDIT THIS MASTER FILE (munge.mk.in) - edit munge.mk instead. 2 | # munge.mk - user-specific configuration file for munging: 3 | 4 | # 5 | # Location of mng_to_latex: 6 | # 7 | HOLDOCDIR=${HOME}/WAP/HOLDoc 8 | 9 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/stream_spec/absFunCommute.pstex_t: -------------------------------------------------------------------------------- 1 | \begin{picture}(0,0)% 2 | \includegraphics{absFunCommute.pstex}% 3 | \end{picture}% 4 | \setlength{\unitlength}{4736sp}% 5 | % 6 | \begingroup\makeatletter\ifx\SetFigFont\undefined% 7 | \gdef\SetFigFont#1#2#3#4#5{% 8 | \reset@font\fontsize{#1}{#2pt}% 9 | \fontfamily{#3}\fontseries{#4}\fontshape{#5}% 10 | \selectfont}% 11 | \fi\endgroup% 12 | \begin{picture}(10824,4699)(1189,-9248) 13 | \end{picture}% 14 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/stream_spec/absFunCommute3.pstex_t: -------------------------------------------------------------------------------- 1 | \begin{picture}(0,0)% 2 | \includegraphics{absFunCommute3.pstex}% 3 | \end{picture}% 4 | \setlength{\unitlength}{3315sp}% 5 | % 6 | \begingroup\makeatletter\ifx\SetFigFont\undefined% 7 | \gdef\SetFigFont#1#2#3#4#5{% 8 | \reset@font\fontsize{#1}{#2pt}% 9 | \fontfamily{#3}\fontseries{#4}\fontshape{#5}% 10 | \selectfont}% 11 | \fi\endgroup% 12 | \begin{picture}(4261,2187)(796,-3946) 13 | \end{picture}% 14 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/stream_spec/fm08_reviews.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/Net/TCP/Spec3/stream_spec/fm08_reviews.txt -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/stream_spec/generated/Makefile: -------------------------------------------------------------------------------- 1 | all: alldoc-inc.tex Spec3_alldoc-inc.tex TCP1_auto.imn TCP1_.imn 2 | 3 | TCP1_auto.imn: ../../../Spec1/TCP1_auto.imn 4 | cp $^ $@ 5 | 6 | TCP1_.imn: ../../../Spec1/TCP1_.imn 7 | cp $^ $@ 8 | 9 | alldoc-inc.tex: ../../../Spec1/alldoc-inc.tex 10 | cp $^ $@ 11 | 12 | Spec3_alldoc-inc.tex: ../../../Spec3/alldoc-inc.tex 13 | cp $^ $@ 14 | 15 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/stream_spec/stream_spec.mng: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/Net/TCP/Spec3/stream_spec/stream_spec.mng -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/stream_spec/stream_spec.mng~: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/Net/TCP/Spec3/stream_spec/stream_spec.mng~ -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/stream_spec/stream_spec.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/Net/TCP/Spec3/stream_spec/stream_spec.tex -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/tcp.sty: -------------------------------------------------------------------------------- 1 | % tcp.sty -- extra stuff for TCP spec 2 | % 3 | \ProvidesPackage{tcp} 4 | 5 | \newcommand{\ie}{i.e.\@} 6 | \newcommand{\wasverb}[1]{\texttt{#1}} -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/todo: -------------------------------------------------------------------------------- 1 | Tue Nov 28 11:35:53 GMT 2006 TMP phone 2 | 3 | tentatively aim for SIGCOMM07 deadline (31 Jan) (constraints: Michael 4 | in Perth last two weeks December; Tom's scheduled interruption on 7 5 | Jan) 6 | 7 | look through trace set 8 | - select traces that exemplify stuff (and maybe write a few new ones) 9 | - look at Adam's mirror and make a few lossy traces (a bit later) 10 | - maybe aim for 100 checked traces? 11 | 12 | polish and package abstractor 13 | 14 | write level3 checker and package (run by hand at first, maybe adapt the 15 | checking infrastructure to htmlize etc) 16 | 17 | change form of transition relation. consensus seemed to be to move to 18 | h,S,M ---l---> h',S',M' where S and M are _all_ the streams and messages 19 | in the network 20 | 21 | abstraction relation and function - state a relation (just on low and high level network configurations, or low and high pairs-of-hosts-with-streams-and-messages?) explicitly, and prove (shock) that the abstraction function hits it 22 | 23 | make sure spec3 typesets 24 | 25 | muse on possible proofs of invariants about reachable pairs of TCPSTATEs and wire messages 26 | -------------------------------------------------------------------------------- /unmaintained/Net/TCP/Spec3/word32relnorm.sig: -------------------------------------------------------------------------------- 1 | signature word32relnorm = 2 | sig 3 | 4 | val word32_eqnorm : Term.term -> Thm.thm 5 | 6 | end; 7 | -------------------------------------------------------------------------------- /unmaintained/README: -------------------------------------------------------------------------------- 1 | The Net/ directory is based on the latest CVS version; it contains the segment- and stream-level specifications, trace checker, test generation, and testing infrastructure tools. 2 | 3 | The TCP-HOL4 and TCP-LEM directories are a port of the specifications to [Lem](https://bitbucket.org/Peter_Sewell/lem/). 4 | -------------------------------------------------------------------------------- /unmaintained/TCP-LEM/Spec1/Holmakefile.public: -------------------------------------------------------------------------------- 1 | all: HolDoc.sml HolDoc.sig word16Theory.ui word16Theory.uo word32Theory.uo word32Theory.ui TCP1_net1Theory.uo 2 | 3 | word16Theory.ui word16Theory.uo : \ 4 | $(SIGOBJ)/wordFunctor.ui $(SIGOBJ)/wordFunctorLib.ui \ 5 | $(SIGOBJ)/bitsTheory.ui 6 | $(HOLDIR)/bin/mkword.exe 16 7 | 8 | word32Theory.uo word32Theory.ui : \ 9 | $(SIGOBJ)/wordFunctor.ui $(SIGOBJ)/wordFunctorLib.ui \ 10 | $(SIGOBJ)/bitsTheory.ui 11 | $(HOLDIR)/bin/mkword.exe 32 12 | 13 | HolDoc.sml HolDoc.sig : \ 14 | $(HOLDIR)/tools/holdoc/HolDoc.sml \ 15 | $(HOLDIR)/tools/holdoc/HolDoc.sig 16 | cp $(HOLDIR)/tools/holdoc/HolDoc.sml $(HOLDIR)/tools/holdoc/HolDoc.sig . 17 | -------------------------------------------------------------------------------- /unmaintained/TCP-LEM/Spec1/Makefile: -------------------------------------------------------------------------------- 1 | SHELL=bash 2 | 3 | LEM=lem.sh # local alias for lem, with -lib set appropriately 4 | 5 | LEMS=TCP1_lemSupport.lem TCP1_errors.lem TCP1_signals.lem TCP1_utils.lem TCP1_baseTypes.lem TCP1_timers.lem TCP1_params.lem TCP1_netTypes.lem TCP1_preHostTypes.lem TCP1_LIBinterface.lem TCP1_hostTypes.lem TCP1_host0.lem TCP1_ruleids.lem TCP1_auxFns.lem TCP1_hostLTS.lem # TCP1_net.lem TCP1_net1.lem 6 | 7 | # TCP1_evalSupport.lem - this file is not relevant to the spec; it 8 | # defines a simple host, presumably used for testing purposes 9 | 10 | all: 11 | $(LEM) $(LEMS) 12 | 13 | hol: 14 | $(LEM) -hol TCP1_lemSupport.lem 15 | 16 | FIXMES: 17 | -grep FIXME TCP1_errors.lem TCP1_signals.lem TCP1_utils.lem TCP1_baseTypes.lem TCP1_timers.lem TCP1_params.lem TCP1_netTypes.lem TCP1_preHostTypes.lem TCP1_LIBinterface.lem TCP1_hostTypes.lem TCP1_host0.lem TCP1_ruleids.lem TCP1_auxFns.lem TCP1_hostLTS.lem 18 | 19 | types: 20 | $(LEM) -print_env $(LEMS) 21 | 22 | clean: 23 | rm -f *{.ml,Script.sml} 24 | -------------------------------------------------------------------------------- /unmaintained/TCP-LEM/Spec1/TCP1_hostLTS.lem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rems-project/netsem/0b02450eee334fc42f74ad3da09d3ce1a0698a48/unmaintained/TCP-LEM/Spec1/TCP1_hostLTS.lem -------------------------------------------------------------------------------- /unmaintained/TCP-LEM/Spec1/old/HolDoc.sig: -------------------------------------------------------------------------------- 1 | signature HolDoc = sig 2 | 3 | (* 4 | 5 | Code to automatically generate .imn information for theories at 6 | export time. Output is in file .imn. 7 | 8 | To get this to work it must be the last module opened (more 9 | accurately, it must override bossLib and HolKernel, and so must 10 | follow these two). 11 | 12 | *) 13 | 14 | include Abbrev 15 | val export_theory : unit -> unit 16 | val Define : term quotation -> thm 17 | val xDefine : string -> term quotation -> thm 18 | 19 | end; 20 | -------------------------------------------------------------------------------- /unmaintained/TCP-LEM/Spec1/old/Net_Hol_reln.sig: -------------------------------------------------------------------------------- 1 | signature Net_Hol_reln = sig 2 | include Abbrev 3 | (* provides an inductive definition tool that copes with backwards *) 4 | (* implications (as well as forwards ones) *) 5 | val Net_Hol_reln : term quotation -> thm * thm * thm 6 | end; 7 | -------------------------------------------------------------------------------- /unmaintained/TCP-LEM/Spec1/old/Phase.sig: -------------------------------------------------------------------------------- 1 | signature Phase = sig 2 | 3 | exception PhaseRange 4 | 5 | (* for use in Script files *) 6 | val add_to_phase : int -> string -> unit 7 | val phase : int -> ('a -> HolKernel.thm) -> 'a -> HolKernel.thm 8 | val phase_x : int -> (string -> 'b -> HolKernel.thm) -> 9 | string -> 'b -> HolKernel.thm 10 | (* for use in Theory or other files *) 11 | val add_to_phase_imm : int -> HolKernel.thm -> unit 12 | val phase_imm : int -> HolKernel.thm -> HolKernel.thm 13 | (* read back the phase list *) 14 | val get_phase_list : int -> HolKernel.thm list 15 | 16 | end 17 | -------------------------------------------------------------------------------- /unmaintained/TCP-LEM/Spec1/old/Version.sig: -------------------------------------------------------------------------------- 1 | signature Version = sig 2 | 3 | val register : string -> string -> string -> unit 4 | val registerTheory : string -> string -> string -> unit 5 | val get : unit -> (string * string * string) list 6 | val getString : unit -> string 7 | val getTable : unit -> string 8 | 9 | end; 10 | --------------------------------------------------------------------------------