├── .gitignore ├── .travis.yml ├── CHANGES.md ├── CODE_OF_CONDUCT.md ├── CREDITS.md ├── Makefile ├── Makefile.inc ├── Makefile.top ├── Makefile.ver ├── README.md ├── build-setup-travis.sh ├── doc ├── decode_template.txt ├── network-1.png ├── network-1.svg ├── testnetwork.png └── testnetwork.svg ├── include ├── counter_names.h ├── dag.h ├── dao.h ├── debug.h ├── devid.h ├── dio.h ├── dis.h ├── ether.h ├── event.h ├── fakegrasp.h ├── fakeiface.h ├── grasp.h ├── hexdump.c ├── iface.h ├── mbedtls.h ├── neighbour.h ├── netlink │ ├── libnetlink.h │ ├── ll_map.h │ ├── rt_names.h │ ├── rtm_map.h │ └── utils.h ├── node.h ├── oswconstants.h ├── oswlibs.h ├── pathnames.h ├── prefix.h ├── rpl.h ├── rplmsg.h ├── sll.h └── unstrung.h ├── install-apk-deps.sh ├── install-apt-deps.sh ├── install-git-deps.sh ├── lib ├── Makefile ├── Makefile.library ├── libfakeiface │ ├── .gitignore │ ├── Makefile │ ├── Makefile.depend.Linux.i686 │ ├── Makefile.depend.Linux.x86_64 │ └── pcap_iface.cpp ├── libgrasp │ ├── .gitignore │ ├── Makefile │ ├── client.cpp │ ├── grasp.cddl │ └── rnd_regress.cpp ├── libidevid │ ├── Makefile │ ├── eui64.cpp │ └── rfc8994acp.cpp ├── libndmgmt │ ├── .gitignore │ ├── Makefile │ ├── Makefile.depend.Linux.x86_64 │ ├── counter_names.c │ ├── dag.cpp │ ├── dao.cpp │ ├── daoack.cpp │ ├── debug.cpp │ ├── dio.cpp │ ├── dis.cpp │ ├── event.cpp │ ├── iface.cpp │ ├── ifacefuncs.cpp │ ├── neighbouradvert.cpp │ ├── neighboursolicit.cpp │ ├── netlink.cpp │ ├── node.cpp │ ├── peers.cpp │ ├── prefix.cpp │ └── rplmsg.cpp ├── libnetlink │ ├── .gitignore │ ├── Makefile │ ├── Makefile.depend.Linux.i686 │ ├── dnet_ntop.c │ ├── dnet_pton.c │ ├── inet_proto.c │ ├── ipx_ntop.c │ ├── ipx_pton.c │ ├── libnetlink.c │ ├── ll_addr.c │ ├── ll_map.c │ ├── ll_proto.c │ ├── ll_types.c │ ├── rt_names.c │ └── utils.c └── libosw │ ├── .gitignore │ ├── Makefile │ ├── Makefile.depend.Linux.i686 │ ├── addrtot.c │ ├── addrtypeof.c │ ├── anyaddr.c │ ├── initaddr.c │ ├── initsubnet.c │ ├── portof.c │ ├── sameaddr.c │ ├── subnettot.c │ ├── subnettypeof.c │ ├── ttoaddr.c │ ├── ttosubnet.c │ ├── ttoul.c │ └── ultot.c ├── packaging ├── generic │ └── Makefile.local.sample ├── openwrt │ ├── Makefile │ ├── OPENWRT.md │ ├── build-unstrung.sh │ ├── files │ │ └── sunshine.init │ └── upload.sh └── utils │ └── makeshadowdir ├── programs ├── .gitignore ├── Makefile ├── Makefile.manpages ├── Makefile.program ├── peck │ ├── .gitignore │ ├── Makefile │ ├── peck.8 │ ├── peck.8.ronn │ └── peck.cpp ├── senddao │ ├── .gitignore │ ├── Makefile │ ├── senddao.8 │ ├── senddao.8.xml │ └── senddao.cpp ├── senddio │ ├── .gitignore │ ├── Makefile │ ├── Makefile.depend.Linux.x86_64 │ ├── pathnames.h │ ├── senddio.8 │ ├── senddio.8.xml │ └── senddio.cpp ├── sendnd │ ├── .gitignore │ ├── Makefile │ ├── sendnd.8 │ ├── sendnd.8.ronn │ └── sendnd.cpp └── sunshine │ ├── .gitignore │ ├── Makefile │ ├── Makefile.depend.x86_64 │ ├── main.cpp │ ├── nA.sh │ ├── nE.sh │ ├── sendnd.cpp │ ├── sunshine.8 │ ├── sunshine.8.ronn │ └── sunshine.h ├── quick_start_guide.md └── testing ├── Makefile ├── baseconfigs ├── A │ ├── etc │ │ ├── fstab │ │ ├── hostname │ │ ├── network │ │ │ └── interfaces │ │ └── sysctl.conf │ └── root │ │ └── a1.sh ├── E │ ├── etc │ │ ├── fstab │ │ ├── hostname │ │ ├── network │ │ │ └── interfaces │ │ └── sysctl.conf │ └── root │ │ └── e1.sh ├── J │ ├── etc │ │ ├── fstab │ │ ├── hostname │ │ ├── network │ │ │ └── interfaces │ │ └── sysctl.conf │ └── root │ │ └── j1.sh ├── K │ └── etc │ │ ├── fstab │ │ └── hostname ├── M │ └── etc │ │ ├── fstab │ │ └── hostname ├── N │ ├── etc │ │ ├── fstab │ │ ├── hostname │ │ └── network │ │ │ └── interfaces │ └── root │ │ └── n1.sh ├── all │ └── etc │ │ ├── fstab │ │ ├── inittab │ │ └── udev │ │ └── links.conf ├── net.A.sh ├── net.B.sh ├── net.E.sh ├── net.J.sh ├── net.M.sh ├── net.N.sh └── umlsetup-example-obiwan.txt ├── functional ├── recv-02 │ ├── description.txt │ ├── econsole.txt │ ├── n1-output.txt │ ├── sunfinal.sh │ ├── sunshine.sh │ └── testparams.sh ├── recv-03 │ ├── description.txt │ ├── econsole.txt │ ├── n1-output.txt │ ├── sunfinal.sh │ ├── sunshine.sh │ └── testparams.sh ├── recvself-05 │ ├── aconsole.txt │ ├── asunshine.sh │ ├── description.txt │ ├── n1-output.txt │ ├── sunfinal.sh │ └── testparams.sh ├── send-01 │ ├── asunshine.sh │ ├── description.txt │ ├── econsole.txt │ ├── esunshine.sh │ ├── n1-output.txt │ ├── sleep5.sh │ ├── sunfinal.sh │ └── testparams.sh └── senddio-04 │ ├── aconsole.txt │ ├── description.txt │ ├── dio1.sh │ ├── n1-output.txt │ └── testparams.sh ├── kernelconfigs ├── canonicalize_kernel_config.pl ├── umlplain.config ├── umlplain26.config └── updatekernelconfig.sh ├── unit ├── .gitignore ├── 01-osw │ ├── .gitignore │ └── Makefile ├── 03-dioopt │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ └── dioopt-01.cpp ├── 04-dag │ ├── .gitignore │ ├── Makefile │ └── dag-01.cpp ├── 05-dag │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ └── dag-05.cpp ├── 06-dag │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ ├── dag-03.cpp │ └── description.txt ├── 07-dagset │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ └── dagset-01.cpp ├── 08-event │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ └── event-01.cpp ├── 09-netlink │ ├── .gitignore │ ├── Makefile │ └── dumpif.cpp ├── 10-netlink │ ├── .gitignore │ ├── Makefile │ ├── findeui.cpp │ └── marajade.output.txt ├── 11-senddao │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ ├── description.txt │ ├── senddao-test-01.err │ ├── senddao-test-01.out │ ├── senddao-test-01.sh │ ├── senddao-test-02-pcap.txt │ ├── senddao-test-02.out │ ├── senddao-test-02.sh │ ├── senddao-test-03.out │ ├── senddao-test-03.sh │ ├── senddao-test-04-pcap.txt │ ├── senddao-test-04.out │ └── senddao-test-04.sh ├── 12-senddio │ ├── .gdbinit-short │ ├── .gitignore │ ├── Makefile │ ├── decoded-test-04.txt │ ├── senddio-test-01.err │ ├── senddio-test-01.out │ ├── senddio-test-01.sh │ ├── senddio-test-02.out │ ├── senddio-test-02.sh │ ├── senddio-test-03-pcap.txt │ ├── senddio-test-03.gdb │ ├── senddio-test-03.out │ ├── senddio-test-03.sh │ ├── senddio-test-04.out │ ├── senddio-test-04.sh │ ├── senddio-test-05-pcap.txt │ ├── senddio-test-05.out │ └── senddio-test-05.sh ├── 13-selfprefix │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ ├── description.txt │ ├── selfprefix-13-output.txt │ └── selfprefix-13.cpp ├── 14-sunshine │ ├── .gitignore │ ├── Makefile │ ├── description.txt │ ├── pathnames.sed │ └── sunshine-help.txt ├── 15-builddao │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ ├── builddao-01.cpp │ ├── dao-out.txt │ ├── dao.txt │ └── description.txt ├── 16-vf │ ├── .gitignore │ ├── Makefile │ ├── base.cpp │ ├── base.h │ ├── derived.cpp │ ├── derived.h │ ├── expected.txt │ └── vf.cpp ├── 17-recvdao │ ├── .gdbinit │ ├── .gitignore │ ├── 17-node-A-capture.txt │ ├── 17-recvdao-output.txt │ ├── 17-recvdao.cpp │ ├── Makefile │ └── description.txt ├── 18-checksum │ ├── .gdbinit │ ├── .gitignore │ ├── 18-checksum.cpp │ ├── Makefile │ └── description.txt ├── 19-pickdag │ ├── .gdbinit │ ├── .gitignore │ ├── 19-pickdag-output.txt │ ├── 19-pickdag-pcap.txt │ ├── 19-pickdag.cpp │ ├── Makefile │ └── description.txt ├── 20-prefix │ ├── .gitignore │ ├── 20-prefixtests.cpp │ ├── Makefile │ └── description.txt ├── 21-node │ ├── .gitignore │ ├── 21-inttests.cpp │ ├── 21-nodetests.cpp │ ├── Makefile │ └── description.txt ├── 22-queues │ ├── .gitignore │ ├── 22-queues-out.txt │ ├── 22-queues.cpp │ ├── Makefile │ └── description.txt ├── 23-selfdio │ ├── .gdbinit │ ├── .gitignore │ ├── 23-selfdio-out.txt │ ├── 23-selfdio.cpp │ ├── Makefile │ └── description.txt ├── 24-daoreply │ ├── .gdbinit │ ├── .gitignore │ ├── 24-daoreply-out.txt │ ├── 24-daoreply.cpp │ ├── 24-node-E-capture.txt │ ├── 24-node-E-dio.txt │ ├── Makefile │ ├── daoackA.cpp │ ├── description.txt │ ├── dioA.cpp │ └── pedigree.txt ├── 25-childdio │ ├── .gdbinit │ ├── .gitignore │ ├── 25-childdio-output.txt │ ├── 25-childdio.cpp │ ├── Makefile │ └── description.txt ├── 26-senddaoack │ ├── .gdbinit │ ├── .gitignore │ ├── Makefile │ ├── description.txt │ ├── senddaoack-test-01-pcap.txt │ └── senddaoack-test-01.txt ├── 27-daoreplydao │ ├── .gdbinit │ ├── .gitignore │ ├── 27-daoreplydao.cpp │ ├── Makefile │ ├── daoreply-out.txt │ ├── description.txt │ └── node-E-dio.txt ├── 28-daowrongack │ ├── .gitignore │ ├── 28-daowrongack-out.txt │ ├── 28-daowrongack.cpp │ ├── 28-node-E-capture.txt │ ├── Makefile │ └── description.txt ├── 29-daoreply-nopio │ ├── .gdbinit │ ├── .gitignore │ ├── 29-daoreply-nopio-out.txt │ ├── 29-daoreply-nopio.cpp │ ├── 29-node-E-capture.txt │ ├── Makefile │ ├── description.txt │ └── pedigree.txt ├── 30-ackdao │ ├── .gdbinit │ ├── .gitignore │ ├── 30-ackdao-output.txt │ ├── 30-ackdao.cpp │ ├── 30-node-A-capture.txt │ ├── Makefile │ └── description.txt ├── 31-daoreply-extraprefix │ ├── .gdbinit │ ├── .gitignore │ ├── 31-daoreply-extra-out.txt │ ├── 31-daoreply-extra.cpp │ ├── 31-node-E-capture.txt │ ├── Makefile │ ├── description.txt │ └── pedigree.txt ├── 32-daoreply-onlyif │ ├── .gitignore │ ├── 32-daoreply-onlyif-out.txt │ ├── 32-daoreply-onlyif.cpp │ ├── 32-node-E-capture.txt │ ├── Makefile │ ├── description.txt │ └── pedigree.txt ├── 33-newifdao │ ├── .gitignore │ ├── 33-newifdao-out.txt │ ├── 33-newifdao.cpp │ ├── Makefile │ └── description.txt ├── 34-builddis │ ├── .gitignore │ ├── 34-builddis.cpp │ ├── Makefile │ ├── description.txt │ ├── dis.txt │ ├── node-E-dis-out.txt │ └── node-E-dis.txt ├── 35-recvdis │ ├── .gdbinit │ ├── .gitignore │ ├── 35-node-A-capture.txt │ ├── 35-recvdis-output.txt │ ├── 35-recvdis.cpp │ ├── Makefile │ └── description.txt ├── 36-peckusage │ ├── .gitignore │ ├── Makefile │ ├── SIGNING.md │ ├── mic.pem │ ├── peck-test-01.out │ ├── peck-test-01.sh │ └── vendor_secp384r1.crt ├── 37-fmteui │ ├── .gitignore │ ├── Makefile │ └── fmteui.cpp ├── 38-builddaoack │ ├── .gdbinit │ ├── .gitignore │ ├── 26-builddaoack.cpp │ ├── Makefile │ ├── daoack-out.txt │ ├── daoack.txt │ └── description.txt ├── 39-daoJ │ ├── .gitignore │ ├── 39-dao-J.txt │ ├── 39-daoJ.cpp │ ├── Makefile │ ├── description.txt │ └── node-J-dao-out.txt ├── 40-build-ns │ ├── .gitignore │ ├── Makefile │ ├── description.txt │ ├── send-nd-test-00.out │ ├── send-nd-test-01-pcap.txt │ ├── send-nd-test-01.out │ └── send-nd-test-01.sh ├── 41-acceptns │ ├── .gitignore │ ├── 41-acceptns-almec-capture.txt │ ├── 41-acceptns-almec.txt │ ├── 41-acceptns-capture.txt │ ├── 41-acceptns-out-accepted.txt │ ├── 41-acceptns-out-declined.txt │ ├── 41-acceptns-out.txt │ ├── 41-acceptns-tooshort.txt │ ├── 41-acceptns.cpp │ ├── Makefile │ ├── description.txt │ └── pedigree.txt ├── 42-build-na │ ├── .gitignore │ ├── Makefile │ ├── description.txt │ ├── send-nd-test-42-pcap.txt │ ├── send-nd-test-42.out │ └── send-nd-test-42.sh ├── 43-sendgrasp │ ├── .gdbinit │ ├── .gitignore │ ├── 43-grasp-out.txt │ ├── 43-sendgrasp-out.txt │ ├── 43-sendgrasp.cpp │ ├── Makefile │ ├── description.txt │ ├── grasp-reply.dump │ └── pedigree.txt ├── 44-dio-ungrounded │ ├── .gdbinit │ ├── .gitignore │ ├── 44-dio-ungrounded.cpp │ ├── 44-node-E-dio.txt │ ├── Makefile │ ├── daoreply-out.txt │ ├── description.txt │ └── node-E-dio.txt ├── 45-extract-eui │ ├── .gitignore │ ├── Makefile │ ├── extract-eui.cpp │ └── f202.crt ├── 46-method-varargs │ ├── .gitignore │ ├── 46-method-varargs.cpp │ ├── Makefile │ └── method-varargs-out.txt ├── 47-dao-ignoredpio │ ├── .gdbinit │ ├── .gitignore │ ├── 47-dao-ignoredpio.cpp │ ├── 47-node-E-dio.txt │ ├── Makefile │ ├── daoreply-out.txt │ ├── description.txt │ └── node-E-dio.txt ├── 48-explicitprefix │ ├── .gdbinit │ ├── .gitignore │ ├── 48-explicitprefix-output.txt │ ├── 48-explicitprefix.cpp │ ├── Makefile │ └── description.txt ├── 49-explicitiid │ ├── .gdbinit │ ├── .gitignore │ ├── 49-explicitiid-output.txt │ ├── 49-explicitiid.cpp │ ├── Makefile │ └── description.txt ├── 50-sunshine-root │ ├── .gitignore │ ├── Makefile │ ├── description.txt │ ├── hostcert.pem │ └── sunshine-root.txt ├── INPUTS │ ├── 24-node-E-dio.pcap │ ├── 27-daoJ-inst42.pcap │ ├── 27-daoJ.pcap │ ├── 29-dao-nopio.pcap │ ├── 31-dao-extra.pcap │ ├── 32-dao-onlyif.pcap │ ├── 35-nodeE-dis.pcap │ ├── Makefile │ ├── a1.pcap │ ├── almec-ns.pcap │ ├── basic-dao.txt │ ├── basic-dio.txt │ ├── dao-J.pcap │ ├── dao.pcap │ ├── dao2-t2.pcap │ ├── dao2.pcap │ ├── dao2.txt │ ├── daoE.pcap │ ├── daoack-A-example661e.pcap │ ├── daoack-A-ripple.pcap │ ├── daoack-A-ripple1.pcap │ ├── daoack-A-wrongseq-ripple1.pcap │ ├── dio-02.pcap │ ├── dio-19-t1.pcap │ ├── dio-19-t2.pcap │ ├── dio-A-661e-ungrounded.pcap │ ├── dio-A-661e.pcap │ ├── dio-A-ripple.pcap │ ├── dio-A-ripple1.pcap │ ├── dio-B-661e.pcap │ ├── dio-E-eth0.pcap │ ├── dio-E-eth1.pcap │ ├── dio-E-eth1d.pcap │ ├── dioA-eth0.pcap │ ├── dioA-eth1.pcap │ ├── dioA-eth1b.pcap │ ├── herring-na.pcap │ ├── herring-ns.pcap │ ├── just-comments.txt │ ├── nodeM-ns-tooshort.pcap │ ├── nodeM-ns.pcap │ ├── pedigree.txt │ ├── plainnd.pcap │ ├── ra-01.pcap │ ├── rs-01.pcap │ ├── senddio-2.pcap │ ├── senddio-example.pcap │ └── senddio.pcap ├── Makefile └── Makefile.testing └── utils ├── GetOpts.tcl ├── Makefile ├── Xhost-test.tcl ├── buildinitrd ├── fixups ├── fixup-proc-1-pid.sed ├── no-icmp-v6-mcast.sed ├── no-tentative.sed ├── remove_dummy.sed ├── script-only.sed └── tcpdump-packet-count.sed ├── initrd-i386.list ├── initrd-x86_64.list ├── kernelversion-short ├── linuxrc-funcs.sh ├── linuxrc-uml-x86_64.sh ├── linuxrc-uml.sh ├── localswitches.sh ├── localswitches.tcl ├── make-uml.sh ├── netjig.tcl ├── redocon.sh ├── runme.sh ├── testing-functions.sh ├── uml-functions.sh ├── uml_netjig ├── .cvsignore ├── .gitignore ├── Makefile ├── cmdmode.c ├── getopt_long.c ├── hash.c ├── hash.h ├── nethub.c ├── nethub.h ├── netjig.h ├── port.c ├── port.h ├── switch.h ├── tuntap.c ├── tuntap.h ├── uml_netjig.8 ├── uml_netjig.c └── uml_switch.c ├── umlsetup-sample.sh ├── vde0_script.rc ├── vde1_script.rc ├── vde2_script.rc ├── vde3_script.rc ├── vde4_script.rc ├── vde99_script.rc └── verify-uml.sh /.gitignore: -------------------------------------------------------------------------------- 1 | *~ 2 | \#*\# 3 | .\#* 4 | *.bak 5 | *.8.html 6 | *.o 7 | *.a 8 | core 9 | UMLPOOL 10 | umlsetup.sh 11 | testing/functional/*/OUTPUT 12 | Makefile.ver 13 | 14 | TAGS 15 | Makefile.local 16 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | # the cp for the libcrypto modules keeps us from using the containers. 2 | sudo: required 3 | dist: trusty 4 | 5 | rvm: 6 | - 2.1.5 7 | 8 | language: c++ 9 | compiler: 10 | - g++ 11 | 12 | cache: 13 | - bundler 14 | 15 | cache: 16 | directories: 17 | - $HOME/stuff 18 | 19 | before_install: 20 | - "sudo dpkg --add-architecture i386" 21 | - "sudo apt-get update" 22 | - "sudo apt-get remove oracle-java7-installer oracle-java8-installer oracle-java9-installer" 23 | 24 | # the cp is because libssl-dev:i386 and libssl-dev:amd64 can not co-exist together due to package 25 | # incompatibilities, but in fact have no problems in practice. 26 | install: 27 | - "./install-apt-deps.sh" 28 | - "rvm autolibs enable" 29 | - "rvm install ruby-2.1.5" 30 | - "rvm use 2.1.5" 31 | - "gem install ronn cbor cbor-diag" 32 | - "./build-setup-travis.sh ONLYARCH=x86_64" 33 | - "PATH=$HOME/bin:$PATH export PATH" 34 | 35 | script: 36 | - "cat Makefile.local" 37 | - "make vars " 38 | - "make programs " 39 | - "make checkprograms " 40 | - "make unitcheck" 41 | -------------------------------------------------------------------------------- /CHANGES.md: -------------------------------------------------------------------------------- 1 | Version 1.11.0 2 | ============== 3 | 4 | - switches to "semantic" versioning. 5 | - use ARPHRD_6LOWPAN for newer kernels, but take care to make sure it is 6 | defined. 7 | - fixed event queue processing so that it never pulls when empty (bradjc5) 8 | - set autonomous address flag in DIO (bradjc5) [rfc6550, sec 6.7.10] 9 | - added option to disable multicast of DIO messages. 10 | 11 | Version 1.10 12 | ============ 13 | 14 | Version 1.10 was release on October 19, 2015. 15 | - added listening on netlink socket to identify new interfaces 16 | - new --ignore-pio to not configure a local IP based upon PIOs received in 17 | the DIO. 18 | - new --dao-if-filter and --dao-addr-filter permit addresses found on 19 | interfaces listed to be added to DAOs sent. 20 | - changes to event queue system: events can more easily be rescheduled 21 | - the emitted DIO RPL prefix info option was created/parsed incorrectly. 22 | 23 | 24 | Version 1.00 25 | ============ 26 | 27 | The first public release was version 1.00, on October 14, 2014, 28 | but the exact release point become muddied as code was ported. 29 | -------------------------------------------------------------------------------- /CREDITS.md: -------------------------------------------------------------------------------- 1 | The following people worked on Unstrung: 2 | 3 | Michael Richardson 4 | Simon Vincent 5 | Brad Campbell 6 | 7 | -------------------------------------------------------------------------------- /Makefile.ver: -------------------------------------------------------------------------------- 1 | PANDORA_VERSION=1.12.1 2 | BUILDNUMBER="$(shell date +%Y%m%d_%s)" 3 | 4 | 5 | -------------------------------------------------------------------------------- /doc/network-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/doc/network-1.png -------------------------------------------------------------------------------- /doc/testnetwork.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/doc/testnetwork.png -------------------------------------------------------------------------------- /include/dao.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNSTRUNG_DAO_H_ 2 | #define _UNSTRUNG_DAO_H_ 3 | 4 | extern "C" { 5 | #include 6 | #include /* for PATH_PROC_NET_IF_INET6 */ 7 | #include 8 | #include 9 | #include 10 | #include "rpl.h" 11 | } 12 | 13 | #include "rplmsg.h" 14 | #include "node.h" 15 | 16 | class rpl_dao : public rpl_msg { 17 | public: 18 | rpl_dao(const unsigned char *data, int dao_len, dag_network *dag); 19 | struct rpl_dao_target *rpltarget(void); 20 | }; 21 | 22 | 23 | #endif /* NODE_H */ 24 | 25 | /* 26 | * Local Variables: 27 | * c-basic-offset:4 28 | * c-style: whitesmith 29 | * End: 30 | */ 31 | 32 | -------------------------------------------------------------------------------- /include/dio.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNSTRUNG_DIO_H_ 2 | #define _UNSTRUNG_DIO_H_ 3 | 4 | extern "C" { 5 | #include 6 | #include /* for PATH_PROC_NET_IF_INET6 */ 7 | #include 8 | #include 9 | #include 10 | #include "rpl.h" 11 | } 12 | 13 | #include "rplmsg.h" 14 | #include "node.h" 15 | 16 | class rpl_dio : public rpl_msg { 17 | public: 18 | rpl_dio(rpl_node &peer, dag_network *dag, 19 | const struct nd_rpl_dio *dio, int dio_len); 20 | struct rpl_dio_destprefix *destprefix(void); 21 | 22 | private: 23 | rpl_node &mPeer; 24 | }; 25 | 26 | 27 | #endif /* NODE_H */ 28 | 29 | /* 30 | * Local Variables: 31 | * c-basic-offset:4 32 | * c-style: whitesmith 33 | * End: 34 | */ 35 | 36 | -------------------------------------------------------------------------------- /include/dis.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNSTRUNG_DIS_H_ 2 | #define _UNSTRUNG_DIS_H_ 3 | 4 | extern "C" { 5 | #include 6 | #include /* for PATH_PROC_NET_IF_INET6 */ 7 | #include 8 | #include 9 | #include 10 | #include "rpl.h" 11 | } 12 | 13 | #include "rplmsg.h" 14 | #include "node.h" 15 | 16 | class rpl_dis : public rpl_msg { 17 | public: 18 | rpl_dis(const unsigned char *data, int dis_len, u_int32_t *stats); 19 | struct rpl_dis_solicitedinfo *rplsolicitedinfo(void); 20 | }; 21 | 22 | 23 | #endif /* _UNSTRUNG_DIS_H_ */ 24 | 25 | /* 26 | * Local Variables: 27 | * c-basic-offset:4 28 | * c-style: whitesmith 29 | * End: 30 | */ 31 | 32 | -------------------------------------------------------------------------------- /include/fakegrasp.h: -------------------------------------------------------------------------------- 1 | #ifndef _FAKE_GRASP_H_ 2 | #define _FAKE_GRASP_H_ 3 | 4 | #include "grasp.h" 5 | 6 | class fake_grasp_client: public grasp_client { 7 | public: 8 | fake_grasp_client(rpl_debug *debug, network_interface *iface) : grasp_client(debug, iface) { 9 | non_random_session_id = 1804289382; 10 | }; 11 | 12 | virtual grasp_session_id generate_random_sessionid(bool init) { 13 | return ++non_random_session_id; 14 | }; 15 | 16 | private: 17 | unsigned int non_random_session_id; 18 | 19 | }; 20 | 21 | #endif /* _FAKE_GRASP_H */ 22 | -------------------------------------------------------------------------------- /include/mbedtls.h: -------------------------------------------------------------------------------- 1 | extern "C" { 2 | 3 | #if !defined(MBEDTLS_CONFIG_FILE) 4 | #include "mbedtls/config.h" 5 | #else 6 | #include MBEDTLS_CONFIG_FILE 7 | #endif 8 | 9 | #if defined(MBEDTLS_PLATFORM_C) 10 | #include "mbedtls/platform.h" 11 | #else 12 | #include 13 | #define mbedtls_fprintf fprintf 14 | #define mbedtls_printf printf 15 | #endif 16 | 17 | #include "mbedtls/entropy.h" 18 | #include "mbedtls/ctr_drbg.h" 19 | #include "mbedtls/net.h" 20 | #include "mbedtls/error.h" 21 | #include "mbedtls/ssl.h" 22 | #include "mbedtls/x509.h" 23 | #include "mbedtls/oid.h" 24 | #include "mbedtls/asn1.h" 25 | 26 | } 27 | -------------------------------------------------------------------------------- /include/netlink/ll_map.h: -------------------------------------------------------------------------------- 1 | #ifndef __LL_MAP_H__ 2 | #define __LL_MAP_H__ 1 3 | 4 | extern int ll_remember_index(const struct sockaddr_nl *who, 5 | struct nlmsghdr *n, void *arg); 6 | extern int ll_init_map(struct rtnl_handle *rth); 7 | extern unsigned ll_name_to_index(const char *name); 8 | extern const char *ll_index_to_name(unsigned idx); 9 | extern const char *ll_idx_n2a(unsigned idx, char *buf); 10 | extern int ll_index_to_type(unsigned idx); 11 | extern unsigned ll_index_to_flags(unsigned idx); 12 | 13 | #endif /* __LL_MAP_H__ */ 14 | -------------------------------------------------------------------------------- /include/netlink/rt_names.h: -------------------------------------------------------------------------------- 1 | #ifndef RT_NAMES_H_ 2 | #define RT_NAMES_H_ 1 3 | 4 | #include 5 | 6 | char* rtnl_rtprot_n2a(int id, char *buf, int len); 7 | char* rtnl_rtscope_n2a(int id, char *buf, int len); 8 | char* rtnl_rttable_n2a(int id, char *buf, int len); 9 | char* rtnl_rtrealm_n2a(int id, char *buf, int len); 10 | char* rtnl_dsfield_n2a(int id, char *buf, int len); 11 | int rtnl_rtprot_a2n(__u32 *id, char *arg); 12 | int rtnl_rtscope_a2n(__u32 *id, char *arg); 13 | int rtnl_rttable_a2n(__u32 *id, char *arg); 14 | int rtnl_rtrealm_a2n(__u32 *id, char *arg); 15 | int rtnl_dsfield_a2n(__u32 *id, char *arg); 16 | 17 | const char *inet_proto_n2a(int proto, char *buf, int len); 18 | int inet_proto_a2n(char *buf); 19 | 20 | 21 | const char * ll_type_n2a(int type, char *buf, int len); 22 | 23 | const char *ll_addr_n2a(unsigned char *addr, int alen, int type, char *buf, int blen); 24 | int ll_addr_a2n(char *lladdr, int len, char *arg); 25 | 26 | const char * ll_proto_n2a(unsigned short id, char *buf, int len); 27 | int ll_proto_a2n(unsigned short *id, char *buf); 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /include/netlink/rtm_map.h: -------------------------------------------------------------------------------- 1 | #ifndef __RTM_MAP_H__ 2 | #define __RTM_MAP_H__ 1 3 | 4 | char *rtnl_rtntype_n2a(int id, char *buf, int len); 5 | int rtnl_rtntype_a2n(int *id, char *arg); 6 | 7 | int get_rt_realms(__u32 *realms, char *arg); 8 | 9 | 10 | #endif /* __RTM_MAP_H__ */ 11 | -------------------------------------------------------------------------------- /include/oswconstants.h: -------------------------------------------------------------------------------- 1 | typedef int bool; 2 | #define FALSE 0 3 | #define TRUE 1 4 | -------------------------------------------------------------------------------- /include/rplmsg.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNSTRUNG_RPLMSG_H_ 2 | #define _UNSTRUNG_RPLMSG_H_ 3 | 4 | extern "C" { 5 | #include 6 | #include /* for PATH_PROC_NET_IF_INET6 */ 7 | #include 8 | #include 9 | #include 10 | #include "rpl.h" 11 | } 12 | 13 | class rpl_msg { 14 | public: 15 | rpl_msg(const unsigned char *subopts, int subopt_len, u_int32_t *stats); 16 | struct nd_rpl_genoption *search_subopt(enum RPL_SUBOPT optnum, 17 | int *p_opt_len = NULL); 18 | void reset_options(void); 19 | 20 | protected: 21 | u_int32_t *mStats; 22 | 23 | private: 24 | u_int8_t mBytes[2048]; 25 | int mLen; 26 | 27 | /* 28 | * this structure is a set of pseudo pointers, 29 | * where we last found an an option of that particular type. 30 | */ 31 | int16_t mOptions[256]; 32 | }; 33 | 34 | 35 | #endif /* RPLMSG_H */ 36 | 37 | /* 38 | * Local Variables: 39 | * c-basic-offset:4 40 | * c-style: whitesmith 41 | * End: 42 | */ 43 | 44 | -------------------------------------------------------------------------------- /include/unstrung.h: -------------------------------------------------------------------------------- 1 | #ifndef _UNSTRUNG_UNSTRUNG_H_ 2 | #define _UNSTRUNG_UNSTRUNG_H_ 3 | 4 | #define PANDORA_VERSION_MAJOR 1 5 | #define PANDORA_VERSION_MINOR 0 6 | 7 | #define _U_ __attribute__((unused)) 8 | 9 | #endif /* UNSTRING_H */ 10 | 11 | /* 12 | * Local Variables: 13 | * c-basic-offset:4 14 | * c-style: whitesmith 15 | * End: 16 | */ 17 | 18 | -------------------------------------------------------------------------------- /install-apk-deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # these are dependancies for ALPINE Linux (not Android) 4 | 5 | sudo apk update 6 | 7 | sudo apk install flex bison boost-dev cmake libpcap-dev cmocka-dev 8 | 9 | # libdbus-1-dev libusb-1.0-0-dev libcmocka-dev libcmocka0 10 | # libnl-3-200 libnl-genl-3-200 libnl-3-dev libnl-genl-3-dev libusb-1.0-0 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /install-apt-deps.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ `uname -m` = "amd64" ] || [ `uname -m` = "i386" ] 4 | then 5 | sudo apt-get install gcc-multilib g++-multilibi lib32stdc++6 lib32z1-dev 6 | fi 7 | sudo apt-get install dpkg-dev pkg-config libssl-dev 8 | #cp /usr/lib/x86_64-linux-gnu/libcrypto* /tmp 9 | 10 | sudo apt-get install build-essential libdbus-1-dev libusb-1.0-0-dev flex bison libboost-dev libcmocka-dev libcmocka0 \ 11 | cmake libnl-3-200 libnl-genl-3-200 libnl-3-dev libnl-genl-3-dev libusb-1.0-0 \ 12 | libpcap-dev 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /lib/Makefile: -------------------------------------------------------------------------------- 1 | # unstrung master makefile 2 | # 3 | # Copyright (C) 2009 Michael Richardson 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU General Public License as published by the 7 | # Free Software Foundation; either version 2 of the License, or (at your 8 | # option) any later version. See . 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | # for more details. 14 | # 15 | 16 | 17 | UNSTRUNG_SRCDIR?=$(shell cd ..; pwd) 18 | export UNSTRUNG_SRCDIR 19 | 20 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 21 | 22 | srcdir?=$(shell pwd) 23 | 24 | SUBDIRS=libndmgmt libosw libnetlink 25 | SUBDIRS+=libidevid 26 | ifeq ($(GRASP_CLIENT),true) 27 | SUBDIRS+=libgrasp 28 | endif 29 | ifeq ($(EMBEDDED),) 30 | SUBDIRS+=libfakeiface 31 | endif 32 | 33 | unitcheck: 34 | @true 35 | -------------------------------------------------------------------------------- /lib/libfakeiface/.gitignore: -------------------------------------------------------------------------------- 1 | pcap_iface.o 2 | libfakeiface.a 3 | -------------------------------------------------------------------------------- /lib/libfakeiface/Makefile.depend.Linux.i686: -------------------------------------------------------------------------------- 1 | pcap_iface.o: pcap_iface.cpp \ 2 | ../../include/iface.h \ 3 | ../../include/pathnames.h \ 4 | ../../include/oswlibs.h \ 5 | ../../include/rpl.h \ 6 | ../../include/prefix.h \ 7 | ../../include/debug.h \ 8 | ../../include/event.h \ 9 | ../../include/dag.h \ 10 | ../../include/node.h \ 11 | ../../include/fakeiface.h \ 12 | ../../include/sll.h \ 13 | ../../include/ether.h \ 14 | ../../include/sll.h \ 15 | ../../include/ether.h \ 16 | ../../include/hexdump.c \ 17 | ../../include/netlink/rt_names.h \ 18 | ../../include/netlink/utils.h \ 19 | ../../include/netlink/libnetlink.h \ 20 | ../../include/netlink/ll_map.h \ 21 | ../../include/netlink/rtm_map.h 22 | -------------------------------------------------------------------------------- /lib/libfakeiface/Makefile.depend.Linux.x86_64: -------------------------------------------------------------------------------- 1 | pcap_iface.o: pcap_iface.cpp \ 2 | ../../include/iface.h \ 3 | ../../include/pathnames.h \ 4 | ../../include/oswlibs.h \ 5 | ../../include/rpl.h \ 6 | ../../include/prefix.h \ 7 | ../../include/debug.h \ 8 | ../../include/event.h \ 9 | ../../include/dag.h \ 10 | ../../include/node.h \ 11 | ../../include/fakeiface.h \ 12 | ../../include/sll.h \ 13 | ../../include/ether.h \ 14 | ../../include/sll.h \ 15 | ../../include/ether.h \ 16 | ../../include/hexdump.c \ 17 | ../../include/netlink/rt_names.h \ 18 | ../../include/netlink/utils.h \ 19 | ../../include/netlink/libnetlink.h \ 20 | ../../include/netlink/ll_map.h \ 21 | ../../include/netlink/rtm_map.h 22 | -------------------------------------------------------------------------------- /lib/libgrasp/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *.a -------------------------------------------------------------------------------- /lib/libgrasp/Makefile: -------------------------------------------------------------------------------- 1 | # Neighbour Discovery Library 2 | # Copyright (C) 2009-2013 Michael Richardson 3 | # 4 | # This program is free software; you can redistribute it and/or modify it 5 | # under the terms of the GNU General Public License as published by the 6 | # Free Software Foundation; either version 2 of the License, or (at your 7 | # option) any later version. See . 8 | # 9 | # This program is distributed in the hope that it will be useful, but 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | # for more details. 13 | # 14 | 15 | 16 | UNSTRUNG_SRCDIR?=$(shell cd ../..; pwd) 17 | export UNSTRUNG_SRCDIR 18 | 19 | include ${UNSTRUNG_SRCDIR}/Makefile.ver 20 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 21 | 22 | srcdir?=${UNSTRUNG_SRCDIR}/lib/libgrasp/ 23 | 24 | LIBRARY=grasp 25 | LIB=lib${LIBRARY}.a 26 | MANDIR=$(MANTREE)/man3 27 | 28 | ONEFILE=client.cpp 29 | CXXSRCS=client.cpp 30 | ifeq ($(EMBEDDED),) 31 | CXXSRCS+=rnd_regress.cpp 32 | endif 33 | 34 | #enable to get lots more debugging about semantics. 35 | #CFLAGS=-DPARSER_TYPE_DEBUG 36 | CXXFLAGS+=-g -O0 37 | 38 | OBJS=${SRCS:.c=.o} ${CXXSRCS:.cpp=.o} 39 | 40 | include ${srcdir}../Makefile.library 41 | 42 | -------------------------------------------------------------------------------- /lib/libidevid/Makefile: -------------------------------------------------------------------------------- 1 | # library of functions related to reading attributes out of IDevID and LDevID certificates 2 | # 3 | # Copyright (C) 2021 Michael Richardson 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU General Public License as published by the 7 | # Free Software Foundation; either version 2 of the License, or (at your 8 | # option) any later version. See . 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | # for more details. 14 | # 15 | 16 | UNSTRUNG_SRCDIR?=$(shell cd ../..; pwd) 17 | 18 | include ${UNSTRUNG_SRCDIR}/Makefile.ver 19 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 20 | 21 | LIBRARY=idevid 22 | LIB=lib${LIBRARY}.a 23 | 24 | ONEFILE=eui64.cpp 25 | CFLAGS+=${WERROR} 26 | 27 | SRCS = 28 | 29 | CXXSRCS= rfc8994acp.cpp 30 | ifeq ($(USE_MBEDTLS),true) 31 | CXXSRCS= eui64.cpp 32 | endif 33 | 34 | CXXFLAGS+=-g ${CROSSFLAGS} 35 | CFLAGS+=-g ${CROSSFLAGS} 36 | 37 | OBJS=${SRCS:.c=.o} ${CXXSRCS:.cpp=.o} 38 | 39 | include ${srcdir}../Makefile.library 40 | 41 | -------------------------------------------------------------------------------- /lib/libndmgmt/.gitignore: -------------------------------------------------------------------------------- 1 | *.a 2 | *.o 3 | -------------------------------------------------------------------------------- /lib/libndmgmt/peers.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * keep information about each peer! 3 | * 4 | */ 5 | -------------------------------------------------------------------------------- /lib/libnetlink/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | libnetlinkstrung.a 3 | 4 | -------------------------------------------------------------------------------- /lib/libnetlink/Makefile.depend.Linux.i686: -------------------------------------------------------------------------------- 1 | inet_proto.o: inet_proto.c \ 2 | ../../include/netlink/utils.h \ 3 | ../../include/netlink/libnetlink.h \ 4 | ../../include/netlink/ll_map.h \ 5 | ../../include/netlink/rtm_map.h 6 | libnetlink.o: libnetlink.c \ 7 | ../../include/netlink/libnetlink.h 8 | ll_addr.o: ll_addr.c \ 9 | ../../include/netlink/rt_names.h \ 10 | ../../include/netlink/utils.h \ 11 | ../../include/netlink/libnetlink.h \ 12 | ../../include/netlink/ll_map.h \ 13 | ../../include/netlink/rtm_map.h 14 | ll_map.o: ll_map.c \ 15 | ../../include/netlink/libnetlink.h \ 16 | ../../include/netlink/ll_map.h 17 | ll_proto.o: ll_proto.c \ 18 | ../../include/netlink/utils.h \ 19 | ../../include/netlink/libnetlink.h \ 20 | ../../include/netlink/ll_map.h \ 21 | ../../include/netlink/rtm_map.h \ 22 | ../../include/netlink/rt_names.h 23 | ll_types.o: ll_types.c \ 24 | ../../include/netlink/rt_names.h 25 | rt_names.o: rt_names.c \ 26 | ../../include/netlink/rt_names.h 27 | utils.o: utils.c ../../include/netlink/utils.h \ 28 | ../../include/netlink/libnetlink.h \ 29 | ../../include/netlink/ll_map.h \ 30 | ../../include/netlink/rtm_map.h 31 | -------------------------------------------------------------------------------- /lib/libosw/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | libosw.a -------------------------------------------------------------------------------- /lib/libosw/Makefile.depend.Linux.i686: -------------------------------------------------------------------------------- 1 | addrtot.o: addrtot.c ../../include/oswlibs.h 2 | addrtypeof.o: addrtypeof.c \ 3 | ../../include/oswlibs.h 4 | anyaddr.o: anyaddr.c ../../include/oswlibs.h 5 | initaddr.o: initaddr.c ../../include/oswlibs.h 6 | initsubnet.o: initsubnet.c \ 7 | ../../include/oswlibs.h 8 | portof.o: portof.c ../../include/oswlibs.h 9 | subnettot.o: subnettot.c \ 10 | ../../include/oswlibs.h \ 11 | ../../include/oswconstants.h 12 | subnettypeof.o: subnettypeof.c \ 13 | ../../include/oswlibs.h 14 | ttoaddr.o: ttoaddr.c ../../include/oswlibs.h 15 | ttosubnet.o: ttosubnet.c \ 16 | ../../include/oswlibs.h 17 | ttoul.o: ttoul.c ../../include/oswlibs.h 18 | ultot.o: ultot.c ../../include/oswlibs.h 19 | -------------------------------------------------------------------------------- /packaging/generic/Makefile.local.sample: -------------------------------------------------------------------------------- 1 | ifeq ($(ARCH),i386) 2 | NETDISSECTLIB=/corp/projects/pandora/host/tcpdump-4.6.2/libnetdissect.a 3 | NETDISSECTH=-DNETDISSECT -I/corp/projects/pandora/include -I/corp/projects/pandora/host/tcpdump-4.6.2/ -I/corp/projects/pandora/tcpdump-4.6.2 4 | LIBPCAP=/corp/projects/pandora/x86/libpcap-1.6.2/libpcap.a 5 | endif 6 | 7 | LIBPCAPINC=-I/corp/projects/pandora/include 8 | TCPDUMP=/corp/projects/pandora/host/tcpdump-4.6.2/tcpdump 9 | LIBPCAP_HOST=$(shell /corp/projects/pandora/host/libpcap-1.6.2/pcap-config --libs) 10 | 11 | -------------------------------------------------------------------------------- /packaging/openwrt/build-unstrung.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | make package/unstrung/prepare USE_SOURCE_DIR=/ssw/projects/pandora/unstrung V=s 4 | make package/unstrung/compile USE_SOURCE_DIR=/ssw/projects/pandora/unstrung V=s 5 | -------------------------------------------------------------------------------- /packaging/openwrt/files/sunshine.init: -------------------------------------------------------------------------------- 1 | #!/bin/sh /etc/rc.common 2 | # Copyright (C) 2014 Sandelman Software Works - unstrung.sandelman.ca. 3 | 4 | START=50 5 | 6 | USE_PROCD=1 7 | PROG=/sbin/sunshine 8 | OPTIONS=$(if [ -f /etc/sunshine.conf ]; then cat /etc/sunshine.conf; fi) 9 | # verbose needs to be taken from 10 | 11 | start_service() { 12 | procd_open_instance 13 | procd_set_param command "$PROG" --sleep 90 --dagid unstrung --instance 0 --interval 60000 --syslog --verbose ${OPTIONS} 14 | procd_close_instance 15 | } 16 | 17 | -------------------------------------------------------------------------------- /packaging/openwrt/upload.sh: -------------------------------------------------------------------------------- 1 | cp bin/ramips/packages/base/unstrung_1.00-1_ramips_24kec.ipk /ssw/projects/bluerose/sites/unstrung.sandelman.ca/downloads/ipkg 2 | -------------------------------------------------------------------------------- /programs/.gitignore: -------------------------------------------------------------------------------- 1 | radvd-1.1 2 | -------------------------------------------------------------------------------- /programs/Makefile: -------------------------------------------------------------------------------- 1 | # unstrung master makefile 2 | # 3 | # Copyright (C) 2009-2013 Michael Richardson 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU General Public License as published by the 7 | # Free Software Foundation; either version 2 of the License, or (at your 8 | # option) any later version. See . 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | # for more details. 14 | # 15 | 16 | 17 | UNSTRUNG_SRCDIR?=$(shell cd ..; pwd) 18 | export UNSTRUNG_SRCDIR 19 | 20 | NEEDCHECK= 21 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 22 | 23 | srcdir?=$(shell pwd) 24 | 25 | SUBDIRS=sunshine 26 | 27 | # only built utility programs on bigger systems; they are used for testing only 28 | ifeq ($(EMBEDDED),) 29 | ifeq ($(USE_MBEDTLS),true) 30 | SUBDIRS+=peck 31 | endif 32 | SUBDIRS+=senddio senddao sendnd 33 | endif 34 | 35 | unitcheck: 36 | @true 37 | -------------------------------------------------------------------------------- /programs/Makefile.manpages: -------------------------------------------------------------------------------- 1 | # xmlto is from http://cyberelk.net/tim/xmlto/ 2 | ifneq ($(strip $(XMLTO)),) 3 | %.8: %.8.xml 4 | ${XMLTO} man $< 5 | 6 | %.8.html: %.8.xml 7 | ${XMLTO} html-nochunks $< 8 | 9 | %.5: %.5.xml 10 | ${XMLTO} man $< 11 | 12 | %.1: %.1.xml 13 | ${XMLTO} man $< 14 | endif 15 | 16 | # ronn is from https://rtomayko.github.io/ronn/ 17 | ifneq ($(strip $(RONN)),) 18 | %.8: %.8.ronn 19 | ${RONN} --roff $< 20 | 21 | %.8.html: %.8.ronn 22 | ${RONN} --html $< 23 | 24 | %.5: %.5.ronn 25 | ${RONN} --roff $< 26 | 27 | %.1: %.1.ronn 28 | ${RONN} --roff $< 29 | endif 30 | 31 | 32 | 33 | 34 | 35 | -------------------------------------------------------------------------------- /programs/peck/.gitignore: -------------------------------------------------------------------------------- 1 | peck 2 | *.o 3 | -------------------------------------------------------------------------------- /programs/peck/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the PANDORA sunshine daemon 2 | # Copyright (C) 2009-2013 Michael Richardson 3 | # 4 | # This program is free software; you can redistribute it and/or modify it 5 | # under the terms of the GNU General Public License as published by the 6 | # Free Software Foundation; either version 2 of the License, or (at your 7 | # option) any later version. See . 8 | # 9 | # This program is distributed in the hope that it will be useful, but 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | # for more details. 13 | 14 | UNSTRUNG_SRCDIR?=$(shell cd ../..; pwd) 15 | srcdir?=${UNSTRUNG_SRCDIR}/programs/peck/ 16 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 17 | 18 | PROGRAM=peck 19 | PROGRAMDIR=/sbin 20 | ONEFILE=peck.c 21 | OBJS=peck.o 22 | LIBS=${LIBNDMGMT} ${LIBOSW} ${LIBNETLINK} ${LIBFAKEIFACE} ${LIBGRASP} 23 | LIBS+=${LIBCBOR} 24 | 25 | include ${UNSTRUNG_SRCDIR}/programs/Makefile.program 26 | 27 | ifeq ($(USE_MBEDTLS),true) 28 | CXXFLAGS+=-DHAVE_MBEDTLS 29 | LIBS+=${LIBIDEVID} 30 | LIBS+=${MBEDTLSLIB}/libmbedx509.a 31 | LIBS+=${MBEDTLSLIB}/libmbedcrypto.a 32 | LIBS+=${MBEDTLSLIB}/libmbedtls.a 33 | endif 34 | 35 | -------------------------------------------------------------------------------- /programs/peck/peck.8: -------------------------------------------------------------------------------- 1 | .\" generated with Ronn/v0.7.3 2 | .\" http://github.com/rtomayko/ronn/tree/0.7.3 3 | . 4 | .TH "PECK" "8" "July 2016" "" "" 5 | . 6 | .SH "NAME" 7 | \fBpeck\fR \- poke EUI\-64 from CertifiKate 8 | . 9 | .P 10 | The peck command reads a Manufacturer installed certificate located by default at /boot/mic\.pem and configures the EUI\-64 contained within as the layer\-2 MAC address for the specified interface\. 11 | . 12 | .P 13 | In addition to configuring the layer\-2 address, this act also configures how SLAAC will form the link\-local layer\-3 address on the given interface\. 14 | . 15 | .P 16 | Unless supressed with \-\-noicmp, an ICMP Neighbor Discovery (ND) ICMP message is sent with the EARO option containing the indicated hostid\. 17 | . 18 | .P 19 | By default peck will fork into the background (writing it\'s pid into /run/peck\.pid) and then listen for a 6top connection from a JCE\. Security will be setup using DTLS, with a private key found in /boot/mic\.priv\. 20 | . 21 | .P 22 | If the file /run/peck\.pid already exists, and contains a valid PID (as determined by kill(USR1,PID)), then it will signal the existing peck instance to restart with a new ICMP message\. 23 | . 24 | .P 25 | Unless supressed with \-\-noinotify, peck will watch the file /boot/mic\.pem to see if it changes, and if it does, it will restart\. 26 | -------------------------------------------------------------------------------- /programs/peck/peck.8.ronn: -------------------------------------------------------------------------------- 1 | peck(8) -- poke EUI-64 from CertifiKate 2 | ======================================= 3 | 4 | The peck command reads a Manufacturer installed certificate located by 5 | default at /boot/mic.pem and configures the EUI-64 contained within as 6 | the layer-2 MAC address for the specified interface. 7 | 8 | In addition to configuring the layer-2 address, this act also configures 9 | how SLAAC will form the link-local layer-3 address on the given interface. 10 | 11 | Unless supressed with --noicmp, an ICMP Neighbor Discovery (ND) ICMP message 12 | is sent with the EARO option containing the indicated hostid. 13 | 14 | By default peck will fork into the background (writing it's pid into 15 | /run/peck.pid) and then listen for a 6top connection from a JCE. 16 | Security will be setup using DTLS, with a private key found in /boot/mic.priv. 17 | 18 | If the file /run/peck.pid already exists, and contains a valid PID (as 19 | determined by kill(USR1,PID)), then it will signal the existing peck 20 | instance to restart with a new ICMP message. 21 | 22 | Unless supressed with --noinotify, peck will watch the file /boot/mic.pem 23 | to see if it changes, and if it does, it will restart. 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /programs/senddao/.gitignore: -------------------------------------------------------------------------------- 1 | senddao 2 | senddao.o 3 | 4 | -------------------------------------------------------------------------------- /programs/senddao/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../..; pwd) 2 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 3 | 4 | # local install of pcap.h, or make sure you have libpcap-dev installed. 5 | CFLAGS+=${LIBPCAPINC} -g 6 | CXXFLAGS+=${LIBPCAPINC} -g 7 | PROGRAM=senddao 8 | PROGRAMDIR=/sbin 9 | ONEFILE=senddao.cpp 10 | OBJS=senddao.o 11 | LDFLAGS+=${LIBPCAP} 12 | 13 | include ${UNSTRUNG_SRCDIR}/programs/Makefile.program 14 | -------------------------------------------------------------------------------- /programs/senddio/.gitignore: -------------------------------------------------------------------------------- 1 | senddio 2 | senddio.o 3 | 4 | -------------------------------------------------------------------------------- /programs/senddio/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../..; pwd) 2 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 3 | 4 | # local install of pcap.h, or make sure you have libpcap-dev installed. 5 | CFLAGS+=${LIBPCAPINC} -g 6 | CXXFLAGS+=${LIBPCAPINC} -g 7 | PROGRAM=senddio 8 | PROGRAMDIR=/sbin 9 | ONEFILE=senddio.cpp 10 | OBJS=senddio.o 11 | # debug for freed memory touches 12 | #LIBS+=/sandel/lib/i386-linux-gnu/libefence.a 13 | 14 | include ${UNSTRUNG_SRCDIR}/programs/Makefile.program 15 | -------------------------------------------------------------------------------- /programs/senddio/Makefile.depend.Linux.x86_64: -------------------------------------------------------------------------------- 1 | senddio.o: senddio.cpp pathnames.h \ 2 | ../../include/oswlibs.h \ 3 | ../../include/rpl.h \ 4 | ../../include/hexdump.c \ 5 | ../../include/iface.h \ 6 | ../../include/pathnames.h \ 7 | ../../include/oswlibs.h \ 8 | ../../include/rpl.h \ 9 | ../../include/prefix.h \ 10 | ../../include/debug.h \ 11 | ../../include/event.h \ 12 | ../../include/dag.h \ 13 | ../../include/node.h \ 14 | ../../include/fakeiface.h \ 15 | ../../include/sll.h \ 16 | ../../include/ether.h 17 | -------------------------------------------------------------------------------- /programs/sendnd/.gitignore: -------------------------------------------------------------------------------- 1 | sendnd 2 | sendnd.o 3 | 4 | -------------------------------------------------------------------------------- /programs/sendnd/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../..; pwd) 2 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 3 | 4 | # local install of pcap.h, or make sure you have libpcap-dev installed. 5 | CFLAGS+=${LIBPCAPINC} -g 6 | CXXFLAGS+=${LIBPCAPINC} -g 7 | PROGRAM=sendnd 8 | PROGRAMDIR=/sbin 9 | ONEFILE=sendnd.cpp 10 | OBJS=sendnd.o 11 | LDFLAGS+=${LIBPCAP} 12 | 13 | include ${UNSTRUNG_SRCDIR}/programs/Makefile.program 14 | -------------------------------------------------------------------------------- /programs/sendnd/sendnd.8: -------------------------------------------------------------------------------- 1 | .\" generated with Ronn/v0.7.3 2 | .\" http://github.com/rtomayko/ronn/tree/0.7.3 3 | . 4 | .TH "SENDND" "8" "September 2016" "" "" 5 | . 6 | .SH "NAME" 7 | \fBsendnd\fR \- send 6lowPAN Neighbour Discovery messages 8 | . 9 | .P 10 | The sendnd creates a number of different ND messages and sends them to a specified host or multicast address\. It then listens for ND messages for a period of time, and then exits\. 11 | -------------------------------------------------------------------------------- /programs/sendnd/sendnd.8.ronn: -------------------------------------------------------------------------------- 1 | sendnd(8) -- send 6lowPAN Neighbour Discovery messages 2 | ====================================================== 3 | 4 | The sendnd creates a number of different ND messages and sends them 5 | to a specified host or multicast address. It then listens for ND 6 | messages for a period of time, and then exits. 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /programs/sunshine/.gitignore: -------------------------------------------------------------------------------- 1 | sunshine 2 | *.o 3 | -------------------------------------------------------------------------------- /programs/sunshine/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for the UNSTRUNG sunshine daemon 2 | # Copyright (C) 2009-2013 Michael Richardson 3 | # 4 | # This program is free software; you can redistribute it and/or modify it 5 | # under the terms of the GNU General Public License as published by the 6 | # Free Software Foundation; either version 2 of the License, or (at your 7 | # option) any later version. See . 8 | # 9 | # This program is distributed in the hope that it will be useful, but 10 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | # for more details. 13 | 14 | 15 | UNSTRUNG_SRCDIR?=$(shell cd ../..; pwd) 16 | srcdir?=${UNSTRUNG_SRCDIR}/programs/sunshine/ 17 | 18 | PROGRAM=sunshine 19 | SRCS=main.cpp sendnd.cpp 20 | ONEFILE=main.cpp 21 | OBJS=${SRCS:.cpp=.o} 22 | CFLAGS+=${LIBPCAPINC} 23 | CXXFLAGS+=${LIBPCAPINC} 24 | CXXFLAGS+=-g -DBUILDNUMBER=\"${BUILDNUMBER}\" 25 | LDFLAGS=-g 26 | 27 | include ${UNSTRUNG_SRCDIR}/programs/Makefile.program 28 | 29 | -------------------------------------------------------------------------------- /programs/sunshine/Makefile.depend.x86_64: -------------------------------------------------------------------------------- 1 | sendnd.o: sendnd.cpp sunshine.h 2 | -------------------------------------------------------------------------------- /programs/sunshine/nA.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /sbin/sunshine -K; sleep 1 4 | /sbin/sunshine -v --dagid FUNFUNFUN -i eth1 -W 10000 --prefix 2001:1234:5678::/48 --rank 1 -I 1 2>&1 | tee /var/log/nA.log 5 | 6 | -------------------------------------------------------------------------------- /programs/sunshine/nE.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | /sbin/sunshine -K 4 | sleep 2 5 | #/sbin/sunshine -v --dagid FUNFUNFUN -W 10000 -i eth0 -i eth1 2>&1 | tee -a /var/log/nE.log 6 | /sbin/sunshine -v --dagid FUNFUNFUN -W 10000 -i eth1 2>&1 | tee -a /var/log/nE.log 7 | -------------------------------------------------------------------------------- /programs/sunshine/sendnd.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2009-2013 Michael Richardson 3 | * 4 | * This program is free software; you can redistribute it and/or modify it 5 | * under the terms of the GNU General Public License as published by the 6 | * Free Software Foundation; either version 2 of the License, or (at your 7 | * option) any later version. See . 8 | * 9 | * This program is distributed in the hope that it will be useful, but 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 | * for more details. 13 | * 14 | */ 15 | 16 | #include 17 | #include 18 | #include 19 | 20 | #include "sunshine.h" 21 | 22 | /* 23 | * Local Variables: 24 | * c-basic-offset:4 25 | * c-style: whitesmith 26 | * End: 27 | */ 28 | -------------------------------------------------------------------------------- /programs/sunshine/sunshine.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/programs/sunshine/sunshine.h -------------------------------------------------------------------------------- /testing/Makefile: -------------------------------------------------------------------------------- 1 | # unstrung master makefile 2 | # 3 | # Copyright (C) 2009 Michael Richardson 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU General Public License as published by the 7 | # Free Software Foundation; either version 2 of the License, or (at your 8 | # option) any later version. See . 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | # for more details. 14 | # 15 | 16 | 17 | UNSTRUNG_SRCDIR?=$(shell cd ..; pwd) 18 | export UNSTRUNG_SRCDIR 19 | 20 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 21 | 22 | srcdir?=$(shell pwd) 23 | 24 | UNITSUBDIRS=utils unit 25 | SUBDIRS=${UNITSUBDIRS} 26 | 27 | unitcheck:: 28 | @for d in $(SUBDIRS); \ 29 | do \ 30 | (cd $$d && $(MAKE) DESTDIR=${DESTDIR} check || exit 1);\ 31 | done 32 | -------------------------------------------------------------------------------- /testing/baseconfigs/A/etc/fstab: -------------------------------------------------------------------------------- 1 | /dev/root / hostfs defaults 0 0 2 | /dev/shm /tmp tmpfs defaults 0 0 3 | proc /proc proc defaults 4 | devpts /dev/pts devpts mode=0622 0 0 5 | -------------------------------------------------------------------------------- /testing/baseconfigs/A/etc/hostname: -------------------------------------------------------------------------------- 1 | A 2 | -------------------------------------------------------------------------------- /testing/baseconfigs/A/etc/network/interfaces: -------------------------------------------------------------------------------- 1 | auto lo 2 | iface lo inet loopback 3 | 4 | auto eth0 5 | auto eth1 6 | allow-hotplug eth2 7 | 8 | iface eth0 inet6 manual 9 | up modprobe ipv6; ifconfig eth0 up 10 | 11 | iface eth1 inet6 manual 12 | up modprobe ipv6; ifconfig eth1 up 13 | 14 | iface eth2 inet6 static 15 | address 2607:f0b0:f:83::2 16 | netmask 64 17 | gateway 2607:f0b0:f:83::1 18 | -------------------------------------------------------------------------------- /testing/baseconfigs/A/etc/sysctl.conf: -------------------------------------------------------------------------------- 1 | net/ipv6/conf/all/forwarding=1 2 | 3 | -------------------------------------------------------------------------------- /testing/baseconfigs/A/root/a1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -x /sbin/sunshine ]; 3 | then 4 | mv /sbin/sunshine /sbin/sunshine.run 5 | fi 6 | 7 | # for coredump 8 | cd /tmp 9 | ulimit -c unlimited 10 | 11 | /sbin/sunshine.run -i 1 --dagid 2001:db8:0001::1 -i eth1 --rank 1 --prefix 2001:db8:0001::/48 --interval 30000 --verbose --timelog 12 | -------------------------------------------------------------------------------- /testing/baseconfigs/E/etc/fstab: -------------------------------------------------------------------------------- 1 | /dev/root / hostfs defaults 0 0 2 | /dev/shm /tmp tmpfs defaults 0 0 3 | /dev/shm /var/run tmpfs defaults 0 0 4 | proc /proc proc defaults 5 | devpts /dev/pts devpts mode=0622 0 0 6 | -------------------------------------------------------------------------------- /testing/baseconfigs/E/etc/hostname: -------------------------------------------------------------------------------- 1 | E 2 | -------------------------------------------------------------------------------- /testing/baseconfigs/E/etc/network/interfaces: -------------------------------------------------------------------------------- 1 | auto lo 2 | iface lo inet loopback 3 | iface lo inet6 loopback 4 | 5 | auto eth0 eth1 6 | 7 | iface eth0 inet6 manual 8 | up modprobe ipv6; ifconfig eth0 up 9 | 10 | iface eth1 inet6 manual 11 | up modprobe ipv6; ifconfig eth1 up 12 | -------------------------------------------------------------------------------- /testing/baseconfigs/E/etc/sysctl.conf: -------------------------------------------------------------------------------- 1 | net/ipv6/conf/all/forwarding=1 2 | 3 | -------------------------------------------------------------------------------- /testing/baseconfigs/E/root/e1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -x /sbin/sunshine ]; 3 | then 4 | mv /sbin/sunshine /sbin/sunshine.run 5 | fi 6 | 7 | # for coredump 8 | cd /tmp 9 | ulimit -c unlimited 10 | 11 | /sbin/sunshine.run -I 1 -i eth0 -i eth1 --interval 100000 --verbose --timelog 12 | -------------------------------------------------------------------------------- /testing/baseconfigs/J/etc/fstab: -------------------------------------------------------------------------------- 1 | /dev/root / hostfs defaults 0 0 2 | /dev/shm /tmp tmpfs defaults 0 0 3 | /dev/shm /var/run tmpfs defaults 0 0 4 | proc /proc proc defaults 5 | devpts /dev/pts devpts mode=0622 0 0 6 | -------------------------------------------------------------------------------- /testing/baseconfigs/J/etc/hostname: -------------------------------------------------------------------------------- 1 | J 2 | -------------------------------------------------------------------------------- /testing/baseconfigs/J/etc/network/interfaces: -------------------------------------------------------------------------------- 1 | auto lo 2 | iface lo inet loopback 3 | 4 | auto eth0 5 | auto eth1 6 | 7 | iface eth0 inet6 manual 8 | up modprobe ipv6; ifconfig eth0 up 9 | 10 | iface eth1 inet6 manual 11 | up modprobe ipv6; ifconfig eth1 up 12 | -------------------------------------------------------------------------------- /testing/baseconfigs/J/etc/sysctl.conf: -------------------------------------------------------------------------------- 1 | net/ipv6/conf/all/forwarding=1 2 | 3 | -------------------------------------------------------------------------------- /testing/baseconfigs/J/root/j1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -x /sbin/sunshine ]; 3 | then 4 | mv /sbin/sunshine /sbin/sunshine.run 5 | fi 6 | 7 | # for coredump 8 | cd /tmp 9 | ulimit -c unlimited 10 | 11 | /sbin/sunshine.run -I 1 -i eth0 -i eth1 --interval 100000 --verbose --timelog 12 | -------------------------------------------------------------------------------- /testing/baseconfigs/K/etc/fstab: -------------------------------------------------------------------------------- 1 | /dev/root / hostfs defaults 0 0 2 | /dev/shm /tmp tmpfs defaults 0 0 3 | /dev/shm /var/run tmpfs defaults 0 0 4 | proc /proc proc defaults 5 | devpts /dev/pts devpts mode=0622 0 0 6 | -------------------------------------------------------------------------------- /testing/baseconfigs/K/etc/hostname: -------------------------------------------------------------------------------- 1 | K 2 | -------------------------------------------------------------------------------- /testing/baseconfigs/M/etc/fstab: -------------------------------------------------------------------------------- 1 | /dev/root / hostfs defaults 0 0 2 | /dev/shm /tmp tmpfs defaults 0 0 3 | /dev/shm /var/run tmpfs defaults 0 0 4 | proc /proc proc defaults 5 | devpts /dev/pts devpts mode=0622 0 0 6 | -------------------------------------------------------------------------------- /testing/baseconfigs/M/etc/hostname: -------------------------------------------------------------------------------- 1 | M 2 | -------------------------------------------------------------------------------- /testing/baseconfigs/N/etc/fstab: -------------------------------------------------------------------------------- 1 | /dev/root / hostfs defaults 0 0 2 | /dev/shm /tmp tmpfs defaults 0 0 3 | /dev/shm /var/run tmpfs defaults 0 0 4 | proc /proc proc defaults 5 | devpts /dev/pts devpts mode=0622 0 0 6 | -------------------------------------------------------------------------------- /testing/baseconfigs/N/etc/hostname: -------------------------------------------------------------------------------- 1 | N 2 | -------------------------------------------------------------------------------- /testing/baseconfigs/N/etc/network/interfaces: -------------------------------------------------------------------------------- 1 | auto lo 2 | iface lo inet loopback 3 | iface lo inet6 loopback 4 | 5 | auto eth0 eth1 6 | 7 | iface eth0 inet6 manual 8 | up modprobe ipv6; ifconfig eth0 up 9 | 10 | iface eth1 inet6 manual 11 | up modprobe ipv6; ifconfig eth1 up 12 | -------------------------------------------------------------------------------- /testing/baseconfigs/N/root/n1.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ -x /sbin/sunshine ]; 3 | then 4 | mv /sbin/sunshine /sbin/sunshine.run 5 | fi 6 | 7 | /sbin/sunshine.run --dagid ripple -i eth0 -i eth1 --interval 100000 --verbose --timelog 8 | -------------------------------------------------------------------------------- /testing/baseconfigs/all/etc/fstab: -------------------------------------------------------------------------------- 1 | /dev/root / hostfs defaults 0 0 2 | /dev/shm /tmp tmpfs defaults 0 0 3 | /dev/shm /var/run tmpfs defaults 0 0 4 | proc /proc proc defaults 5 | devpts /dev/pts devpts mode=0622 0 0 6 | -------------------------------------------------------------------------------- /testing/baseconfigs/all/etc/udev/links.conf: -------------------------------------------------------------------------------- 1 | # This file does not exist. Please do not ask the Debian maintainer about it. 2 | # If you need manually created devices, create them in /lib/udev/devices/ . 3 | 4 | L fd /proc/self/fd 5 | L stdin /proc/self/fd/0 6 | L stdout /proc/self/fd/1 7 | L stderr /proc/self/fd/2 8 | L core /proc/kcore 9 | 10 | D pts 11 | D shm 12 | 13 | M null c 1 3 14 | M console c 5 1 15 | M tty1 c 4 1 16 | 17 | # Hic sunt leones. 18 | M ppp c 108 0 19 | M loop0 b 7 0 20 | D net 21 | M net/tun c 10 200 22 | 23 | -------------------------------------------------------------------------------- /testing/baseconfigs/net.B.sh: -------------------------------------------------------------------------------- 1 | # 2 | # network for B, between n1 and n2 (parallel to E) 3 | # 4 | if [ -n "$UML_n2_CTL" ] 5 | then 6 | net_eth0="eth0=daemon,12:00:00:66:67:01,unix,$UML_n2_CTL"; 7 | else 8 | net_eth0="eth0=mcast,12:00:00:66:67:01,239.192.0.1,21300" 9 | fi 10 | 11 | if [ -n "$UML_n1_CTL" ] 12 | then 13 | net_eth1="eth1=daemon,12:00:00:66:67:02,unix,$UML_n1_CTL"; 14 | else 15 | net_eth1="eth1=mcast,12:00:00:66:67:02,239.192.1.2,31200"; 16 | fi 17 | 18 | net="$net_eth0 $net_eth1" 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /testing/baseconfigs/net.E.sh: -------------------------------------------------------------------------------- 1 | # 2 | # network for E, between n1 and n2. 3 | # 4 | mac_eth0=12:00:00:66:69:01 5 | if [ -n "$UML_n2_CTL" ] 6 | then 7 | net_eth0="eth0=daemon,$mac_eth0,unix,$UML_n2_CTL"; 8 | kvm_eth0="-net nic,vlan=2,model=virtio,name=En2,macaddr=$mac_eth0 " 9 | kvm_eth0="$kvm_eth0 -net vde,vlan=2,sock=${VDE_DIR}/2"; 10 | else 11 | net_eth0="eth0=mcast,12:00:00:66:69:01,239.192.0.1,21300" 12 | fi 13 | 14 | mac_eth1=12:00:00:66:69:02 15 | if [ -n "$UML_n1_CTL" ] 16 | then 17 | net_eth1="eth1=daemon,$mac_eth1,unix,$UML_n1_CTL"; 18 | kvm_eth1="-net nic,vlan=1,model=virtio,name=En1,macaddr=$mac_eth1 " 19 | kvm_eth1="$kvm_eth1 -net vde,vlan=1,sock=${VDE_DIR}/1"; 20 | else 21 | net_eth1="eth1=mcast,12:00:00:66:69:02,239.192.1.2,31200"; 22 | fi 23 | 24 | mac_eth2=12:00:00:66:69:03 25 | if [ -d /tmp/vde.ctl ]; 26 | then 27 | kvm_eth2="-net nic,vlan=99,model=virtio,name=Eobiwan,macaddr=$mac_eth2 " 28 | kvm_eth2="$kvm_eth2 -net vde,vlan=99,sock=${VDE_DIR}/99"; 29 | fi 30 | 31 | net="$net_eth0 $net_eth1" 32 | kvmnet="$kvm_eth0 $kvm_eth1 $kvm_eth2" 33 | 34 | 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /testing/baseconfigs/net.J.sh: -------------------------------------------------------------------------------- 1 | # 2 | # network for J, between n2 and n3. 3 | # 4A = ASCII for 'J' 4 | # 5 | mac_eth0=12:00:00:66:4A:01 6 | if [ -n "$UML_n2_CTL" ] 7 | then 8 | net_eth0="eth0=daemon,$mac_eth0,unix,$UML_n2_CTL"; 9 | kvm_eth0="-net nic,vlan=2,model=virtio,name=Jn2,macaddr=$mac_eth0 " 10 | kvm_eth0="$kvm_eth0 -net vde,vlan=2,sock=${VDE_DIR}/2"; 11 | else 12 | net_eth0="eth0=mcast,12:00:00:66:4A:01,239.192.0.1,21300" 13 | fi 14 | 15 | mac_eth1=12:00:00:66:4A:02 16 | if [ -n "$UML_n3_CTL" ] 17 | then 18 | net_eth1="eth1=daemon,$mac_eth1,unix,$UML_n3_CTL"; 19 | kvm_eth1="-net nic,vlan=3,name=En3,macaddr=$mac_eth1,model=virtio" 20 | kvm_eth1="$kvm_eth1 -net vde,vlan=3,sock=${VDE_DIR}/3"; 21 | else 22 | net_eth1="eth1=mcast,12:00:00:66:4A:02,239.192.1.2,21303"; 23 | fi 24 | 25 | mac_eth2=12:00:00:66:4A:03 26 | if [ -d /tmp/vde.ctl ]; 27 | then 28 | kvm_eth2="-net nic,vlan=99,model=virtio,name=Jobiwan,macaddr=$mac_eth2 " 29 | kvm_eth2="$kvm_eth2 -net vde,vlan=99,sock=${VDE_DIR}/99"; 30 | fi 31 | 32 | 33 | net="$net_eth0 $net_eth1" 34 | kvmnet="$kvm_eth0 $kvm_eth1 $kvm_eth2" 35 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /testing/baseconfigs/net.M.sh: -------------------------------------------------------------------------------- 1 | # 2 | # network for M, on n3 only 3 | # 4D = ASCII for 'M' 4 | # 5 | mac_eth0=12:00:00:66:4D:01 6 | if [ -n "$UML_n3_CTL" ] 7 | then 8 | net_eth0="eth0=daemon,$mac_eth0,unix,$UML_n3_CTL"; 9 | kvm_eth0="-net nic,vlan=3,name=Mn3,macaddr=$mac_eth0,model=virtio" 10 | kvm_eth0="$kvm_eth0 -net vde,vlan=3,sock=${VDE_DIR}/3"; 11 | else 12 | net_eth0="eth0=mcast,$mac_eth0,239.192.1.2,31200" 13 | fi 14 | 15 | mac_eth2=12:00:00:66:4D:03 16 | if [ -d /tmp/vde.ctl ]; 17 | then 18 | kvm_eth2="-net nic,vlan=99,model=virtio,name=Mobiwan,macaddr=$mac_eth2 " 19 | kvm_eth2="$kvm_eth2 -net vde,vlan=99,sock=${VDE_DIR}/99"; 20 | fi 21 | 22 | 23 | net="$net_eth0 " 24 | kvmnet="$kvm_eth0 $kvm_eth2" 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /testing/baseconfigs/net.N.sh: -------------------------------------------------------------------------------- 1 | # 2 | # network for N, between n1 and n3. 3 | # 4E = ASCII for 'N' 4 | # 5 | if [ -n "$UML_n1_CTL" ] 6 | then 7 | net_eth0="eth0=daemon,12:00:00:66:4E:01,unix,$UML_n1_CTL"; 8 | else 9 | net_eth0="eth0=mcast,12:00:00:66:4E:01,239.192.1.2,31200" 10 | fi 11 | 12 | if [ -n "$UML_n3_CTL" ] 13 | then 14 | net_eth1="eth1=daemon,12:00:00:66:4E:02,unix,$UML_n3_CTL"; 15 | else 16 | net_eth1="eth1=mcast,12:00:00:66:4E:02,239.192.1.2,21303"; 17 | fi 18 | 19 | net="$net_eth0 $net_eth1" 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /testing/functional/recv-02/description.txt: -------------------------------------------------------------------------------- 1 | This tests uses the DIO packet that was sent by senddio-01, 2 | receiving it with tcpdump to validate that the plumbing works properly. 3 | 4 | 5 | -------------------------------------------------------------------------------- /testing/functional/recv-02/econsole.txt: -------------------------------------------------------------------------------- 1 | E:~# sleep 2 2 | E:~# ip -6 addr ls 3 | 5: eth0: mtu 1500 qlen 1000 4 | inet6 fe80::1000:ff:fe66:6601/64 scope link 5 | valid_lft forever preferred_lft forever 6 | 6: eth1: mtu 1500 qlen 1000 7 | inet6 fe80::1000:ff:fe66:6602/64 scope link 8 | valid_lft forever preferred_lft forever 9 | E:~# : /sbin/sunshine -i eth0 -i eth1 10 | E:~# tcpdump -t -i eth1 -n & 11 | [1] PID 12 | E:~# sleep 1 13 | tcpdump: WARNING: eth1: no IPv4 address assigned 14 | tcpdump: verbose output suppressed, use -v or -vv for full protocol decode 15 | listening on eth1, link-type EN10MB (Ethernet), capture size 65535 bytes 16 | E:~# echo true 17 | true 18 | IP6 fe80::1000:ff:fe64:6423 > ff02::1: ICMP6, RPL, DAG Information Object, length 40 19 | ^C 20 | 21 | E:~# kill %tcpdump 22 | 23 | 0 packets dropped by kernel 24 | 25 | -------------------------------------------------------------------------------- /testing/functional/recv-02/n1-output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/functional/recv-02/n1-output.txt -------------------------------------------------------------------------------- /testing/functional/recv-02/sunfinal.sh: -------------------------------------------------------------------------------- 1 | kill %tcpdump 2 | 3 | : ==== end ==== 4 | 5 | -------------------------------------------------------------------------------- /testing/functional/recv-02/sunshine.sh: -------------------------------------------------------------------------------- 1 | : ==== start ==== 2 | sleep 2 3 | ip -6 addr ls 4 | : /sbin/sunshine -i eth0 -i eth1 5 | tcpdump -t -i eth1 -n & 6 | sleep 1 7 | echo true 8 | 9 | -------------------------------------------------------------------------------- /testing/functional/recv-02/testparams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TEST_PURPOSE=regress 4 | TEST_PROB_REPORT=0 5 | TEST_TYPE=pkttest 6 | 7 | XHOST_LIST="E" 8 | XNET_LIST="ground n1 n2 n3" 9 | 10 | TESTNAME=recv-02 11 | EHOST=E 12 | 13 | N1_PLAY=../../unit/INPUTS/dio-02.pcap 14 | REF_N1_OUTPUT=n1-output.txt 15 | REF_N1_FILTER="no-icmp-v6-mcast.sed" 16 | REF_E_CONSOLE_OUTPUT=econsole.txt 17 | REF_CONSOLE_FIXUPS="script-only.sed" 18 | REF_CONSOLE_FIXUPS="${REF_CONSOLE_FIXUPS} tcpdump-packet-count.sed" 19 | REF_CONSOLE_FIXUPS="${REF_CONSOLE_FIXUPS} no-icmp-v6-mcast.sed" 20 | REF_CONSOLE_FIXUPS="${REF_CONSOLE_FIXUPS} fixup-proc-1-pid.sed" 21 | E_RUN_SCRIPT=sunshine.sh 22 | E_FINAL_SCRIPT=sunfinal.sh 23 | 24 | PACKETRATE=100 25 | 26 | -------------------------------------------------------------------------------- /testing/functional/recv-03/description.txt: -------------------------------------------------------------------------------- 1 | This tests uses the DIO packet that was sent by senddio-01, 2 | receiving it with sunshine, validating that it has now seen a new 3 | node on the network. 4 | 5 | 6 | -------------------------------------------------------------------------------- /testing/functional/recv-03/n1-output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/functional/recv-03/n1-output.txt -------------------------------------------------------------------------------- /testing/functional/recv-03/sunfinal.sh: -------------------------------------------------------------------------------- 1 | : now kill the running daemon 2 | sunshine -K 3 | 4 | : ==== end ==== 5 | 6 | -------------------------------------------------------------------------------- /testing/functional/recv-03/sunshine.sh: -------------------------------------------------------------------------------- 1 | : ==== start ==== 2 | sleep 2 3 | ip -6 addr ls 4 | /sbin/sunshine -v -v -i eth0 -D 5 | echo true 6 | 7 | -------------------------------------------------------------------------------- /testing/functional/recv-03/testparams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TEST_PURPOSE=regress 4 | TEST_PROB_REPORT=0 5 | TEST_TYPE=pkttest 6 | 7 | XHOST_LIST="E" 8 | XNET_LIST="ground n1" 9 | 10 | TESTNAME=recv-03 11 | EHOST=E 12 | 13 | N1_PLAY=../../unit/INPUTS/dio-02.pcap 14 | REF_N1_OUTPUT=n1-output.txt 15 | REF_N1_FILTER="no-icmp-v6-mcast.sed" 16 | REF_E_CONSOLE_OUTPUT=econsole.txt 17 | REF_CONSOLE_FIXUPS="script-only.sed " 18 | REF_CONSOLE_FIXUPS="${REF_CONSOLE_FIXUPS} remove_dummy.sed" 19 | E_RUN_SCRIPT=sunshine.sh 20 | E_FINAL_SCRIPT=sunfinal.sh 21 | 22 | PACKETRATE=100 23 | 24 | -------------------------------------------------------------------------------- /testing/functional/recvself-05/asunshine.sh: -------------------------------------------------------------------------------- 1 | : ==== start ==== 2 | sleep 2 3 | ip -6 addr ls 4 | /sbin/sunshine -v -v -i eth0 -p 2001:db8:0001::/48 -A 5 | echo true 6 | 7 | -------------------------------------------------------------------------------- /testing/functional/recvself-05/description.txt: -------------------------------------------------------------------------------- 1 | This tests the case when we hear our own multicast, we should not 2 | do anything useful with such a message. 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /testing/functional/recvself-05/n1-output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/functional/recvself-05/n1-output.txt -------------------------------------------------------------------------------- /testing/functional/recvself-05/sunfinal.sh: -------------------------------------------------------------------------------- 1 | : now kill the running daemon 2 | sunshine -K 3 | 4 | : ==== end ==== 5 | 6 | -------------------------------------------------------------------------------- /testing/functional/recvself-05/testparams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TEST_PURPOSE=regress 4 | TEST_PROB_REPORT=0 5 | TEST_TYPE=pkttest 6 | 7 | XHOST_LIST="A" 8 | XNET_LIST="ground n1" 9 | 10 | TESTNAME=recvself-05 11 | AHOST=A 12 | 13 | N1_PLAY=../../unit/INPUTS/dio-02.pcap 14 | REF_N1_OUTPUT=n1-output.txt 15 | REF_N1_FILTER="no-icmp-v6-mcast.sed" 16 | REF_A_CONSOLE_OUTPUT=econsole.txt 17 | REF_CONSOLE_FIXUPS="script-only.sed " 18 | #REF_CONSOLE_FIXUPS="${REF_CONSOLE_FIXUPS} remove_dummy.sed" 19 | A_RUN_SCRIPT=asunshine.sh 20 | A_FINAL_SCRIPT=sunfinal.sh 21 | 22 | PACKETRATE=100 23 | 24 | -------------------------------------------------------------------------------- /testing/functional/send-01/asunshine.sh: -------------------------------------------------------------------------------- 1 | : ==== start ==== 2 | sleep 2 3 | ip -6 addr ls 4 | /sbin/sunshine -v -v -i eth0 -p 2001:db8:0001::/48 -A 5 | echo true 6 | 7 | -------------------------------------------------------------------------------- /testing/functional/send-01/description.txt: -------------------------------------------------------------------------------- 1 | This test starts up sunshine (on A) with a command to announce a particular 2 | DAGID + prefix goal onto the n1 network. This test confirms that E sees 3 | this DIO. 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /testing/functional/send-01/esunshine.sh: -------------------------------------------------------------------------------- 1 | : ==== start ==== 2 | sleep 2 3 | ip -6 addr ls 4 | /sbin/sunshine -i eth0 -D -v -v 5 | echo true 6 | 7 | -------------------------------------------------------------------------------- /testing/functional/send-01/n1-output.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/functional/send-01/n1-output.txt -------------------------------------------------------------------------------- /testing/functional/send-01/sleep5.sh: -------------------------------------------------------------------------------- 1 | sleep 5 2 | 3 | -------------------------------------------------------------------------------- /testing/functional/send-01/sunfinal.sh: -------------------------------------------------------------------------------- 1 | : now kill the running daemon 2 | sunshine -K 3 | 4 | : ==== end ==== 5 | 6 | -------------------------------------------------------------------------------- /testing/functional/send-01/testparams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TEST_PURPOSE=regress 4 | TEST_PROB_REPORT=0 5 | TEST_TYPE=pkttest 6 | 7 | XHOST_LIST="A E" 8 | XNET_LIST="ground n1" 9 | 10 | TESTNAME=send-01 11 | AHOST=A 12 | EHOST=E 13 | 14 | REF_N1_OUTPUT=n1-output.txt 15 | REF_N1_FILTER="no-icmp-v6-mcast.sed" 16 | REF_E_CONSOLE_OUTPUT=econsole.txt 17 | REF_CONSOLE_FIXUPS="script-only.sed " 18 | REF_CONSOLE_FIXUPS="${REF_CONSOLE_FIXUPS} remove_dummy.sed" 19 | A_RUN_SCRIPT=asunshine.sh 20 | E_RUN_SCRIPT=esunshine.sh 21 | A_RUN2_SCRIPT=sleep5.sh 22 | A_FINAL_SCRIPT=sunfinal.sh 23 | E_FINAL_SCRIPT=sunfinal.sh 24 | 25 | PACKETRATE=100 26 | 27 | -------------------------------------------------------------------------------- /testing/functional/senddio-04/aconsole.txt: -------------------------------------------------------------------------------- 1 | A:~# sleep 2 2 | A:~# ip -6 addr ls 3 | 5: eth0: mtu 1500 qlen 1000 4 | inet6 fe80::1000:ff:fedc:bcff/64 scope link 5 | valid_lft forever preferred_lft forever 6 | 6: eth1: mtu 1500 qlen 1000 7 | inet6 fe80::1000:ff:fe64:6423/64 scope link 8 | valid_lft forever preferred_lft forever 9 | A:~# /sbin/senddio -v -p 2001:db8:0001::/48 -i eth1 10 | found[1]: lo type=loopback (inactive new) 11 | found[2]: dummy0 type=ether (inactive new) 12 | found[3]: tunl0 type=ipip (inactive new) 13 | found[4]: gre0 type=gre (inactive new) 14 | found[5]: eth0 type=ether (inactive new) 15 | adding as new interface 12:00:00:dc:bc:ff/1200:00ff:fedc:bcff 16 | found[6]: eth1 type=ether (inactive new) 17 | adding as new interface 12:00:00:64:64:23/1200:00ff:fe64:6423 18 | Sending ICMP of length: 40 19 | 0000: 9b 02 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 20 | 0010: 00 00 00 00 00 00 00 00 03 00 0c 00 00 00 00 00 ................ 21 | 0020: 30 20 01 0d b8 00 01 00 0 ...... 22 | Starting setup for eth1 23 | sending RA on 4 24 | 25 | -------------------------------------------------------------------------------- /testing/functional/senddio-04/description.txt: -------------------------------------------------------------------------------- 1 | This tests uses the senddio to insert DAG Information Object ICMPv6 into 2 | the network. It tests that the interface to the kernel is working. 3 | 4 | -------------------------------------------------------------------------------- /testing/functional/senddio-04/dio1.sh: -------------------------------------------------------------------------------- 1 | : ==== start ==== 2 | sleep 2 3 | ip -6 addr ls 4 | /sbin/senddio -v -p 2001:db8:0001::/48 -i eth1 5 | : ==== end ==== 6 | 7 | -------------------------------------------------------------------------------- /testing/functional/senddio-04/n1-output.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::1000:ff:fe64:6423 > ff02::1: ICMP6, RPL, DAG Information Object, length 40 2 | -------------------------------------------------------------------------------- /testing/functional/senddio-04/testparams.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | TEST_PURPOSE=regress 4 | TEST_PROB_REPORT=0 5 | TEST_TYPE=pkttest 6 | 7 | XHOST_LIST="A" 8 | XNET_LIST="ground n1" 9 | 10 | TESTNAME=senddio-04 11 | AHOST=A 12 | EXITONEMPTY=--exitonempty 13 | PRIV_INPUT=../inputs/01-sunrise-sunset-ping.pcap 14 | 15 | REF_N1_OUTPUT=n1-output.txt 16 | REF_N1_FILTER="no-icmp-v6-mcast.sed" 17 | REF_A_CONSOLE_OUTPUT=aconsole.txt 18 | REF_CONSOLE_FIXUPS="script-only.sed" 19 | A_RUN_SCRIPT=dio1.sh 20 | 21 | PACKETRATE=100 22 | 23 | -------------------------------------------------------------------------------- /testing/kernelconfigs/updatekernelconfig.sh: -------------------------------------------------------------------------------- 1 | #!/bin/zsh 2 | 3 | # this script goes into $POOLSPACE/{plain,swan}{,26} and looks for the .config 4 | # file that is there. It canonicalizes the file using "sort", and adds any 5 | # missing items to uml{plain,swan}{,26}.config. 6 | # 7 | # Actually, it just cats the new file and the old file, turning all comments 8 | # like '# FOO is not set' into "FOO=n" and uses sort -u on the result. 9 | # 10 | 11 | canonicalize_kernel_config() { 12 | old=$1 13 | new=$2 14 | out=`basename $old` 15 | 16 | rm -f $out.new 17 | ./canonicalize_kernel_config.pl $old $new >$out.new 18 | } 19 | 20 | source ../../umlsetup.sh 21 | for type in plain swan 22 | do 23 | for ver in "" 26 24 | do 25 | if [ -f $POOLSPACE/${type}${ver}/.config ] 26 | then 27 | canonicalize_kernel_config uml${type}${ver}.config $POOLSPACE/${type}${ver}/.config 28 | mv uml${type}${ver}.config uml${type}${ver}.config.old 29 | mv uml${type}${ver}.config.new uml${type}${ver}.config 30 | fi 31 | done 32 | done 33 | 34 | -------------------------------------------------------------------------------- /testing/unit/.gitignore: -------------------------------------------------------------------------------- 1 | OUTPUTS -------------------------------------------------------------------------------- /testing/unit/01-osw/.gitignore: -------------------------------------------------------------------------------- 1 | addrtot-01 2 | ttoaddr-01 3 | ttosubnet-01 4 | -------------------------------------------------------------------------------- /testing/unit/01-osw/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | all: check 7 | 8 | OSWDIR=${UNSTRUNG_SRCDIR}/lib/libosw 9 | 10 | addrtot-01: ${OSWDIR}/addrtot.c 11 | ${CC} -g -DADDRTOT_MAIN ${CFLAGS} -o addrtot-01 ${OSWDIR}/addrtot.c ${LDFLAGS} 12 | 13 | ttoaddr-01: ${OSWDIR}/ttoaddr.c 14 | ${CC} -g -DTTOADDR_MAIN ${CFLAGS} -o ttoaddr-01 ${OSWDIR}/ttoaddr.c ${LDFLAGS} 15 | 16 | ttosubnet-01: ${OSWDIR}/ttosubnet.c 17 | ${CC} -g -DTTOSUBNET_MAIN ${CFLAGS} -o ttosubnet-01 ${OSWDIR}/ttosubnet.c ${LDFLAGS} 18 | 19 | check:: addrtot-01 ttoaddr-01 ttosubnet-01 20 | ./addrtot-01 -r 21 | ./ttoaddr-01 -r 22 | ./ttosubnet-01 -r 23 | 24 | checkprograms:: 25 | programs:: 26 | 27 | clean:: 28 | @rm -rf addrtot-01 ttoaddr-01 ttosubnet-01 *.o 29 | -------------------------------------------------------------------------------- /testing/unit/03-dioopt/.gdbinit: -------------------------------------------------------------------------------- 1 | file dioopt-01 -------------------------------------------------------------------------------- /testing/unit/03-dioopt/.gitignore: -------------------------------------------------------------------------------- 1 | dioopt-01 2 | 3 | -------------------------------------------------------------------------------- /testing/unit/03-dioopt/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | dioopt-01: dioopt-01.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o dioopt-01 dioopt-01.cpp ${LDFLAGS} 10 | 11 | check:: dioopt-01 12 | ./dioopt-01 13 | 14 | checkprograms:: dioopt-01 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf dioopt-01 *.o 19 | -------------------------------------------------------------------------------- /testing/unit/04-dag/.gitignore: -------------------------------------------------------------------------------- 1 | dag-01 2 | -------------------------------------------------------------------------------- /testing/unit/04-dag/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | dag-01: dag-01.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o dag-01 dag-01.cpp ${LDFLAGS} 10 | 11 | check:: dag-01 12 | ./dag-01 13 | 14 | checkprograms:: dag-01 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf dag-01 *.o 19 | -------------------------------------------------------------------------------- /testing/unit/05-dag/.gdbinit: -------------------------------------------------------------------------------- 1 | file dag-05 2 | -------------------------------------------------------------------------------- /testing/unit/05-dag/.gitignore: -------------------------------------------------------------------------------- 1 | dag-05 2 | -------------------------------------------------------------------------------- /testing/unit/05-dag/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | dag-05: dag-05.cpp ${INC}/iface.h ${INC}/dag.h ${LIBS} 9 | ${CXX} ${CXXFLAGS} -o dag-05 dag-05.cpp ${LDFLAGS} 10 | 11 | check:: dag-05 12 | ./dag-05 13 | 14 | unitcheck checkprograms:: dag-05 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf dag-05 *.o 19 | -------------------------------------------------------------------------------- /testing/unit/06-dag/.gdbinit: -------------------------------------------------------------------------------- 1 | file dag-03 -------------------------------------------------------------------------------- /testing/unit/06-dag/.gitignore: -------------------------------------------------------------------------------- 1 | dag-03 2 | t1.pcap 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/06-dag/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | dag-03: dag-03.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o dag-03 dag-03.cpp ${LDFLAGS} 10 | 11 | check:: dag-03 12 | ./dag-03 13 | 14 | checkprograms:: dag-03 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf dag-03 *.o 19 | -------------------------------------------------------------------------------- /testing/unit/06-dag/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates some properties of DAG objects. 2 | -------------------------------------------------------------------------------- /testing/unit/07-dagset/.gdbinit: -------------------------------------------------------------------------------- 1 | file dagset-01 2 | -------------------------------------------------------------------------------- /testing/unit/07-dagset/.gitignore: -------------------------------------------------------------------------------- 1 | dagset-01 2 | -------------------------------------------------------------------------------- /testing/unit/07-dagset/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=dagset-01 9 | 10 | ${TESTNAME}: ${TESTNAME}.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 11 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 12 | 13 | check:: ${TESTNAME} 14 | ./${TESTNAME} 15 | 16 | checkprograms:: ${TESTNAME} 17 | programs:: 18 | 19 | clean:: 20 | @rm -rf ${TESTNAME} *.o 21 | -------------------------------------------------------------------------------- /testing/unit/08-event/.gdbinit: -------------------------------------------------------------------------------- 1 | file event-01 2 | -------------------------------------------------------------------------------- /testing/unit/08-event/.gitignore: -------------------------------------------------------------------------------- 1 | event-01 2 | 3 | -------------------------------------------------------------------------------- /testing/unit/08-event/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | event-01: event-01.cpp ${INC}/event.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o event-01 event-01.cpp ${LDFLAGS} 10 | 11 | check:: event-01 12 | ./event-01 13 | 14 | checkprograms:: event-01 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf event-01 *.o 19 | -------------------------------------------------------------------------------- /testing/unit/09-netlink/.gitignore: -------------------------------------------------------------------------------- 1 | dumpif 2 | -------------------------------------------------------------------------------- /testing/unit/09-netlink/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | dumpif: dumpif.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o dumpif dumpif.cpp ${LDFLAGS} 10 | 11 | check:: dumpif 12 | ./dumpif | grep "lo:" 13 | 14 | checkprograms:: dumpif 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf dumpif *.o 19 | -------------------------------------------------------------------------------- /testing/unit/10-netlink/.gitignore: -------------------------------------------------------------------------------- 1 | findeui 2 | 3 | -------------------------------------------------------------------------------- /testing/unit/10-netlink/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | findeui: findeui.cpp ${LIBNETLINK} ${LIBOSW} 9 | ${CXX} ${CXXFLAGS} -o findeui findeui.cpp ${LDFLAGS} 10 | 11 | check:: findeui 12 | ./findeui >/dev/null 13 | 14 | checkprograms:: findeui 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf findeui *.o 19 | -------------------------------------------------------------------------------- /testing/unit/10-netlink/findeui.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "iface.h" 4 | 5 | extern "C" { 6 | #include "pcap.h" 7 | #include "sll.h" 8 | #include "ether.h" 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | } 16 | 17 | #include "iface.h" 18 | #include "dag.h" 19 | 20 | /* 21 | * this program needs to dump the list of interfaces via netlink, 22 | * printing the MAC address of each interface that it sees. 23 | * 24 | * It should run, but the output is going to change by system. 25 | */ 26 | 27 | 28 | int main(int argc, char *argv[]) 29 | { 30 | rpl_debug *deb = new rpl_debug(true, stdout); 31 | network_interface::scan_devices(deb, false); 32 | 33 | exit(0); 34 | } 35 | 36 | /* 37 | * Local Variables: 38 | * c-basic-offset:4 39 | * c-style: whitesmith 40 | * End: 41 | */ 42 | 43 | 44 | -------------------------------------------------------------------------------- /testing/unit/10-netlink/marajade.output.txt: -------------------------------------------------------------------------------- 1 | found[1]: lo type=loopback (inactive new) 2 | found[2]: eth0 type=ether (inactive new) 3 | adding as new interface 00:0d:60:fa:7f:03/020d:60ff:fefa:7f03 4 | found[3]: irda0 type=irda (inactive new) 5 | found[4]: wlan0 type=ether (inactive new) 6 | adding as new interface 00:05:4e:4a:55:da/0205:4eff:fe4a:55da 7 | found[6]: pan0 type=ether (inactive new) 8 | adding as new interface 3e:61:6a:97:14:c3/3e61:6aff:fe97:14c3 9 | found[7]: teredo type=[65534] (inactive new) 10 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/.gdbinit: -------------------------------------------------------------------------------- 1 | file ../../../programs/senddao/senddao 2 | set args --fake --outpcap ../OUTPUTS/senddao-test-04out.pcap -i wlan0 -v --dagid T1 --sequence 1 --instance 2 --prefix 2001:db8::/38 --myid 2001:db8::abcd:1 --dest fe80::1200:00ff:fe64:6423 --target 2001:db8::abcd:2/128 -------------------------------------------------------------------------------- /testing/unit/11-senddao/.gitignore: -------------------------------------------------------------------------------- 1 | OUTPUT 2 | .gdbinit-02 3 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | export SENDDAO=${UNSTRUNG_OBJDIR}/programs/senddao/senddao 7 | 8 | checkprograms:: 9 | programs:: 10 | clean:: 11 | @rm -f core.* 12 | @rm -rf OUTPUT 13 | 14 | check:: 15 | @rm -f core.* 16 | ./senddao-test-01.sh 17 | ./senddao-test-02.sh 18 | ./senddao-test-03.sh 19 | ./senddao-test-04.sh 20 | @if [ -f core.* ]; then echo CORE FILES FOUND; exit 1; else exit 0; fi 21 | 22 | update: 23 | cp OUTPUTS/senddao-test-01.raw senddao-test-01.out 24 | cp OUTPUTS/senddao-test-01.err senddao-test-01.err 25 | cp ../OUTPUTS/senddao-test-02.raw senddao-test-02.out 26 | cp ../OUTPUTS/senddao-test-02-pcap.txt senddao-test-02-pcap.txt 27 | cp OUTPUTS/senddao-test-03.raw senddao-test-03.out 28 | cp ../OUTPUTS/senddao-test-04.raw senddao-test-04.out 29 | cp ../OUTPUTS/senddao-test-04-pcap.txt senddao-test-04-pcap.txt 30 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/description.txt: -------------------------------------------------------------------------------- 1 | 1) This exercisese the senddao program. 2 | 2) It uses the senddao program to create a number of different kinds of DAO 3 | packets, exercising the DAO generation routines. 4 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-01.err: -------------------------------------------------------------------------------- 1 | either a prefix is needed to send a DAO, or --daoack 2 | Usage: senddao [--sequence #] [--instance #] [--ack-request] 3 | [--dagid hexstring] 4 | [--daoack seqnum] 5 | [--dest target] [--prefix prefix] 6 | [--target prefix...] 7 | [-d datafile] [--outpcap file --fake] [--fake] [--iface net] 8 | either a prefix is needed to send a DAO, or --daoack 9 | Usage: senddao [--sequence #] [--instance #] [--ack-request] 10 | [--dagid hexstring] 11 | [--daoack seqnum] 12 | [--dest target] [--prefix prefix] 13 | [--target prefix...] 14 | [-d datafile] [--outpcap file --fake] [--fake] [--iface net] 15 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-01.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/11-senddao/senddao-test-01.out -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-01.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SENDDAO=${SENDDAO-../../../programs/senddao/senddao} 4 | 5 | # this test case just tests stderr, that the usage message comes out 6 | # sanely, with no crashes when there are not the right arguments. 7 | 8 | mkdir -p OUTPUTS 9 | 10 | ( 11 | ${SENDDAO} --fake -v -d ../INPUTS/just-comments.txt 12 | # with no file. 13 | ${SENDDAO} -v 14 | ) 2> OUTPUTS/senddao-test-01.err | tee OUTPUTS/senddao-test-01.raw | diff -B -w - senddao-test-01.out 15 | diff -B -w OUTPUTS/senddao-test-01.err senddao-test-01.err 16 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-02-pcap.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:7061:6e64:6f72:6120:6973:2066:756e:a6c,seq:1,instance:1,Dagid,40] 2 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-02.out: -------------------------------------------------------------------------------- 1 | Using faked interfaces 2 | Creating PCAP interface: wlan0 3 | link found[1]: wlan0 type=ether (active new) faked 4 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 5 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 6 | Creating PCAP interface: lo 7 | link found[2]: lo type=loopback (active new) faked 8 | ip found[2]: lo scope=254 address=::1 9 | link found[3]: virbr0 no carrier, ignored 10 | Sending ICMP of length: 24 11 | 0000: 9b 02 00 00 01 40 00 01 70 61 6e 64 6f 72 61 20 .....@..pandora 12 | 0010: 69 73 20 66 75 6e 0a 6c is fun.l 13 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-02.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | SENDDAO=${SENDDAO-../../../programs/senddao/senddao} 5 | mkdir -p ../OUTPUTS 6 | 7 | PCAP02=../OUTPUTS/basic-dao.pcap 8 | 9 | echo "set args --fake -v -d ../INPUTS/basic-dao.txt -O ${PCAP02} -i wlan0" >.gdbinit-02 10 | 11 | ${SENDDAO} --fake -v -d ../INPUTS/basic-dao.txt -O ${PCAP02} -i wlan0 2>&1 | tee ../OUTPUTS/senddao-test-02.raw | diff -B -w - senddao-test-02.out 12 | 13 | ${TCPDUMP-tcpdump} -t -n -r ${PCAP02} -v -v | tee ../OUTPUTS/senddao-test-02-pcap.txt | diff -B -w - senddao-test-02-pcap.txt 14 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-03.out: -------------------------------------------------------------------------------- 1 | Using faked interfaces 2 | link found[1]: wlan0 type=ether (active new) faked 3 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 4 | link found[2]: lo type=loopback (active new) faked 5 | ip found[2]: lo scope=254 address=::1 6 | link found[3]: virbr0 no carrier, ignored 7 | Must specify pcap outfile (-O) 8 | Usage: senddao [--sequence #] [--instance #] [--ack-request] 9 | [--dagid hexstring] 10 | [--daoack seqnum] 11 | [--dest target] [--prefix prefix] 12 | [--target prefix...] 13 | [-d datafile] [--outpcap file --fake] [--fake] [--iface net] 14 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-03.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SENDDAO=${SENDDAO-./senddao} 4 | 5 | mkdir -p OUTPUTS 6 | # SHOULD fail because no -O out.pcap 7 | 8 | ${SENDDAO} --fake -i wlan0 -v --dagid thisismydicedag2 --sequence 11 --instance 43 2>&1 | 9 | tee OUTPUTS/senddao-test-03.raw | diff -B -w - senddao-test-03.out 10 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-04-pcap.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 48) fe80::216:3eff:fe11:3424 > fe80::1200:ff:fe64:6423: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:6664:3830:3a61:6263:643a:3a31:3200:0,seq:2,instance:2,acK,Dagid,c0] opt:rpltarget len:20 0x0000: 0080 2001 0db8 0000 0000 0000 0000 abcd 0x0010: 0002 opt:pad0 opt:pad0 opt:pad0 opt:pad0 2 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-04.out: -------------------------------------------------------------------------------- 1 | Using faked interfaces 2 | Creating PCAP interface: wlan0 3 | link found[1]: wlan0 type=ether (active new) faked 4 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 5 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 6 | Creating PCAP interface: lo 7 | link found[2]: lo type=loopback (active new) faked 8 | ip found[2]: lo scope=254 address=::1 9 | link found[3]: virbr0 no carrier, ignored 10 | new RPL node: fe80::1200:ff:fe64:6423 11 | invoking ip -6 route add 2001:db8::abcd:2/128 via fe80::1200:ff:fe64:6423 dev wlan0 src 2001:db8::abcd:1 12 | would invoke cmd: ip -6 route add 2001:db8::abcd:2/128 via fe80::1200:ff:fe64:6423 dev wlan0 src 2001:db8::abcd:1 13 | would invoke cmd: ip -6 route show 14 | building DAO 15 | Sending ICMP of length: 48 16 | 0000: 9b 02 00 00 02 c0 00 02 66 64 38 30 3a 61 62 63 ........fd80:abc 17 | 0010: 64 3a 3a 31 32 00 00 00 05 12 00 80 20 01 0d b8 d::12....... ... 18 | 0020: 00 00 00 00 00 00 00 00 ab cd 00 02 00 00 00 00 ................ 19 | -------------------------------------------------------------------------------- /testing/unit/11-senddao/senddao-test-04.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SENDDAO=${SENDDAO-../../../programs/senddao/senddao} 4 | PCAP04=../OUTPUTS/senddao-test-04out.pcap 5 | 6 | ${SENDDAO} -v -v --fake --outpcap ${PCAP04} -i wlan0 -v --instance 2 --dagid fd80:abcd::12 --sequence 1 --prefix 2001:db8::/38 --myid 2001:db8::abcd:1 --dest fe80::1200:00ff:fe64:6423 --target 2001:db8::abcd:2/128 2>&1 | 7 | tee ../OUTPUTS/senddao-test-04.raw | diff -B -w - senddao-test-04.out 8 | 9 | ${TCPDUMP-tcpdump} -t -n -r ${PCAP04} -v -v -v | tee ../OUTPUTS/senddao-test-04-pcap.txt | diff - senddao-test-04-pcap.txt 10 | 11 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/.gdbinit-short: -------------------------------------------------------------------------------- 1 | file ../../../programs/senddio/senddio 2 | set args --fake -v -p 2001:db8:0001::/48 -G -I 42 --version 1 -S 10 -R 1 -s -D thisismynicedag1 3 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/.gitignore: -------------------------------------------------------------------------------- 1 | OUTPUT 2 | .gdbinit 3 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/decoded-test-04.txt: -------------------------------------------------------------------------------- 1 | Sending ICMP of length: 48 2 | 3 | /----------------- ICMP v6 code 4 | | /-------------- ICMP v6 type 5 | | | /----------- ICMP v6 checksum 6 | | | | /----------------------------------- instanceid 7 | | | | | /-------------------------------- version 8 | | | | | | /----------------------------- dagrank 9 | | | | | | |||| /----------------- mopprf:7G, 5-3=MOP,2-0=PRF 10 | | | | | | |||| | /------------------- dtrigger seq num 11 | | | | | | | | | | /----------------- flags 12 | | | | | | | | | | | /-------------- resv1 13 | | | | | | | | | | | | DAGID 14 | 0000: 9b 01 00 00 01 00 00 0a d0 2a 00 00 74 68 69 73 .........*..this 15 | 0010: 69 73 6d 79 6e 69 63 65 64 61 67 31 08 0d 30 00 ismynicedag1..0. 16 | 0020: 00 00 00 00 20 01 0d b8 00 01 00 00 00 00 00 00 .... ........... 17 | 18 | 19 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-01.err: -------------------------------------------------------------------------------- 1 | Usage: senddio [--verbose] [--instanceid #] [--dagid hexstring] [--prefix prefix] 2 | [-d datafile] [--fake] [--iface net] 3 | [--version #] [--grounded] [--storing] 4 | [--non-storing] [--multicast] [--no-multicast] 5 | [--sequence #] [--rank #] 6 | Usage: senddio [--verbose] [--instanceid #] [--dagid hexstring] [--prefix prefix] 7 | [-d datafile] [--fake] [--iface net] 8 | [--version #] [--grounded] [--storing] 9 | [--non-storing] [--multicast] [--no-multicast] 10 | [--sequence #] [--rank #] 11 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-01.out: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/12-senddio/senddio-test-01.out -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-01.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SENDDIO=${SENDDIO-./senddio} 4 | 5 | # this test case just tests stderr, that the usage message comes out 6 | # sanely, with no crashes when there are not the right arguments. 7 | 8 | ( 9 | ${SENDDIO} --fake -v -d ../INPUTS/just-comments.txt 10 | # with no file. 11 | ${SENDDIO} -v 12 | ) 2>OUTPUT/senddio-test-01.err | diff - senddio-test-01.out 13 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-02.out: -------------------------------------------------------------------------------- 1 | Sending ICMP of length: 40 2 | 0000: 9b 01 00 00 80 01 01 01 70 61 6e 64 6f 72 61 20 ........pandora 3 | 0010: 69 73 20 66 75 6e 0a 6c 69 62 65 72 61 74 65 20 is fun.liberate 4 | 0020: 79 6f 75 72 20 76 36 0a your v6. 5 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-02.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | SENDDIO=${SENDDIO-./senddio} 4 | 5 | ${SENDDIO} --fake -i wlan0 -v -d ../INPUTS/basic-dio.txt | tee OUTPUT/senddio-test-02.raw | diff -B -w - senddio-test-02.out 6 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-03-pcap.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 64) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)DODAG Information Object [dagid:2001:db8:661e::1,seq:10,instance:42,rank:2,grounded,mop:storing-multicast,prf:0] 2 | 0x0000: 6000 0000 0040 3a40 fe80 0000 0000 0000 `....@:@........ 3 | 0x0010: 0216 3eff fe11 3424 ff02 0000 0000 0000 ..>...4$........ 4 | 0x0020: 0000 0000 0000 0001 9b01 37b5 2a01 0002 ..........7.*... 5 | 0x0030: 980a 0000 2001 0db8 661e 0000 0000 0000 ........f....... 6 | 0x0040: 0000 0001 081e 3040 0000 0000 0000 0000 ......0@........ 7 | 0x0050: 0000 0000 2001 0db8 0001 0000 0000 0000 ................ 8 | 0x0060: 0000 0000 0000 0000 ........ 9 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-03.gdb: -------------------------------------------------------------------------------- 1 | file ../../../programs/senddio/senddio 2 | set args --pcapout ../OUTPUTS/senddio-test-03.pcap --fake -i wlan0 -v --dagid T1 --prefix 2001:db8:0001::/48 --prefixlifetime 12 --instance 42 --grounded --storing --version 1 --sequence 10 --rank 2 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-03.out: -------------------------------------------------------------------------------- 1 | Sending ICMP of length: 64 2 | 0000: 9b 01 00 00 2a 01 00 02 98 0a 00 00 20 01 0d b8 ....*....... ... 3 | 0010: 66 1e 00 00 00 00 00 00 00 00 00 01 08 1e 30 40 f.............0@ 4 | 0020: 00 00 00 00 00 00 00 00 00 00 00 00 20 01 0d b8 ............ ... 5 | 0030: 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 6 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-04.out: -------------------------------------------------------------------------------- 1 | Sending ICMP of length: 64 2 | 0000: 9b 01 00 00 2a 01 00 02 98 0a 00 00 20 01 0d b8 ....*....... ... 3 | 0010: 00 01 00 00 00 00 00 00 00 00 00 01 08 1e 30 40 ..............0@ 4 | 0020: 00 00 00 00 00 00 00 00 00 00 00 00 20 01 0d b8 ............ ... 5 | 0030: 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 6 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-05-pcap.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 64) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)DODAG Information Object [dagid:2001:db8:661e::1,seq:10,instance:42,rank:2,mop:storing-multicast,prf:0] 2 | 0x0000: 6000 0000 0040 3a40 fe80 0000 0000 0000 `....@:@........ 3 | 0x0010: 0216 3eff fe11 3424 ff02 0000 0000 0000 ..>...4$........ 4 | 0x0020: 0000 0000 0000 0001 9b01 b7b5 2a01 0002 ............*... 5 | 0x0030: 180a 0000 2001 0db8 661e 0000 0000 0000 ........f....... 6 | 0x0040: 0000 0001 081e 3040 0000 0000 0000 0000 ......0@........ 7 | 0x0050: 0000 0000 2001 0db8 0001 0000 0000 0000 ................ 8 | 0x0060: 0000 0000 0000 0000 ........ 9 | -------------------------------------------------------------------------------- /testing/unit/12-senddio/senddio-test-05.out: -------------------------------------------------------------------------------- 1 | Sending ICMP of length: 64 2 | 0000: 9b 01 00 00 2a 01 00 02 18 0a 00 00 20 01 0d b8 ....*....... ... 3 | 0010: 66 1e 00 00 00 00 00 00 00 00 00 01 08 1e 30 40 f.............0@ 4 | 0020: 00 00 00 00 00 00 00 00 00 00 00 00 20 01 0d b8 ............ ... 5 | 0030: 00 01 00 00 00 00 00 00 00 00 00 00 00 00 00 00 ................ 6 | -------------------------------------------------------------------------------- /testing/unit/13-selfprefix/.gdbinit: -------------------------------------------------------------------------------- 1 | file selfprefix-13 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /testing/unit/13-selfprefix/.gitignore: -------------------------------------------------------------------------------- 1 | selfprefix-13 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/13-selfprefix/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | selfprefix-13: selfprefix-13.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o selfprefix-13 selfprefix-13.cpp ${LDFLAGS} 8 | 9 | checkprograms:: selfprefix-13 10 | programs:: 11 | 12 | check:: selfprefix-13 13 | @mkdir -p ../OUTPUTS 14 | @echo SELFPREFIX13: 15 | ./selfprefix-13 2>&1 | tee ../OUTPUTS/13-selfprefix-output.raw | diff -B - selfprefix-13-output.txt 16 | 17 | clean:: 18 | @rm -rf selfprefix-13 *.o 19 | 20 | update:: 21 | cp ../OUTPUTS/13-selfprefix-output.raw selfprefix-13-output.txt 22 | -------------------------------------------------------------------------------- /testing/unit/13-selfprefix/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that when a node hears it's own announcement 2 | due to network/radio issues, that it doesn't do anything with it. 3 | -------------------------------------------------------------------------------- /testing/unit/14-sunshine/.gitignore: -------------------------------------------------------------------------------- 1 | .gdbinit 2 | -------------------------------------------------------------------------------- /testing/unit/14-sunshine/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | PATHNAMES=../14-sunshine/pathnames.sed 3 | 4 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 5 | include ${srcdir}../Makefile.testing 6 | 7 | export SUNSHINE=${UNSTRUNG_OBJDIR}/programs/sunshine/sunshine 8 | 9 | checkprograms:: 10 | programs:: 11 | clean:: 12 | @rm -f core.* 13 | @rm -rf OUTPUTS 14 | 15 | check:: 16 | @(echo file ${SUNSHINE}; echo set args "--help") >.gdbinit 17 | ${SUNSHINE} --help 2>&1 | tee ../OUTPUTS/sunshine-help.raw | sed -f ${PATHNAMES} | diff - sunshine-help.txt 18 | @if [ -f core.* ]; then echo CORE FILES FOUND; exit 1; else exit 0; fi 19 | 20 | update: 21 | sed -f ${PATHNAMES} ../OUTPUTS/sunshine-help.raw >sunshine-help.txt 22 | 23 | -------------------------------------------------------------------------------- /testing/unit/14-sunshine/description.txt: -------------------------------------------------------------------------------- 1 | 1) This exercisese the sunshine program. 2 | Currently only looking at the --help option. 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/14-sunshine/pathnames.sed: -------------------------------------------------------------------------------- 1 | s,/.*/sunshine,PATH/sunshine, 2 | s,PANDORA unstrung version .* starting at .*,PANDORA unstrung version VERSION starting at TODAY, 3 | /ip found/d 4 | /link found/d 5 | /interface .* has IPv6 disabled/d 6 | -------------------------------------------------------------------------------- /testing/unit/14-sunshine/sunshine-help.txt: -------------------------------------------------------------------------------- 1 | PANDORA unstrung version VERSION starting at TODAY 2 | Usage: PATH/sunshine [-?] [-i ifname] 3 | [-p prefix] [--prefix prefix] announce this IPv6 prefix in the destination option 4 | [-G dagid] [--dagid dagid] DAGid to use to announce, string or hexn 5 | [-R rank] [--rank rank] Initial rank to announce with 6 | [-I num] [--instanceid num] Instance ID (number) 7 | [-W msec] [--interval msec] Number of miliseconds between DIO 8 | [-m] [--nomulticast] Disable multicast in DIOs 9 | [--verbose] [--timelog] Turn on logging (with --time logged) 10 | [--syslog] [--stderr] Log to syslog and/or stderr 11 | [--registrar hostname:port] set address of GRASP responder on registrar 12 | [--ldevid filename] load certificate with ACP Node Name to configure IID 13 | [--iid ipv6] setup the lower bits of the IPv6, the IID 14 | [--ignore-pio] Ignore PIOs found in DIO 15 | [--dao-if-filter] List of interfaces (glob permitted) to take DAO addresses from 16 | [--dao-addr-filter] List of prefixes/len to take DAO addresses from 17 | [--sleep=secs] sleep secs before trying to talk to network 18 | -------------------------------------------------------------------------------- /testing/unit/15-builddao/.gdbinit: -------------------------------------------------------------------------------- 1 | file builddao-01 2 | -------------------------------------------------------------------------------- /testing/unit/15-builddao/.gitignore: -------------------------------------------------------------------------------- 1 | builddao-01 2 | -------------------------------------------------------------------------------- /testing/unit/15-builddao/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=builddao-01 9 | 10 | ${TESTNAME}: ${TESTNAME}.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 11 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 12 | 13 | check:: ${TESTNAME} 14 | ./${TESTNAME} | tee ../OUTPUTS/15-dao-out.txt | diff - dao-out.txt 15 | @${TCPDUMP} -t -n -r ../OUTPUTS/15-dao.pcap | tee ../OUTPUTS/15-dao.txt | diff - dao.txt 16 | 17 | checkprograms:: ${TESTNAME} 18 | programs:: 19 | 20 | clean:: 21 | @rm -rf ${TESTNAME} *.o 22 | 23 | update: 24 | cp ../OUTPUTS/15-dao-out.txt dao-out.txt 25 | cp ../OUTPUTS/15-dao.txt dao.txt 26 | -------------------------------------------------------------------------------- /testing/unit/15-builddao/dao-out.txt: -------------------------------------------------------------------------------- 1 | builddao-01 t1 2 | Creating PCAP interface: wlan0 3 | link found[1]: wlan0 type=ether (active new) faked 4 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 5 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 6 | Creating PCAP interface: lo 7 | link found[2]: lo type=loopback (active new) faked 8 | ip found[2]: lo scope=254 address=::1 9 | link found[3]: virbr0 no carrier, ignored 10 | new RPL node: fe80::216:3eff:fe22:4455 11 | add a prefix to the dn 12 | peer 'fe80::216:3eff:fe22:4455' announces prefix: 2001:db8:abcd::/64 13 | adding prefix: 2001:db8:abcd:0:216:3eff:fe11:3424/128 learnt from iface: wlan0 14 | invoking ip -6 addr del 2001:db8:abcd:0:216:3eff:fe11:3424/128 dev lo 15 | would invoke cmd: ip -6 addr del 2001:db8:abcd:0:216:3eff:fe11:3424/128 dev lo 16 | invoking ip -6 addr add 2001:db8:abcd:0:216:3eff:fe11:3424/128 dev lo 17 | would invoke cmd: ip -6 addr add 2001:db8:abcd:0:216:3eff:fe11:3424/128 dev lo 18 | would invoke cmd: ip -6 route show 19 | sending DAO on if: wlan0(faked) 20 | builddao-01 tests finished 21 | -------------------------------------------------------------------------------- /testing/unit/15-builddao/dao.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe22:4455: ICMP6, RPL, (CLR)Destination Advertisement Object, length 48 2 | -------------------------------------------------------------------------------- /testing/unit/15-builddao/description.txt: -------------------------------------------------------------------------------- 1 | This test case builds a DAO message to send. 2 | To do so, it creates a DAG, adding a node and a prefix to it, 3 | and then arranges to announce it. 4 | 5 | -------------------------------------------------------------------------------- /testing/unit/16-vf/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | vf 3 | -------------------------------------------------------------------------------- /testing/unit/16-vf/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=vf 9 | 10 | ${TESTNAME}: ${TESTNAME}.cpp ${INC}/iface.h ${INC}/dag.h base.o derived.o 11 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp base.o derived.o ${LDFLAGS} 12 | 13 | check:: ${TESTNAME} 14 | ./${TESTNAME} | diff - expected.txt 15 | 16 | checkprograms:: ${TESTNAME} 17 | programs:: 18 | 19 | clean:: 20 | @rm -rf ${TESTNAME} *.o 21 | -------------------------------------------------------------------------------- /testing/unit/16-vf/base.cpp: -------------------------------------------------------------------------------- 1 | #include "base.h" 2 | #include 3 | using namespace std; 4 | 5 | void Base::f(const char *f) { 6 | cout << "Base f(" << f << ")" << endl; 7 | this->vf(f); 8 | } 9 | 10 | void Base::vf(const char *f) { 11 | cout << "Base vf(" << f << ")" << endl; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /testing/unit/16-vf/base.h: -------------------------------------------------------------------------------- 1 | class Base { 2 | public: 3 | void f(const char *f); 4 | virtual void vf(const char *f); 5 | }; 6 | 7 | -------------------------------------------------------------------------------- /testing/unit/16-vf/derived.cpp: -------------------------------------------------------------------------------- 1 | #include "base.h" 2 | #include "derived.h" 3 | 4 | #include 5 | using namespace std; 6 | 7 | void Derived::f(const char *f) { 8 | cout << "Derived f(" << f << ")" << endl; 9 | } 10 | 11 | void Derived::vf(const char *f) { 12 | cout << "Derived vf(" << f << ")" << endl; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /testing/unit/16-vf/derived.h: -------------------------------------------------------------------------------- 1 | class Derived : public Base { 2 | public: 3 | void f(const char *f); 4 | void vf(const char *f); 5 | }; 6 | 7 | -------------------------------------------------------------------------------- /testing/unit/16-vf/expected.txt: -------------------------------------------------------------------------------- 1 | Base f(one) 2 | Base vf(one) 3 | Base f(five) 4 | Derived vf(five) 5 | Derived vf(six) 6 | -------------------------------------------------------------------------------- /testing/unit/16-vf/vf.cpp: -------------------------------------------------------------------------------- 1 | #include "base.h" 2 | #include "derived.h" 3 | 4 | int main() 5 | { 6 | Base b1; 7 | b1.f("one"); 8 | 9 | Derived d2; // Derived object 10 | Base* bp = &d2; // Base pointer to Derived object 11 | bp->f("five"); // Base f() 12 | bp->vf("six"); // which vf()? 13 | 14 | return 0; 15 | } 16 | -------------------------------------------------------------------------------- /testing/unit/17-recvdao/.gdbinit: -------------------------------------------------------------------------------- 1 | file 17-recvdao 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/17-recvdao/.gitignore: -------------------------------------------------------------------------------- 1 | 17-recvdao 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/17-recvdao/17-node-A-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object Ack [dagid:2001:db8:661e::1,seq:2,instance:42,status:0] 2 | -------------------------------------------------------------------------------- /testing/unit/17-recvdao/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 17-recvdao: 17-recvdao.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 17-recvdao 17-recvdao.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 17-recvdao 10 | programs:: 11 | 12 | check:: 17-recvdao 13 | @mkdir -p ../OUTPUTS 14 | @echo SELFPREFIX13: 15 | ./17-recvdao 2>&1 | tee ../OUTPUTS/17-recvdao-output.raw | diff -B - 17-recvdao-output.txt 16 | @${TCPDUMP} -t -v -n -r ../OUTPUTS/17-node-A-out.pcap | tee ../OUTPUTS/17-node-A-capture.txt | diff -B - 17-node-A-capture.txt 17 | 18 | 19 | clean:: 20 | @rm -rf 17-recvdao *.o 21 | 22 | update: 23 | cp ../OUTPUTS/17-recvdao-output.raw 17-recvdao-output.txt 24 | cp ../OUTPUTS/17-node-A-capture.txt 17-node-A-capture.txt 25 | 26 | pcapupdate: 27 | cp ../OUTPUTS/24-node-E-out.pcap ../INPUTS/daoE.pcap 28 | 29 | -------------------------------------------------------------------------------- /testing/unit/17-recvdao/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a DAO message 2 | from a node of higher rank (further from the root), and that we install 3 | source routes for the destinations listed. 4 | 5 | We also reply to the DAO packet with a DAOACK. 6 | 7 | The input packet is produced by 24-daoreply, and can be updated with 8 | make pcapupdate. 9 | 10 | 11 | -------------------------------------------------------------------------------- /testing/unit/18-checksum/.gdbinit: -------------------------------------------------------------------------------- 1 | file 18-checksum 2 | -------------------------------------------------------------------------------- /testing/unit/18-checksum/.gitignore: -------------------------------------------------------------------------------- 1 | 18-checksum 2 | -------------------------------------------------------------------------------- /testing/unit/18-checksum/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 18-checksum: 18-checksum.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 18-checksum 18-checksum.cpp ${LDFLAGS} 8 | 9 | checkprograms:: 18-checksum 10 | programs:: 11 | 12 | check:: 18-checksum 13 | @mkdir -p ../OUTPUTS 14 | @echo 18CHECKSUM: 15 | ./18-checksum 16 | @echo SUCCEED 17 | 18 | clean:: 19 | @rm -rf 18-checksum *.o 20 | -------------------------------------------------------------------------------- /testing/unit/18-checksum/description.txt: -------------------------------------------------------------------------------- 1 | This confirms the checksum routine from RFC1071 test vectors. 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/19-pickdag/.gdbinit: -------------------------------------------------------------------------------- 1 | file 19-pickdag 2 | -------------------------------------------------------------------------------- /testing/unit/19-pickdag/.gitignore: -------------------------------------------------------------------------------- 1 | 19-pickdag 2 | -------------------------------------------------------------------------------- /testing/unit/19-pickdag/19-pickdag-pcap.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 48) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:2001:db8:661e::1,seq:2,instance:42,acK,Dagid,c0] 2 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 48) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:2001:db8:661e::1,seq:3,instance:42,acK,Dagid,c0] 3 | -------------------------------------------------------------------------------- /testing/unit/19-pickdag/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | SENDDIO=${UNSTRUNG_OBJDIR}/programs/senddio/senddio 7 | 8 | 19-pickdag: 19-pickdag.cpp ${INC}/iface.h ${LIBS} 9 | ${CXX} ${CXXFLAGS} -o 19-pickdag 19-pickdag.cpp ${LDFLAGS} 10 | 11 | checkprograms:: 19-pickdag 12 | programs:: 13 | 14 | check:: 19-pickdag 15 | @mkdir -p ../OUTPUTS 16 | @echo PICKDAG19: 17 | ./19-pickdag 2>&1 | tee ../OUTPUTS/19-pickdag-output.raw | diff -B - 19-pickdag-output.txt 18 | @${TCPDUMP} -t -n -r ../OUTPUTS/19-pickdag.pcap -v | tee ../OUTPUTS/19-pickdag-pcap.raw | diff -B - 19-pickdag-pcap.txt 19 | 20 | clean:: 21 | @rm -rf 19-pickdag *.o 22 | 23 | update:: 24 | cp ../OUTPUTS/19-pickdag-output.raw 19-pickdag-output.txt 25 | cp ../OUTPUTS/19-pickdag-pcap.raw 19-pickdag-pcap.txt 26 | 27 | pcapupdate: 28 | ${SENDDIO} --pcapout ../INPUTS/dio-B-661e.pcap --fake -i wlan0 -v --instanceid 99 --dagid 2001:db8:661e::1 --prefix 2001:db8:0001::/48 --prefixlifetime 12 --grounded --storing --version 1 --sequence 10 --rank 2 29 | 30 | -------------------------------------------------------------------------------- /testing/unit/19-pickdag/description.txt: -------------------------------------------------------------------------------- 1 | This test case receives two DIO messages: one for a DAGID that 2 | is interesting, and another for a DAGID that is not interesting. 3 | 4 | The interesting DAGID will result in a DIO being scheduled, as well 5 | as a DAO being scheduled. 6 | 7 | The ../INPUTS/dio-19-t1.pcap file is produced by 12-senddio step 3, 8 | which is also used in 24-daoreply, and therefore is not updated here. 9 | 10 | -------------------------------------------------------------------------------- /testing/unit/20-prefix/.gitignore: -------------------------------------------------------------------------------- 1 | 20-prefixtests 2 | -------------------------------------------------------------------------------- /testing/unit/20-prefix/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | 20-prefixtests: 20-prefixtests.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o 20-prefixtests 20-prefixtests.cpp ${LDFLAGS} 10 | 11 | check:: 20-prefixtests 12 | ./20-prefixtests 13 | 14 | checkprograms:: 20-prefixtests 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf 20-prefixtests *.o 19 | -------------------------------------------------------------------------------- /testing/unit/20-prefix/description.txt: -------------------------------------------------------------------------------- 1 | This test case exercises the properties of prefix_node's and prefix_map. 2 | -------------------------------------------------------------------------------- /testing/unit/21-node/.gitignore: -------------------------------------------------------------------------------- 1 | 21-nodetests 2 | -------------------------------------------------------------------------------- /testing/unit/21-node/21-inttests.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Unit tests for list properties of a node. 3 | */ 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | extern "C" { 11 | #include 12 | #include 13 | } 14 | 15 | typedef std::map node_map; 16 | typedef node_map::iterator node_map_iterator; 17 | 18 | 19 | int main(int argc, char *argv[]) 20 | { 21 | node_map nodelist1; 22 | 23 | nodelist1[10]=100; 24 | nodelist1[20]=400; 25 | nodelist1[30]=900; 26 | 27 | assert(nodelist1.size() == 3); 28 | 29 | int count=0; 30 | node_map_iterator nmi = nodelist1.begin(); 31 | while(nmi != nodelist1.end()) { 32 | assert(nmi->first * nmi->first == nmi->second); 33 | count++; 34 | nmi++; 35 | } 36 | assert(nodelist1.size() == count); 37 | 38 | exit(0); 39 | } 40 | 41 | 42 | -------------------------------------------------------------------------------- /testing/unit/21-node/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | 21-nodetests: 21-nodetests.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o 21-nodetests 21-nodetests.cpp ${LDFLAGS} 10 | 11 | check:: 21-nodetests 12 | ./21-nodetests 13 | 14 | checkprograms:: 21-nodetests 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf 21-nodetests *.o 19 | -------------------------------------------------------------------------------- /testing/unit/21-node/description.txt: -------------------------------------------------------------------------------- 1 | This test case just confirms some C++ std properties which were originally 2 | unclear: iterators have both .things and ->things which are different. 3 | The -> things are really (*blah).thing, which is to say that it first 4 | applies *, which results in a foo_pair. 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /testing/unit/22-queues/.gitignore: -------------------------------------------------------------------------------- 1 | 22-queues 2 | -------------------------------------------------------------------------------- /testing/unit/22-queues/22-queues-out.txt: -------------------------------------------------------------------------------- 1 | event list (3 events) 2 | 0: event#3(test3) at (2004-January-10 01:37:05 PM)<1073741825:3024>, type: send_dio 3 | 1: event#2(test2) at (2004-January-10 01:38:04 PM)<1073741884:8024>, type: send_dao 4 | 2: event#1(test1) at (2004-January-10 01:39:04 PM)<1073741944:10024>, type: send_dio 5 | t2: 6 | event#3(test3) at (2004-January-10 01:37:05 PM)<1073741825:3024>, type: send_dio 7 | event list (2 events) 8 | 0: event#2(test2) at (2004-January-10 01:38:04 PM)<1073741884:8024>, type: send_dao 9 | 1: event#1(test1) at (2004-January-10 01:39:04 PM)<1073741944:10024>, type: send_dio 10 | event#2(test2) at (2004-January-10 01:38:04 PM)<1073741884:8024>, type: send_dao 11 | event list (1 events) 12 | 0: event#1(test1) at (2004-January-10 01:39:04 PM)<1073741944:10024>, type: send_dio 13 | event#1(test1) at (2004-January-10 01:39:04 PM)<1073741944:10024>, type: send_dio 14 | event list (0 events) 15 | -------------------------------------------------------------------------------- /testing/unit/22-queues/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | 22-queues: 22-queues.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o 22-queues 22-queues.cpp ${LDFLAGS} 10 | 11 | check:: 22-queues 12 | ./22-queues | tee ../OUTPUTS/22-queues.raw | diff - 22-queues-out.txt 13 | 14 | checkprograms:: 22-queues 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf 22-queues *.o 19 | 20 | update: 21 | cp ../OUTPUTS/22-queues.raw 22-queues-out.txt 22 | -------------------------------------------------------------------------------- /testing/unit/22-queues/description.txt: -------------------------------------------------------------------------------- 1 | This test case deals with vectors of events, organized into a heap in 2 | order to implement a priority queue. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /testing/unit/23-selfdio/.gdbinit: -------------------------------------------------------------------------------- 1 | file 23-selfdio 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/23-selfdio/.gitignore: -------------------------------------------------------------------------------- 1 | 23-selfdio 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/23-selfdio/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 23-selfdio: 23-selfdio.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 23-selfdio 23-selfdio.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 23-selfdio 10 | programs:: 11 | 12 | check:: 23-selfdio 13 | @mkdir -p ../OUTPUTS 14 | ./23-selfdio 2>&1 | tee ../OUTPUTS/23-selfdio-out.raw | diff -B - 23-selfdio-out.txt 15 | 16 | clean:: 17 | @rm -rf 23-selfdio *.o 18 | 19 | update:: 20 | cp ../OUTPUTS/23-selfdio-out.raw 23-selfdio-out.txt 21 | 22 | -------------------------------------------------------------------------------- /testing/unit/23-selfdio/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a DIO message 2 | from a node of higher rank, and that we will ignore it, because we 3 | are already lower rank than it. 4 | This test case starts out with the assumption that the DAG 5 | was originally announced from this node, so the DIO we would have sent 6 | is actually built (but not sent), and then we start to listen for 7 | the reply. 8 | 9 | The dio-E.pcap file was produced by the UNTI test harness and captured. 10 | 11 | 12 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/.gdbinit: -------------------------------------------------------------------------------- 1 | file 24-daoreply 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/.gitignore: -------------------------------------------------------------------------------- 1 | 24-daoreply 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/24-daoreply.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "iface.h" 4 | 5 | #include "fakeiface.h" 6 | 7 | /* refactored because test case 27 uses this */ 8 | #include "../24-daoreply/dioA.cpp" 9 | #include "../24-daoreply/daoackA.cpp" 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | rpl_debug *deb = new rpl_debug(true, stdout); 14 | deb->want_time_log = false; 15 | 16 | const char * outpcap= "../OUTPUTS/24-node-E-out.pcap"; 17 | dag_network *dag = dioA_setup(deb); 18 | pcap_network_interface *iface = dioA_iface_setup(NULL, dag,deb,outpcap); 19 | dioA_event(iface, deb, outpcap); 20 | 21 | const char *pcapin2 = "../INPUTS/daoack-A-example661e.pcap"; 22 | iface = daoackA_setup(deb,pcapin2, 23 | "../OUTPUTS/24-node-E-dio.pcap"); 24 | daoackA_process(iface); 25 | 26 | exit(0); 27 | } 28 | 29 | 30 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/24-node-E-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 48) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:2001:db8:661e::1,seq:2,instance:42,acK,Dagid,c0] 2 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/24-node-E-dio.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 64) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)DODAG Information Object [dagid:2001:db8:661e::1,seq:10,instance:42,rank:3,grounded,mop:storing-multicast,prf:0] 2 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 24-daoreply: 24-daoreply.cpp ../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 24-daoreply 24-daoreply.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 24-daoreply 10 | programs:: 11 | 12 | check:: 24-daoreply 13 | @mkdir -p ../OUTPUTS 14 | ./24-daoreply 2>&1 | tee ../OUTPUTS/24-daoreply-out.raw | diff -B - 24-daoreply-out.txt 15 | ${TCPDUMP} -t -v -n -r ../OUTPUTS/24-node-E-out.pcap | tee ../OUTPUTS/24-node-E-capture.txt | diff -B - 24-node-E-capture.txt 16 | ${TCPDUMP} -t -v -n -r ../OUTPUTS/24-node-E-dio.pcap | tee ../OUTPUTS/24-node-E-dio.txt | diff -B - 24-node-E-dio.txt 17 | 18 | clean:: 19 | @rm -rf 24-daoreply *.o 20 | 21 | update: 22 | cp ../OUTPUTS/24-daoreply-out.raw 24-daoreply-out.txt 23 | cp ../OUTPUTS/24-node-E-capture.txt 24-node-E-capture.txt 24 | cp ../OUTPUTS/24-node-E-dio.txt 24-node-E-dio.txt 25 | 26 | 27 | pcapupdate: 28 | cp ../OUTPUTS/senddio-test-03.pcap ../INPUTS/dio-A-661e.pcap 29 | cp ../OUTPUTS/17-node-A-out.pcap ../INPUTS/daoack-A-example661e.pcap 30 | 31 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/daoackA.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "iface.h" 4 | 5 | #include "fakeiface.h" 6 | 7 | pcap_network_interface *daoackA_setup(rpl_debug *deb, 8 | const char *pcapin2, const char *outpcap) 9 | { 10 | pcap_network_interface *iface = NULL; 11 | 12 | iface = pcap_network_interface::setup_infile_outfile("wlan0", pcapin2, 13 | outpcap, deb); 14 | printf("Processing input file %s on if=[%u]: %s state: %s %s\n", 15 | pcapin2, 16 | iface->get_if_index(), iface->get_if_name(), 17 | iface->is_active() ? "active" : "inactive", 18 | iface->faked() ? " faked" : ""); 19 | return iface; 20 | } 21 | 22 | void daoackA_process(pcap_network_interface *iface) 23 | { 24 | iface->process_pcap(); 25 | 26 | /* again, drain off any events */ 27 | network_interface::terminating(); 28 | while(network_interface::force_next_event()); 29 | } 30 | 31 | void daoackA_step(rpl_debug *deb, 32 | const char *pcapin2, const char *outpcap) 33 | { 34 | pcap_network_interface *iface = daoackA_setup(deb,pcapin2,outpcap); 35 | daoackA_process(iface); 36 | } 37 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a DIO message 2 | from a node of lower rank, and that we take it as our parent, 3 | and then emit both a DIO on all interfaces, and more importantly, 4 | a DAO telling our parent who we are. 5 | We should then expect to get a DAOACK from the parent. 6 | The DIO is grounded. 7 | 8 | 9 | -------------------------------------------------------------------------------- /testing/unit/24-daoreply/pedigree.txt: -------------------------------------------------------------------------------- 1 | Test case 12, case 3 now produces the right packet. Use 'make pcapupdate', 2 | but here are the old instructions: 3 | 4 | The second packet comes from 17-daoreply, and is also copied by pcapupdate. 5 | 6 | ==== 7 | 8 | Run VM A, and capture packets: 9 | tcpdump -i eth1 -s 0 -n -w a1.pcap 10 | 11 | then run: 12 | 13 | /sbin/sunshine.run --dagid 2001:0db8:661e::1 -i eth1 --rank 1 --prefix 2001:db8:0001::/48 --interval 3000 --verbose --timelog 14 | 15 | and hit ^C after two packets are sent. 16 | 17 | cp ../../../UMLPOOL/A/root/root/a1-oct7.pcap . 18 | 19 | Then: 20 | tcpdump -n -r a1.pcap -w ../INPUTS/dio-A-661e.pcap ip6 dst ff02::1a 21 | 22 | The result should be: 23 | % tcpdump -n -r ../INPUTS/dio-A-ripple.pcap 24 | reading from file ../INPUTS/dio-A-ripple.pcap, link-type EN10MB (Ethernet) 25 | 19:16:53.721925 IP6 fe80::1000:ff:fe64:6423 > ff02::1a: ICMP6, RPL, (CLR)DODAG Information Object, length 64 26 | 19:17:23.761197 IP6 fe80::1000:ff:fe64:6423 > ff02::1a: ICMP6, RPL, (CLR)DODAG Information Object, length 64 27 | 28 | Finally take the first packet only: 29 | tcpdump -n -c 1 -r ../INPUTS/dio-A-ripple.pcap -w ../INPUTS/dio-A-ripple1.pcap 30 | 31 | -------------------------------------------------------------------------------- /testing/unit/25-childdio/.gdbinit: -------------------------------------------------------------------------------- 1 | file 25-childdio 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /testing/unit/25-childdio/.gitignore: -------------------------------------------------------------------------------- 1 | 25-childdio 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/25-childdio/25-childdio-output.txt: -------------------------------------------------------------------------------- 1 | Creating PCAP interface: wlan0 2 | link found[1]: wlan0 type=ether (active new) faked 3 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 4 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 5 | Creating PCAP interface: lo 6 | link found[2]: lo type=loopback (active new) faked 7 | ip found[2]: lo scope=254 address=::1 8 | link found[3]: virbr0 no carrier, ignored 9 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 10 | invoking ip -6 route add unreachable 2001:db8:1::/48 dev lo 11 | would invoke cmd: ip -6 route add unreachable 2001:db8:1::/48 dev lo 12 | would invoke cmd: ip -6 route show 13 | packet 1 is being processed 14 | new RPL node: fe80::1000:ff:fe66:6602 15 | wlan0: received packet from fe80::1000:ff:fe66:6602 -> ff02::1a[1] hoplimit=0 16 | processing dio(60) [1/[7269:7070:6c65::]: seq:1,rank:2,version:1,grounded,storing-mcast] 17 | does peer 'fe80::1000:ff:fe66:6602' have better rank? (2 < 1) 18 | iface1[1]: wlan0 19 | iface2[1]: wlan0 20 | Processing input file 21 | -------------------------------------------------------------------------------- /testing/unit/25-childdio/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 25-childdio: 25-childdio.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 25-childdio 25-childdio.cpp ${LDFLAGS} 8 | 9 | checkprograms:: 25-childdio 10 | programs:: 11 | 12 | check:: 25-childdio 13 | @mkdir -p ../OUTPUTS 14 | @echo 25-CHILDDIO: 15 | ./25-childdio 2>&1 | tee ../OUTPUTS/25-childdio-output.raw | diff -B - 25-childdio-output.txt 16 | 17 | clean:: 18 | @rm -rf 25-childdio *.o 19 | 20 | update:: 21 | cp ../OUTPUTS/25-childdio-output.raw 25-childdio-output.txt 22 | -------------------------------------------------------------------------------- /testing/unit/25-childdio/description.txt: -------------------------------------------------------------------------------- 1 | This test case determines how a parent that hears it's child's DIOs 2 | reacts when the rank is: 3 | 65535 - infinity => do nothing. 4 | >self - good, ignore. 5 | 6 | 7 | -------------------------------------------------------------------------------- /testing/unit/26-senddaoack/.gdbinit: -------------------------------------------------------------------------------- 1 | file ../../../programs/senddao/senddao 2 | set args --fake --outpcap ../OUTPUTS/senddaoack-test-04out.pcap -i wlan0 -v --dagid thisismydicedag2 --sequence 11 --instance 43 --prefix fdfd:abcd:ef01::/48 3 | -------------------------------------------------------------------------------- /testing/unit/26-senddaoack/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testing/unit/26-senddaoack/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | export SENDDAO=${UNSTRUNG_OBJDIR}/programs/senddao/senddao 7 | PCAP01=../OUTPUTS/senddaoack-test-01out.pcap 8 | 9 | checkprograms:: 10 | programs:: 11 | clean:: 12 | @rm -f core.* 13 | @rm -rf OUTPUT 14 | 15 | check:: 16 | @rm -f core.* 17 | @${SENDDAO} --fake --outpcap ${PCAP01} -i wlan0 -v --instance 43 --dagid thisismydicedag2 --daoack 11 --sequence 11 >../OUTPUTS/senddaoack-test-01.raw 2>&1 18 | @diff -B -w ../OUTPUTS/senddaoack-test-01.raw senddaoack-test-01.txt 19 | @${TCPDUMP} -t -n -r ${PCAP01} -v -v -v >../OUTPUTS/senddaoack-test-01-pcap.txt 20 | @diff ../OUTPUTS/senddaoack-test-01-pcap.txt senddaoack-test-01-pcap.txt 21 | @if [ -f core.* ]; then echo CORE FILES FOUND; exit 1; else exit 0; fi 22 | 23 | update: 24 | cp ../OUTPUTS/senddaoack-test-01.raw senddaoack-test-01.txt 25 | cp ../OUTPUTS/senddaoack-test-01-pcap.txt senddaoack-test-01-pcap.txt 26 | -------------------------------------------------------------------------------- /testing/unit/26-senddaoack/description.txt: -------------------------------------------------------------------------------- 1 | This exercises the senddao program in order to generate an appropriate DAOACK 2 | message. These messages travel from parent to child to acknowledge/accept 3 | the child node as a child of the parent. 4 | 5 | -------------------------------------------------------------------------------- /testing/unit/26-senddaoack/senddaoack-test-01-pcap.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object Ack [dagid:7468:6973:6973:6d79:6469:6365:6461:6732,seq:1,instance:43,status:0] 2 | -------------------------------------------------------------------------------- /testing/unit/26-senddaoack/senddaoack-test-01.txt: -------------------------------------------------------------------------------- 1 | Using faked interfaces 2 | link found[1]: wlan0 type=ether (active new) faked 3 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 4 | link found[2]: lo type=loopback (active new) faked 5 | ip found[2]: lo scope=254 address=::1 6 | link found[3]: virbr0 no carrier, ignored 7 | Sending ICMP of length: 24 8 | 0000: 9b 03 00 00 2b 80 01 00 74 68 69 73 69 73 6d 79 ....+...thisismy 9 | 0010: 64 69 63 65 64 61 67 32 dicedag2 10 | -------------------------------------------------------------------------------- /testing/unit/27-daoreplydao/.gdbinit: -------------------------------------------------------------------------------- 1 | file 27-daoreplydao 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/27-daoreplydao/.gitignore: -------------------------------------------------------------------------------- 1 | 27-daoreplydao 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/27-daoreplydao/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=27-daoreplydao 9 | OUTPUT=daoreply 10 | OUTPUT1=node-E-dio 11 | OUTPUT2=node-E-dio 12 | INCLUDES=../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp 13 | INCLUDES+=${INC}/iface.h ${INC}/dag.h 14 | 15 | ${TESTNAME}: ${TESTNAME}.cpp ${LIBNDMGMT} ${INCLUDES} 16 | 17 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 18 | 19 | check:: ${TESTNAME} 20 | ./${TESTNAME} | tee ../OUTPUTS/${OUTPUT}-out.txt | diff -B -w - ${OUTPUT}-out.txt 21 | @${TCPDUMP} -t -n -r ../OUTPUTS/27-${OUTPUT1}.pcap | tee ../OUTPUTS/${OUTPUT1}.txt | diff -B -w - ${OUTPUT1}.txt 22 | 23 | checkprograms:: ${TESTNAME} 24 | programs:: 25 | 26 | clean:: 27 | @rm -rf ${TESTNAME} *.o 28 | 29 | update: 30 | cp ../OUTPUTS/${OUTPUT}-out.txt ${OUTPUT}-out.txt 31 | cp ../OUTPUTS/${OUTPUT1}.txt ${OUTPUT1}.txt 32 | 33 | pcapupdate: 34 | cp ../OUTPUTS/39-dao-J.pcap ../INPUTS/27-daoJ-inst42.pcap 35 | -------------------------------------------------------------------------------- /testing/unit/27-daoreplydao/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates a node intermediate (E) in the mesh will 2 | reply accurately to a DAO from a lower node (J), putting appropriate 3 | route entries, and then sending up a DAO to the parent. 4 | 5 | This is similar to test case 24, but it goes a step further, 6 | listening for the DAO from node J below this node E. 7 | 8 | QUESTION: do we wait for the DAOACK from the parent before sending 9 | our DAOACKs? 10 | 11 | The daoJ from node J comes from test case: 39-daoJ. 12 | 13 | 14 | -------------------------------------------------------------------------------- /testing/unit/27-daoreplydao/node-E-dio.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::216:3eff:fe11:3424 > ff02::1: ICMP6, RPL, (CLR)DODAG Information Object, length 64 2 | -------------------------------------------------------------------------------- /testing/unit/28-daowrongack/.gitignore: -------------------------------------------------------------------------------- 1 | 28-daowrongack 2 | 3 | -------------------------------------------------------------------------------- /testing/unit/28-daowrongack/28-daowrongack.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "iface.h" 4 | 5 | #include "fakeiface.h" 6 | 7 | /* refactored because test case 27 uses this */ 8 | #include "../24-daoreply/dioA.cpp" 9 | #include "../24-daoreply/daoackA.cpp" 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | rpl_debug *deb = new rpl_debug(true, stdout); 14 | deb->want_time_log = false; 15 | 16 | dioA_step(deb, NULL, "../OUTPUTS/28-node-E-out.pcap"); 17 | daoackA_step(deb, "../INPUTS/daoack-A-wrongseq-ripple1.pcap", NULL); 18 | 19 | printf("\ndone\n"); 20 | 21 | exit(0); 22 | } 23 | 24 | 25 | -------------------------------------------------------------------------------- /testing/unit/28-daowrongack/28-node-E-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 48) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:2001:db8:661e::1,seq:2,instance:42,acK,Dagid,c0] 2 | -------------------------------------------------------------------------------- /testing/unit/28-daowrongack/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 28-daowrongack: 28-daowrongack.cpp ../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 28-daowrongack 28-daowrongack.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 28-daowrongack 10 | programs:: 11 | 12 | check:: 28-daowrongack 13 | @mkdir -p ../OUTPUTS 14 | ./28-daowrongack 2>&1 | tee ../OUTPUTS/28-daowrongack-out.raw | diff -B - 28-daowrongack-out.txt 15 | ${TCPDUMP} -t -v -n -r ../OUTPUTS/24-node-E-out.pcap | tee ../OUTPUTS/28-node-E-capture.txt | diff -B - 28-node-E-capture.txt 16 | 17 | clean:: 18 | @rm -rf 28-daowrongack *.o 19 | 20 | update: 21 | cp ../OUTPUTS/28-daowrongack-out.raw 28-daowrongack-out.txt 22 | cp ../OUTPUTS/28-node-E-capture.txt 28-node-E-capture.txt 23 | -------------------------------------------------------------------------------- /testing/unit/28-daowrongack/description.txt: -------------------------------------------------------------------------------- 1 | This test case is identical to 27-daoreplydao, except that the ACK to the DAO 2 | has the wrong sequence number. 3 | This is based upon 24-daoreply, 4 | 5 | -------------------------------------------------------------------------------- /testing/unit/29-daoreply-nopio/.gdbinit: -------------------------------------------------------------------------------- 1 | file 29-daoreply-nopio 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/29-daoreply-nopio/.gitignore: -------------------------------------------------------------------------------- 1 | 29-daoreply-nopio 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/29-daoreply-nopio/29-daoreply-nopio.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "iface.h" 4 | 5 | #include "fakeiface.h" 6 | 7 | /* refactored because test case 27 uses this */ 8 | #include "../24-daoreply/dioA.cpp" 9 | #include "../24-daoreply/daoackA.cpp" 10 | 11 | int main(int argc, char *argv[]) 12 | { 13 | rpl_debug *deb = new rpl_debug(true, stdout); 14 | deb->want_time_log = false; 15 | 16 | dag_network *dag = dioA_setup(deb); 17 | 18 | dag->set_ignore_pio(true); 19 | 20 | const char *outpcap = "../OUTPUTS/29-node-E-out.pcap"; 21 | pcap_network_interface *iface = dioA_iface_setup(NULL, dag,deb,outpcap); 22 | dioA_event(iface, deb, outpcap); 23 | daoackA_step(deb, "../INPUTS/daoack-A-example661e.pcap", NULL); 24 | 25 | exit(0); 26 | } 27 | 28 | 29 | -------------------------------------------------------------------------------- /testing/unit/29-daoreply-nopio/29-node-E-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:2001:db8:661e::1,seq:2,instance:42,acK,Dagid,c0] 2 | -------------------------------------------------------------------------------- /testing/unit/29-daoreply-nopio/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 29-daoreply-nopio: 29-daoreply-nopio.cpp ../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 29-daoreply-nopio 29-daoreply-nopio.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 29-daoreply-nopio 10 | programs:: 11 | 12 | check:: 29-daoreply-nopio 13 | @mkdir -p ../OUTPUTS 14 | ./29-daoreply-nopio 2>&1 | tee ../OUTPUTS/29-daoreply-nopio-out.raw | diff -B - 29-daoreply-nopio-out.txt 15 | ${TCPDUMP} -t -v -v -n -r ../OUTPUTS/29-node-E-out.pcap | tee ../OUTPUTS/29-node-E-capture.txt | diff -B - 29-node-E-capture.txt 16 | 17 | clean:: 18 | @rm -rf 29-daoreply-nopio *.o 19 | 20 | update: 21 | cp ../OUTPUTS/29-daoreply-nopio-out.raw 29-daoreply-nopio-out.txt 22 | cp ../OUTPUTS/29-node-E-capture.txt 29-node-E-capture.txt 23 | -------------------------------------------------------------------------------- /testing/unit/29-daoreply-nopio/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a DIO message. 2 | The DIO will include a PIO, but because of --ignore-dao-pio this node 3 | will ignore the PIO itself, and simply reply with a DAO ack. 4 | 5 | We should then expect to get a DAOACK from the parent. 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /testing/unit/29-daoreply-nopio/pedigree.txt: -------------------------------------------------------------------------------- 1 | The inputs for this test are the same as from 24-daoreply, so the file is 2 | reused. 3 | -------------------------------------------------------------------------------- /testing/unit/30-ackdao/.gdbinit: -------------------------------------------------------------------------------- 1 | file ./30-ackdao 2 | set args ../INPUTS/29-dao-nopio.pcap ../INPUTS/31-dao-extra.pcap ../INPUTS/32-dao-onlyif.pcap 3 | -------------------------------------------------------------------------------- /testing/unit/30-ackdao/.gitignore: -------------------------------------------------------------------------------- 1 | 30-ackdao 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/30-ackdao/30-node-A-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object Ack [dagid:7269:7070:6c65::,seq:2,instance:42,status:0] 2 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object Ack [dagid:7269:7070:6c65::,seq:2,instance:42,status:0] 3 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object Ack [dagid:7269:7070:6c65::,seq:2,instance:42,status:0] 4 | -------------------------------------------------------------------------------- /testing/unit/30-ackdao/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a DAO message 2 | from a node of higher rank (further from the root), and that we install 3 | source routes for the destinations listed. 4 | One DAO that we receive has no destinations. 5 | A second DAO is received that has a non-PIO generated destination. 6 | 7 | The input file INPUTS/29nopio.pcap is produced by 29-daoreply-nopio. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /testing/unit/31-daoreply-extraprefix/.gdbinit: -------------------------------------------------------------------------------- 1 | file 31-daoreply-extra 2 | -------------------------------------------------------------------------------- /testing/unit/31-daoreply-extraprefix/.gitignore: -------------------------------------------------------------------------------- 1 | 31-daoreply-extra 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/31-daoreply-extraprefix/31-node-E-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 64) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:2001:db8:661e::1,seq:2,instance:42,acK,Dagid,c0] opt:rpltarget len:20 opt:rpltarget len:20 2 | -------------------------------------------------------------------------------- /testing/unit/31-daoreply-extraprefix/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 31-daoreply-extra: 31-daoreply-extra.cpp ../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 31-daoreply-extra 31-daoreply-extra.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 31-daoreply-extra 10 | programs:: 11 | 12 | check:: 31-daoreply-extra 13 | @mkdir -p ../OUTPUTS 14 | ./31-daoreply-extra 2>&1 | tee ../OUTPUTS/31-daoreply-extra-out.raw | diff -B - 31-daoreply-extra-out.txt 15 | ${TCPDUMP} -t -v -v -n -r ../OUTPUTS/31-node-E-out.pcap | tee ../OUTPUTS/31-node-E-capture.txt | diff -B - 31-node-E-capture.txt 16 | 17 | clean:: 18 | @rm -rf 31-daoreply-extra *.o 19 | 20 | update: 21 | cp ../OUTPUTS/31-daoreply-extra-out.raw 31-daoreply-extra-out.txt 22 | cp ../OUTPUTS/31-node-E-capture.txt 31-node-E-capture.txt 23 | -------------------------------------------------------------------------------- /testing/unit/31-daoreply-extraprefix/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a DIO message. 2 | The DIO will include a PIO, but because of the --additional-prefixes option, 3 | the prefixes found on the on the listed interface will also be returned 4 | in the DAO. 5 | 6 | We should then expect to get a DAOACK from the parent. 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /testing/unit/31-daoreply-extraprefix/pedigree.txt: -------------------------------------------------------------------------------- 1 | The inputs for this test are the same as from 24-daoreply, so the file is 2 | reused. 3 | -------------------------------------------------------------------------------- /testing/unit/32-daoreply-onlyif/.gitignore: -------------------------------------------------------------------------------- 1 | 32-daoreply-onlyif 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/32-daoreply-onlyif/32-node-E-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 48) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, RPL, (CLR)Destination Advertisement Object [dagid:2001:db8:661e::1,seq:2,instance:42,acK,Dagid,c0] opt:rpltarget len:20 opt:pad0 opt:pad0 opt:pad0 opt:pad0 2 | -------------------------------------------------------------------------------- /testing/unit/32-daoreply-onlyif/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 32-daoreply-onlyif: 32-daoreply-onlyif.cpp ../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 32-daoreply-onlyif 32-daoreply-onlyif.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 32-daoreply-onlyif 10 | programs:: 11 | 12 | check:: 32-daoreply-onlyif 13 | @mkdir -p ../OUTPUTS 14 | ./32-daoreply-onlyif 2>&1 | tee ../OUTPUTS/32-daoreply-onlyif-out.raw | diff -B - 32-daoreply-onlyif-out.txt 15 | ${TCPDUMP} -t -v -v -n -r ../OUTPUTS/32-node-E-out.pcap | tee ../OUTPUTS/32-node-E-capture.txt | diff -B - 32-node-E-capture.txt 16 | 17 | clean:: 18 | @rm -rf 32-daoreply-onlyif *.o 19 | 20 | update: 21 | cp ../OUTPUTS/32-daoreply-onlyif-out.raw 32-daoreply-onlyif-out.txt 22 | cp ../OUTPUTS/32-node-E-capture.txt 32-node-E-capture.txt 23 | 24 | -------------------------------------------------------------------------------- /testing/unit/32-daoreply-onlyif/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a DIO message, and send a DAO 2 | out. The PIO in the DIO is ignored. 3 | A new interface is created after the DIO is received, and an IP address on 4 | that interface belongs in the DAO, so a DAO should be sent. 5 | 6 | 7 | 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /testing/unit/32-daoreply-onlyif/pedigree.txt: -------------------------------------------------------------------------------- 1 | The inputs for this test are the same as from 24-daoreply, so the file is 2 | reused. 3 | -------------------------------------------------------------------------------- /testing/unit/33-newifdao/.gitignore: -------------------------------------------------------------------------------- 1 | 33-newifdao 2 | *.o 3 | .gdbinit 4 | -------------------------------------------------------------------------------- /testing/unit/33-newifdao/33-newifdao-out.txt: -------------------------------------------------------------------------------- 1 | link found[10]: acp0 type=ether (inactive new) 2 | adding as new interface 00:11:22:33:44:45/0211:22ff:fe33:4445 3 | added fd01:203:405:607::1111 to DAG 1/[2001:db8:661e::1] 4 | ip found[10]: acp0 scope=0 address=fd01:203:405:607::1111 announced 5 | -------------------------------------------------------------------------------- /testing/unit/33-newifdao/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 33-newifdao: 33-newifdao.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 33-newifdao 33-newifdao.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 33-newifdao 10 | programs:: 11 | 12 | check:: 33-newifdao 13 | @mkdir -p ../OUTPUTS 14 | ./33-newifdao 2>&1 | tee ../OUTPUTS/33-newifdao-out.raw | diff -B - 33-newifdao-out.txt 15 | 16 | clean:: 17 | @rm -rf 33-newifdao *.o 18 | 19 | update: 20 | cp ../OUTPUTS/33-newifdao-out.raw 33-newifdao-out.txt 21 | 22 | 23 | # Local Variables: 24 | # compile: "make check" 25 | # 26 | # End: 27 | 28 | -------------------------------------------------------------------------------- /testing/unit/33-newifdao/description.txt: -------------------------------------------------------------------------------- 1 | This tests that a new interface being added with an IP address that belongs 2 | in a DAO does not cause a problem when no DIO has been received yet, so 3 | there is no parent to notify yet. 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /testing/unit/34-builddis/.gitignore: -------------------------------------------------------------------------------- 1 | 34-builddis 2 | -------------------------------------------------------------------------------- /testing/unit/34-builddis/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=34-builddis 9 | OUTPUT=node-E-dis 10 | NUM=34 11 | 12 | ${TESTNAME}: ${TESTNAME}.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 13 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 14 | 15 | check:: ${TESTNAME} 16 | ./${TESTNAME} | tee ../OUTPUTS/${OUTPUT}-out.txt | diff - ${OUTPUT}-out.txt 17 | @${TCPDUMP} -t -n -r ../OUTPUTS/${NUM}-${OUTPUT}.pcap | tee ../OUTPUTS/${OUTPUT}.txt | diff - ${OUTPUT}.txt 18 | 19 | checkprograms:: ${TESTNAME} 20 | programs:: 21 | 22 | clean:: 23 | @rm -rf ${TESTNAME} *.o 24 | 25 | update: 26 | cp ../OUTPUTS/${OUTPUT}-out.txt ${OUTPUT}-out.txt 27 | cp ../OUTPUTS/${OUTPUT}.txt ${OUTPUT}.txt 28 | 29 | # Local Variables: 30 | # compile-command: "make check" 31 | # End: 32 | -------------------------------------------------------------------------------- /testing/unit/34-builddis/description.txt: -------------------------------------------------------------------------------- 1 | This test case builds a DAOACK message to send. 2 | To do so, it creates a DAG, adds a child node, and then invokes 3 | the DAOACK function against the child node. 4 | 5 | -------------------------------------------------------------------------------- /testing/unit/34-builddis/dis.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::216:3eff:fe11:3424 > ff02::1: ICMP6, RPL, (CLR)DODAG Information Solicitation, length 32 2 | -------------------------------------------------------------------------------- /testing/unit/34-builddis/node-E-dis-out.txt: -------------------------------------------------------------------------------- 1 | Creating PCAP interface: wlan0 2 | link found[1]: wlan0 type=ether (active new) faked 3 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 4 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 5 | Creating PCAP interface: lo 6 | link found[2]: lo type=loopback (active new) faked 7 | ip found[2]: lo scope=254 address=::1 8 | link found[3]: virbr0 no carrier, ignored 9 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6602 10 | sending DIS on if: wlan0 for instanceID: 2 11 | 34-build_dis tests finished 12 | -------------------------------------------------------------------------------- /testing/unit/34-builddis/node-E-dis.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::216:3eff:fe11:3424 > ff02::1: ICMP6, RPL, (CLR)DODAG Information Solicitation, length 32 2 | -------------------------------------------------------------------------------- /testing/unit/35-recvdis/.gdbinit: -------------------------------------------------------------------------------- 1 | file 35-recvdis 2 | 3 | -------------------------------------------------------------------------------- /testing/unit/35-recvdis/.gitignore: -------------------------------------------------------------------------------- 1 | 35-recvdis 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/35-recvdis/35-node-A-capture.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/35-recvdis/35-node-A-capture.txt -------------------------------------------------------------------------------- /testing/unit/35-recvdis/35-recvdis-output.txt: -------------------------------------------------------------------------------- 1 | Creating PCAP interface: wlan0 2 | link found[1]: wlan0 type=ether (active new) faked 3 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 4 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 5 | Creating PCAP interface: lo 6 | link found[2]: lo type=loopback (active new) faked 7 | ip found[2]: lo scope=254 address=::1 8 | link found[3]: virbr0 no carrier, ignored 9 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 10 | Processing input file 11 | packet 1 is being processed 12 | wlan0: received packet from fe80::216:3eff:fe11:3424 -> ff02::1[1] hoplimit=0 13 | received DIS from fe80::216:3eff:fe11:3424 14 | received DIS from fe80::216:3eff:fe11:3424 15 | 16 | -------------------------------------------------------------------------------- /testing/unit/35-recvdis/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 35-recvdis: 35-recvdis.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 35-recvdis 35-recvdis.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 35-recvdis 10 | programs:: 11 | 12 | check:: 35-recvdis 13 | @mkdir -p ../OUTPUTS 14 | ./35-recvdis 2>&1 | tee ../OUTPUTS/35-recvdis-output.raw | diff -B - 35-recvdis-output.txt 15 | @${TCPDUMP} -t -v -n -r ../OUTPUTS/35-node-A-out.pcap | tee ../OUTPUTS/35-node-A-capture.txt | diff -B - 35-node-A-capture.txt 16 | 17 | 18 | clean:: 19 | @rm -rf 35-recvdis *.o 20 | 21 | update: 22 | cp ../OUTPUTS/35-recvdis-output.raw 35-recvdis-output.txt 23 | cp ../OUTPUTS/35-node-A-capture.txt 35-node-A-capture.txt 24 | 25 | inputs: 26 | cp ../OUTPUTS/34-node-E-dis.pcap ../INPUTS/35-nodeE-dis.pcap 27 | 28 | # Local Variables: 29 | # compile-command: "make check" 30 | # End: 31 | -------------------------------------------------------------------------------- /testing/unit/35-recvdis/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a DIS message, and that 2 | it results in a reset of the trickle timers. That should almost immediately 3 | result in a DIO being multicasted. 4 | 5 | The input file INPUTS/dis1.pcap is produced by 34-builddis. 6 | cp ../OUTPUTS/34-node-E-dis.pcap ../INPUTS/35-nodeE-dis.pcap 7 | -------------------------------------------------------------------------------- /testing/unit/36-peckusage/.gitignore: -------------------------------------------------------------------------------- 1 | OUTPUT 2 | -------------------------------------------------------------------------------- /testing/unit/36-peckusage/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | INC=${UNSTRUNG_SRCDIR}/include 6 | 7 | export PECK=${UNSTRUNG_OBJDIR}/programs/peck/peck 8 | 9 | checkprograms:: 10 | programs:: 11 | clean:: 12 | @rm -f core.* 13 | @rm -rf OUTPUT 14 | 15 | check:: 16 | @mkdir -p OUTPUT 17 | @rm -f core.* 18 | ./peck-test-01.sh 19 | @if [ -f core.* ]; then echo CORE FILES FOUND; exit 1; else exit 0; fi 20 | 21 | update: 22 | cp OUTPUT/peck-test-01.raw peck-test-01.out 23 | 24 | 25 | -------------------------------------------------------------------------------- /testing/unit/36-peckusage/SIGNING.md: -------------------------------------------------------------------------------- 1 | mic.pem and vendor_secp384r1.crt 2 | -------------------------------- 3 | 4 | These files come from Minerva Highway tests data. 5 | Minerva is at: https://github.com/AnimaGUS-minerva/highway.git 6 | 7 | The mic.pem file comes from spec/files/cert/00-D0-E5-F2-00-02/device.crt 8 | The vendor\_secp384r1.crt file comes from spec/files/cert/vendor\_secp384r1.crt 9 | 10 | The command: rake highway:h1\_bootstrap\_ca RESIGN=true 11 | can be used to update the CA certificate. 12 | 13 | The command: rake highway:signmic EUI64=00-D0-E5-F2-00-02 14 | can be used to update the IDevID. 15 | -------------------------------------------------------------------------------- /testing/unit/36-peckusage/mic.pem: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIIB3jCCAWSgAwIBAgIEOEt1+zAKBggqhkjOPQQDAjBVMRIwEAYKCZImiZPyLGQB 3 | GRYCY2ExGTAXBgoJkiaJk/IsZAEZFglzYW5kZWxtYW4xJDAiBgNVBAMMG2hpZ2h3 4 | YXktdGVzdC5leGFtcGxlLmNvbSBDQTAgFw0yMzA2MTUxMTUyMTBaGA8yOTk5MTIz 5 | MTAwMDAwMFowHDEaMBgGA1UEBRMRMDAtRDAtRTUtRjItMDAtMDIwWTATBgcqhkjO 6 | PQIBBggqhkjOPQMBBwNCAAQDo3VDh7N8wAqah5yt9vQ4ExzUDIQf4EBOQXnwWxNL 7 | IHGzRJtJYvEWMM67AH2AsafZOxNQm6YnpU/Dln9M/iEno1kwVzAdBgNVHQ4EFgQU 8 | RYjMlpYAZDewuiNlZGRUCAZsVq0wCQYDVR0TBAIwADArBggrBgEFBQcBIAQfFh1o 9 | aWdod2F5LXRlc3QuZXhhbXBsZS5jb206OTQ0MzAKBggqhkjOPQQDAgNoADBlAjEA 10 | rPRa7qlgE5p2FRcsxjJ+AEktbMRQTyNZ0Dapx0yjsy4+is77LVbm2f39xjTm8D81 11 | AjBBUzGwWP5BNJ3MFfd0KC3BpL7QqNUq4KG4sBn7EsJBckL6gW6w3p+KJydS7/be 12 | Z9U= 13 | -----END CERTIFICATE----- 14 | -------------------------------------------------------------------------------- /testing/unit/36-peckusage/peck-test-01.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | PECK=${PECK-../../../programs/peck/peck} 4 | 5 | # this test case just tests stderr, that the usage message comes out 6 | # sanely, with no crashes when there are not the right arguments. 7 | 8 | ( 9 | ${PECK} --help 10 | ${PECK} -V 11 | 12 | # echo this one will fail as /boot/manufacturer.pem is not present, etc. 13 | ${PECK} --fake wlan0 14 | 15 | # see SIGNING.md for instructions on where these came from 16 | ${PECK} --fake --mic mic.pem --manuca vendor_secp384r1.crt wlan0 17 | 18 | ) 2>&1 | tee OUTPUT/peck-test-01.raw | diff - peck-test-01.out 19 | -------------------------------------------------------------------------------- /testing/unit/36-peckusage/vendor_secp384r1.crt: -------------------------------------------------------------------------------- 1 | -----BEGIN CERTIFICATE----- 2 | MIICOzCCAcKgAwIBAgIEGLBrkzAKBggqhkjOPQQDAjBVMRIwEAYKCZImiZPyLGQB 3 | GRYCY2ExGTAXBgoJkiaJk/IsZAEZFglzYW5kZWxtYW4xJDAiBgNVBAMMG2hpZ2h3 4 | YXktdGVzdC5leGFtcGxlLmNvbSBDQTAeFw0yMzA2MTUxMTQ4NDdaFw0yNTA2MTQx 5 | MTQ4NDdaMFUxEjAQBgoJkiaJk/IsZAEZFgJjYTEZMBcGCgmSJomT8ixkARkWCXNh 6 | bmRlbG1hbjEkMCIGA1UEAwwbaGlnaHdheS10ZXN0LmV4YW1wbGUuY29tIENBMHYw 7 | EAYHKoZIzj0CAQYFK4EEACIDYgAELuf8pLSWxS4zAvO4e2/sk63hbhfBsHsChy+J 8 | ktK9HVQELm6g1EHE6476V61wqU6I4iws4KfH85HFA5GfSw/zPdCw4qYizSDpD47h 9 | fEJKAG0/KTK2PNzEvMu+sGewGpTUo2MwYTAPBgNVHRMBAf8EBTADAQH/MA4GA1Ud 10 | DwEB/wQEAwIBBjAdBgNVHQ4EFgQUXgypUlqM36kPAxTplvGAdoxTiggwHwYDVR0j 11 | BBgwFoAUXgypUlqM36kPAxTplvGAdoxTiggwCgYIKoZIzj0EAwIDZwAwZAIwDCgI 12 | 0PPdKTBOdJiMinhgwusXZ4rG87x+Y0ywIo0TYY2cYlGHUpdU9krzTwNh4BSsAjBA 13 | 3J8MXk4kXTs1L16tFUVOkKuAQyAP4HrRMMyWyVRSuGt5Er++AkBpx8F8ZuuBAiA= 14 | -----END CERTIFICATE----- 15 | -------------------------------------------------------------------------------- /testing/unit/37-fmteui/.gitignore: -------------------------------------------------------------------------------- 1 | fmteui -------------------------------------------------------------------------------- /testing/unit/37-fmteui/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | fmteui: fmteui.cpp ${INC}/iface.h ${LIBNDMGMT} 9 | ${CXX} ${CXXFLAGS} -o fmteui fmteui.cpp ${LDFLAGS} 10 | 11 | check:: fmteui 12 | ./fmteui 13 | 14 | checkprograms:: fmteui 15 | programs:: 16 | 17 | clean:: 18 | @rm -rf fmteui *.o 19 | -------------------------------------------------------------------------------- /testing/unit/38-builddaoack/.gdbinit: -------------------------------------------------------------------------------- 1 | file 26-builddaoack 2 | -------------------------------------------------------------------------------- /testing/unit/38-builddaoack/.gitignore: -------------------------------------------------------------------------------- 1 | 26-builddaoack 2 | -------------------------------------------------------------------------------- /testing/unit/38-builddaoack/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=26-builddaoack 9 | OUTPUT=daoack 10 | 11 | ${TESTNAME}: ${TESTNAME}.cpp ${INC}/iface.h ${INC}/dag.h ${LIBNDMGMT} 12 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 13 | 14 | check:: ${TESTNAME} 15 | ./${TESTNAME} | tee ../OUTPUTS/${OUTPUT}-out.txt | diff - ${OUTPUT}-out.txt 16 | @${TCPDUMP} -t -n -r ../OUTPUTS/26-${OUTPUT}.pcap | tee ../OUTPUTS/${OUTPUT}.txt | diff - ${OUTPUT}.txt 17 | 18 | checkprograms:: ${TESTNAME} 19 | programs:: 20 | 21 | clean:: 22 | @rm -rf ${TESTNAME} *.o 23 | 24 | update: 25 | cp ../OUTPUTS/${OUTPUT}-out.txt ${OUTPUT}-out.txt 26 | cp ../OUTPUTS/${OUTPUT}.txt ${OUTPUT}.txt 27 | -------------------------------------------------------------------------------- /testing/unit/38-builddaoack/daoack-out.txt: -------------------------------------------------------------------------------- 1 | 26-builddaoack t1 2 | Creating PCAP interface: wlan0 3 | link found[1]: wlan0 type=ether (active new) faked 4 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 5 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 6 | Creating PCAP interface: lo 7 | link found[2]: lo type=loopback (active new) faked 8 | ip found[2]: lo scope=254 address=::1 9 | link found[3]: virbr0 no carrier, ignored 10 | new RPL node: fe80::216:3eff:fe22:4455 11 | sending DAOACK on if: wlan0(faked) 12 | 26-builddaoack tests finished 13 | -------------------------------------------------------------------------------- /testing/unit/38-builddaoack/daoack.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe22:4455: ICMP6, RPL, (CLR)Destination Advertisement Object Ack, length 24 2 | -------------------------------------------------------------------------------- /testing/unit/38-builddaoack/description.txt: -------------------------------------------------------------------------------- 1 | This test case builds a DAOACK message to send. 2 | To do so, it creates a DAG, adds a child node, and then invokes 3 | the DAOACK function against the child node. 4 | 5 | -------------------------------------------------------------------------------- /testing/unit/39-daoJ/.gitignore: -------------------------------------------------------------------------------- 1 | 39-daoJ 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/39-daoJ/39-dao-J.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::1200:ff:fe64:4a01 > fe80::216:3eff:fe11:3424: ICMP6, RPL, (CLR)Destination Advertisement Object, length 48 2 | -------------------------------------------------------------------------------- /testing/unit/39-daoJ/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=39-daoJ 9 | OUTPUT=node-J-dao 10 | OUTPUT1=39-dao-J 11 | INCLUDES=../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp 12 | INCLUDES+=${INC}/iface.h ${INC}/dag.h 13 | 14 | ${TESTNAME}: ${TESTNAME}.cpp ${LIBNDMGMT} ${INCLUDES} 15 | 16 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 17 | 18 | check:: ${TESTNAME} 19 | ./${TESTNAME} | tee ../OUTPUTS/${OUTPUT}-out.txt | diff -B -w - ${OUTPUT}-out.txt 20 | @${TCPDUMP} -t -n -r ../OUTPUTS/${OUTPUT1}.pcap | tee ../OUTPUTS/${OUTPUT1}.txt | diff -B -w - ${OUTPUT1}.txt 21 | 22 | checkprograms:: ${TESTNAME} 23 | programs:: 24 | 25 | clean:: 26 | @rm -rf ${TESTNAME} *.o 27 | 28 | update: 29 | cp ../OUTPUTS/${OUTPUT}-out.txt ${OUTPUT}-out.txt 30 | cp ../OUTPUTS/${OUTPUT1}.txt ${OUTPUT1}.txt 31 | 32 | pcapupdate: 33 | cp ../OUTPUTS/24-node-E-dio.pcap ../INPUTS/24-node-E-dio.pcap 34 | 35 | -------------------------------------------------------------------------------- /testing/unit/39-daoJ/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates a node J, two levels down can receive 2 | a DIO from an intermediate (E), and will reply with a DAO. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /testing/unit/40-build-ns/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .gdbinit 3 | -------------------------------------------------------------------------------- /testing/unit/40-build-ns/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | export SENDND=${UNSTRUNG_OBJDIR}/programs/sendnd/sendnd 7 | 8 | checkprograms:: 9 | programs:: 10 | clean:: 11 | @rm -f core.* 12 | @rm -rf OUTPUT 13 | 14 | check:: 15 | @rm -f core.* 16 | ./send-nd-test-01.sh 17 | @if [ -f core.* ]; then echo CORE FILES FOUND; exit 1; else exit 0; fi 18 | 19 | update: 20 | cp ../OUTPUTS/send-nd-test-00.raw send-nd-test-00.out 21 | cp ../OUTPUTS/send-nd-test-01.raw send-nd-test-01.out 22 | cp ../OUTPUTS/send-nd-test-01-pcap.txt send-nd-test-01-pcap.txt 23 | 24 | vars: 25 | echo ${SENDND} 26 | -------------------------------------------------------------------------------- /testing/unit/40-build-ns/description.txt: -------------------------------------------------------------------------------- 1 | This test case builds an ICMP Neighbour Solicitation message. 2 | This requires that a fake device identity be created so that it 3 | can be placed into the extension. 4 | 5 | 6 | -------------------------------------------------------------------------------- /testing/unit/40-build-ns/send-nd-test-00.out: -------------------------------------------------------------------------------- 1 | please select either --advert or --solicit 2 | Usage: sendnd --solicit [] 3 | sendnd --advert [] 4 | -------------------------------------------------------------------------------- /testing/unit/40-build-ns/send-nd-test-01-pcap.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 40) fe80::216:3eff:fe11:3424 > ff02::1: [icmp6 sum ok] ICMP6, neighbor solicitation, length 40, who has fe80::216:3eff:fe11:3424 2 | unknown option (33), length 16 (2): 3 | 0x0000: 0000 0000 0005 0216 3eff fe11 3424 4 | -------------------------------------------------------------------------------- /testing/unit/40-build-ns/send-nd-test-01.out: -------------------------------------------------------------------------------- 1 | Using faked interfaces 2 | Creating PCAP interface: wlan0 3 | link found[1]: wlan0 type=ether (active new) faked 4 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 5 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 6 | Creating PCAP interface: lo 7 | link found[2]: lo type=loopback (active new) faked 8 | ip found[2]: lo scope=254 address=::1 9 | link found[3]: virbr0 no carrier, ignored 10 | Sending ICMP of length: 40 11 | 0000: 87 00 00 00 20 00 00 00 fe 80 00 00 00 00 00 00 .... ........... 12 | 0010: 02 16 3e ff fe 11 34 24 21 02 00 00 00 00 00 05 ..>...4$!....... 13 | 0020: 02 16 3e ff fe 11 34 24 ..>...4$ 14 | -------------------------------------------------------------------------------- /testing/unit/40-build-ns/send-nd-test-01.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | SENDND=${SENDND-../../../programs/sendnd/sendnd} 5 | mkdir -p ../OUTPUTS 6 | 7 | PCAP02=../OUTPUTS/basic-nd.pcap 8 | 9 | echo "file ${SENDND}" >.gdbinit 10 | echo "set args --help" >>.gdbinit 11 | (${SENDND}; ${SENDND} --help) 2>&1 | tee ../OUTPUTS/send-nd-test-00.raw | diff -B -w - send-nd-test-00.out 12 | 13 | ARGS="--fake -v -O ${PCAP02} -i wlan0 --solicit devid" 14 | echo "set args ${ARGS}" >>.gdbinit 15 | ${SENDND} ${ARGS} 2>&1 | tee ../OUTPUTS/send-nd-test-01.raw | diff -B -w - send-nd-test-01.out 16 | 17 | ${TCPDUMP-tcpdump} -t -n -r ${PCAP02} -v -v | tee ../OUTPUTS/send-nd-test-01-pcap.txt | diff -B -w - send-nd-test-01-pcap.txt 18 | -------------------------------------------------------------------------------- /testing/unit/41-acceptns/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | 41-acceptns 3 | -------------------------------------------------------------------------------- /testing/unit/41-acceptns/41-acceptns-almec-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > 2607:f0b0:f:2::247: [icmp6 sum ok] ICMP6, neighbor advertisement, length 24, tgt is fe80::216:3eff:fe11:3424, Flags [solicited, override] 2 | -------------------------------------------------------------------------------- /testing/unit/41-acceptns/41-acceptns-capture.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 40) fe80::216:3eff:fe11:3424 > fe80::216:3eff:fe11:3424: [icmp6 sum ok] ICMP6, neighbor advertisement, length 40, tgt is fe80::216:3eff:fe11:3424, Flags [solicited, override][ndp opt] 2 | -------------------------------------------------------------------------------- /testing/unit/41-acceptns/41-acceptns-tooshort.txt: -------------------------------------------------------------------------------- 1 | Creating PCAP interface: wlan0 2 | link found[1]: wlan0 type=ether (active new) faked 3 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 4 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 5 | Creating PCAP interface: lo 6 | link found[2]: lo type=loopback (active new) faked 7 | ip found[2]: lo scope=254 address=::1 8 | ip found[1]: wlan0 scope=253 address=fe80::1200:ff:fe66:4a02 9 | Processing input file ../INPUTS/nodeM-ns-tooshort.pcap on if=[1]: wlan0 state: active faked 10 | packet 1 is being processed 11 | wlan0: received packet from fe80::216:3eff:fe11:3424 -> ff02::1[1] hoplimit=0 12 | processing NS(11) 13 | ns has invalid len: 11(<24) 14 | -------------------------------------------------------------------------------- /testing/unit/41-acceptns/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can receive a Neighbour Solicitation 2 | message that has an ARO in it. 3 | 4 | Only works when GRASP_CLIENT built-in. 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /testing/unit/41-acceptns/pedigree.txt: -------------------------------------------------------------------------------- 1 | The inputs for this are created by 40-buildns. 2 | 3 | ../INPUTS/nodeM-ns-tooshort.pcap was created with: 4 | bittwiste -I nodeM-ns.pcap -O nodeM-ns-tooshort.pcap -D 62-90 5 | which just truncated the packet. 6 | 7 | ../INPUTS/herring-ns.pcap was captured from a live network: 8 | tcpdump -n -w herring-ns.pcap -c 1 ip6 src fe80::216:3eff:fe83:4f47 9 | -------------------------------------------------------------------------------- /testing/unit/42-build-na/.gitignore: -------------------------------------------------------------------------------- 1 | 2 | .gdbinit 3 | -------------------------------------------------------------------------------- /testing/unit/42-build-na/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | export SENDND=${UNSTRUNG_OBJDIR}/programs/sendnd/sendnd 7 | 8 | checkprograms:: 9 | programs:: 10 | clean:: 11 | @rm -f core.* 12 | @rm -rf OUTPUT 13 | 14 | check:: 15 | @rm -f core.* 16 | ./send-nd-test-42.sh 17 | @if [ -f core.* ]; then echo CORE FILES FOUND; exit 1; else exit 0; fi 18 | 19 | update: 20 | cp ../OUTPUTS/send-nd-test-42.raw send-nd-test-42.out 21 | cp ../OUTPUTS/send-nd-test-42-pcap.txt send-nd-test-42-pcap.txt 22 | 23 | vars: 24 | echo ${SENDND} 25 | -------------------------------------------------------------------------------- /testing/unit/42-build-na/description.txt: -------------------------------------------------------------------------------- 1 | This test case builds an ICMP Neighbour Advertisement message. 2 | This is sent unicast back to the place that asked for it. 3 | It needs to confirm reachability. 4 | 5 | The destination in this case is set to node M: fe80::1200:ff:fe66:4d01. 6 | 7 | 8 | -------------------------------------------------------------------------------- /testing/unit/42-build-na/send-nd-test-42-pcap.txt: -------------------------------------------------------------------------------- 1 | IP6 (hlim 64, next-header ICMPv6 (58) payload length: 24) fe80::216:3eff:fe11:3424 > fe80::1200:ff:fe66:4d01: [icmp6 sum ok] ICMP6, neighbor advertisement, length 24, tgt is fe80::216:3eff:fe11:3424, Flags [solicited, override] 2 | -------------------------------------------------------------------------------- /testing/unit/42-build-na/send-nd-test-42.out: -------------------------------------------------------------------------------- 1 | Using faked interfaces 2 | Creating PCAP interface: wlan0 3 | link found[1]: wlan0 type=ether (active new) faked 4 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 5 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 6 | Creating PCAP interface: lo 7 | link found[2]: lo type=loopback (active new) faked 8 | ip found[2]: lo scope=254 address=::1 9 | link found[3]: virbr0 no carrier, ignored 10 | Sending ICMP of length: 24 11 | 0000: 88 00 00 00 60 00 00 00 fe 80 00 00 00 00 00 00 ....`........... 12 | 0010: 02 16 3e ff fe 11 34 24 ..>...4$ 13 | -------------------------------------------------------------------------------- /testing/unit/42-build-na/send-nd-test-42.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e 4 | SENDND=${SENDND-../../../programs/sendnd/sendnd} 5 | mkdir -p ../OUTPUTS 6 | 7 | PCAP42=../OUTPUTS/basic-na.pcap 8 | echo "file ${SENDND}" >.gdbinit 9 | 10 | ARGS="--fake -v -O ${PCAP42} -i wlan0 --advert fe80::1200:ff:fe66:4d01" 11 | echo "set args ${ARGS}" >>.gdbinit 12 | ${SENDND} ${ARGS} 2>&1 | tee ../OUTPUTS/send-nd-test-42.raw | diff -B -w - send-nd-test-42.out 13 | 14 | ${TCPDUMP-tcpdump} -t -n -r ${PCAP42} -v -v | tee ../OUTPUTS/send-nd-test-42-pcap.txt | diff -B -w - send-nd-test-42-pcap.txt 15 | -------------------------------------------------------------------------------- /testing/unit/43-sendgrasp/.gdbinit: -------------------------------------------------------------------------------- 1 | file 43-sendgrasp 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/43-sendgrasp/.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | 41-acceptns 3 | 43-sendgrasp 4 | -------------------------------------------------------------------------------- /testing/unit/43-sendgrasp/43-grasp-out.txt: -------------------------------------------------------------------------------- 1 | 83 # array(3) 2 | 03 # unsigned(3) 3 | 1a 6b8b4577 # unsigned(1804289399) 4 | 84 # array(4) 5 | 6b # text(11) 6 | 34363933303a364a4f494e # "46930:6JOIN" 7 | 02 # unsigned(2) 8 | 02 # unsigned(2) 9 | 82 # array(2) 10 | 48 # bytes(8) 11 | 0102030405060708 # "\x01\x02\x03\x04\x05\x06\a\b" 12 | 67 # text(7) 13 | 36702d69706970 # "6p-ipip" 14 | -------------------------------------------------------------------------------- /testing/unit/43-sendgrasp/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: 43-sendgrasp 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | RAWPCAP=../OUTPUTS/43-sendgrasp-out.pcap 9 | RAWPCAPOUT=../OUTPUTS/43-sendgrasp-out.txt 10 | RAWGRASPOUT=../OUTPUTS/43-grasp-pretty.txt 11 | 12 | 43-sendgrasp: 43-sendgrasp.cpp ${LIBS} 13 | ${CXX} ${CXXFLAGS} -DRAWPCAP=\"${RAWPCAP}\" -o 43-sendgrasp 43-sendgrasp.cpp ${LDFLAGS} ${LIBS} ${CBOR_LIB} 14 | 15 | checkprograms:: 43-sendgrasp 16 | programs:: 17 | 18 | check:: 43-sendgrasp 19 | @mkdir -p ../OUTPUTS 20 | ./43-sendgrasp 2>&1 | tee ../OUTPUTS/43-sendgrasp-out.raw | diff -B - 43-sendgrasp-out.txt 21 | -cbor2pretty.rb ../OUTPUTS/43-6join-grasp.dump | tee ${RAWGRASPOUT} | diff -B - 43-grasp-out.txt 22 | 23 | clean:: 24 | @rm -rf 43-sendgrasp *.o 25 | 26 | update: 27 | cp ../OUTPUTS/43-sendgrasp-out.raw 43-sendgrasp-out.txt 28 | cp ${RAWGRASPOUT} 43-grasp-out.txt 29 | : cp ${RAWPCAPOUT} 43-sendgrasp-capture.txt 30 | -------------------------------------------------------------------------------- /testing/unit/43-sendgrasp/description.txt: -------------------------------------------------------------------------------- 1 | This case tests building a grasp request in CBOR and sending it down a 2 | TCP pipe. For the purposes of testing, the pipe is just a file. 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /testing/unit/43-sendgrasp/grasp-reply.dump: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/43-sendgrasp/grasp-reply.dump -------------------------------------------------------------------------------- /testing/unit/43-sendgrasp/pedigree.txt: -------------------------------------------------------------------------------- 1 | There are no inputs at present. 2 | -------------------------------------------------------------------------------- /testing/unit/44-dio-ungrounded/.gdbinit: -------------------------------------------------------------------------------- 1 | file 44-dio-ungrounded 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/44-dio-ungrounded/.gitignore: -------------------------------------------------------------------------------- 1 | 44-dio-ungrounded 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/44-dio-ungrounded/44-dio-ungrounded.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "iface.h" 4 | 5 | #include "fakeiface.h" 6 | #include "../24-daoreply/dioA.cpp" 7 | #include "../24-daoreply/daoackA.cpp" 8 | 9 | int main(int argc, char *argv[]) 10 | { 11 | pcap_network_interface *iface = NULL; 12 | struct in6_addr iface_src2; 13 | 14 | rpl_debug *deb = new rpl_debug(true, stdout); 15 | deb->want_time_log = false; 16 | 17 | dioA_step(deb, "../INPUTS/dio-A-661e-ungrounded.pcap", NULL); 18 | daoackA_step(deb, 19 | "../INPUTS/daoack-A-example661e.pcap", 20 | "../OUTPUTS/44-node-E-dio.pcap"); 21 | 22 | exit(0); 23 | } 24 | 25 | 26 | -------------------------------------------------------------------------------- /testing/unit/44-dio-ungrounded/44-node-E-dio.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::216:3eff:fe11:3424 > ff02::1: ICMP6, RPL, (CLR)DODAG Information Object, length 64 2 | -------------------------------------------------------------------------------- /testing/unit/44-dio-ungrounded/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=44-dio-ungrounded 9 | OUTPUT=daoreply 10 | OUTPUT1=44-node-E-dio 11 | INCLUDES=../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp 12 | INCLUDES+=${INC}/iface.h ${INC}/dag.h 13 | 14 | ${TESTNAME}: ${TESTNAME}.cpp ${LIBNDMGMT} ${INCLUDES} 15 | 16 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 17 | 18 | check:: ${TESTNAME} 19 | ./${TESTNAME} | tee ../OUTPUTS/${OUTPUT}-out.txt | diff -B -w - ${OUTPUT}-out.txt 20 | @${TCPDUMP} -t -n -r ../OUTPUTS/${OUTPUT1}.pcap | tee ../OUTPUTS/${OUTPUT1}.txt | diff -B -w - ${OUTPUT1}.txt 21 | 22 | checkprograms:: ${TESTNAME} 23 | programs:: 24 | 25 | clean:: 26 | @rm -rf ${TESTNAME} *.o 27 | 28 | update: 29 | cp ../OUTPUTS/${OUTPUT}-out.txt ${OUTPUT}-out.txt 30 | cp ../OUTPUTS/${OUTPUT1}.txt ${OUTPUT1}.txt 31 | 32 | pcapupdate: 33 | : cp ../OUTPUTS/39-dao-J.pcap ../INPUTS/44-daoJ-inst42.pcap 34 | cp ../OUTPUTS/senddio-test-05.pcap ../INPUTS/dio-A-661e-ungrounded.pcap 35 | -------------------------------------------------------------------------------- /testing/unit/44-dio-ungrounded/description.txt: -------------------------------------------------------------------------------- 1 | This test case is similar to 24-daoreply, in that a DIO is received 2 | from the parent, and then a DAO, and then a DAOACK. 3 | 4 | In this case, the initial DIO has not been marked as grounded. 5 | This should cause sunshine to install a route only for the prefix in the PIO(s). 6 | 7 | 8 | -------------------------------------------------------------------------------- /testing/unit/44-dio-ungrounded/node-E-dio.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::216:3eff:fe11:3424 > ff02::1: ICMP6, RPL, (CLR)DODAG Information Object, length 64 2 | -------------------------------------------------------------------------------- /testing/unit/45-extract-eui/.gitignore: -------------------------------------------------------------------------------- 1 | extract-eui 2 | -------------------------------------------------------------------------------- /testing/unit/45-extract-eui/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | TESTNAME=extract-eui 6 | 7 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 8 | include ${srcdir}../Makefile.testing 9 | 10 | EXTRALIBS=${LIBIDEVID} ${MBEDTLSLIB}/libmbedx509.a 11 | 12 | ${TESTNAME}: ${TESTNAME}.cpp ${INC}/iface.h ${LIBS} ${LIBIDEVID} 13 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 14 | 15 | check:: ${TESTNAME} 16 | ./${TESTNAME} 17 | 18 | checkprograms:: ${TESTNAME} 19 | programs:: 20 | 21 | clean:: 22 | @rm -rf ${TESTNAME} *.o 23 | -------------------------------------------------------------------------------- /testing/unit/45-extract-eui/f202.crt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/45-extract-eui/f202.crt -------------------------------------------------------------------------------- /testing/unit/46-method-varargs/.gitignore: -------------------------------------------------------------------------------- 1 | 46-method-varargs 2 | -------------------------------------------------------------------------------- /testing/unit/46-method-varargs/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=46-method-varargs 9 | OUTPUT=method-varargs 10 | INCLUDES= 11 | 12 | ${TESTNAME}: ${TESTNAME}.cpp ${LIBNDMGMT} ${INCLUDES} 13 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 14 | 15 | check:: ${TESTNAME} 16 | ./${TESTNAME} | tee ../OUTPUTS/${OUTPUT}-out.txt | diff -B -w - ${OUTPUT}-out.txt 17 | 18 | checkprograms:: ${TESTNAME} 19 | programs:: 20 | 21 | clean:: 22 | @rm -rf ${TESTNAME} *.o 23 | 24 | update: 25 | cp ../OUTPUTS/${OUTPUT}-out.txt ${OUTPUT}-out.txt 26 | 27 | pcapupdate: 28 | @true 29 | 30 | 31 | -------------------------------------------------------------------------------- /testing/unit/46-method-varargs/method-varargs-out.txt: -------------------------------------------------------------------------------- 1 | my funny valentine -------------------------------------------------------------------------------- /testing/unit/47-dao-ignoredpio/.gdbinit: -------------------------------------------------------------------------------- 1 | file 44-dio-ungrounded 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/47-dao-ignoredpio/.gitignore: -------------------------------------------------------------------------------- 1 | 47-dao-ignoredpio 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/47-dao-ignoredpio/47-node-E-dio.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/47-dao-ignoredpio/47-node-E-dio.txt -------------------------------------------------------------------------------- /testing/unit/47-dao-ignoredpio/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | all: check 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | TESTNAME=47-dao-ignoredpio 9 | OUTPUT=daoreply 10 | OUTPUT1=node-E-dio 11 | INCLUDES=../24-daoreply/dioA.cpp ../24-daoreply/daoackA.cpp 12 | INCLUDES+=${INC}/iface.h ${INC}/dag.h 13 | 14 | EXTRALIBS=${LIBIDEVID} ${MBEDTLSLIB}/libmbedx509.a 15 | 16 | ${TESTNAME}: ${TESTNAME}.cpp ${LIBNDMGMT} ${LIBIDEVID} ${INCLUDES} 17 | ${CXX} ${CXXFLAGS} -o ${TESTNAME} ${TESTNAME}.cpp ${LDFLAGS} 18 | 19 | check:: ${TESTNAME} 20 | ./${TESTNAME} | tee ../OUTPUTS/${OUTPUT}-out.txt | diff -B -w - ${OUTPUT}-out.txt 21 | @${TCPDUMP} -t -n -r ../OUTPUTS/47-${OUTPUT1}.pcap | tee ../OUTPUTS/${OUTPUT1}.txt | diff -B -w - ${OUTPUT1}.txt 22 | 23 | checkprograms:: ${TESTNAME} 24 | programs:: 25 | 26 | clean:: 27 | @rm -rf ${TESTNAME} *.o 28 | 29 | update: 30 | cp ../OUTPUTS/${OUTPUT}-out.txt ${OUTPUT}-out.txt 31 | cp ../OUTPUTS/${OUTPUT1}.txt ${OUTPUT1}.txt 32 | 33 | pcapupdate: 34 | cp ../OUTPUTS/senddio-test-05.pcap ../INPUTS/dio-A-661e-ungrounded.pcap 35 | -------------------------------------------------------------------------------- /testing/unit/47-dao-ignoredpio/description.txt: -------------------------------------------------------------------------------- 1 | This test case is similar to 24-daoreply, in that a DIO is received 2 | from the parent, and then a DAO, and then a DAOACK. 3 | 4 | This node has it's address set via a certificate, and so it does not 5 | configure an address based upon the DIO's PIO. It does however: 6 | 7 | 1) include the configured address in it's DAO. 8 | 2) configure a route via parent for the prefix in the PIO. 9 | 10 | 11 | -------------------------------------------------------------------------------- /testing/unit/47-dao-ignoredpio/node-E-dio.txt: -------------------------------------------------------------------------------- 1 | IP6 fe80::216:3eff:fe11:3424 > ff02::1: ICMP6, RPL, (CLR)DODAG Information Object, length 64 2 | -------------------------------------------------------------------------------- /testing/unit/48-explicitprefix/.gdbinit: -------------------------------------------------------------------------------- 1 | file 17-recvdao 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/48-explicitprefix/.gitignore: -------------------------------------------------------------------------------- 1 | 48-explicitprefix 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/48-explicitprefix/48-explicitprefix-output.txt: -------------------------------------------------------------------------------- 1 | Creating PCAP interface: wlan0 2 | link found[1]: wlan0 type=ether (active new) faked 3 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 4 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 5 | Creating PCAP interface: lo 6 | link found[2]: lo type=loopback (active new) faked 7 | ip found[2]: lo scope=254 address=::1 8 | link found[3]: virbr0 no carrier, ignored 9 | invoking ip -6 route add unreachable 2001:db8:1::/48 dev lo 10 | would invoke cmd: ip -6 route add unreachable 2001:db8:1::/48 dev lo 11 | would invoke cmd: ip -6 route show 12 | new RPL node: fe80::1000:ff:fe64:6423 13 | peer 'fe80::1000:ff:fe64:6423' announces prefix: 2001:db8:1::/48 14 | adding prefix: 2001:db8:2::3333/128 learnt from iface: wlan0 15 | invoking ip -6 addr del 2001:db8:2::3333/128 dev lo 16 | would invoke cmd: ip -6 addr del 2001:db8:2::3333/128 dev lo 17 | invoking ip -6 addr add 2001:db8:2::3333/128 dev lo 18 | would invoke cmd: ip -6 addr add 2001:db8:2::3333/128 dev lo 19 | would invoke cmd: ip -6 route show 20 | -------------------------------------------------------------------------------- /testing/unit/48-explicitprefix/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 48-explicitprefix: 48-explicitprefix.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 48-explicitprefix 48-explicitprefix.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 48-explicitprefix 10 | programs:: 11 | 12 | check:: 48-explicitprefix 13 | @mkdir -p ../OUTPUTS 14 | @echo SELFPREFIX13: 15 | ./48-explicitprefix 2>&1 | tee ../OUTPUTS/48-explicitprefix-output.raw | diff -B - 48-explicitprefix-output.txt 16 | #@${TCPDUMP} -t -v -n -r ../OUTPUTS/17-node-A-out.pcap | tee ../OUTPUTS/17-node-A-capture.txt | diff -B - 17-node-A-capture.txt 17 | 18 | 19 | clean:: 20 | @rm -rf 48-explicitprefix *.o 21 | 22 | update: 23 | cp ../OUTPUTS/48-explicitprefix-output.raw 48-explicitprefix-output.txt 24 | #cp ../OUTPUTS/17-node-A-capture.txt 17-node-A-capture.txt 25 | 26 | pcapupdate: 27 | cp ../OUTPUTS/24-node-E-out.pcap ../INPUTS/daoE.pcap 28 | 29 | -------------------------------------------------------------------------------- /testing/unit/48-explicitprefix/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can set an explicit IPv6 node address, 2 | ignoring any PIO received. 3 | 4 | 5 | -------------------------------------------------------------------------------- /testing/unit/49-explicitiid/.gdbinit: -------------------------------------------------------------------------------- 1 | file 17-recvdao 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/49-explicitiid/.gitignore: -------------------------------------------------------------------------------- 1 | 49-explicitiid 2 | *.o 3 | -------------------------------------------------------------------------------- /testing/unit/49-explicitiid/49-explicitiid-output.txt: -------------------------------------------------------------------------------- 1 | Creating PCAP interface: wlan0 2 | link found[1]: wlan0 type=ether (active new) faked 3 | adding as new interface 00:16:3e:11:34:24/0216:3eff:fe11:3424 4 | ip found[1]: wlan0 scope=253 address=fe80::1000:ff:fe64:6423 5 | Creating PCAP interface: lo 6 | link found[2]: lo type=loopback (active new) faked 7 | ip found[2]: lo scope=254 address=::1 8 | link found[3]: virbr0 no carrier, ignored 9 | invoking ip -6 route add unreachable 2001:db8:1::/48 dev lo 10 | would invoke cmd: ip -6 route add unreachable 2001:db8:1::/48 dev lo 11 | would invoke cmd: ip -6 route show 12 | new RPL node: fe80::1000:ff:fe64:6423 13 | peer 'fe80::1000:ff:fe64:6423' announces prefix: 2001:db8:1::/48 14 | adding prefix: 2001:db8:1::221b/128 learnt from iface: wlan0 15 | invoking ip -6 addr del 2001:db8:1::221b/128 dev lo 16 | would invoke cmd: ip -6 addr del 2001:db8:1::221b/128 dev lo 17 | invoking ip -6 addr add 2001:db8:1::221b/128 dev lo 18 | would invoke cmd: ip -6 addr add 2001:db8:1::221b/128 dev lo 19 | would invoke cmd: ip -6 route show 20 | -------------------------------------------------------------------------------- /testing/unit/49-explicitiid/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | 3 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 4 | include ${srcdir}../Makefile.testing 5 | 6 | 49-explicitiid: 49-explicitiid.cpp ${INC}/iface.h ${LIBS} 7 | ${CXX} ${CXXFLAGS} -o 49-explicitiid 49-explicitiid.cpp ${LDFLAGS} ${LIBS} 8 | 9 | checkprograms:: 49-explicitiid 10 | programs:: 11 | 12 | check:: 49-explicitiid 13 | @mkdir -p ../OUTPUTS 14 | @echo SELFPREFIX13: 15 | ./49-explicitiid 2>&1 | tee ../OUTPUTS/49-explicitiid-output.raw | diff -B - 49-explicitiid-output.txt 16 | #@${TCPDUMP} -t -v -n -r ../OUTPUTS/17-node-A-out.pcap | tee ../OUTPUTS/17-node-A-capture.txt | diff -B - 17-node-A-capture.txt 17 | 18 | 19 | clean:: 20 | @rm -rf 49-explicitiid *.o 21 | 22 | update: 23 | cp ../OUTPUTS/49-explicitiid-output.raw 49-explicitiid-output.txt 24 | #cp ../OUTPUTS/17-node-A-capture.txt 17-node-A-capture.txt 25 | 26 | pcapupdate: 27 | cp ../OUTPUTS/24-node-E-out.pcap ../INPUTS/daoE.pcap 28 | 29 | -------------------------------------------------------------------------------- /testing/unit/49-explicitiid/description.txt: -------------------------------------------------------------------------------- 1 | This test case validates that we can set an explicit IID for the node, and 2 | that it will get combined with the received PIO. 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /testing/unit/50-sunshine-root/.gitignore: -------------------------------------------------------------------------------- 1 | .gdbinit 2 | -------------------------------------------------------------------------------- /testing/unit/50-sunshine-root/Makefile: -------------------------------------------------------------------------------- 1 | UNSTRUNG_SRCDIR?=$(shell cd ../../..; pwd) 2 | ARGS=-I 1 --dagid C0:FFEE::C0:FFEE --ldevid hostcert.pem --stderr --verbose -W 100000 -h 3 | PATHNAMES=../14-sunshine/pathnames.sed 4 | 5 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 6 | include ${srcdir}../Makefile.testing 7 | 8 | export SUNSHINE=${UNSTRUNG_OBJDIR}/programs/sunshine/sunshine 9 | 10 | checkprograms:: 11 | programs:: 12 | clean:: 13 | @rm -f core.* 14 | @rm -rf OUTPUTS 15 | 16 | check:: 17 | @(echo file ${SUNSHINE}; echo set args $ARGS) >.gdbinit 18 | ${SUNSHINE} ${ARGS} 2>&1 | tee ../OUTPUTS/sunshine-root.raw | sed -f ${PATHNAMES} | diff - sunshine-root.txt 19 | @if [ -f core.* ]; then echo CORE FILES FOUND; exit 1; else exit 0; fi 20 | 21 | update: 22 | sed -f ${PATHNAMES} ../OUTPUTS/sunshine-root.raw >sunshine-root.txt 23 | 24 | -------------------------------------------------------------------------------- /testing/unit/50-sunshine-root/description.txt: -------------------------------------------------------------------------------- 1 | 2) This exercisese the sunshine program and argument parsing. 2 | 3 | 4 | -------------------------------------------------------------------------------- /testing/unit/50-sunshine-root/hostcert.pem: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/50-sunshine-root/hostcert.pem -------------------------------------------------------------------------------- /testing/unit/INPUTS/24-node-E-dio.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/24-node-E-dio.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/27-daoJ-inst42.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/27-daoJ-inst42.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/27-daoJ.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/27-daoJ.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/29-dao-nopio.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/29-dao-nopio.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/31-dao-extra.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/31-dao-extra.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/32-dao-onlyif.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/32-dao-onlyif.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/35-nodeE-dis.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/35-nodeE-dis.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/Makefile: -------------------------------------------------------------------------------- 1 | all: dio-A-ripple1.pcap dio-E-eth1d.pcap 2 | # first packet, from node A 3 | dio-A-ripple1.pcap: dio-E-eth1.pcap 4 | tcpdump -c 1 -n -r dio-E-eth1.pcap -w dio-A-ripple1.pcap 5 | 6 | # second packet, from node E. 7 | dio-E-eth1d.pcap: dio-E-eth1.pcap 8 | tcpdump -c 1 -n -w dio-E-eth1d.pcap -r dio-E-eth1.pcap ip6 src fe80::1000:ff:fe66:6602 -------------------------------------------------------------------------------- /testing/unit/INPUTS/a1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/a1.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/almec-ns.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/almec-ns.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/basic-dao.txt: -------------------------------------------------------------------------------- 1 | # send out a DIO 2 | # ICMP v6 type 3 | 9B 4 | # ICMP v6 code 5 | 02 6 | # ICMP v6 checksum 7 | 00 00 8 | # DAG options 9 | # instanceid 10 | 01 11 | # flags: D (DODAGID present) 12 | 40 13 | # reserved 14 | 00 15 | # sequence 16 | 01 17 | # dagid (16 bytes) 18 | 70 61 6e 64 6f 72 61 20 69 73 20 66 75 6e 0a 6c 19 | 20 | -------------------------------------------------------------------------------- /testing/unit/INPUTS/basic-dio.txt: -------------------------------------------------------------------------------- 1 | # send out a DIO 2 | # ICMP v6 type 3 | 9B 4 | # ICMP v6 code 5 | 01 6 | # ICMP v6 checksum 7 | 00 00 8 | # DAG options 9 | # first, the GDA00PRF, values here are: 0x80 = grounded 10 | 80 11 | # sequence 12 | 01 13 | # instanceid 14 | 01 15 | # dagrank 16 | 01 17 | # dagid 18 | 70 61 6e 64 6f 72 61 20 69 73 20 66 75 6e 0a 6c 19 | 69 62 65 72 61 74 65 20 79 6f 75 72 20 76 36 0a 20 | -------------------------------------------------------------------------------- /testing/unit/INPUTS/dao-J.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dao-J.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dao.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dao.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dao2-t2.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dao2-t2.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dao2.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dao2.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/daoE.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/daoE.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/daoack-A-example661e.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/daoack-A-example661e.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/daoack-A-ripple.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/daoack-A-ripple.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/daoack-A-ripple1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/daoack-A-ripple1.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/daoack-A-wrongseq-ripple1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/daoack-A-wrongseq-ripple1.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-02.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-02.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-19-t1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-19-t1.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-19-t2.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-19-t2.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-A-661e-ungrounded.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-A-661e-ungrounded.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-A-661e.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-A-661e.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-A-ripple.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-A-ripple.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-A-ripple1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-A-ripple1.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-B-661e.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-B-661e.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-E-eth0.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-E-eth0.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-E-eth1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-E-eth1.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dio-E-eth1d.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dio-E-eth1d.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dioA-eth0.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dioA-eth0.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dioA-eth1.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dioA-eth1.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/dioA-eth1b.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/dioA-eth1b.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/herring-na.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/herring-na.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/herring-ns.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/herring-ns.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/just-comments.txt: -------------------------------------------------------------------------------- 1 | # this is a file just full of comments 2 | # Ha. 3 | 4 | # oh, and a blank line. -------------------------------------------------------------------------------- /testing/unit/INPUTS/nodeM-ns-tooshort.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/nodeM-ns-tooshort.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/nodeM-ns.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/nodeM-ns.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/pedigree.txt: -------------------------------------------------------------------------------- 1 | -*- fundamental-mode -*- 2 | file,produced how, used by 3 | basic-dao.txt 4 | basic-dio.txt 5 | dao.pcap 6 | dao2.pcap,15-builddao,17-recvdao 7 | dio-02.pcap 8 | dioA-eth0.pcap 9 | dioA-eth1.pcap 10 | dio-E-eth1.pcap,tcpdump on node E from sunshine,23-selfdio,tcpdump -n -r e-eth1.pcap -c 2 -w dio-E-eth1.pcap ip6 dst ff02::1a 11 | dio-A-ripple1.pcap,first packet from dio-E-eth1.pcap,MAKEFILE 12 | dioE-eth1d.pcap,first packet from dio-E-eth1 13 | dioA-eth1b.pcap,tcpdump on node A from sunshine,13-selfprefix 14 | 15 | just-comments.txt 16 | plainnd.pcap 17 | ra-01.pcap 18 | rs-01.pcap 19 | senddio-2.pcap 20 | senddio-example.pcap 21 | senddio.pcap 22 | -------------------------------------------------------------------------------- /testing/unit/INPUTS/plainnd.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/plainnd.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/ra-01.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/ra-01.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/rs-01.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/rs-01.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/senddio-2.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/senddio-2.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/senddio-example.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/senddio-example.pcap -------------------------------------------------------------------------------- /testing/unit/INPUTS/senddio.pcap: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/AnimaGUS-minerva/unstrung/37959427322d943feb70c661d0123833ceeb7765/testing/unit/INPUTS/senddio.pcap -------------------------------------------------------------------------------- /testing/unit/Makefile.testing: -------------------------------------------------------------------------------- 1 | INC=${UNSTRUNG_SRCDIR}/include 2 | 3 | # local install of pcap.h, or make sure you have libpcap-dev installed. 4 | CXXFLAGS+=${LIBPCAPINC} -g ${CROSSFLAGS} ${MBEDTLSH} 5 | CFLAGS+=${CROSSFLAGS} ${MBEDTLSH} 6 | LIBS=${LIBFAKEIFACE} ${LIBNDMGMT} ${LIBOSW} ${LIBNETLINK} ${LIBOSW} ${LIBIDEVID} 7 | LIBS+=${LIBGRASP} ${LIBCBOR} ${LIBCRYPT} 8 | LDFLAGS+=${EXTRALIBS} ${LIBS} ${LIBPCAP} 9 | -------------------------------------------------------------------------------- /testing/utils/Makefile: -------------------------------------------------------------------------------- 1 | # unstrung master makefile 2 | # 3 | # Copyright (C) 2009 Michael Richardson 4 | # 5 | # This program is free software; you can redistribute it and/or modify it 6 | # under the terms of the GNU General Public License as published by the 7 | # Free Software Foundation; either version 2 of the License, or (at your 8 | # option) any later version. See . 9 | # 10 | # This program is distributed in the hope that it will be useful, but 11 | # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 12 | # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 13 | # for more details. 14 | # 15 | 16 | 17 | UNSTRUNG_SRCDIR?=$(shell cd ../..; pwd) 18 | export UNSTRUNG_SRCDIR 19 | 20 | include ${UNSTRUNG_SRCDIR}/Makefile.inc 21 | 22 | srcdir?=$(shell pwd) 23 | 24 | SUBDIRS=uml_netjig 25 | 26 | -------------------------------------------------------------------------------- /testing/utils/buildinitrd: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | # build up a cramfs for initrd use. 4 | # probably you will run this under fakeroot 5 | 6 | PATH=$PATH:/usr/sbin:/sbin export PATH 7 | 8 | list=$1 9 | srctree=$2 10 | basicroot=$3 11 | 12 | echo "info: buildinitrd script, list=\"$1\" scrctree=\"$2\" basicroot=\"$3\" and pwd=\"`pwd`\"" 13 | 14 | rm -rf initrd 15 | mkdir -p initrd 16 | cat $list | (cd ${basicroot} && cpio --format=crc -o) | (cd initrd && cpio -id ) 17 | 18 | #(cd initrd/bin && while read thing; do /bin/ln -f busybox $thing; done) <initrd.cpio 40 | 41 | -------------------------------------------------------------------------------- /testing/utils/fixups/fixup-proc-1-pid.sed: -------------------------------------------------------------------------------- 1 | #!/usr/bin/sed 2 | 3 | s/^\(\[1\]\) [0-9]*/\1 PID/; 4 | s/Killing process [0-9]*/Killing process PID/; 5 | 6 | -------------------------------------------------------------------------------- /testing/utils/fixups/no-icmp-v6-mcast.sed: -------------------------------------------------------------------------------- 1 | #!/bin/sed -f 2 | 3 | /multicast listener report/d 4 | /router solicitation/d 5 | -------------------------------------------------------------------------------- /testing/utils/fixups/no-tentative.sed: -------------------------------------------------------------------------------- 1 | #!/bin/sed -f 2 | 3 | s/tentative// 4 | 5 | -------------------------------------------------------------------------------- /testing/utils/fixups/remove_dummy.sed: -------------------------------------------------------------------------------- 1 | /dummy0 type=ether/{ 2 | n; d; 3 | } -------------------------------------------------------------------------------- /testing/utils/fixups/script-only.sed: -------------------------------------------------------------------------------- 1 | 1,/==== start ====/d 2 | /==== end ====/,$d 3 | -------------------------------------------------------------------------------- /testing/utils/fixups/tcpdump-packet-count.sed: -------------------------------------------------------------------------------- 1 | #!/bin/sed -f 2 | 3 | /[0-9]* packets captured/d 4 | /[0-9]* packets received by filter/d 5 | -------------------------------------------------------------------------------- /testing/utils/initrd-x86_64.list: -------------------------------------------------------------------------------- 1 | ./bin/cat 2 | ./bin/chmod 3 | ./bin/echo 4 | ./bin/grep 5 | ./bin/ln 6 | ./bin/ls 7 | ./bin/mkdir 8 | ./bin/mknod 9 | ./bin/mount 10 | ./bin/rm 11 | ./bin/sh 12 | ./bin/bash 13 | ./bin/umount 14 | ./usr/bin/strace 15 | ./lib/libacl.so.1 16 | ./lib/libacl.so.1.1.0 17 | ./lib/libattr.so.1 18 | ./lib/libattr.so.1.1.0 19 | ./lib/ld-2.7.so 20 | ./lib/libacl.so.1 21 | ./lib/libacl.so.1.1.0 22 | ./lib/libattr.so.1 23 | ./lib/libattr.so.1.1.0 24 | ./lib/libblkid.so.1 25 | ./lib/libblkid.so.1.0 26 | ./lib/libc-2.7.so 27 | ./lib/libdevmapper.so.1.02.1 28 | ./lib/libdl-2.7.so 29 | ./lib/ld-linux-x86-64.so.2 30 | ./lib/libacl.so.1 31 | ./lib/libncurses.so.5.6 32 | ./lib/libpthread-2.7.so 33 | ./lib/librt-2.7.so 34 | ./lib/libselinux.so.1 35 | ./lib/libc.so.6 36 | ./lib/libdl.so.2 37 | ./lib/libncurses.so.5 38 | ./lib/libuuid.so.1.2 39 | ./lib/libpthread.so.0 40 | ./lib/librt.so.1 41 | ./lib/libuuid.so.1 42 | ./lib64 43 | ./selinux 44 | ./sys 45 | ./sbin/pivot_root 46 | 47 | -------------------------------------------------------------------------------- /testing/utils/kernelversion-short: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # determine kernel version code, mostly for use in RPM building 3 | 4 | awk 'BEGIN { FS = " *= *" } 5 | NF != 2 { next } 6 | $1 == "VERSION" { maj = $2 } 7 | $1 == "PATCHLEVEL" { mid = $2 } 8 | END { print maj "." mid }' $* 9 | -------------------------------------------------------------------------------- /testing/utils/localswitches.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #set -x 4 | 5 | BUILDTOP=${MYBOX-/c2/freeswan/freeswan-1.92} 6 | export BUILDTOP 7 | OPENSWANSRCDIR=$BUILDTOP 8 | export OPENSWANSRCDIR 9 | export NETJIGDUMP=true 10 | 11 | # enable this so that you can attach gdb. 12 | #export NETJIGTESTDEBUG="netjig" 13 | 14 | . $BUILDTOP/umlsetup.sh 15 | export POOLSPACE 16 | 17 | SWITCHES='UML_ground_CTL UML_n1_CTL UML_n2_CTL UML_n3_CTL' 18 | for sw in $SWITCHES 19 | do 20 | unset $!sw 21 | done 22 | 23 | # suck in local test configuration, if any. 24 | if [ -f testparams.sh ] 25 | then 26 | . testparams.sh 27 | fi 28 | 29 | # XXX 30 | if [ -n "${PUB_INPUT-}" ] 31 | then 32 | export PUBLIC_PLAY=${PUB_INPUT} 33 | fi 34 | 35 | if [ -n "${PRIV_INPUT-}" ] 36 | then 37 | export PRIV_PLAY=${PRIV_INPUT} 38 | fi 39 | 40 | if [ -n "${EAST_INPUT-}" ] 41 | then 42 | export EAST_PLAY=${EAST_INPUT} 43 | fi 44 | 45 | 46 | 47 | case $* in 48 | 0) if [ -n "$XHOST_LIST" ]; then 49 | hosts=`echo $XHOST_LIST | tr 'A-Z' 'a-z'` 50 | fi;; 51 | *) hosts=$@;; 52 | esac 53 | 54 | exec expect -f $BUILDTOP/testing/utils/localswitches.tcl $hosts 55 | 56 | -------------------------------------------------------------------------------- /testing/utils/redocon.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ -z "${UNSTRUNG_SRCDIR}" ] 4 | then 5 | if [ -f ../../umlsetup.sh ]; then 6 | UNSTRUNG_SRCDIR=`cd ../.. && pwd` 7 | else 8 | if [ -f ../../../umlsetup.sh ]; then 9 | UNSTRUNG_SRCDIR=`cd ../../.. && pwd` 10 | fi 11 | fi 12 | fi 13 | 14 | . ../../../umlsetup.sh 15 | TESTINGROOT=${UNSTRUNG_SRCDIR}/testing 16 | UTILS=`cd ${TESTINGROOT}/utils && pwd` 17 | 18 | . $UTILS/testing-functions.sh 19 | . testparams.sh 20 | 21 | compareoutputs; 22 | 23 | -------------------------------------------------------------------------------- /testing/utils/runme.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # $Id: runme.sh,v 1.3 2004/05/28 02:07:02 mcr Exp $ 5 | # 6 | # use this script to run a single test from within that test directory. 7 | # 8 | 9 | if [ -z "${UNTI_SRCDIR}" ] 10 | then 11 | if [ -f ../../umlsetup.sh ]; then 12 | UNTI_SRCDIR=`cd ../.. && pwd` 13 | else 14 | if [ -f ../../../umlsetup.sh ]; then 15 | UNTI_SRCDIR=`cd ../../.. && pwd` 16 | fi 17 | fi 18 | fi 19 | 20 | . ../../../umlsetup.sh 21 | TESTINGROOT=${UNTI_SRCDIR}/testing 22 | UTILS=`cd ${TESTINGROOT}/utils && pwd` 23 | 24 | . $UTILS/testing-functions.sh 25 | . testparams.sh 26 | 27 | if [ -z "${TEST_TYPE}" ] 28 | then 29 | echo runme.sh now requires that testparams.sh defines TEST_TYPE= 30 | fi 31 | 32 | ( cd .. && $TEST_TYPE $TESTNAME good ) 33 | 34 | summarize_results 35 | 36 | 37 | -------------------------------------------------------------------------------- /testing/utils/uml_netjig/.cvsignore: -------------------------------------------------------------------------------- 1 | uml_netjig 2 | uml_switch 3 | -------------------------------------------------------------------------------- /testing/utils/uml_netjig/.gitignore: -------------------------------------------------------------------------------- 1 | uml_netjig 2 | uml_switch 3 | *.o -------------------------------------------------------------------------------- /testing/utils/uml_netjig/hash.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2002 Yon Uriarte and Jeff Dike 2 | * Licensed under the GPL 3 | */ 4 | 5 | #ifndef __HASH_H__ 6 | #define __HASH_H__ 7 | 8 | struct nethub; 9 | 10 | extern void *find_in_hash(struct nethub *nh, unsigned char *dst); 11 | extern void insert_into_hash(struct nethub *nh, unsigned char *src, void *port); 12 | extern void delete_hash(struct nethub *nh, unsigned char *dst); 13 | extern void print_hash(struct nethub *nh, 14 | char *(*port_id)(void *)); 15 | extern void update_entry_time(struct nethub *nh, unsigned char *src); 16 | extern void hash_init(struct nethub *nh); 17 | extern void hash_periodic(struct nethub *nh); 18 | 19 | #define GC_INTERVAL 2 20 | #define GC_EXPIRE 100 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /testing/utils/uml_netjig/switch.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2002 Jeff Dike 2 | * Licensed under the GPL 3 | */ 4 | 5 | #ifndef __SWITCH_H__ 6 | #define __SWITCH_H__ 7 | 8 | #define ETH_ALEN 6 9 | 10 | #endif 11 | -------------------------------------------------------------------------------- /testing/utils/uml_netjig/tuntap.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "nethub.h" 11 | #include "port.h" 12 | 13 | static void send_tap(int fd, void *packet, int len, void *unused) 14 | { 15 | int n; 16 | 17 | n = write(fd, packet, len); 18 | if(n != len){ 19 | if(errno != EAGAIN) perror("send_tap"); 20 | } 21 | } 22 | 23 | int open_tap(struct netjig_state *ns, 24 | struct nethub *nh, 25 | char *dev) 26 | { 27 | struct ifreq ifr; 28 | int fd, err; 29 | 30 | if((fd = open("/dev/net/tun", O_RDWR)) < 0){ 31 | perror("Failed to open /dev/net/tun"); 32 | return(-1); 33 | } 34 | memset(&ifr, 0, sizeof(ifr)); 35 | ifr.ifr_flags = IFF_TAP | IFF_NO_PI; 36 | strncpy(ifr.ifr_name, dev, sizeof(ifr.ifr_name) - 1); 37 | if(ioctl(fd, TUNSETIFF, (void *) &ifr) < 0){ 38 | perror("TUNSETIFF failed"); 39 | close(fd); 40 | return(-1); 41 | } 42 | 43 | err = setup_sock_tap(ns, nh, fd, send_tap); 44 | if(err) return(err); 45 | 46 | add_fd(ns, fd); 47 | 48 | return(fd); 49 | } 50 | 51 | -------------------------------------------------------------------------------- /testing/utils/uml_netjig/tuntap.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2002 Jeff Dike 2 | * Licensed under the GPL 3 | */ 4 | 5 | #ifndef __TUNTAP_H__ 6 | #define __TUNTAP_H__ 7 | 8 | extern int open_tap(struct netjig_state *ns, 9 | struct nethub *nh, 10 | char *dev); 11 | 12 | extern void handle_tap(int fd, int hub); 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /testing/utils/vde0_script.rc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testing/utils/vde1_script.rc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testing/utils/vde2_script.rc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testing/utils/vde3_script.rc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testing/utils/vde4_script.rc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testing/utils/vde99_script.rc: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /testing/utils/verify-uml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # show me 4 | #set -x 5 | 6 | # fail if any command fails 7 | set -e 8 | 9 | case $# in 10 | 1) UNTI_SRCDIR=$1; shift;; 11 | esac 12 | 13 | if [ `id -u` = 0 ] 14 | then 15 | echo Do not run this as root. 16 | exit 17 | fi 18 | 19 | # 20 | # configuration for this file has moved to $UNTI_SRCDIR/umlsetup.sh 21 | # By default, that file does not exist. A sample is at umlsetup-sample.sh 22 | # in this directory. Copy it to $UNTI_SRCDIR and edit it. 23 | # 24 | if [ -z "${UNTI_SRCDIR}" ] && [ -f umlsetup.sh ] 25 | then 26 | UNTI_SRCDIR=`pwd` 27 | fi 28 | 29 | UNTI_SRCDIR=${UNTI_SRCDIR-../..} 30 | if [ ! -f ${UNTI_SRCDIR}/umlsetup.sh ] 31 | then 32 | echo No umlsetup.sh. Please read instructions in doc/umltesting.html and testing/utils/umlsetup-sample.sh. 33 | exit 1 34 | fi 35 | 36 | . ${UNTI_SRCDIR}/umlsetup.sh 37 | 38 | if [ ! -d ${KERNPOOL}/. ]; then echo Your KERNPOOL= is not properly set; exit 1; fi 39 | 40 | if [ -z "${UNTI_HOSTS}" ]; then echo Your UNTI_HOSTS= is not properly set; exit 1; fi 41 | if [ ! -d ${BASICROOT}/. ]; then echo Your BASICROOT=${BASICROOT} is not properly set; exit 1; fi 42 | 43 | --------------------------------------------------------------------------------