├── .gitignore ├── .gitlab-ci.yml ├── .travis.yml ├── AUTHORS ├── CHANGELOG ├── DISTFILES ├── FAQ ├── INSTALL.md ├── LICENSE ├── Makefile.in ├── NEWS ├── NODIST ├── README.fastclick.md ├── README.md ├── README.metron.md ├── README.original.md ├── aclocal.m4 ├── apps ├── ClickController │ ├── .gitignore │ ├── ClickController.java │ ├── ClickException.java │ ├── ControlSocket.java │ ├── NewConnectionDialog.java │ ├── Pair.java │ ├── README │ ├── RouterTreeModel.java │ ├── StringUtils.java │ └── Util.java ├── clicky │ ├── .gitignore │ ├── AUTHORS │ ├── ChangeLog │ ├── Makefile.am │ ├── NEWS │ ├── README │ ├── clicky.glade │ ├── clicky.gladep │ ├── clicky.gtkrc │ ├── configure.ac │ ├── images │ │ └── throbber.gif │ └── src │ │ ├── .gitignore │ │ ├── Makefile.am │ │ ├── callbacks.h │ │ ├── cdriver.cc │ │ ├── cdriver.hh │ │ ├── clicky.cc │ │ ├── crouter.cc │ │ ├── crouter.hh │ │ ├── ddecor.cc │ │ ├── ddecor.hh │ │ ├── dialogs.cc │ │ ├── dstyle.cc │ │ ├── dstyle.hh │ │ ├── dwidget.cc │ │ ├── dwidget.hh │ │ ├── gathererror.cc │ │ ├── gathererror.hh │ │ ├── hvalues.cc │ │ ├── hvalues.hh │ │ ├── interface.c │ │ ├── interface.h │ │ ├── main.cc │ │ ├── permstr.cc │ │ ├── permstr.hh │ │ ├── rectangle.hh │ │ ├── rectsearch.hh │ │ ├── ref.hh │ │ ├── scopechain.cc │ │ ├── scopechain.hh │ │ ├── support.c │ │ ├── support.h │ │ ├── tmain.cc │ │ ├── tmain.hh │ │ ├── transform.cc │ │ ├── transform.hh │ │ ├── wdiagram.cc │ │ ├── wdiagram.hh │ │ ├── whandler.cc │ │ ├── whandler.hh │ │ ├── wmain.cc │ │ ├── wmain.hh │ │ └── xcallbacks.c └── csclient │ ├── csclient.cc │ ├── csclient.hh │ └── test.click ├── bsdmodule ├── .gitignore ├── BSDmakefile ├── Makefile.in ├── clickfs.cc ├── clickfs_element.cc ├── clickfs_tree.cc ├── clickfs_tree.hh ├── clickfs_vnops.cc ├── config.cc ├── kernelerror.cc ├── kernelerror.hh ├── massage-vnode_if.pl ├── module.cc ├── module_c.c ├── modulepriv.hh └── sched.cc ├── click-buildtool.in ├── click-compile.in ├── click-mkelemmap ├── click.spec ├── conf ├── README.md ├── app │ └── webgen.click ├── bpf │ ├── xdp_count.c │ ├── xdp_count.o │ └── xdp_count_common.h ├── deprecated │ ├── click-mkclgw.pl │ ├── delay.click │ ├── demo.click │ ├── fake-iprouter.click │ ├── fastudpsrc.click │ ├── kswitch.ipb │ ├── localdelay.click │ ├── make-ip-conf.pl │ ├── make-udpcount.pl │ ├── make-udpgen.pl │ ├── sampler.click │ ├── udpcount.click │ └── udpgen.click ├── dpdk │ ├── dpdk-bounce.click │ ├── dpdk-ring-primary.click │ └── dpdk-ring-secondary.click ├── grid │ ├── grid.click │ ├── simple-dsdv-userlevel.click │ └── simple-dsdv.click ├── ip6 │ ├── icmp6error.click │ ├── ip601.click │ ├── ip6ndadvertiser.click │ ├── ip6ndadvertiser02.click │ ├── ip6ndsolicitor.click │ └── ip6print.click ├── kernel │ └── fromhost-tunnel.click ├── lib │ └── classifier.click ├── metron │ ├── __init__.py │ ├── click_to_dpdk_rules.py │ ├── click_to_onos_of_rules.py │ ├── common.py │ ├── dispatcher-flow-static.click │ ├── metron-dispatcher-flow-legacy-af-pkt.click │ ├── metron-dispatcher-flow-legacy-af-xdp.click │ ├── metron-dispatcher-flow.click │ ├── metron-dispatcher-rss.click │ ├── metron-dispatcher-vmdq.click │ ├── rules_to_json.py │ ├── test_click_rules │ └── test_nic_rules ├── nat │ ├── gnat01.click │ ├── gnat02.click │ ├── ip64-nat.click │ ├── ip64-nat2.click │ ├── ip64-nat3.click │ ├── ip64-nat4.click │ ├── mazu-nat.click │ ├── nat-dpdk.click │ ├── rewriter.click │ ├── thomer-nat.click │ └── urewrite.click ├── pktgen │ ├── README.md │ ├── pktgen-l2.click │ ├── pktgen-l3.click │ ├── receiver-l2.click │ ├── receiver-l3.click │ ├── tester-l2-dual-loop.click │ ├── tester-l2-dual.click │ ├── tester-l2.click │ ├── tester-l3-loop.click │ └── tester-l3.click ├── proxy │ └── dnsproxy.click ├── queueing │ └── diffserv.ipb ├── ron │ ├── fwrules │ ├── insert_fwrules.sh │ ├── insert_fwrules_real.sh │ ├── make-adapt-ron.pl │ ├── make-all-config.pl │ ├── make-client-ron.pl │ ├── make-flexclient-ron.pl │ ├── make-multiclient-ron.pl │ ├── make-server-ron.pl │ ├── nodelist │ ├── nodelist-down │ ├── open-nodes-big.sh │ ├── open-nodes.sh │ ├── push-click.pl │ ├── push-config.pl │ ├── push-datacollection.pl │ ├── remove-logs.pl │ ├── start-all.pl │ ├── start-client.sh │ ├── start-datacollect.sh │ ├── start-server.sh │ ├── start-traceroute.sh │ ├── stop-all.pl │ ├── stop-client.sh │ ├── stop-datacollect.sh │ ├── stop-server.sh │ └── stop-traceroute.sh ├── router │ ├── ipsec-router.click │ ├── router-vanilla.click │ └── router.click ├── sched │ └── stridetest.click ├── script │ ├── script-parabolawave.click │ ├── script-squarewave.click │ └── script-trianglewave.click ├── simple │ └── print-pings.click ├── snoop │ └── snooptcp.ipb ├── switch │ ├── switch-2ports-printing-vanilla.click │ └── switch-2ports-vanilla.click ├── test │ ├── schedorder1.click │ ├── test-device.click │ ├── test-ping-userlevel.click │ ├── test-ping.click │ ├── test-tap.click │ ├── test-tcp.click │ ├── test-toytcp.click │ ├── test-tun.click │ ├── test.click │ ├── test2.click │ └── test3.click ├── tools │ ├── example.clgw │ ├── ip.clickpat │ ├── kernel.clickpat │ ├── make-dsdv-config.pl │ ├── make-dsr-config.pl │ ├── test-clicky.ccss │ ├── test-clicky.click │ └── unarp.clickpat ├── tutorial │ ├── README.md │ ├── tutorial-01.click │ ├── tutorial-02.click │ └── tutorial-03.click ├── vpn │ ├── vpn-rl.ipb │ └── vpn.ipb └── wifi │ ├── README │ ├── access-point.click │ ├── associate.pl │ ├── dump.click │ ├── gen_config_roofnet.sh │ ├── gen_config_safe.pl │ ├── pseudo-ibss.click │ ├── read_handler │ ├── sample.click │ ├── scan.pl │ ├── set_channel.pl │ ├── sr2.click │ ├── srcr.click │ ├── station.click │ └── write_handler ├── config-bsdmodule.h.in ├── config-linuxmodule.h.in ├── config-minios.h.in ├── config-ns.h.in ├── config-userlevel.h.in ├── config.guess ├── config.h.in ├── config.mk.in ├── config.sub ├── configure ├── configure.in ├── doc ├── .gitignore ├── Doxyfile ├── Makefile.in ├── click-align.1 ├── click-combine.1 ├── click-devirtualize.1 ├── click-elem2man ├── click-fastclassifier.1 ├── click-flatten.1 ├── click-install.1 ├── click-mkmindriver.1 ├── click-pretty.1 ├── click-uncombine.1 ├── click-undead.1 ├── click-uninstall.1 ├── click-xform.1 ├── click.1 ├── click.5 ├── click.o.8 ├── click.texi ├── click.y ├── elementdoc.7 ├── man2html ├── mkwebdoc.pl ├── testie.1 └── texinfo.tex ├── drivers ├── README ├── e1000-2.x │ ├── LICENSE │ ├── Makefile │ ├── Makefile.orig │ ├── README │ ├── README-rtm │ ├── ans.c │ ├── ans.h │ ├── ans_driver.c │ ├── ans_driver.h │ ├── ans_hw.c │ ├── ans_hw.h │ ├── ans_os.c │ ├── ans_os.h │ ├── base_comm.h │ ├── e1000.h │ ├── e1000.h.orig │ ├── e1000_fxhw.c │ ├── e1000_fxhw.h │ ├── e1000_kcompat.h │ ├── e1000_main.c │ ├── e1000_main.c.orig │ ├── e1000_phy.c │ ├── e1000_phy.h │ ├── e1000_proc.c │ ├── e1000_proc.h │ └── e1000_vendor_info.h ├── e1000-4.x │ ├── LICENSE │ ├── README │ ├── README-rtm │ ├── e1000.7 │ ├── e1000.spec │ ├── ldistrib.txt │ └── src │ │ ├── Makefile │ │ ├── ans.c │ │ ├── ans.h │ │ ├── ans_driver.c │ │ ├── ans_driver.h │ │ ├── ans_hw.c │ │ ├── ans_hw.h │ │ ├── ans_interface.h │ │ ├── ans_os.c │ │ ├── ans_os.h │ │ ├── base_comm.h │ │ ├── e1000.h │ │ ├── e1000.h.orig │ │ ├── e1000_ethtool.c │ │ ├── e1000_hw.c │ │ ├── e1000_hw.h │ │ ├── e1000_idiag.c │ │ ├── e1000_idiag.c.orig │ │ ├── e1000_main.c │ │ ├── e1000_main.c.orig │ │ ├── e1000_osdep.h │ │ ├── e1000_param.c │ │ ├── e1000_param.c.orig │ │ ├── e1000_proc.c │ │ ├── idiag_e1000.h │ │ ├── idiag_pro.h │ │ ├── idiag_test.c │ │ ├── kcompat.c │ │ └── kcompat.h ├── e1000-5.x │ ├── LICENSE │ ├── README │ ├── e1000.7 │ ├── e1000.spec │ ├── ldistrib.txt │ └── src │ │ ├── Makefile │ │ ├── e1000.h │ │ ├── e1000_ethtool.c │ │ ├── e1000_hw.c │ │ ├── e1000_hw.h │ │ ├── e1000_main.c │ │ ├── e1000_osdep.h │ │ ├── e1000_param.c │ │ ├── kcompat.c │ │ ├── kcompat.h │ │ └── kcompat_ethtool.c ├── e1000-6.x │ ├── LICENSE │ ├── README │ ├── SUMS │ ├── e1000.7 │ ├── e1000.spec │ ├── ldistrib.txt │ └── src │ │ ├── Makefile │ │ ├── bypass_modectrl_tool.c │ │ ├── e1000.h │ │ ├── e1000_bypass_ctrl.c │ │ ├── e1000_bypass_ctrl.h │ │ ├── e1000_ethtool.c │ │ ├── e1000_hw.c │ │ ├── e1000_hw.h │ │ ├── e1000_main.c │ │ ├── e1000_osdep.h │ │ ├── e1000_param.c │ │ ├── kcompat.c │ │ ├── kcompat.h │ │ └── kcompat_ethtool.c ├── e1000-7.3.20-polling.patch ├── e1000-7.6.15.5-polling.patch ├── e1000-7.x │ ├── COPYING │ ├── README │ ├── e1000.7 │ ├── e1000.spec │ ├── ldistrib.txt │ ├── pci.updates │ └── src │ │ ├── Makefile │ │ ├── e1000.h │ │ ├── e1000_ethtool.c │ │ ├── e1000_hw.c │ │ ├── e1000_hw.h │ │ ├── e1000_main.c │ │ ├── e1000_osdep.h │ │ ├── e1000_param.c │ │ ├── kcompat.c │ │ ├── kcompat.h │ │ └── kcompat_ethtool.c └── e1000e-0.4.1.7-2010-02-25.polling.patch ├── elements ├── analysis │ ├── adjusttimestamp.cc │ ├── adjusttimestamp.hh │ ├── aggcounter.cc │ ├── aggcounter.hh │ ├── aggcountervector.cc │ ├── aggcountervector.hh │ ├── aggpktcounter.cc │ ├── aggpktcounter.hh │ ├── aggregatefilter.cc │ ├── aggregatefilter.hh │ ├── aggregatefirst.cc │ ├── aggregatefirst.hh │ ├── aggregateip.cc │ ├── aggregateip.hh │ ├── aggregateipaddrpair.cc │ ├── aggregateipaddrpair.hh │ ├── aggregateipflows.cc │ ├── aggregateipflows.hh │ ├── aggregatelast.cc │ ├── aggregatelast.hh │ ├── aggregatelen.cc │ ├── aggregatelen.hh │ ├── aggregatenotifier.cc │ ├── aggregatenotifier.hh │ ├── aggregatepaint.cc │ ├── aggregatepaint.hh │ ├── anonipaddr.cc │ ├── anonipaddr.hh │ ├── averagebatchcounter.cc │ ├── averagebatchcounter.hh │ ├── batchstats.cc │ ├── batchstats.hh │ ├── burststats.cc │ ├── burststats.hh │ ├── checknumberpacket.cc │ ├── checknumberpacket.hh │ ├── cyclecountaccum.cc │ ├── cyclecountaccum.hh │ ├── eraseippayload.cc │ ├── eraseippayload.hh │ ├── fromcapdump.cc │ ├── fromcapdump.hh │ ├── fromdagdump.cc │ ├── fromdagdump.hh │ ├── fromflandump.cc │ ├── fromflandump.hh │ ├── fromipsumdump.cc │ ├── fromipsumdump.hh │ ├── fromnetflowsumdump.cc │ ├── fromnetflowsumdump.hh │ ├── fromnlanrdump.cc │ ├── fromnlanrdump.hh │ ├── fromtcpdump.cc │ ├── fromtcpdump.hh │ ├── hardwarecounter.cc │ ├── hardwarecounter.hh │ ├── ipsumdump_anno.cc │ ├── ipsumdump_anno.hh │ ├── ipsumdump_icmp.cc │ ├── ipsumdump_icmp.hh │ ├── ipsumdump_ip.cc │ ├── ipsumdump_ip.hh │ ├── ipsumdump_link.cc │ ├── ipsumdump_link.hh │ ├── ipsumdump_payload.cc │ ├── ipsumdump_payload.hh │ ├── ipsumdump_tcp.cc │ ├── ipsumdump_tcp.hh │ ├── ipsumdump_udp.cc │ ├── ipsumdump_udp.hh │ ├── ipsumdumpinfo.cc │ ├── ipsumdumpinfo.hh │ ├── multireplay.cc │ ├── multireplay.hh │ ├── numberpacket.cc │ ├── numberpacket.hh │ ├── packetmemstats.cc │ ├── packetmemstats.hh │ ├── recordtimestamp.cc │ ├── recordtimestamp.hh │ ├── replay.cc │ ├── replay.hh │ ├── rssverifier.cc │ ├── rssverifier.hh │ ├── rtcycles.cc │ ├── rtcycles.hh │ ├── setcyclecount.cc │ ├── setcyclecount.hh │ ├── settimestampdelta.cc │ ├── settimestampdelta.hh │ ├── storetimestamp.cc │ ├── storetimestamp.hh │ ├── storeudptimeseqrecord.cc │ ├── storeudptimeseqrecord.hh │ ├── timefilter.cc │ ├── timefilter.hh │ ├── timerange.cc │ ├── timerange.hh │ ├── timesortedsched.cc │ ├── timesortedsched.hh │ ├── timestampaccum.cc │ ├── timestampaccum.hh │ ├── timestampdiff.cc │ ├── timestampdiff.hh │ ├── toipflowdumps.cc │ ├── toipflowdumps.hh │ ├── toipsumdump.cc │ └── toipsumdump.hh ├── app │ ├── ftpportmapper.cc │ └── ftpportmapper.hh ├── aqm │ ├── adaptivered.cc │ ├── adaptivered.hh │ ├── codel.cc │ ├── codel.hh │ ├── pi.cc │ ├── pi.hh │ ├── red.cc │ └── red.hh ├── bsdmodule │ ├── anydevice.cc │ ├── anydevice.hh │ ├── fastudpsrc.cc │ ├── fastudpsrc.hh │ ├── fromdevice.cc │ ├── fromdevice.hh │ ├── fromhost.cc │ ├── fromhost.hh │ ├── todevice.cc │ ├── todevice.hh │ ├── tohost.cc │ ├── tohost.hh │ ├── tohostsniffers.cc │ └── tohostsniffers.hh ├── control │ ├── chattermessage.cc │ ├── chattermessage.hh │ ├── pushmessage.cc │ └── pushmessage.hh ├── ethernet │ ├── arpadvertiser.cc │ ├── arpadvertiser.hh │ ├── arpfaker.cc │ ├── arpfaker.hh │ ├── arpprint.cc │ ├── arpprint.hh │ ├── arpquerier.cc │ ├── arpquerier.hh │ ├── arpresponder.cc │ ├── arpresponder.hh │ ├── arptable.cc │ ├── arptable.hh │ ├── checkarpheader.cc │ ├── checkarpheader.hh │ ├── ensureether.cc │ ├── ensureether.hh │ ├── etherencap.cc │ ├── etherencap.hh │ ├── ethermirror.cc │ ├── ethermirror.hh │ ├── etherpausesource.cc │ ├── etherpausesource.hh │ ├── etherrewrite.cc │ ├── etherrewrite.hh │ ├── ethervlanencap.cc │ ├── ethervlanencap.hh │ ├── getetheraddress.cc │ ├── getetheraddress.hh │ ├── hostetherfilter.cc │ ├── hostetherfilter.hh │ ├── ip6ndadvertiser.cc │ ├── ip6ndadvertiser.hh │ ├── ip6ndsolicitor.cc │ ├── ip6ndsolicitor.hh │ ├── setetheraddress.cc │ ├── setetheraddress.hh │ ├── setvlananno.cc │ ├── setvlananno.hh │ ├── storeetheraddress.cc │ ├── storeetheraddress.hh │ ├── stripethervlanheader.cc │ ├── stripethervlanheader.hh │ ├── vlandecap.cc │ ├── vlandecap.hh │ ├── vlanencap.cc │ └── vlanencap.hh ├── etherswitch │ ├── bridgemessage.cc │ ├── bridgemessage.hh │ ├── debugbridge.cc │ ├── debugbridge.hh │ ├── etherswitch.cc │ ├── etherswitch.hh │ ├── listenetherswitch.cc │ ├── listenetherswitch.hh │ ├── spantree.cc │ └── spantree.hh ├── flow │ ├── batchfcb.hh │ ├── flowhyperscan.cc │ ├── flowhyperscan.hh │ ├── flowiploadbalancer.cc │ ├── flowiploadbalancer.hh │ ├── flowipmanager.cc │ ├── flowipmanager.hh │ ├── flowipmanagerimp.cc │ ├── flowipmanagerimp.hh │ ├── flowipmanagermp.cc │ ├── flowipmanagermp.hh │ ├── flowipnat.cc │ ├── flowipnat.hh │ ├── flowlock.cc │ ├── flowlock.hh │ ├── simpletcpreorder.cc │ ├── simpletcpreorder.hh │ ├── tcpreorder.cc │ └── tcpreorder.hh ├── grid │ ├── ackresponder.cc │ ├── ackresponder.hh │ ├── ackresponder2.cc │ ├── ackresponder2.hh │ ├── ackretrysender.cc │ ├── ackretrysender.hh │ ├── ackretrysender2.cc │ ├── ackretrysender2.hh │ ├── airoinfo.cc │ ├── airoinfo.hh │ ├── amoeba.cc │ ├── amoeba.hh │ ├── bottleneckmetric.cc │ ├── bottleneckmetric.hh │ ├── checkgridheader.cc │ ├── checkgridheader.hh │ ├── delivery_rate_table.hh │ ├── dsdvroutetable.cc │ ├── dsdvroutetable.hh │ ├── dsr.hh │ ├── dsrarptable.cc │ ├── dsrarptable.hh │ ├── dsrroutetable.cc │ ├── dsrroutetable.hh │ ├── e2elossmetric.cc │ ├── e2elossmetric.hh │ ├── etx2metric.cc │ ├── etx2metric.hh │ ├── etxmetric.cc │ ├── etxmetric.hh │ ├── filterbyhops.cc │ ├── filterbyhops.hh │ ├── filterbyrange.cc │ ├── filterbyrange.hh │ ├── fixdstloc.cc │ ├── fixdstloc.hh │ ├── fixsrcloc.cc │ ├── fixsrcloc.hh │ ├── floodinglocquerier.cc │ ├── floodinglocquerier.hh │ ├── gen-loss-rate-tables.pl │ ├── grid.hh │ ├── gridencap.cc │ ├── gridencap.hh │ ├── gridgatewayinfo.cc │ ├── gridgatewayinfo.hh │ ├── gridgenericlocinfo.cc │ ├── gridgenericlocinfo.hh │ ├── gridgenericlogger.cc │ ├── gridgenericlogger.hh │ ├── gridgenericmetric.cc │ ├── gridgenericmetric.hh │ ├── gridgenericrt.hh │ ├── gridheaderinfo.cc │ ├── gridheaderinfo.hh │ ├── gridlocationinfo.cc │ ├── gridlocationinfo.hh │ ├── gridlocationinfo2.cc │ ├── gridlocationinfo2.hh │ ├── gridlogger.cc │ ├── gridlogger.hh │ ├── gridprobehandler.cc │ ├── gridprobehandler.hh │ ├── gridprobereplyreceiver.cc │ ├── gridprobereplyreceiver.hh │ ├── gridprobesender.cc │ ├── gridprobesender.hh │ ├── gridproxy.cc │ ├── gridproxy.hh │ ├── gridroutecb.hh │ ├── gridroutetable.cc │ ├── gridroutetable.hh │ ├── gridsrforwarder.cc │ ├── gridsrforwarder.hh │ ├── gridtxerror.cc │ ├── gridtxerror.hh │ ├── hello.cc │ ├── hello.hh │ ├── hopcountmetric.cc │ ├── hopcountmetric.hh │ ├── incseqno.cc │ ├── incseqno.hh │ ├── linkstat.cc │ ├── linkstat.hh │ ├── linktester.cc │ ├── linktester.hh │ ├── linktestreceiver.cc │ ├── linktestreceiver.hh │ ├── linktracker.cc │ ├── linktracker.hh │ ├── lirmetric.cc │ ├── lirmetric.hh │ ├── locfromfile.cc │ ├── locfromfile.hh │ ├── locqueryresponder.cc │ ├── locqueryresponder.hh │ ├── loctable.cc │ ├── loctable.hh │ ├── lookupgeogridroute.cc │ ├── lookupgeogridroute.hh │ ├── lookuplocalgridroute.cc │ ├── lookuplocalgridroute.hh │ ├── lookuplocalgridroute2.cc │ ├── lookuplocalgridroute2.hh │ ├── lrhello.cc │ ├── lrhello.hh │ ├── movesim.cc │ ├── movesim.hh │ ├── packetlogger.cc │ ├── packetlogger.hh │ ├── packetlogger2.cc │ ├── packetlogger2.hh │ ├── pep.cc │ ├── pep.hh │ ├── pep_proto.hh │ ├── pingpong.cc │ ├── pingpong.hh │ ├── printgrid.cc │ ├── printgrid.hh │ ├── qvec.hh │ ├── radiosim.cc │ ├── radiosim.hh │ ├── region.cc │ ├── region.hh │ ├── regionpep.cc │ ├── regionpep.hh │ ├── setgridchecksum.cc │ ├── setgridchecksum.hh │ ├── simplelocquerier.cc │ ├── simplelocquerier.hh │ ├── stripdsrheader.cc │ ├── stripdsrheader.hh │ ├── threshmetric.cc │ ├── threshmetric.hh │ ├── timeutils.hh │ ├── unstripdsrheader.cc │ ├── unstripdsrheader.hh │ ├── updateroutes.cc │ ├── updateroutes.hh │ ├── yarvismetric.cc │ └── yarvismetric.hh ├── icmp │ ├── checkicmpheader.cc │ ├── checkicmpheader.hh │ ├── icmperror.cc │ ├── icmperror.hh │ ├── icmpipencap.cc │ ├── icmpipencap.hh │ ├── icmppingencap.cc │ ├── icmppingencap.hh │ ├── icmppingresponder.cc │ ├── icmppingresponder.hh │ ├── icmppingrewriter.cc │ ├── icmppingrewriter.hh │ ├── icmprewriter.cc │ ├── icmprewriter.hh │ ├── icmpsendpings.cc │ └── icmpsendpings.hh ├── ids │ ├── actypes.h │ ├── ahocorasick.c │ ├── ahocorasick.h │ ├── ahocorasickplus.cc │ ├── ahocorasickplus.hh │ ├── groupregexclassifier.cc │ ├── groupregexclassifier.hh │ ├── mpool.c │ ├── mpool.h │ ├── node.c │ ├── node.h │ ├── regexclassifier.cc │ ├── regexclassifier.hh │ ├── regexmatcher.cc │ ├── regexmatcher.hh │ ├── regexset.cc │ ├── regexset.hh │ ├── replace.c │ ├── replace.h │ ├── stringclassifier.cc │ ├── stringclassifier.hh │ ├── stringmatcher.cc │ └── stringmatcher.hh ├── ip │ ├── automarkipheader.cc │ ├── automarkipheader.hh │ ├── checkipheader.cc │ ├── checkipheader.hh │ ├── checkipheader2.cc │ ├── checkipheader2.hh │ ├── decipttl.cc │ ├── decipttl.hh │ ├── directiplookup.cc │ ├── directiplookup.hh │ ├── fixipsrc.cc │ ├── fixipsrc.hh │ ├── flowrrswitch.cc │ ├── flowrrswitch.hh │ ├── generateipfilter.cc │ ├── generateipfilter.hh │ ├── generateipflowdispatcher.cc │ ├── generateipflowdispatcher.hh │ ├── generateiplookup.cc │ ├── generateiplookup.hh │ ├── getipaddress.cc │ ├── getipaddress.hh │ ├── ipaddrpairrewriter.cc │ ├── ipaddrpairrewriter.hh │ ├── ipaddrrewriter.cc │ ├── ipaddrrewriter.hh │ ├── ipclassifier.cc │ ├── ipclassifier.hh │ ├── ipencap.cc │ ├── ipencap.hh │ ├── ipfieldinfo.cc │ ├── ipfieldinfo.hh │ ├── ipfilter.cc │ ├── ipfilter.hh │ ├── ipfragmenter.cc │ ├── ipfragmenter.hh │ ├── ipgwoptions.cc │ ├── ipgwoptions.hh │ ├── ipinputcombo.cc │ ├── ipinputcombo.hh │ ├── ipmirror.cc │ ├── ipmirror.hh │ ├── ipnameinfo.cc │ ├── ipnameinfo.hh │ ├── ipoutputcombo.cc │ ├── ipoutputcombo.hh │ ├── ipprint.cc │ ├── ipprint.hh │ ├── ipratemon.cc │ ├── ipratemon.hh │ ├── ipreassembler.cc │ ├── ipreassembler.hh │ ├── iprewriterbase.cc │ ├── iprewriterbase.hh │ ├── iprewritermap.cc │ ├── iprewritermap.hh │ ├── iproutetable.cc │ ├── iproutetable.hh │ ├── iprwmapping.cc │ ├── iprwmapping.hh │ ├── iprwpattern.cc │ ├── iprwpattern.hh │ ├── iprwpatterns.cc │ ├── iprwpatterns.hh │ ├── lineariplookup.cc │ ├── lineariplookup.hh │ ├── lookupiproute.cc │ ├── lookupiproute.hh │ ├── lookupiproutelinux.cc │ ├── lookupiproutelinux.hh │ ├── lookupiproutemp.cc │ ├── lookupiproutemp.hh │ ├── markipce.cc │ ├── markipce.hh │ ├── markipheader.cc │ ├── markipheader.hh │ ├── radixiplookup.cc │ ├── radixiplookup.hh │ ├── rangeiplookup.cc │ ├── rangeiplookup.hh │ ├── rfc2507c.cc │ ├── rfc2507c.hh │ ├── rfc2507d.cc │ ├── rfc2507d.hh │ ├── ripsend.cc │ ├── ripsend.hh │ ├── rripmapper.cc │ ├── rripmapper.hh │ ├── setipaddress.cc │ ├── setipaddress.hh │ ├── setipchecksum.cc │ ├── setipchecksum.hh │ ├── setipdscp.cc │ ├── setipdscp.hh │ ├── setipecn.cc │ ├── setipecn.hh │ ├── setrandipaddress.cc │ ├── setrandipaddress.hh │ ├── siphmapper.cc │ ├── siphmapper.hh │ ├── sortediplookup.cc │ ├── sortediplookup.hh │ ├── storeipaddress.cc │ ├── storeipaddress.hh │ ├── stripipheader.cc │ ├── stripipheader.hh │ ├── threadipmapper.cc │ ├── threadipmapper.hh │ ├── truncateippayload.cc │ ├── truncateippayload.hh │ ├── unstripipheader.cc │ └── unstripipheader.hh ├── ip6 │ ├── addresstranslator.cc │ ├── addresstranslator.hh │ ├── checkip6header.cc │ ├── checkip6header.hh │ ├── decip6hlim.cc │ ├── decip6hlim.hh │ ├── getip6address.cc │ ├── getip6address.hh │ ├── icmp6error.cc │ ├── icmp6error.hh │ ├── ip6encap.cc │ ├── ip6encap.hh │ ├── ip6fragmenter.cc │ ├── ip6fragmenter.hh │ ├── ip6mirror.cc │ ├── ip6mirror.hh │ ├── ip6print.cc │ ├── ip6print.hh │ ├── ip6routetable.cc │ ├── ip6routetable.hh │ ├── lookupip6route.cc │ ├── lookupip6route.hh │ ├── markip6header.cc │ ├── markip6header.hh │ ├── protocoltranslator46.cc │ ├── protocoltranslator46.hh │ ├── protocoltranslator64.cc │ ├── protocoltranslator64.hh │ ├── setip6address.cc │ ├── setip6address.hh │ ├── setip6dscp.cc │ └── setip6dscp.hh ├── ipsec │ ├── README │ ├── aes.cc │ ├── aes.hh │ ├── des.cc │ ├── des.hh │ ├── desp.cc │ ├── desp.hh │ ├── esp.cc │ ├── esp.hh │ ├── hmac.cc │ ├── hmac.hh │ ├── hmacsha1.cc │ ├── hmacsha1.hh │ ├── ipsecencap.cc │ ├── ipsecencap.hh │ ├── ipsecroutetable.cc │ ├── ipsecroutetable.hh │ ├── radixipseclookup.cc │ ├── radixipseclookup.hh │ ├── sadatatuple.hh │ ├── satable.cc │ ├── satable.hh │ ├── sha1.cc │ ├── sha1.hh │ ├── sha1_impl.cc │ └── sha1_impl.hh ├── linuxmodule │ ├── anydevice.cc │ ├── anydevice.hh │ ├── fastudpsrc.cc │ ├── fastudpsrc.hh │ ├── fromdevice.cc │ ├── fromdevice.hh │ ├── fromhost.cc │ ├── fromhost.hh │ ├── fromuserdevice.cc │ ├── fromuserdevice.hh │ ├── perfcountaccum.cc │ ├── perfcountaccum.hh │ ├── perfcountinfo.cc │ ├── perfcountinfo.hh │ ├── perfcountuser.cc │ ├── perfcountuser.hh │ ├── polldevice.cc │ ├── polldevice.hh │ ├── schedulelinux.cc │ ├── schedulelinux.hh │ ├── setperfcount.cc │ ├── setperfcount.hh │ ├── threadmonitor.cc │ ├── threadmonitor.hh │ ├── todevice.cc │ ├── todevice.hh │ ├── tohost.cc │ ├── tohost.hh │ ├── tohostsniffers.cc │ ├── tohostsniffers.hh │ ├── touserdevice.cc │ └── touserdevice.hh ├── local │ ├── bufconv.cc │ ├── bufconv.hh │ ├── chuckcheck.cc │ ├── chuckcheck.hh │ ├── copyflowid.cc │ ├── copyflowid.hh │ ├── copytcpseq.cc │ ├── copytcpseq.hh │ ├── duppath.cc │ ├── duppath.hh │ ├── forceicmp.cc │ ├── forceicmp.hh │ ├── forceip.cc │ ├── forceip.hh │ ├── forcetcp.cc │ ├── forcetcp.hh │ ├── forceudp.cc │ ├── forceudp.hh │ ├── indextreesiplookup.cc │ ├── indextreesiplookup.hh │ ├── print80211.cc │ ├── print80211.hh │ ├── printairo.cc │ ├── printairo.hh │ ├── reframe.cc │ ├── reframe.hh │ ├── rrunqueue.cc │ ├── rrunqueue.hh │ ├── tcpack.cc │ ├── tcpack.hh │ ├── tcpbuffer.cc │ ├── tcpbuffer.hh │ ├── tcpconn.cc │ ├── tcpconn.hh │ ├── tcpdemux.cc │ ├── tcpdemux.hh │ ├── tcpreflector.cc │ ├── tcpreflector.hh │ ├── toytcp.cc │ ├── toytcp.hh │ ├── webgen.cc │ ├── webgen.hh │ ├── webserver.cc │ └── webserver.hh ├── minios │ ├── fromdevice.cc │ ├── fromdevice.hh │ ├── todevice.cc │ └── todevice.hh ├── ns │ ├── fromsimdevice.cc │ ├── fromsimdevice.hh │ ├── simpacketanalyzer.cc │ ├── simpacketanalyzer.hh │ ├── tosimdevice.cc │ ├── tosimdevice.hh │ ├── tosimtrace.cc │ └── tosimtrace.hh ├── radio │ ├── b8b10.cc │ ├── b8b10.hh │ ├── bim-proto.hh │ ├── bim.cc │ ├── bim.hh │ ├── checkpattern.cc │ ├── checkpattern.hh │ ├── scramble.cc │ ├── scramble.hh │ ├── sendpattern.cc │ └── sendpattern.hh ├── research │ ├── countertest.cc │ ├── countertest.hh │ ├── extendedcounters.cc │ ├── extendedcounters.hh │ ├── flowipmanagerhmp.cc │ ├── flowipmanagerhmp.hh │ ├── flowipmanagerspinlock.cc │ ├── flowipmanagerspinlock.hh │ ├── flowrandload.cc │ ├── flowrandload.hh │ ├── flowworkpackage.cc │ ├── flowworkpackage.hh │ ├── randload.cc │ ├── randload.hh │ ├── workpackage.cc │ └── workpackage.hh ├── simple │ ├── simpleidle.cc │ ├── simpleidle.hh │ ├── simplepriosched.cc │ ├── simplepriosched.hh │ ├── simplepullswitch.cc │ ├── simplepullswitch.hh │ ├── simplerrsched.cc │ └── simplerrsched.hh ├── standard │ ├── addressinfo.cc │ ├── align.cc │ ├── align.hh │ ├── alignmentinfo.cc │ ├── annotationinfo.cc │ ├── annotationinfo.hh │ ├── averagecounter.cc │ ├── averagecounter.hh │ ├── bandwidthmeter.cc │ ├── bandwidthmeter.hh │ ├── bandwidthshaper.cc │ ├── bandwidthshaper.hh │ ├── block.cc │ ├── block.hh │ ├── burster.cc │ ├── burster.hh │ ├── bwratedsplitter.cc │ ├── bwratedsplitter.hh │ ├── bwratedunqueue.cc │ ├── bwratedunqueue.hh │ ├── bypass.cc │ ├── bypass.hh │ ├── checkcrc32.cc │ ├── checkcrc32.hh │ ├── checklength.cc │ ├── checklength.hh │ ├── checkpaint.cc │ ├── checkpaint.hh │ ├── classification.cc │ ├── classification.hh │ ├── classifier.cc │ ├── classifier.hh │ ├── clickyinfo.cc │ ├── clickyinfo.hh │ ├── clipboard.cc │ ├── clipboard.hh │ ├── compblock.cc │ ├── compblock.hh │ ├── counter.cc │ ├── counter.hh │ ├── cpuqueue.cc │ ├── cpuqueue.hh │ ├── cpuswitch.cc │ ├── cpuswitch.hh │ ├── delayshaper.cc │ ├── delayshaper.hh │ ├── delayunqueue.cc │ ├── delayunqueue.hh │ ├── devirtualizeinfo.cc │ ├── devirtualizeinfo.hh │ ├── discard.cc │ ├── discard.hh │ ├── discardnofree.cc │ ├── discardnofree.hh │ ├── discardnofreebuffer.cc │ ├── discardnofreebuffer.hh │ ├── drivermanager.cc │ ├── drivermanager.hh │ ├── dropbroadcasts.cc │ ├── dropbroadcasts.hh │ ├── drr.cc │ ├── drr.hh │ ├── ensureheadroom.cc │ ├── ensureheadroom.hh │ ├── errorelement.cc │ ├── exactcpuswitch.cc │ ├── exactcpuswitch.hh │ ├── flowinfo.cc │ ├── flowinfo.hh │ ├── frontdropqueue.cc │ ├── frontdropqueue.hh │ ├── fullnotequeue.cc │ ├── fullnotequeue.hh │ ├── hashswitch.cc │ ├── hashswitch.hh │ ├── hub.cc │ ├── hub.hh │ ├── idle.cc │ ├── idle.hh │ ├── infinitesource.cc │ ├── infinitesource.hh │ ├── inputswitch.cc │ ├── inputswitch.hh │ ├── linkunqueue.cc │ ├── linkunqueue.hh │ ├── markmacheader.cc │ ├── markmacheader.hh │ ├── messageelement.cc │ ├── messageelement.hh │ ├── meter.cc │ ├── meter.hh │ ├── minbatch.cc │ ├── minbatch.hh │ ├── mixedqueue.cc │ ├── mixedqueue.hh │ ├── movedata.cc │ ├── movedata.hh │ ├── msqueue.cc │ ├── msqueue.hh │ ├── multicounter.cc │ ├── multicounter.hh │ ├── notifierqueue.cc │ ├── notifierqueue.hh │ ├── nullelement.cc │ ├── nullelement.hh │ ├── nulls.cc │ ├── nulls.hh │ ├── pad.cc │ ├── pad.hh │ ├── paint.cc │ ├── paint.hh │ ├── paint2.cc │ ├── paint2.hh │ ├── paintrr.cc │ ├── paintrr.hh │ ├── paintswitch.cc │ ├── paintswitch.hh │ ├── painttee.cc │ ├── painttee.hh │ ├── pipeliner.cc │ ├── pipeliner.hh │ ├── portinfo.cc │ ├── print.cc │ ├── print.hh │ ├── priosched.cc │ ├── priosched.hh │ ├── pullswitch.cc │ ├── pullswitch.hh │ ├── quicknotequeue.cc │ ├── quicknotequeue.hh │ ├── quitwatcher.cc │ ├── quitwatcher.hh │ ├── randomerror.cc │ ├── randomerror.hh │ ├── randomsample.cc │ ├── randomsample.hh │ ├── randomsource.cc │ ├── randomsource.hh │ ├── randomswitch.cc │ ├── randomswitch.hh │ ├── ratedsource.cc │ ├── ratedsource.hh │ ├── ratedsplitter.cc │ ├── ratedsplitter.hh │ ├── ratedunqueue.cc │ ├── ratedunqueue.hh │ ├── resize.cc │ ├── resize.hh │ ├── rrmultisched.cc │ ├── rrmultisched.hh │ ├── rrsched.cc │ ├── rrsched.hh │ ├── rrswitch.cc │ ├── rrswitch.hh │ ├── scheduleinfo.cc │ ├── script.cc │ ├── script.hh │ ├── search.cc │ ├── search.hh │ ├── setannobyte.cc │ ├── setannobyte.hh │ ├── setcrc32.cc │ ├── setcrc32.hh │ ├── setpackettype.cc │ ├── setpackettype.hh │ ├── settimestamp.cc │ ├── settimestamp.hh │ ├── shaper.cc │ ├── shaper.hh │ ├── simplequeue.cc │ ├── simplequeue.hh │ ├── staticpullswitch.cc │ ├── staticpullswitch.hh │ ├── staticswitch.cc │ ├── staticswitch.hh │ ├── storedata.cc │ ├── storedata.hh │ ├── stridesched.cc │ ├── stridesched.hh │ ├── strideswitch.cc │ ├── strideswitch.hh │ ├── strip.cc │ ├── strip.hh │ ├── striptonet.cc │ ├── striptonet.hh │ ├── suppressor.cc │ ├── suppressor.hh │ ├── switch.cc │ ├── switch.hh │ ├── tee.cc │ ├── tee.hh │ ├── threadsafequeue.cc │ ├── threadsafequeue.hh │ ├── timedsink.cc │ ├── timedsink.hh │ ├── timedsource.cc │ ├── timedsource.hh │ ├── timedunqueue.cc │ ├── timedunqueue.hh │ ├── truncate.cc │ ├── truncate.hh │ ├── unqueue.cc │ ├── unqueue.hh │ ├── unqueue2.cc │ ├── unqueue2.hh │ ├── unstrip.cc │ ├── unstrip.hh │ ├── unstripanno.cc │ └── unstripanno.hh ├── tcpudp │ ├── checktcpheader.cc │ ├── checktcpheader.hh │ ├── checkudpheader.cc │ ├── checkudpheader.hh │ ├── dynudpipencap.cc │ ├── dynudpipencap.hh │ ├── fasttcpflows.cc │ ├── fasttcpflows.hh │ ├── fastudpflows.cc │ ├── fastudpflows.hh │ ├── fastudpsrcip6.cc │ ├── fastudpsrcip6.hh │ ├── iploadbalancer.cc │ ├── iploadbalancer.hh │ ├── iprewriter.cc │ ├── iprewriter.hh │ ├── networkdirectionswap.cc │ ├── networkdirectionswap.hh │ ├── networkheaderfieldsrewriter.cc │ ├── networkheaderfieldsrewriter.hh │ ├── resetipchecksum.cc │ ├── resetipchecksum.hh │ ├── settcpchecksum.cc │ ├── settcpchecksum.hh │ ├── setudpchecksum.cc │ ├── setudpchecksum.hh │ ├── snooptcp.cc │ ├── snooptcp.hh │ ├── statelesstcpresp.cc │ ├── statelesstcpresp.hh │ ├── striptcpheader.cc │ ├── striptcpheader.hh │ ├── striptransportheader.cc │ ├── striptransportheader.hh │ ├── tcpfragmenter.cc │ ├── tcpfragmenter.hh │ ├── tcpipsend.cc │ ├── tcpipsend.hh │ ├── tcprewriter.cc │ ├── tcprewriter.hh │ ├── udpip6encap.cc │ ├── udpip6encap.hh │ ├── udpipencap.cc │ ├── udpipencap.hh │ ├── udprewriter.cc │ ├── udprewriter.hh │ ├── unstriptcpheader.cc │ ├── unstriptcpheader.hh │ ├── unstriptransportheader.cc │ └── unstriptransportheader.hh ├── test │ ├── batchtest.cc │ ├── batchtest.hh │ ├── bhmtest.cc │ ├── bhmtest.hh │ ├── biginttest.cc │ ├── biginttest.hh │ ├── bitvectortest.cc │ ├── bitvectortest.hh │ ├── blockthread.cc │ ├── blockthread.hh │ ├── checkpacket.cc │ ├── checkpacket.hh │ ├── clptest.cc │ ├── clptest.hh │ ├── comparepackets.cc │ ├── comparepackets.hh │ ├── confparsetest.cc │ ├── confparsetest.hh │ ├── cryptotest.cc │ ├── cryptotest.hh │ ├── dequetest.cc │ ├── dequetest.hh │ ├── errortest.cc │ ├── errortest.hh │ ├── functiontest.cc │ ├── functiontest.hh │ ├── handlertask.cc │ ├── handlertask.hh │ ├── hashtablemptest.cc │ ├── hashtablemptest.hh │ ├── hashtabletest.cc │ ├── hashtabletest.hh │ ├── heaptest.cc │ ├── heaptest.hh │ ├── jsontest.cc │ ├── jsontest.hh │ ├── listtest.cc │ ├── listtest.hh │ ├── mtdietest.cc │ ├── mtdietest.hh │ ├── neighborhoodtest.cc │ ├── neighborhoodtest.hh │ ├── notifierdebug.cc │ ├── notifierdebug.hh │ ├── notifiertest.cc │ ├── notifiertest.hh │ ├── nulltask.cc │ ├── nulltask.hh │ ├── packettest.cc │ ├── packettest.hh │ ├── queuethreadtest.cc │ ├── queuethreadtest.hh │ ├── queueyanktest.cc │ ├── queueyanktest.hh │ ├── randomseed.cc │ ├── randomseed.hh │ ├── rcutest.cc │ ├── rcutest.hh │ ├── schedordertest.cc │ ├── schedordertest.hh │ ├── sorttest.cc │ ├── sorttest.hh │ ├── stringtest.cc │ ├── stringtest.hh │ ├── taskthreadtest.cc │ ├── taskthreadtest.hh │ ├── testflowspace.cc │ ├── testflowspace.hh │ ├── timertest.cc │ ├── timertest.hh │ ├── tokenbuckettest.cc │ ├── tokenbuckettest.hh │ ├── upstreamnotifier.cc │ ├── upstreamnotifier.hh │ ├── vectortest.cc │ └── vectortest.hh ├── threads │ ├── balancedthreadsched.cc │ ├── balancedthreadsched.hh │ ├── pathspinlock.cc │ ├── pathspinlock.hh │ ├── spinlockacquire.cc │ ├── spinlockacquire.hh │ ├── spinlockinfo.cc │ ├── spinlockinfo.hh │ ├── spinlockrelease.cc │ ├── spinlockrelease.hh │ ├── staticthreadsched.cc │ └── staticthreadsched.hh ├── tunnel │ ├── erspandecap.cc │ ├── erspandecap.hh │ ├── gtpdecap.cc │ ├── gtpdecap.hh │ ├── gtpencap.cc │ ├── gtpencap.hh │ ├── gtplookup.cc │ ├── gtplookup.hh │ ├── gtptable.cc │ └── gtptable.hh ├── userlevel │ ├── blackboxnf.cc │ ├── blackboxnf.hh │ ├── changeuid.cc │ ├── changeuid.hh │ ├── chattersocket.cc │ ├── chattersocket.hh │ ├── controlsocket.cc │ ├── controlsocket.hh │ ├── counterfile.cc │ ├── counterfile.hh │ ├── devicebalancer.cc │ ├── devicebalancer.hh │ ├── dpdkdevclock.cc │ ├── dpdkdevclock.hh │ ├── dpdkinfo.cc │ ├── dpdkinfo.hh │ ├── ensuredpdkbuffer.cc │ ├── ensuredpdkbuffer.hh │ ├── ensurenetmapbuffer.cc │ ├── ensurenetmapbuffer.hh │ ├── fakepcap.cc │ ├── fakepcap.hh │ ├── fastudpsrc.cc │ ├── fastudpsrc.hh │ ├── fromdevice.cc │ ├── fromdevice.hh │ ├── fromdpdkdevice.cc │ ├── fromdpdkdevice.hh │ ├── fromdpdkring.cc │ ├── fromdpdkring.hh │ ├── fromdump.cc │ ├── fromdump.hh │ ├── fromhost.cc │ ├── fromhost.hh │ ├── fromnetmapdevice.cc │ ├── fromnetmapdevice.hh │ ├── fromrawsocket.cc │ ├── fromrawsocket.hh │ ├── fromsocket.cc │ ├── fromsocket.hh │ ├── handlerproxy.cc │ ├── handlerproxy.hh │ ├── httpserver.cc │ ├── httpserver.hh │ ├── ipflowrawsockets.cc │ ├── ipflowrawsockets.hh │ ├── jiffieclock.cc │ ├── jiffieclock.hh │ ├── kernelfilter.cc │ ├── kernelfilter.hh │ ├── kerneltap.cc │ ├── kerneltap.hh │ ├── kerneltun.cc │ ├── kerneltun.hh │ ├── khandlerproxy.cc │ ├── khandlerproxy.hh │ ├── linuxclock.cc │ ├── linuxclock.hh │ ├── mbgclock.cc │ ├── mbgclock.hh │ ├── mcastsocket.cc │ ├── mcastsocket.hh │ ├── metron.cc │ ├── metron.hh │ ├── monitoringreportsocket.cc │ ├── monitoringreportsocket.hh │ ├── netmapinfo.cc │ ├── netmapinfo.hh │ ├── printold.cc │ ├── printold.hh │ ├── progressbar.cc │ ├── progressbar.hh │ ├── queuedevice.cc │ ├── queuedevice.hh │ ├── rawsocket.cc │ ├── rawsocket.hh │ ├── socket.cc │ ├── socket.hh │ ├── todevice.cc │ ├── todevice.hh │ ├── todpdkdevice.cc │ ├── todpdkdevice.hh │ ├── todpdkring.cc │ ├── todpdkring.hh │ ├── todump.cc │ ├── todump.hh │ ├── tohost.cc │ ├── tohost.hh │ ├── tonetmapdevice.cc │ ├── tonetmapdevice.hh │ ├── torawsocket.cc │ ├── torawsocket.hh │ ├── tosocket.cc │ ├── tosocket.hh │ ├── tscclock.cc │ ├── tscclock.hh │ ├── umlswitch.cc │ ├── umlswitch.hh │ ├── xdploader.cc │ └── xdploader.hh └── wifi │ ├── ap │ ├── associationresponder.cc │ ├── associationresponder.hh │ ├── beaconsource.cc │ ├── beaconsource.hh │ ├── openauthresponder.cc │ ├── openauthresponder.hh │ ├── proberesponder.cc │ ├── proberesponder.hh │ ├── stationtable.cc │ └── stationtable.hh │ ├── athdesc.h │ ├── athdescdecap.cc │ ├── athdescdecap.hh │ ├── athdescencap.cc │ ├── athdescencap.hh │ ├── autoratefallback.cc │ ├── autoratefallback.hh │ ├── availablerates.cc │ ├── availablerates.hh │ ├── bitrate.cc │ ├── bitrate.hh │ ├── ethercount.cc │ ├── ethercount.hh │ ├── extradecap.cc │ ├── extradecap.hh │ ├── extraencap.cc │ ├── extraencap.hh │ ├── filterfailures.cc │ ├── filterfailures.hh │ ├── filterphyerr.cc │ ├── filterphyerr.hh │ ├── filtertx.cc │ ├── filtertx.hh │ ├── fromhandler.cc │ ├── fromhandler.hh │ ├── linktable.cc │ ├── linktable.hh │ ├── madwifirate.cc │ ├── madwifirate.hh │ ├── packetstore.cc │ ├── packetstore.hh │ ├── path.hh │ ├── printtxfeedback.cc │ ├── printtxfeedback.hh │ ├── printwifi.cc │ ├── printwifi.hh │ ├── prism2decap.cc │ ├── prism2decap.hh │ ├── prism2encap.cc │ ├── prism2encap.hh │ ├── probetxrate.cc │ ├── probetxrate.hh │ ├── pushanno.cc │ ├── pushanno.hh │ ├── radiotapdecap.cc │ ├── radiotapdecap.hh │ ├── radiotapencap.cc │ ├── radiotapencap.hh │ ├── rc4.cc │ ├── rc4.hh │ ├── readanno.cc │ ├── readanno.hh │ ├── rxstats.cc │ ├── rxstats.hh │ ├── setnoack.cc │ ├── setnoack.hh │ ├── setrts.cc │ ├── setrts.hh │ ├── settxpower.cc │ ├── settxpower.hh │ ├── settxrate.cc │ ├── settxrate.hh │ ├── station │ ├── associationrequester.cc │ ├── associationrequester.hh │ ├── beaconscanner.cc │ ├── beaconscanner.hh │ ├── beacontracker.cc │ ├── beacontracker.hh │ ├── openauthrequester.cc │ ├── openauthrequester.hh │ ├── proberequester.cc │ └── proberequester.hh │ ├── wepdecap.cc │ ├── wepdecap.hh │ ├── wepencap.cc │ ├── wepencap.hh │ ├── wifidecap.cc │ ├── wifidecap.hh │ ├── wifidefrag.cc │ ├── wifidefrag.hh │ ├── wifidupefilter.cc │ ├── wifidupefilter.hh │ ├── wifiencap.cc │ ├── wifiencap.hh │ ├── wififragment.cc │ ├── wififragment.hh │ ├── wifiseq.cc │ ├── wifiseq.hh │ ├── wirelessinfo.cc │ └── wirelessinfo.hh ├── etc ├── .gitignore ├── COPYING ├── COPYING.lgpl ├── click.vim ├── diagrams │ ├── .gitignore │ ├── Makefile │ ├── README │ ├── elements.mp │ ├── elemfig.sty │ ├── fonts.mp │ ├── samp01_examples.mp │ ├── samp02_processing.mp │ ├── samp03_routers.mp │ ├── samp04_iprouter.mp │ └── samp05_other.mp ├── elementmap.xsl ├── freebsd-4.3-patch ├── libclick │ ├── .gitignore │ ├── DISTFILES │ ├── Makefile.in │ ├── lc-Makefile.in │ ├── lc-configure.ac │ ├── lc-gitignore │ └── lc-libsrc-Makefile.in ├── linux-2.6.16.13-patch ├── linux-2.6.19.2-patch ├── linux-2.6.24.7-patch ├── make-bsd-patch ├── make-linux-patch ├── ns-2.30-patch ├── ns-2.34-patch ├── pcmcia-cs-3.1.16-patch ├── restore-bsd ├── restore-linux ├── restore-linux24 ├── ron │ ├── .gitignore │ ├── Makefile.in │ ├── changeuid.cc │ ├── changeuid.hh │ ├── config.h │ ├── config.h.in │ ├── configure.ac │ ├── discardnotify.cc │ ├── discardnotify.hh │ ├── divertsocket.cc │ ├── divertsocket.hh │ ├── install-sh │ ├── ipdecappaint.cc │ ├── ipdecappaint.hh │ ├── ipencap2.cc │ ├── ipencap2.hh │ ├── ipencappaint.cc │ ├── ipencappaint.hh │ ├── lookupiprouteron.cc │ ├── lookupiprouteron.hh │ ├── missing │ ├── mkinstalldirs │ ├── policyprobe.cc │ ├── policyprobe.hh │ ├── portclassifier.cc │ ├── portclassifier.hh │ ├── printtime.cc │ ├── printtime.hh │ ├── queuenotify.cc │ ├── queuenotify.hh │ ├── ronroutemodular.cc │ ├── ronroutemodular.hh │ ├── todevicenotify.cc │ └── todevicenotify.hh ├── samplellrpc │ ├── .gitignore │ ├── Makefile │ ├── README │ └── click-readcounter.c └── samplepackage │ ├── .gitignore │ ├── Makefile.in │ ├── README │ ├── configure.ac │ ├── sampleelt.cc │ ├── sampleelt.hh │ └── test.click ├── exopc ├── .gitignore ├── Makefile.in ├── click.cc ├── cross-compile.sh ├── samples │ ├── icmp.quad │ ├── icmp.smp │ └── icmp.uni └── syscall.c ├── img └── metron-agent-arch.png ├── include ├── .gitignore ├── click │ ├── .gitignore │ ├── algorithm.hh │ ├── allocator.hh │ ├── archive.hh │ ├── args.hh │ ├── array_memory.hh │ ├── atomic.hh │ ├── batchbuilder.hh │ ├── batchelement.hh │ ├── bighashmap.cc │ ├── bighashmap.hh │ ├── bighashmap_arena.hh │ ├── bigint.hh │ ├── bitvector.hh │ ├── clp.h │ ├── confparse.hh │ ├── crc32.h │ ├── cxxprotect.h │ ├── cxxunprotect.h │ ├── deque.cc │ ├── deque.hh │ ├── dequeue.hh │ ├── dpdk_glue.hh │ ├── dpdkdevice.hh │ ├── driver.hh │ ├── element.hh │ ├── elemfilter.hh │ ├── error.hh │ ├── etheraddress.hh │ ├── ewma.hh │ ├── fixconfig.h │ ├── flow │ │ ├── common.hh │ │ ├── flow.hh │ │ └── flowelement.hh │ ├── flowrulecache.hh │ ├── flowrulemanager.hh │ ├── flowruleparser.hh │ ├── fromfile.hh │ ├── gaprate.hh │ ├── glue.hh │ ├── handler.hh │ ├── handlercall.hh │ ├── hashallocator.hh │ ├── hashcode.hh │ ├── hashcontainer.hh │ ├── hashmap.cc │ ├── hashmap.hh │ ├── hashtable.hh │ ├── hashtablemp.hh │ ├── heap.hh │ ├── icmpflowid.hh │ ├── ino.hh │ ├── integers.hh │ ├── ip6address.hh │ ├── ip6flowid.hh │ ├── ip6table.hh │ ├── ipaddress.hh │ ├── ipaddresslist.hh │ ├── ipelement.hh │ ├── ipflowid.hh │ ├── iphelper.hh │ ├── iptable.hh │ ├── json.hh │ ├── lexer.hh │ ├── libdivide.h │ ├── list.hh │ ├── llrpc.h │ ├── loadbalancer.hh │ ├── machine.hh │ ├── master.hh │ ├── md5.h │ ├── multithread.hh │ ├── nameinfo.hh │ ├── netmapdevice.hh │ ├── notifier.hh │ ├── numa.hh │ ├── package.hh │ ├── packet.hh │ ├── packet_anno.hh │ ├── packetbatch.hh │ ├── pair.hh │ ├── perfctr-i586.hh │ ├── ring.hh │ ├── router.hh │ ├── routerthread.hh │ ├── routervisitor.hh │ ├── selectset.hh │ ├── simclick.h │ ├── skbmgr.hh │ ├── standard │ │ ├── addressinfo.hh │ │ ├── alignmentinfo.hh │ │ ├── errorelement.hh │ │ ├── portinfo.hh │ │ ├── scheduleinfo.hh │ │ ├── storage.hh │ │ └── threadsched.hh │ ├── statvector.hh │ ├── straccum.hh │ ├── string.hh │ ├── sync.hh │ ├── task.hh │ ├── tcpelement.hh │ ├── tcphelper.hh │ ├── timer.hh │ ├── timerset.hh │ ├── timerwheel.hh │ ├── timestamp.hh │ ├── tinyexpr.hh │ ├── tokenbucket.hh │ ├── type_traits.hh │ ├── userutils.hh │ ├── variableenv.hh │ ├── vector.cc │ └── vector.hh ├── clicknet │ ├── dhcp.h │ ├── erspan.h │ ├── ether.h │ ├── fddi.h │ ├── gtp.h │ ├── icmp.h │ ├── icmp6.h │ ├── ip.h │ ├── ip6.h │ ├── llc.h │ ├── ppp.h │ ├── radiotap.h │ ├── rfc1483.h │ ├── tcp.h │ ├── udp.h │ └── wifi.h └── metron │ └── servicechain.hh ├── install-sh ├── installch.in ├── lib ├── allocator.cc ├── archive.cc ├── args.cc ├── atomic.cc ├── batchelement.cc ├── bighashmap_arena.cc ├── bitvector.cc ├── clp.c ├── confparse.cc ├── crc32.c ├── dpdkdevice.cc ├── driver.cc ├── element.cc ├── elemfilter.cc ├── error.cc ├── etheraddress.cc ├── exportstub.cc ├── flow.cc ├── flowelement.cc ├── flowrulecache.cc ├── flowrulemanager.cc ├── flowruleparser.cc ├── fromfile.cc ├── gaprate.cc ├── glue.cc ├── handlercall.cc ├── hashallocator.cc ├── in_cksum.c ├── ino.cc ├── integers.cc ├── ip6address.cc ├── ip6flowid.cc ├── ip6table.cc ├── ipaddress.cc ├── ipflowid.cc ├── iptable.cc ├── json.cc ├── lexer.cc ├── master.cc ├── md5.cc ├── metron │ └── servicechain.cc ├── nameinfo.cc ├── netmapdevice.cc ├── notifier.cc ├── packet.cc ├── packetbatch.cc ├── router.cc ├── routerthread.cc ├── routervisitor.cc ├── selectset.cc ├── straccum.cc ├── strerror.c ├── string.cc ├── task.cc ├── tcpelement.cc ├── tcphelper.cc ├── timer.cc ├── timerset.cc ├── timestamp.cc ├── userutils.cc └── variableenv.cc ├── linuxmodule ├── .gitignore ├── Makefile.in ├── click-linuxtool.pl ├── clickfs.cc ├── config.cc ├── kernelversion.c ├── module.cc ├── moduleparm.h ├── modulepriv.hh ├── proclikefs.c ├── proclikefs.h ├── read-pmc.c ├── sched.cc └── skbmgr.cc ├── m4 ├── ax_check_compile_flag.m4 └── click.m4 ├── mininet ├── README.md ├── Vagrantfile └── switch │ ├── topology-mininetonly.py │ └── topology.py ├── minios ├── .gitignore ├── LICENSE ├── Makefile.in ├── click.cc ├── config.mk.in ├── config.xen └── elements.exclude ├── missing ├── mkinstalldirs ├── ns ├── .gitignore ├── CUT_BinHeap.h ├── Makefile.in ├── nsclick-test.cc └── nsclick.cc ├── pathvars.h.in ├── share └── click │ ├── pkg-Makefile │ ├── pkg-bsdmodule.mk │ ├── pkg-config.mk.in │ ├── pkg-linuxmodule-26.mk │ ├── pkg-linuxmodule.mk │ └── pkg-userlevel.mk ├── test ├── IPRewriter │ ├── FTPPortMapper-01.testie │ ├── ICMPPingRewriter-01.testie │ ├── ICMPPingRewriter-02.testie │ ├── IPAddrPairRewriter-01.testie │ ├── IPAddrPairRewriter-02.testie │ ├── IPAddrRewriter-01.testie │ ├── IPAddrRewriter-02.testie │ ├── IPAddrRewriter-03.testie │ ├── IPRewriter-01.testie │ ├── IPRewriter-02.testie │ ├── IPRewriter-03.testie │ ├── IPRewriter-04.testie │ ├── IPRewriter-09.testie │ ├── IPRewriter-10.testie │ ├── IPRewriter-11.testie │ ├── IPRewriter-12.testie │ ├── IPRewriter-15.testie │ ├── IPRewriter-16.testie │ ├── IPRewriter-17.testie │ ├── RoundRobinIPMapper-01.testie │ ├── TCPRewriter-01-StateMigration.testie │ ├── TCPRewriter-01.testie │ ├── TCPRewriter-02.testie │ ├── TCPRewriter-03.testie │ ├── TCPRewriter-04.testie │ ├── ThreadIPMapper-01.testie │ ├── UDPRewriter-01.testie │ ├── UDPRewriter-02.testie │ ├── UDPRewriter-03.testie │ ├── UDPRewriter-04.testie │ ├── UDPRewriter-09.testie │ ├── UDPRewriter-11.testie │ ├── UDPRewriter-12.testie │ ├── UDPRewriter-13.testie │ ├── UDPRewriter-IMP-01.testie │ ├── UDPRewriter-StateMigration-01.testie │ └── agg-01.testie ├── analysis │ ├── AdjustTimestamp-01.testie │ ├── AggregateCounter-01.testie │ ├── AggregateIPFlows-01.testie │ ├── FromIPSummaryDump-01.testie │ ├── FromIPSummaryDump-02.testie │ ├── FromIPSummaryDump-ipopt-01.testie │ ├── FromTcpdump-01.testie │ ├── FromTcpdump-02.testie │ ├── IPSummaryDump-01.testie │ ├── IPSummaryDump-02.testie │ ├── NumberPacket-01.testie │ ├── Replay-01.testie │ ├── Replay-Timing-01.testie │ ├── TimeFilter-01.testie │ ├── TimeSortedSched-01.testie │ ├── TimeSortedSched-02.testie │ ├── latency-01.testie │ ├── latency-02.testie │ └── latency-begin.testie ├── batch │ ├── autobatch.testie │ └── jumpbatch.testie ├── compound │ ├── compact-01.testie │ ├── input-01.testie │ ├── overload-01.testie │ └── variables-01.testie ├── ethernet │ ├── ARPQuerier-01.testie │ ├── ARPQuerier-02.testie │ ├── ARPQuerier-03.testie │ ├── ARPQuerier-04.testie │ ├── ARPQuerier-05.testie │ ├── ARPQuerier-06.testie │ ├── ARPQuerier-07.testie │ ├── ARPQuerier-08.testie │ ├── ARPResponder-01.testie │ ├── EtherEncap-01.testie │ ├── EtherVLANEncap-01.testie │ ├── VLANEncap-01.testie │ └── VLANEncap-02.testie ├── flow │ ├── flowhyperscan-01.testie │ ├── flowipnat-01.testie │ └── flowspace-01.testie ├── gtp │ └── GTPEncap-01.testie ├── handlers │ ├── KernelHandlerProxy-01.testie │ ├── expansion-01.testie │ ├── handlercall-01.testie │ ├── kernel-01.testie │ └── privatehandler-01.testie ├── icmp │ ├── ICMPError-sourceroute-01.testie │ ├── ICMPIPEncap-01.testie │ ├── ICMPPingEncap-01.testie │ ├── ICMPRewriter-01.testie │ ├── ICMPRewriter-02.testie │ └── ICMPRewriter-03.testie ├── ip │ ├── AddressInfo-bcast-01.testie │ ├── IPFilter-01.testie │ ├── IPFilter-02.testie │ ├── IPFilter-03.testie │ ├── IPFilter-04.testie │ ├── IPFilter-05.testie │ ├── IPFilter-06.testie │ ├── IPFilter-07.testie │ ├── IPFilter-08.testie │ ├── IPFragmenter-01.testie │ ├── IPFragmenter-02.testie │ ├── IPPrint-01.testie │ ├── IPReassembler-01.testie │ ├── MarkIPCE-01.testie │ ├── SetIPDSCP-01.testie │ ├── StoreIPAddress-01.testie │ ├── iplookups-01.testie │ └── iplookups-02.testie ├── linuxmodule │ ├── ToHost-01.testie │ ├── ToHost-02.testie │ ├── ToHost-udpsocket-01.testie │ ├── clickfs-01.testie │ └── deviceup-01.testie ├── standard │ ├── AlignmentInfo-01.testie │ ├── BandwidthRatedSplitter-01.testie │ ├── BandwidthRatedUnqueue-01.testie │ ├── Bypass-01.testie │ ├── Bypass-02.testie │ ├── Classifier-01.testie │ ├── Classifier-02.testie │ ├── Clipboard-01.testie │ ├── DelayShaper-notifier-01.testie │ ├── FrontDropQueue-01.testie │ ├── FullNoteQueue-upstream-notifier-01.testie │ ├── Hub-01.testie │ ├── Idle-01.testie │ ├── LinkUnqueue-01.testie │ ├── MixedQueue-01.testie │ ├── MixedQueue-02.testie │ ├── MoveData-01.testie │ ├── Pad-01.testie │ ├── PaintRR-01.testie │ ├── PullSwitch-01.testie │ ├── Queue-notifiers-01.testie │ ├── Queue-yank-01.testie │ ├── QuickNoteQueue-01.testie │ ├── RatedSplitter-01.testie │ ├── RatedUnqueue-01.testie │ ├── Resize-01.testie │ ├── Script-01.testie │ ├── Script-02.testie │ ├── Script-03.testie │ ├── Script-04.testie │ ├── Script-05.testie │ ├── Shaper-01.testie │ ├── StoreData-01.testie │ ├── StrideSched-01.testie │ ├── Tee-01.testie │ ├── Unqueue-01.testie │ ├── bigint-01.testie │ ├── bitvector-01.testie │ ├── confparse-01.testie │ ├── crypto-01.testie │ ├── deque-01.testie │ ├── error-01.testie │ ├── functions-01.testie │ ├── hashtable-01.testie │ ├── hashtablemp-01.testie │ ├── heap-01.testie │ ├── landmarks-01.testie │ ├── library-01.testie │ ├── list-01.testie │ ├── neighborhood-01.testie │ ├── notifier-01.testie │ ├── notifier-02.testie │ ├── notifier-03.testie │ ├── notifier-04.testie │ ├── notifier-05.testie │ ├── notifier-06.testie │ ├── perf-01.testie │ ├── search-01.testie │ ├── sort-01.testie │ ├── string-01.testie │ ├── timer-01.testie │ ├── timer-02.testie │ ├── tokenbucket-01.testie │ └── vector-01.testie ├── tcpudp │ ├── StripTCPHeader-01.testie │ └── UDPIPEncap-01.testie ├── testie ├── threads │ ├── CounterMP-01.testie │ ├── CounterMP-02.testie │ ├── IsFullpush-01.testie │ ├── MTDieTest-01.testie │ ├── Pipeliner-01.testie │ ├── Pipeliner-02.testie │ ├── Pipeliner-03.testie │ ├── RCUTest-01.testie │ ├── StaticThreadSched-01.testie │ ├── StaticThreadSched-02.testie │ ├── affinity-01.testie │ ├── threadvector-cpuswitch.testie │ └── threadvector-exactcpuswitch.testie ├── tools │ ├── align-01.testie │ ├── align-02.testie │ ├── align-03.testie │ ├── combine-01.testie │ ├── fastclassifier-01.testie │ ├── lexer-01.testie │ ├── lexer-02.testie │ ├── lexer-03.testie │ ├── lexer-04.testie │ ├── lexer-05.testie │ ├── lexer-06.testie │ ├── lexer-07.testie │ ├── lexer-08.testie │ ├── lexer-09.testie │ ├── mkmindriver-01.testie │ ├── mkmindriver-02.testie │ ├── testie-01.testie │ ├── testie-02.testie │ ├── testie-03.testie │ ├── undead-01.testie │ └── xform-ip-01.testie └── userlevel │ ├── ControlSocket-llrpc-01.testie │ ├── ControlSocket-llrpc-02.testie │ ├── McastSocket-01.testie │ ├── McastSocket-02.testie │ ├── McastSocket-03.testie │ ├── Script-signal-01.testie │ ├── Script-signal-02.testie │ ├── Script-signal-03.testie │ ├── clp-01.testie │ ├── dpdk.testie │ ├── iprouter-01.testie │ ├── netmap-01.testie │ ├── netmap-02.testie │ ├── packetpool-01.testie │ ├── packetpool-02.testie │ ├── string-01.testie │ ├── timer-systime-01.testie │ ├── timewarp-01.testie │ └── uhotswap-01.testie ├── tools ├── .gitignore ├── Makefile.in ├── click-align │ ├── .gitignore │ ├── Makefile.in │ ├── alignclass.cc │ ├── alignclass.hh │ ├── alignment.cc │ ├── alignment.hh │ └── click-align.cc ├── click-check │ ├── .gitignore │ ├── Makefile.in │ └── click-check.cc ├── click-combine │ ├── .gitignore │ ├── Makefile.in │ ├── click-combine.cc │ └── click-uncombine.cc ├── click-devirtualize │ ├── .gitignore │ ├── Makefile.in │ ├── click-devirtualize.cc │ ├── cxxclass.cc │ ├── cxxclass.hh │ ├── signature.cc │ ├── signature.hh │ ├── specializer.cc │ └── specializer.hh ├── click-fastclassifier │ ├── .gitignore │ ├── Makefile.in │ ├── click-fastclassifier.cc │ ├── click-fastclassifier.hh │ ├── fc_classifier.cc │ └── fc_ipclassifier.cc ├── click-flatten │ ├── .gitignore │ ├── Makefile.in │ └── click-flatten.cc ├── click-install │ ├── .gitignore │ ├── Makefile.in │ ├── click-install.cc │ ├── click-uninstall.cc │ ├── common.cc │ └── common.hh ├── click-mkmindriver │ ├── .gitignore │ ├── Makefile.in │ └── click-mkmindriver.cc ├── click-pretty │ ├── .gitignore │ ├── Makefile.in │ ├── click-pretty.cc │ ├── html.cc │ └── html.hh ├── click-undead │ ├── .gitignore │ ├── Makefile.in │ └── click-undead.cc ├── click-viz ├── click-xform │ ├── .gitignore │ ├── Makefile.in │ ├── adjacency.cc │ ├── adjacency.hh │ └── click-xform.cc ├── click2xml │ ├── .gitignore │ ├── Makefile.in │ ├── click2xml.cc │ ├── clickconfig.dtd │ ├── xml2click.cc │ └── xml2click.hh ├── grid-params.m4 ├── lib │ ├── .gitignore │ ├── Makefile.in │ ├── eclasst.cc │ ├── eclasst.hh │ ├── elementmap.cc │ ├── elementmap.hh │ ├── elementt.cc │ ├── elementt.hh │ ├── etraits.cc │ ├── etraits.hh │ ├── landmarkt.cc │ ├── landmarkt.hh │ ├── lexert.cc │ ├── lexert.hh │ ├── lexertinfo.cc │ ├── lexertinfo.hh │ ├── processingt.cc │ ├── processingt.hh │ ├── routert.cc │ ├── routert.hh │ ├── runparse.cc │ ├── runparse.hh │ ├── toolutils.cc │ └── toolutils.hh └── make-linux-patch ├── userlevel ├── .gitignore ├── Makefile.in ├── click.cc ├── dpdk.mk └── rte_parse.mk └── vendor ├── nicscheduler ├── ethernetdevice.hh ├── methods │ ├── metron.cc │ ├── metron.hh │ ├── rss.cc │ ├── rss.hh │ ├── rsspp.cc │ ├── rsspp.hh │ ├── rssrr.cc │ ├── rssrr.hh │ └── solver.hh ├── nicscheduler.cc └── nicscheduler.hh └── tinyexpr ├── LICENSE ├── tinyexpr.c └── tinyexpr.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.dSYM 2 | +* 3 | .dotest 4 | .idea 5 | .*.cmd 6 | .dotest 7 | .vimhistory 8 | Makefile 9 | autom4te* 10 | bin 11 | click-buildtool 12 | click-compile 13 | config.cache 14 | config.h 15 | config.log 16 | config.mk 17 | config.status 18 | configure.lineno 19 | depcomp 20 | elementmap 21 | elementmap.xml 22 | etc/pkg-config.mk 23 | installch 24 | man 25 | share/click/config.mk 26 | share/click/elementmap.xml 27 | share/click/pkg-config.mk 28 | stamp-egroup 29 | stamp-h 30 | /Debug/ 31 | -------------------------------------------------------------------------------- /NODIST: -------------------------------------------------------------------------------- 1 | elements/local/*.hh 2 | elements/local/*.cc 3 | -------------------------------------------------------------------------------- /aclocal.m4: -------------------------------------------------------------------------------- 1 | # generated automatically by aclocal 1.15.1 -*- Autoconf -*- 2 | 3 | # Copyright (C) 1996-2017 Free Software Foundation, Inc. 4 | 5 | # This file is free software; the Free Software Foundation 6 | # gives unlimited permission to copy and/or distribute it, 7 | # with or without modifications, as long as this notice is preserved. 8 | 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY, to the extent permitted by law; without 11 | # even the implied warranty of MERCHANTABILITY or FITNESS FOR A 12 | # PARTICULAR PURPOSE. 13 | 14 | m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) 15 | m4_include([m4/ax_check_compile_flag.m4]) 16 | m4_include([m4/click.m4]) 17 | -------------------------------------------------------------------------------- /apps/ClickController/.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | -------------------------------------------------------------------------------- /apps/clicky/.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | *.o 3 | *~ 4 | .deps 5 | .gdb_history 6 | Makefile 7 | Makefile.in 8 | aclocal.m4 9 | autogen.sh 10 | autom4te* 11 | config.h 12 | config.h.in 13 | config.log 14 | config.status 15 | configure 16 | po 17 | stamp-h.in 18 | stamp-h1 19 | -------------------------------------------------------------------------------- /apps/clicky/AUTHORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/apps/clicky/AUTHORS -------------------------------------------------------------------------------- /apps/clicky/ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/apps/clicky/ChangeLog -------------------------------------------------------------------------------- /apps/clicky/Makefile.am: -------------------------------------------------------------------------------- 1 | ## Process this file with automake to produce Makefile.in 2 | AUTOMAKE_OPTIONS = foreign 3 | 4 | SUBDIRS = src 5 | 6 | pkgdata_DATA = images/throbber.gif clicky.gtkrc 7 | -------------------------------------------------------------------------------- /apps/clicky/NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/apps/clicky/NEWS -------------------------------------------------------------------------------- /apps/clicky/clicky.gladep: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Clicky 6 | clicky 7 | images 8 | FALSE 9 | 10 | -------------------------------------------------------------------------------- /apps/clicky/clicky.gtkrc: -------------------------------------------------------------------------------- 1 | style "smallexpander" { 2 | GtkExpander::expander-size = 12 3 | GtkExpander::expander-spacing = 0 4 | } 5 | style "smallbutton" { 6 | GtkButton::inner-border = {2, 2, 2, 2} 7 | GtkButton::image-spacing = 0 8 | GtkWidget::focus-line-width = 0 9 | GtkWidget::focus-padding = 0 10 | } 11 | style "whitebg" { 12 | bg[NORMAL] = "#ff0000" 13 | } 14 | 15 | widget "*.eviewbox.*.GtkExpander" style "smallexpander" 16 | widget "*.eview_titlebox*GtkButton" style "smallbutton" 17 | widget "*.diagram*" style "whitebg" 18 | -------------------------------------------------------------------------------- /apps/clicky/images/throbber.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/apps/clicky/images/throbber.gif -------------------------------------------------------------------------------- /apps/clicky/src/.gitignore: -------------------------------------------------------------------------------- 1 | *.bak 2 | .deps 3 | Makefile 4 | Makefile.in 5 | callbacks.c 6 | clicky 7 | main.c 8 | -------------------------------------------------------------------------------- /apps/clicky/src/interface.h: -------------------------------------------------------------------------------- 1 | /* 2 | * DO NOT EDIT THIS FILE - it is generated by Glade. 3 | */ 4 | 5 | GtkWidget* create_opensocketdialog (void); 6 | GtkWidget* create_mainw (void); 7 | -------------------------------------------------------------------------------- /apps/clicky/src/tmain.cc: -------------------------------------------------------------------------------- 1 | #ifdef HAVE_CONFIG_H 2 | # include 3 | #endif 4 | #include 5 | #include "tmain.hh" 6 | #include "gathererror.hh" 7 | namespace clicky { 8 | 9 | tmain::tmain(dcss_set *ccss) 10 | : crouter(ccss) 11 | { 12 | } 13 | 14 | tmain::~tmain() 15 | { 16 | // only call from GtkWidget destruction 17 | clear(false); 18 | } 19 | 20 | void tmain::on_config_changed(bool, LexerTInfo *) 21 | { 22 | GatherErrorHandler *gerrh = error_handler(); 23 | if (gerrh->nerrors() || gerrh->nwarnings()) 24 | on_error(true, String()); 25 | } 26 | 27 | void tmain::on_error(bool, const String &) 28 | { 29 | ErrorHandler *errh = ErrorHandler::default_handler(); 30 | GatherErrorHandler *gerrh = error_handler(); 31 | for (GatherErrorHandler::iterator gi = gerrh->begin(); 32 | gi != gerrh->end(); ++gi) 33 | errh->xmessage("{}" + gi->message); 34 | gerrh->clear(); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /apps/clicky/src/tmain.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICKY_TMAIN_HH 2 | #define CLICKY_TMAIN_HH 1 3 | #include "crouter.hh" 4 | namespace clicky { 5 | 6 | class tmain : public crouter { public: 7 | 8 | tmain(dcss_set *ccss); 9 | ~tmain(); 10 | 11 | // not really public 12 | void on_config_changed(bool replace, LexerTInfo *linfo); 13 | void on_error(bool replace, const String &dialog); 14 | 15 | }; 16 | 17 | } 18 | #endif 19 | -------------------------------------------------------------------------------- /apps/csclient/test.click: -------------------------------------------------------------------------------- 1 | // test config for csclient.cc test driver 2 | // test.click 3 | 4 | // This configuration should print this line five times: 5 | // ok: 40 | 45000028 00000000 401177c3 01000001 02000002 13691369 6 | 7 | // You can run it at user level as 8 | // 'click test.click' 9 | 10 | InfiniteSource(DATA \<00 00 c0 ae 67 ef 00 00 00 00 00 00 08 00 11 | 45 00 00 28 00 00 00 00 40 11 77 c3 01 00 00 01 12 | 02 00 00 02 13 69 13 69 00 14 d6 41 55 44 50 20 13 | 70 61 63 6b 65 74 21 0a>, LIMIT 5, STOP false) 14 | -> Strip(14) 15 | -> CheckIPHeader(18.26.4.255 2.255.255.255 1.255.255.255) 16 | -> Print(ok) 17 | -> Discard; 18 | 19 | ControlSocket(tcp, 7777); 20 | -------------------------------------------------------------------------------- /bsdmodule/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.d 3 | *.o 4 | @ 5 | elements.conf 6 | elements.mk 7 | elements.cc 8 | machine 9 | click.ko 10 | vnode_if.h 11 | vnode_if_newproto.h 12 | vnode_if_typedef.h 13 | -------------------------------------------------------------------------------- /bsdmodule/kernelerror.hh: -------------------------------------------------------------------------------- 1 | #ifndef KERNELERROR_HH 2 | #define KERNELERROR_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | class KernelErrorHandler : public ErrorHandler { public: 7 | 8 | KernelErrorHandler() { } 9 | 10 | void *emit(const String &str, void *user_data, bool more); 11 | void account(int level); 12 | 13 | }; 14 | 15 | CLICK_ENDDECLS 16 | #endif 17 | -------------------------------------------------------------------------------- /conf/app/webgen.click: -------------------------------------------------------------------------------- 1 | fd :: FromDevice(00:00:5A:98:F9:28); 2 | td :: ToDevice(00:00:5A:98:F9:28); 3 | out :: Queue(1024) -> td; 4 | 5 | fd -> cl :: Classifier(12/0800, 12/0806); 6 | 7 | cl[0] 8 | -> Strip(14) 9 | -> WebGen(7.1.0.0/16, 1.0.0.1, 500) 10 | -> EtherEncap(0x0800, 00:00:5A:98:F9:28, 00:03:47:0D:39:57) 11 | -> out; 12 | 13 | cl[1] 14 | -> ARPResponder(1.0.0.2 00:00:5A:98:F9:28) 15 | -> out; 16 | -------------------------------------------------------------------------------- /conf/bpf/xdp_count.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/conf/bpf/xdp_count.o -------------------------------------------------------------------------------- /conf/bpf/xdp_count_common.h: -------------------------------------------------------------------------------- 1 | struct bpf_map_def SEC("maps") count_map = { 2 | .type = BPF_MAP_TYPE_PERCPU_ARRAY, 3 | .key_size = 4, /* u8 does not work?! */ 4 | .value_size = 8, 5 | .max_entries = 512, 6 | }; 7 | 8 | 9 | -------------------------------------------------------------------------------- /conf/deprecated/delay.click: -------------------------------------------------------------------------------- 1 | // BandwidthShaper parameters 2 | // 262144 B/s -> 2 Mb/s 3 | // 131072 B/s -> 1 Mb/s 4 | // 16384 B/s -> 128 Kb/s 5 | // 7168 B/s -> 56 Kb/s 6 | 7 | PollDevice(eth1, true) 8 | -> SetTimestamp 9 | -> Queue(8) 10 | -> DelayShaper(10) 11 | -> BandwidthShaper(131072B/s) // 1Mb 12 | -> ToDevice(eth2); 13 | 14 | PollDevice(eth2, true) 15 | -> SetTimestamp 16 | -> Queue(8) 17 | -> DelayShaper(10) 18 | -> BandwidthShaper(131072B/s) // 1Mb 19 | -> ToDevice(eth1); 20 | -------------------------------------------------------------------------------- /conf/deprecated/fastudpsrc.click: -------------------------------------------------------------------------------- 1 | 2 | PollDevice(eth1) -> ToHost; 3 | FastUDPSource(1300000, 4000000, 60, 00:03:47:0D:39:57, 2.0.0.2, 1234, 4 | 1:2:3:4:5:6, 2.0.0.1, 1234, 1, 0, 1) 5 | -> ToDevice(eth1); 6 | 7 | -------------------------------------------------------------------------------- /conf/deprecated/sampler.click: -------------------------------------------------------------------------------- 1 | // 2 | // sample packets between eth2 and eth1 at 20000 packets per second. send 3 | // sampled packets up to linux device "sampler", created by FromHost. 4 | // This configuration will only run in the kernel (so you must use 5 | // 'click-install sampler.click'). 6 | // 7 | 8 | elementclass RatedSampler { 9 | $rate | 10 | input -> rs :: RatedSplitter($rate); 11 | rs [0] -> [0] output; 12 | rs [1] -> t :: Tee; 13 | t [0] -> [0] output; 14 | t [1] -> [1] output; 15 | }; 16 | 17 | FromHost(sampler, 192.0.2.0/24) -> Discard; 18 | 19 | PollDevice(eth2) -> s0 :: RatedSampler(20000); 20 | s0 [0] -> Queue -> ToDevice(eth1); 21 | s0 [1] -> ToHostSniffers(sampler); 22 | 23 | PollDevice(eth1) -> s1 :: RatedSampler(20000); 24 | s1 [0] -> Queue -> ToDevice(eth2); 25 | s1 [1] -> ToHostSniffers(sampler); 26 | -------------------------------------------------------------------------------- /conf/dpdk/dpdk-bounce.click: -------------------------------------------------------------------------------- 1 | /** 2 | * This simple configuration bounces packets from a single interface to itself. 3 | * MAC addresses are inverted 4 | * 5 | * A minimal launch line would be : 6 | * sudo bin/click --dpdk -- conf/dpdk/dpdk-bounce.click 7 | */ 8 | 9 | define ($print true) 10 | 11 | FromDPDKDevice(0) 12 | -> EtherMirror() 13 | -> Print(ACTIVE $print) 14 | -> ToDPDKDevice(0) 15 | -------------------------------------------------------------------------------- /conf/dpdk/dpdk-ring-secondary.click: -------------------------------------------------------------------------------- 1 | // Run: sudo bin/click --dpdk -c 0x4 -n 4 --proc-type secondary -v -- conf/dpdk/dpdk-ring-secondary.click 2 | 3 | define( 4 | $queueSize 1024 5 | ); 6 | 7 | // Rx ring from Main (primary) to NF1 (secondary) 8 | nf1_from_main :: FromDPDKRing(MEM_POOL 1, FROM_PROC nf1_rx, TO_PROC main_tx); 9 | // Tx ring from NF1 (secondary) back to Main (primary) 10 | nf1_to_main :: ToDPDKRing (MEM_POOL 2, FROM_PROC nf1_tx, TO_PROC main_rx, IQUEUE $queueSize); 11 | 12 | nf1_from_main 13 | -> Print(NF1) 14 | -> nf1_to_main; 15 | -------------------------------------------------------------------------------- /conf/ip6/ip6print.click: -------------------------------------------------------------------------------- 1 | 2 | c :: Classifier(12/86DD, 12/0800, -); 3 | 4 | FromDevice(eth0,1) -> c; 5 | 6 | c [0] 7 | -> Strip(14) 8 | -> MarkIPHeader 9 | -> IP6Print(v6, NBYTES 512, CONTENTS true) 10 | -> ck :: CheckIP6Header; 11 | 12 | ck [0] 13 | -> Discard; 14 | ck [1] 15 | -> IP6Print(ip6hl) 16 | -> Discard; 17 | 18 | c [1] 19 | -> Strip(14) 20 | -> MarkIPHeader 21 | // -> IPPrint(v4) 22 | -> Discard; 23 | 24 | c [2] 25 | -> Discard; 26 | 27 | -------------------------------------------------------------------------------- /conf/metron/__init__.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from . import * 4 | -------------------------------------------------------------------------------- /conf/metron/test_click_rules: -------------------------------------------------------------------------------- 1 | allow src host 192.168.1.7 and dst host 192.168.2.7 and udp src port 53 2 | allow src host 192.168.10.7 and dst host 192.168.20.7 and dst port 80 3 | allow ip proto tcp and src net 192.168.100.0/24 and dst host 192.168.200.7 and tcp dst port 80 4 | deny src host 192.168.100.7 5 | allow ip6 src net 192.168.200.0/24 and dst host 192.168.20.7 6 | -------------------------------------------------------------------------------- /conf/metron/test_nic_rules: -------------------------------------------------------------------------------- 1 | ingress pattern eth / ipv4 src is 192.168.1.7 dst is 192.168.2.7 / udp src is 53 / end actions queue index 0 / count / end 2 | ingress pattern eth / ipv4 src is 192.168.10.7 dst is 192.168.20.7 / tcp dst is 80 / end actions queue index 1 / count / end 3 | ingress pattern eth / ipv4 src spec 192.168.100.0 src mask 255.255.255.0 dst is 192.168.200.7 / end actions queue index 2 / count / end 4 | -------------------------------------------------------------------------------- /conf/nat/urewrite.click: -------------------------------------------------------------------------------- 1 | rw :: IPRewriter(pattern 8.0.0.2 1000-2000 - - 0 1); 2 | 3 | InfiniteSource(\<00000000111111112222222233333333444444445555>, 3) 4 | -> UDPIPEncap(1.0.0.2, 50, 2.0.0.2, 100, 1) 5 | -> IPPrint(is1) 6 | -> [0]rw; 7 | 8 | InfiniteSource(\<00000000111111112222222233333333444444445555>, 3) 9 | -> UDPIPEncap(10.0.0.2, 50, 1.0.0.2, 100, 1) 10 | -> IPPrint(is2) 11 | -> [0]rw; 12 | rw[0] -> IPPrint(rw0) -> IPMirror -> IPPrint(isR) -> [0]rw; 13 | rw[1] -> IPPrint(rw1) -> Discard; 14 | 15 | -------------------------------------------------------------------------------- /conf/queueing/diffserv.ipb: -------------------------------------------------------------------------------- 1 | TimedSource(.05) 2 | -> d_cl::Classifier(2/0C%FC, 2/1C%FC, 2/2C%FC, -); 3 | 4 | d_cl[0] -> d_m0::Meter(2000) -> d_qa::Queue(200); 5 | d_m0[1] -> Discard; 6 | d_cl[1] -> d_qb::Queue(200) -> d_m1::Shaper(1000); 7 | d_cl[2] -> d_m2::Meter(500) -> d_qc::Queue(200); 8 | d_cl[3] -> d_qd::Queue(500); 9 | d_m2[1] -> SetIPDSCP(0, 14) -> d_qd; 10 | 11 | d_rr::RoundRobinSched; 12 | d_prio::PrioSched; 13 | 14 | d_qa -> [0]d_rr; d_m1 -> [1]d_rr; d_qc -> [2]d_rr; 15 | d_rr -> [0]d_prio; d_qd -> [1]d_prio; 16 | 17 | d_prio -> Discard; 18 | -------------------------------------------------------------------------------- /conf/ron/fwrules: -------------------------------------------------------------------------------- 1 | 2 | Server: 3 | divert 3000 udp from any 4000 to me 4000 in recv fxp0 4 | divert 3001 tcp from any to me 50000-50999 in recv fxp 5 | 6 | Client: 7 | divert 4000 tcp from 18.26.4.106 49990-49999 to any out xmit vr0 8 | divert 4001 tcp from any to 18.26.4.106 49990-49999 in recv vr0 9 | divert 4002 udp from any 4001 to 18.26.4.106 4001 in recv vr0 10 | -------------------------------------------------------------------------------- /conf/ron/insert_fwrules.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | ./insert_fwrules_real.sh fxp0 sudo 4 | 5 | 6 | -------------------------------------------------------------------------------- /conf/ron/insert_fwrules_real.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | #sudo ipfw add 750 divert 3000 udp from any 4000 to me 4000 in recv fxp0 4 | #sudo ipfw add 750 divert 3001 tcp from any to me 50000-50999 in recv fxp0 5 | #sudo ipfw add 750 divert 4000 tcp from $HOST 49900-49999 to any out xmit fxp0 6 | #sudo ipfw add 750 divert 4001 tcp from any to $HOST 49900-49999 in recv fxp0 7 | #sudo ipfw add 750 divert 4002 udp from any 4001 to $HOST 4001 in recv fxp0 8 | 9 | $2 ipfw add 750 divert 3000 udp from any 4000 to me 4000 in recv $1 10 | $2 ipfw add 751 divert 3001 tcp from any to me 62000-64199 in recv $1 11 | 12 | $2 ipfw add 752 divert 4000 tcp from me 60000-61499 to any out xmit $1 13 | $2 ipfw add 753 divert 4001 tcp from any to me 60000-61499 in recv $1 14 | $2 ipfw add 754 divert 4002 udp from any 4001 to me 4001 in recv $1 15 | 16 | 17 | 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /conf/ron/nodelist-down: -------------------------------------------------------------------------------- 1 | #xl0 24.162.251.208 00:03:47:69:49:61 24.162.251.129 nc.ron.lcs.mit.edu I 2 | #fxp0 208.246.45.8 sightpath.ron.lcs.mit.edu I 3 | #fxp0 130.37.30.16 00:02:b3:32:8a:93 130.37.30.1 nl.ron.lcs.mit.edu I 4 | #fxp0 130.240.65.20 lulea.ron.lcs.mit.edu I 5 | #fxp0 204.119.59.136 stoller.ron.lcs.mit.edu I 6 | 7 | -------------------------------------------------------------------------------- /conf/ron/start-client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | setenv CLICKPATH /usr/home/ron/yipal/click-export/lib 4 | sudo rm -f /tmp/clicksocket 5 | touch /usr/home/ron/yipal/datacollection-export/multi/multi2-$1.log 6 | cd /usr/home/ron/yipal/click-export/bin 7 | sudo ./click ../conf/$1-client.conf >>& /usr/home/ron/yipal/datacollection-export/multi/multi2-$1.log & 8 | sleep 1 9 | sudo chmod a+w /tmp/clicksocket 10 | 11 | 12 | -------------------------------------------------------------------------------- /conf/ron/start-datacollect.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | cd /usr/home/ron/yipal/datacollection-export/multi/ 3 | touch multi2-$1.log 4 | ./multicollect.pl -f multi2.ip -n $1 -s 10 >>& multi2-$1.log & 5 | 6 | -------------------------------------------------------------------------------- /conf/ron/start-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | 3 | setenv CLICKPATH /usr/home/ron/yipal/click-export/lib 4 | cd /usr/home/ron/yipal/click-export/bin 5 | sudo ./click ../conf/$1-server.conf >>& /dev/null & 6 | 7 | 8 | -------------------------------------------------------------------------------- /conf/ron/start-traceroute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | cd /usr/home/ron/yipal/datacollection-export/multi/ 3 | touch multi2-$1.trace 4 | ./collectroute.pl -f multi2.ip -n $1 -s 30 >>& multi2-$1.trace & 5 | 6 | -------------------------------------------------------------------------------- /conf/ron/stop-client.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | sudo kill `ps -ax | grep click | grep client.conf | perl -ne '/^\s*(\d+)\s+/; print "$1 ";'` 3 | sudo rm -f /tmp/clicksocket 4 | -------------------------------------------------------------------------------- /conf/ron/stop-datacollect.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | sudo kill `ps -ax | grep multicollect | perl -ne '/^\s*(\d+)\s+/; print "$1 ";'` 3 | sudo rm -f /tmp/clicksocket 4 | -------------------------------------------------------------------------------- /conf/ron/stop-server.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | sudo kill `ps -ax | grep click | grep server.conf | perl -ne '/^\s*(\d+)\s+/; print "$1 ";'` 3 | 4 | 5 | -------------------------------------------------------------------------------- /conf/ron/stop-traceroute.sh: -------------------------------------------------------------------------------- 1 | #!/bin/tcsh 2 | sudo kill `ps -ax | grep collectroute | perl -ne '/^\s*(\d+)\s+/; print "$1 ";'` 3 | sudo rm -f /tmp/clicksocket 4 | -------------------------------------------------------------------------------- /conf/sched/stridetest.click: -------------------------------------------------------------------------------- 1 | i1 :: InfiniteSource(\<11111111>, -1, 5) 2 | i2 :: InfiniteSource(\<22222222>, -1, 5) 3 | i3 :: InfiniteSource(\<33333333>, -1, 5) 4 | i4 :: InfiniteSource(\<44444444>, -1, 5) 5 | i5 :: InfiniteSource(\<55555555>, -1, 5) 6 | i6 :: InfiniteSource(\<66666666>, -1, 5) 7 | i7 :: InfiniteSource(\<77777777>, -1, 5) 8 | i8 :: InfiniteSource(\<88888888>, -1, 7) 9 | 10 | ss :: StrideSched(10,20,30,40,50,60,70,100000) 11 | 12 | i1 -> q1::Queue 13 | i2 -> q2::Queue 14 | i3 -> q3::Queue 15 | i4 -> q4::Queue 16 | i5 -> q5::Queue 17 | i6 -> q6::Queue 18 | i7 -> q7::Queue 19 | i8 -> q8::Queue 20 | //i9::InfiniteSource(\<99999999>, -1, 9) -> Queue -> [8]ss 21 | 22 | q1 -> [0]ss; 23 | q2 -> [1]ss; 24 | q3 -> [2]ss; 25 | q4 -> [3]ss; 26 | q5 -> [4]ss; 27 | q6 -> [5]ss; 28 | q7 -> [6]ss; 29 | q8 -> [7]ss; 30 | 31 | dd :: Discard 32 | 33 | ss[0] -> Print(ss: , 4) -> dd 34 | 35 | // ScheduleInfo(i1 1, i2 1, i3 1, i4 1, i5 1, i6 1, i7 1, i8 1, dd 1) 36 | -------------------------------------------------------------------------------- /conf/script/script-parabolawave.click: -------------------------------------------------------------------------------- 1 | // script-parabolawave.click 2 | 3 | // A Script element is used to control a RatedSource element's rate 4 | // according to a parabolic wave. Watch the result by running 5 | // click -p9999 script-parabolawave.click && clicky -p9999 6 | 7 | // See also the other script-*wave.click scripts. 8 | 9 | s :: RatedSource(RATE 1125) 10 | -> c :: Counter 11 | -> d :: Discard; 12 | 13 | Script(TYPE ACTIVE, 14 | init x 1125, 15 | init velocity -5, 16 | init acceleration -5, 17 | wait 0.01s, 18 | set x $(add $x $velocity), 19 | write s.rate $x, 20 | goto skip $(lt $(abs $velocity) 75), 21 | set acceleration $(neg $acceleration), 22 | label skip, 23 | set velocity $(add $velocity $acceleration), 24 | loop); 25 | 26 | ClickyInfo(STYLE #c { decorations: activity } 27 | activity { decay: 0; max-value: 1125 }); 28 | -------------------------------------------------------------------------------- /conf/script/script-squarewave.click: -------------------------------------------------------------------------------- 1 | // script-squarewave.click 2 | 3 | // A Script element is used to control a RatedSource element's rate 4 | // according to a square wave: 1/2 second at 1000 packets per second 5 | // alternates with 1/2 second off. Watch the result by running 6 | // click -p9999 script-squarewave.click && clicky -p9999 7 | 8 | // See also the other script-*wave.click scripts. 9 | 10 | s :: RatedSource(RATE 1000) 11 | -> c :: Counter 12 | -> d :: Discard; 13 | 14 | Script(TYPE ACTIVE, 15 | init x 0, 16 | wait 0.5s, 17 | set x $(sub 1000 $x), 18 | write s.rate $x, 19 | loop); 20 | 21 | ClickyInfo(STYLE #c { decorations: activity } activity { decay: 0 }); 22 | -------------------------------------------------------------------------------- /conf/script/script-trianglewave.click: -------------------------------------------------------------------------------- 1 | // script-trianglewave.click 2 | 3 | // A Script element is used to control a RatedSource element's rate 4 | // according to a triangle wave. Watch the result by running 5 | // click -p9999 script-trianglewave.click && clicky -p9999 6 | 7 | // See also the other script-*wave.click scripts. 8 | 9 | s :: RatedSource(RATE 1000) 10 | -> c :: Counter 11 | -> d :: Discard; 12 | 13 | Script(TYPE ACTIVE, 14 | init x 1000, 15 | init delta -5, 16 | wait 0.005s, 17 | set x $(add $x $delta), 18 | write s.rate $x, 19 | goto l1 $(in $x 0 1000), 20 | loop, 21 | label l1, 22 | set delta $(if $(eq $x 0) 5 -5), 23 | loop); 24 | 25 | ClickyInfo(STYLE #c { decorations: activity } activity { decay: 0 }); 26 | -------------------------------------------------------------------------------- /conf/simple/print-pings.click: -------------------------------------------------------------------------------- 1 | // print-pings.click 2 | 3 | // This configuration reads packets from a device, and prints out any ICMP 4 | // echo requests it receives. 5 | 6 | // You can run it at user level (as root) as 7 | // 'userlevel/click < conf/print-pings.click' 8 | // or in the kernel with 9 | // 'click-install conf/print-pings.click' 10 | 11 | FromDevice(eth1) // read packets from device 12 | // (assume Ethernet device) 13 | -> Classifier(12/0800) // select IP-in-Ethernet 14 | -> Strip(14) // strip Ethernet header 15 | -> CheckIPHeader // check IP header, mark as IP 16 | -> IPFilter(allow icmp && icmp type echo) // select ICMP echo requests 17 | -> IPPrint // print them out 18 | -> Discard; 19 | -------------------------------------------------------------------------------- /conf/snoop/snooptcp.ipb: -------------------------------------------------------------------------------- 1 | // zwolle -> redlab 2 | 3 | fi :: Classifier(12/0800 26/121a0416 30/121a040a, 4 | 12/0800 26/121a040a 30/121a0416, 5 | -) 6 | 7 | out :: Queue(20) 8 | 9 | out[0] -> ToDump(/tmp/out) 10 | 11 | snp :: SnoopTCP; 12 | 13 | snp[2] -> out; 14 | 15 | FromDump(/tmp/dmp) -> fi 16 | 17 | 18 | // Packets to Mobile host 19 | 20 | fi[1] -> Strip(14) 21 | -> [0]snp[0] 22 | -> EtherEncap(0x0800, 00:00:c0:75:70:ef,00:00:c0:c7:71:ef) 23 | -> out; 24 | 25 | // Packets from Mobile host 26 | 27 | fi[0] -> Strip(14) 28 | -> [1]snp[1] 29 | -> EtherEncap(0x0800, 00:00:c0:c7:71:ef,00:00:c0:75:70:ef) 30 | -> out; 31 | 32 | fi[2] -> Discard; 33 | -------------------------------------------------------------------------------- /conf/test/schedorder1.click: -------------------------------------------------------------------------------- 1 | s1 :: SchedOrderTest(1, SIZE 100, STOP true); 2 | s2 :: SchedOrderTest(2, SIZE 100, LIMIT 10); 3 | s3 :: SchedOrderTest(3, SIZE 100); 4 | 5 | ScheduleInfo(s1 1, s2 2, s3 3); 6 | DriverManager(wait_stop, print s1.order, stop); 7 | -------------------------------------------------------------------------------- /conf/test/test-device.click: -------------------------------------------------------------------------------- 1 | // testdevice.click 2 | 3 | // Tests whether Click can read packets from the network. 4 | // You may need to modify the device name in FromDevice. 5 | // You'll probably need to be root to run this. 6 | 7 | // Run with 8 | // click testdevice.click 9 | // (runs as a user-level program; uses Linux packet sockets or a similar 10 | // mechanism), or 11 | // click-install testdevice.click 12 | // (runs inside a Linux kernel). 13 | 14 | // If you run this inside the kernel, your kernel's ordinary IP stack 15 | // will stop getting packets from eth0. This might not be convenient. 16 | // The Print messages are printed to the system log, which is accessible 17 | // with 'dmesg' and /var/log/messages. The most recent 2-4K of messages are 18 | // stored in /click/messages. 19 | 20 | FromDevice(eth0) -> Print(ok) -> Discard; 21 | -------------------------------------------------------------------------------- /conf/test/test-toytcp.click: -------------------------------------------------------------------------------- 1 | FromDevice(eth0, 0) 2 | -> cl :: Classifier(12/0800 23/06, 12/0806 20/0001) 3 | -> Strip(34) 4 | -> ToyTCP(5432) 5 | // -> IPEncap(6, 10.2.2.2, 10.0.0.1) 6 | -> IPEncap(6, 18.26.4.106, 18.26.4.123) 7 | -> SetTCPChecksum 8 | // -> EtherEncap(0x0800, 00:02:2d:00:42:96, 0:e0:98:1:f2:5c) 9 | -> EtherEncap(0x0800, 0:e0:29:5:e5:6f, 00:90:27:e0:23:1f) 10 | -> td :: ToDevice(eth0); 11 | 12 | cl[1] 13 | // -> ARPResponder(10.2.2.2 00:02:2d:00:42:96) 14 | -> ARPResponder(18.26.4.106 0:e0:29:5:e5:6f) 15 | -> td; 16 | -------------------------------------------------------------------------------- /conf/test/test.click: -------------------------------------------------------------------------------- 1 | // test.click 2 | 3 | // This configuration should print this line five times: 4 | // ok: 40 | 45000028 00000000 401177c3 01000001 02000002 13691369 5 | 6 | // Run it at user level with 7 | // 'click test.click' 8 | 9 | // Run it in the Linux kernel with 10 | // 'click-install test.click' 11 | // Messages are printed to the system log (run 'dmesg' to see them, or look 12 | // in /var/log/messages), and to the file '/click/messages'. 13 | 14 | InfiniteSource(DATA \<00 00 c0 ae 67 ef 00 00 00 00 00 00 08 00 15 | 45 00 00 28 00 00 00 00 40 11 77 c3 01 00 00 01 16 | 02 00 00 02 13 69 13 69 00 14 d6 41 55 44 50 20 17 | 70 61 63 6b 65 74 21 0a>, LIMIT 5, STOP true) 18 | -> Strip(14) 19 | -> Align(4, 0) // in case we're not on x86 20 | -> CheckIPHeader(BADSRC 18.26.4.255 2.255.255.255 1.255.255.255) 21 | -> Print(ok) 22 | -> Discard; 23 | -------------------------------------------------------------------------------- /conf/test/test2.click: -------------------------------------------------------------------------------- 1 | // test2.click 2 | 3 | // This test file contains both push and pull processing and Random 4 | // Early Detection dropping (although no packets are dropped in this 5 | // configuration). 6 | 7 | InfiniteSource(DATA \<00 00 c0 ae 67 ef 00 00 00 00 00 00 08 00 8 | 45 00 00 28 00 00 00 00 40 11 77 c3 01 00 00 01 9 | 02 00 00 02 13 69 13 69 00 14 d6 41 55 44 50 20 10 | 70 61 63 6b 65 74 21 0a 04 00 00 00 01 00 00 00 11 | 01 00 00 00 00 00 00 00 00 80 04 08 00 80 04 08 12 | 53 53 00 00 53 53 00 00 05 00 00 00 00 10 00 00 13 | 01 00 00 00 54 53 00 00 54 e3 04 08 54 e3 04 08 14 | d8 01 00 00>, LIMIT 600000, STOP true) 15 | -> Strip(14) 16 | -> CheckIPHeader(BADSRC 18.26.4.255 2.255.255.255 1.255.255.255) 17 | -> RED(10, 100, .5) 18 | -> Queue 19 | -> Discard; 20 | -------------------------------------------------------------------------------- /conf/test/test3.click: -------------------------------------------------------------------------------- 1 | // test3.click 2 | 3 | // This simple test demonstrates how RoundRobinSched works as a round robin 4 | // scheduler. 5 | 6 | // Run with 'click test3.click' 7 | 8 | rr :: RoundRobinSched; 9 | 10 | TimedSource(0.2) -> Queue(20) -> Print(q1) -> [0]rr; 11 | TimedSource(0.5) -> Queue(20) -> Print(q2) -> [1]rr; 12 | 13 | rr -> TimedSink(0.1); 14 | -------------------------------------------------------------------------------- /conf/tools/test-clicky.ccss: -------------------------------------------------------------------------------- 1 | // test-clicky.ccss 2 | 3 | // This Clicky Cascading Style Sheets file is designed to go with 4 | // test-clicky.click, and shows off how Clicky works with live 5 | // configurations. 6 | 7 | Queue { 8 | decorations: fullness; 9 | } 10 | 11 | Counter { 12 | text: "%n\n%{count}\n%c"; 13 | } 14 | 15 | Counter handler#count { 16 | autorefresh: 100ms; 17 | } 18 | 19 | -------------------------------------------------------------------------------- /conf/tools/test-clicky.click: -------------------------------------------------------------------------------- 1 | // test-clicky.click 2 | 3 | // This simple test file can be used to demonstrate the Clicky GUI. 4 | 5 | rr :: RoundRobinSched; 6 | 7 | TimedSource(0.2) -> c1 :: Counter 8 | -> Queue(20) 9 | -> Print(q1, ACTIVE false) 10 | -> [0]rr; 11 | TimedSource(0.5) -> c2 :: Counter 12 | -> Queue(20) 13 | -> Print(q2, ACTIVE false) 14 | -> [1]rr; 15 | 16 | rr -> TimedSink(0.1); 17 | 18 | ClickyInfo(STYLE @import test-clicky.ccss); 19 | -------------------------------------------------------------------------------- /conf/tools/unarp.clickpat: -------------------------------------------------------------------------------- 1 | elementclass UnARP { 2 | input -> arpq :: ARPQuerier($ip1, $eth1) 3 | -> q :: Queue($q1) 4 | -> RouterLink($r0, $r1, $r2, $r3) 5 | -> c :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -) 6 | -> ARPResponder($eth2) 7 | -> output; 8 | input[1] -> [1]arpq; 9 | input[2] -> q; 10 | c[1] -> [1]output; 11 | c[2] -> [2]output; 12 | c[3] -> [3]output; 13 | } 14 | 15 | elementclass UnARP_Replacement { 16 | input -> EtherEncap(0x0800, $eth1, $eth2) 17 | -> q :: Queue($q1) 18 | -> RouterLink($r0, $r1, $r2, $r3) 19 | -> c :: Classifier(12/0800, -) 20 | -> [2]output; 21 | input[1] -> Discard; 22 | input[2] -> q; 23 | c[1] -> [3]output; 24 | Idle -> output; 25 | Idle -> [1]output; 26 | } 27 | -------------------------------------------------------------------------------- /conf/tutorial/README.md: -------------------------------------------------------------------------------- 1 | These configurations implements the examples FastClick's tutorial wiki. To understand them, go to [the wiki](https://github.com/tbarbette/fastclick/wiki). 2 | -------------------------------------------------------------------------------- /conf/tutorial/tutorial-01.click: -------------------------------------------------------------------------------- 1 | /** 2 | * See wiki tutorial for explanations. 3 | */ 4 | 5 | Idle -> tap :: KernelTap(10.100.0.1/24, DEVNAME vEth1) -> Print() -> Discard; 6 | -------------------------------------------------------------------------------- /conf/tutorial/tutorial-02.click: -------------------------------------------------------------------------------- 1 | define ($ip 10.100.0.2, 2 | $mac aa:aa:aa:aa:aa:aa) 3 | 4 | Idle -> tap :: KernelTap(10.100.0.1/24, DEVNAME vEth1) ; 5 | tap -> c :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -); 6 | 7 | //Answer to ARP requests 8 | c[0] -> ARPResponder( $ip $mac) -> tap ; 9 | //Discard ARP replies for now 10 | c[1] -> Discard; 11 | //Print IP packets 12 | c[2] -> Print("IP", -1) -> Discard; 13 | //Discard non-IP, non-ARP packets 14 | c[3] -> Discard; 15 | 16 | -------------------------------------------------------------------------------- /conf/tutorial/tutorial-03.click: -------------------------------------------------------------------------------- 1 | define ($ip 10.100.0.2, 2 | $mac aa:aa:aa:aa:aa:aa) 3 | 4 | Idle -> tap :: KernelTap(10.100.0.1/24, DEVNAME vEth1) ; 5 | tap -> c :: Classifier(12/0806 20/0001, 12/0806 20/0002, 12/0800, -); 6 | 7 | //Answer to ARP requests 8 | c[0] -> ARPResponder( $ip $mac) -> tap ; 9 | //Discard ARP replies for now 10 | c[1] -> [1]arp :: ARPQuerier($ip, $mac) -> tap; 11 | 12 | //Handle pings 13 | c[2] -> Strip(14) -> CheckIPHeader -> ip :: IPClassifier(proto icmp && icmp type echo, -); 14 | ip[0] -> ICMPPingResponder -> arp -> tap; 15 | ip[1] -> IPPrint -> Discard; 16 | 17 | 18 | //Discard non-IP, non-ARP packets 19 | c[3] -> Discard; 20 | 21 | -------------------------------------------------------------------------------- /conf/wifi/read_handler: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | if [ $# != 1 ]; then 3 | echo "usage: $0 handler" 4 | exit 1 5 | fi 6 | 7 | printf "read $@\nquit\n" | nc 127.0.0.1 7777|grep -v ^Click::ControlSocket |grep -v ^DATA | grep -v "200 Goodbye!"|grep -v "200 Read handler" 8 | -------------------------------------------------------------------------------- /conf/wifi/set_channel.pl: -------------------------------------------------------------------------------- 1 | #!/usr/bin/perl -w 2 | 3 | use strict; 4 | 5 | my ($channel) = @ARGV; 6 | 7 | if ($channel eq "12") { 8 | exit -1; 9 | } 10 | system "write_handler.pl winfo.channel -1"; 11 | 12 | 13 | if ($channel > 20) { 14 | system "write_handler.pl set_rate.rate 12"; 15 | system "write_handler.pl rates.insert DEFAULT 12 24 48 18 36 72 96 108"; 16 | system "write_handler.pl rate.reset 1"; 17 | } else { 18 | system "write_handler.pl set_rate.rate 2"; 19 | system "write_handler.pl rates.insert DEFAULT 2 4 11 12 18 22 24 48 36 72 96 108"; 20 | system "write_handler.pl rate.reset 1"; 21 | } 22 | 23 | system "/sbin/iwconfig ath0 channel $channel"; 24 | system "write_handler.pl winfo.channel $channel"; 25 | 26 | -------------------------------------------------------------------------------- /conf/wifi/write_handler: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ $# -lt 2 ]; then 4 | echo "usage: $0 handler" 5 | exit 1 6 | fi 7 | 8 | ARGS=$@ 9 | printf "write $ARGS\nquit\n" | nc 127.0.0.1 7777 | grep -v ^Click::ControlSocket | grep -v ^DATA | grep -v "200 Goodbye!"| grep -v "200 Write handler" 10 | 11 | -------------------------------------------------------------------------------- /config-ns.h.in: -------------------------------------------------------------------------------- 1 | /* Process this file with configure to produce config-ns.h. -*- mode: c -*- */ 2 | #ifndef CLICK_CONFIG_NS_H 3 | #define CLICK_CONFIG_NS_H 4 | 5 | #ifdef __cplusplus 6 | 7 | /* Define macros that surround Click declarations. */ 8 | #define CLICK_DECLS namespace Click { 9 | #define CLICK_ENDDECLS } 10 | #define CLICK_USING_DECLS using namespace Click; 11 | #define CLICK_NAME(name) ::Click::name 12 | 13 | #endif /* __cplusplus */ 14 | 15 | /* The ns driver probably can't use clock_gettime. */ 16 | #define HAVE_USE_CLOCK_GETTIME 0 17 | 18 | /* Include userlevel configuration. */ 19 | #define CLICK_USERLEVEL 1 20 | #include 21 | 22 | #endif /* CLICK_CONFIG_NS_H */ 23 | -------------------------------------------------------------------------------- /config.mk.in: -------------------------------------------------------------------------------- 1 | clickprefix=@prefix@ 2 | clickbindir=@bindir@ 3 | clickdatadir=@clickdatadir@ 4 | clickincludedir=@includedir@ 5 | clicklibdir=@libdir@ 6 | clicksbindir=@sbindir@ 7 | clicksrcdir=@clickdatadir@/src 8 | 9 | clickbuild_bindir=@clickbuild_bindir@ 10 | clickbuild_datadir=@clickbuild_clickdatadir@ 11 | clickbuild_includedir=@clickbuild_includedir@ 12 | clickbuild_libdir=@clickbuild_libdir@ 13 | clickbuild_sbindir=@clickbuild_sbindir@ 14 | clickbuild_srcdir=@clickbuild_clickdatadir@/src 15 | 16 | clicklinux_builddir=@linux_builddir@ 17 | clicklinux_srcdir=@linux_srcdir@ 18 | 19 | CLICK_HAVE_USERLEVEL_DRIVER=@HAVE_USERLEVEL_DRIVER@ 20 | CLICK_HAVE_LINUXMODULE_DRIVER=@HAVE_LINUXMODULE_DRIVER@ 21 | CLICK_HAVE_BSDMODULE_DRIVER=@HAVE_BSDMODULE_DRIVER@ 22 | CLICK_LINUXMODULE_2_6=@LINUXMODULE_2_6@ 23 | CLICK_GMAKE=@GMAKE@ 24 | -------------------------------------------------------------------------------- /doc/.gitignore: -------------------------------------------------------------------------------- 1 | Doxyfile.bak 2 | Makefile 3 | click.aux 4 | click.cp 5 | click.cps 6 | click.dvi 7 | click.fn 8 | click.html 9 | click.info 10 | click.info* 11 | click.ky 12 | click.log 13 | click.output 14 | click.pg 15 | click.tab.c 16 | click.tmp 17 | click.toc 18 | click.tp 19 | click.vr 20 | -------------------------------------------------------------------------------- /drivers/e1000-2.x/README-rtm: -------------------------------------------------------------------------------- 1 | This is a copy of the Intel Linux driver for the Pro/1000 2 | gigabit ethernet adapter, tuned for small packet performance 3 | and with Click polling extensions. 4 | 5 | See http://www.pdos.lcs.mit.edu/~rtm/e1000/ 6 | -------------------------------------------------------------------------------- /drivers/e1000-4.x/README-rtm: -------------------------------------------------------------------------------- 1 | This is a copy of the Intel Linux driver for the Pro/1000 2 | gigabit ethernet adapter, tuned for small packet performance 3 | and with Click polling extensions. 4 | -------------------------------------------------------------------------------- /drivers/e1000-6.x/README: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/drivers/e1000-6.x/README -------------------------------------------------------------------------------- /drivers/e1000-6.x/SUMS: -------------------------------------------------------------------------------- 1 | 57018 10 src/Makefile 2 | 37816 8 src/bypass_modectrl_tool.c 3 | 63261 10 src/e1000.h 4 | 42983 5 src/e1000_bypass_ctrl.c 5 | 18468 3 src/e1000_bypass_ctrl.h 6 | 39386 53 src/e1000_ethtool.c 7 | 34197 231 src/e1000_hw.c 8 | 43684 120 src/e1000_hw.h 9 | 43421 127 src/e1000_main.c 10 | 13937 5 src/e1000_osdep.h 11 | 59469 23 src/e1000_param.c 12 | 12758 5 src/kcompat.c 13 | 21187 21 src/kcompat.h 14 | 30352 21 src/kcompat_ethtool.c 15 | 39773 19 LICENSE 16 | 00813 24 README 17 | 19518 6 ldistrib.txt 18 | 05050 16 e1000.spec 19 | 13318 10 e1000.7 20 | -------------------------------------------------------------------------------- /drivers/e1000-6.x/ldistrib.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/drivers/e1000-6.x/ldistrib.txt -------------------------------------------------------------------------------- /elements/analysis/aggregatenotifier.cc: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #include 3 | #include "aggregatenotifier.hh" 4 | CLICK_DECLS 5 | 6 | void 7 | AggregateListener::aggregate_notify(uint32_t, AggregateEvent, const Packet *) 8 | { 9 | } 10 | 11 | void 12 | AggregateNotifier::add_listener(AggregateListener *l) 13 | { 14 | for (int i = 0; i < _listeners.size(); i++) 15 | if (_listeners[i] == l) 16 | return; 17 | _listeners.push_back(l); 18 | } 19 | 20 | void 21 | AggregateNotifier::remove_listener(AggregateListener *l) 22 | { 23 | for (int i = 0; i < _listeners.size(); i++) 24 | if (_listeners[i] == l) { 25 | _listeners[i] = _listeners.back(); 26 | _listeners.pop_back(); 27 | return; 28 | } 29 | } 30 | 31 | CLICK_ENDDECLS 32 | ELEMENT_PROVIDES(AggregateNotifier) 33 | -------------------------------------------------------------------------------- /elements/analysis/eraseippayload.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_ERASEIPPAYLOAD_HH 3 | #define CLICK_ERASEIPPAYLOAD_HH 4 | #include 5 | #include 6 | #include 7 | #include 8 | CLICK_DECLS 9 | 10 | /* 11 | =c 12 | 13 | EraseIPPayload() 14 | 15 | =s ip 16 | 17 | erases IP packet payload 18 | 19 | =d 20 | 21 | Erases all TCP or UDP payload in incoming packets. Output packets 22 | have the same length, but all payload bytes are zero. 23 | 24 | =a AnonymizeIPAddr */ 25 | 26 | class EraseIPPayload : public SimpleElement { public: 27 | 28 | EraseIPPayload() CLICK_COLD; 29 | ~EraseIPPayload() CLICK_COLD; 30 | 31 | const char *class_name() const { return "EraseIPPayload"; } 32 | const char *port_count() const { return PORTS_1_1; } 33 | 34 | Packet *simple_action(Packet *); 35 | 36 | }; 37 | 38 | CLICK_ENDDECLS 39 | #endif 40 | -------------------------------------------------------------------------------- /elements/analysis/ipsumdump_anno.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_IPSUMDUMP_ANNO_HH 2 | #define CLICK_IPSUMDUMP_ANNO_HH 3 | #include "ipsumdumpinfo.hh" 4 | CLICK_DECLS 5 | 6 | class IPSummaryDump_Anno { public: 7 | static void static_initialize(); 8 | static void static_cleanup(); 9 | }; 10 | 11 | CLICK_ENDDECLS 12 | #endif 13 | -------------------------------------------------------------------------------- /elements/analysis/ipsumdump_icmp.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_IPSUMDUMP_ICMP_HH 2 | #define CLICK_IPSUMDUMP_ICMP_HH 3 | #include "ipsumdumpinfo.hh" 4 | CLICK_DECLS 5 | 6 | class IPSummaryDump_ICMP { public: 7 | static void static_initialize(); 8 | static void static_cleanup(); 9 | }; 10 | 11 | CLICK_ENDDECLS 12 | #endif 13 | -------------------------------------------------------------------------------- /elements/analysis/ipsumdump_ip.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_IPSUMDUMP_IP_HH 2 | #define CLICK_IPSUMDUMP_IP_HH 3 | #include "ipsumdumpinfo.hh" 4 | CLICK_DECLS 5 | 6 | class IPSummaryDump_IP { public: 7 | static void static_initialize(); 8 | static void static_cleanup(); 9 | }; 10 | 11 | CLICK_ENDDECLS 12 | #endif 13 | -------------------------------------------------------------------------------- /elements/analysis/ipsumdump_link.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_IPSUMDUMP_LINK_HH 2 | #define CLICK_IPSUMDUMP_LINK_HH 3 | #include "ipsumdumpinfo.hh" 4 | CLICK_DECLS 5 | 6 | class IPSummaryDump_Link { public: 7 | static void static_initialize(); 8 | static void static_cleanup(); 9 | }; 10 | 11 | CLICK_ENDDECLS 12 | #endif 13 | -------------------------------------------------------------------------------- /elements/analysis/ipsumdump_payload.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_IPSUMDUMP_PAYLOAD_HH 2 | #define CLICK_IPSUMDUMP_PAYLOAD_HH 3 | #include "ipsumdumpinfo.hh" 4 | CLICK_DECLS 5 | 6 | class IPSummaryDump_Payload { public: 7 | static void static_initialize(); 8 | static void static_cleanup(); 9 | }; 10 | 11 | CLICK_ENDDECLS 12 | #endif 13 | -------------------------------------------------------------------------------- /elements/analysis/ipsumdump_tcp.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_IPSUMDUMP_TCP_HH 2 | #define CLICK_IPSUMDUMP_TCP_HH 3 | #include "ipsumdumpinfo.hh" 4 | CLICK_DECLS 5 | 6 | class IPSummaryDump_TCP { public: 7 | static void static_initialize(); 8 | static void static_cleanup(); 9 | }; 10 | 11 | CLICK_ENDDECLS 12 | #endif 13 | -------------------------------------------------------------------------------- /elements/analysis/ipsumdump_udp.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_IPSUMDUMP_UDP_HH 2 | #define CLICK_IPSUMDUMP_UDP_HH 3 | #include "ipsumdumpinfo.hh" 4 | CLICK_DECLS 5 | 6 | class IPSummaryDump_UDP { public: 7 | static void static_initialize(); 8 | static void static_cleanup(); 9 | }; 10 | 11 | CLICK_ENDDECLS 12 | #endif 13 | -------------------------------------------------------------------------------- /elements/bsdmodule/tohostsniffers.hh: -------------------------------------------------------------------------------- 1 | // -*- mode: c++; c-basic-offset: 4 -*- 2 | #ifndef CLICK_TOHOSTSNIFFERS_BSDMODULE_HH 3 | #define CLICK_TOHOSTSNIFFERS_BSDMODULE_HH 4 | #include "elements/bsdmodule/tohost.hh" 5 | CLICK_DECLS 6 | 7 | /* 8 | * ToHostSniffers behaves exactly like ToHost, except that the SNIFFERS 9 | * keyword argument defaults to true. 10 | * 11 | * Based on elements/linuxmodule/tohost.hh. 12 | */ 13 | 14 | class ToHostSniffers : public ToHost { public: 15 | 16 | ToHostSniffers() CLICK_COLD; 17 | ~ToHostSniffers() CLICK_COLD; 18 | 19 | const char *class_name() const { return "ToHostSniffers"; } 20 | 21 | }; 22 | 23 | CLICK_ENDDECLS 24 | #endif 25 | 26 | -------------------------------------------------------------------------------- /elements/ethernet/ethermirror.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_ETHERMIRROR_HH 2 | #define CLICK_ETHERMIRROR_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * =c 8 | * EtherMirror() 9 | * =s ethernet 10 | * swaps Ethernet source and destination 11 | * =d 12 | * 13 | * Incoming packets are Ethernet. Their source and destination Ethernet 14 | * addresses are swapped before they are output. 15 | * */ 16 | 17 | class EtherMirror : public BatchElement { 18 | public: 19 | 20 | EtherMirror() CLICK_COLD; 21 | ~EtherMirror() CLICK_COLD; 22 | 23 | const char *class_name() const { return "EtherMirror"; } 24 | const char *port_count() const { return PORTS_1_1; } 25 | 26 | Packet *simple_action (Packet *); 27 | #if HAVE_BATCH 28 | PacketBatch *simple_action_batch(PacketBatch *); 29 | #endif 30 | }; 31 | 32 | CLICK_ENDDECLS 33 | #endif // CLICK_ETHERMIRROR_HH 34 | -------------------------------------------------------------------------------- /elements/etherswitch/debugbridge.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_DEBUGBRIDGE_HH 2 | #define CLICK_DEBUGBRIDGE_HH 3 | #include 4 | #include 5 | CLICK_DECLS 6 | 7 | class DebugBridge : public Element { 8 | 9 | String _label; 10 | 11 | public: 12 | 13 | DebugBridge() CLICK_COLD; 14 | ~DebugBridge() CLICK_COLD; 15 | 16 | const char *class_name() const { return "DebugBridge"; } 17 | const char *port_count() const { return PORTS_1_1; } 18 | 19 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 20 | 21 | Packet *simple_action(Packet *); 22 | }; 23 | 24 | CLICK_ENDDECLS 25 | #endif 26 | -------------------------------------------------------------------------------- /elements/grid/gridgenericlocinfo.hh: -------------------------------------------------------------------------------- 1 | #ifndef GRIDGENERICLOCINFO_HH 2 | #define GRIDGENERICLOCINFO_HH 3 | 4 | #include 5 | #include "grid.hh" 6 | CLICK_DECLS 7 | 8 | class GridGenericLocInfo : public Element { 9 | public: 10 | GridGenericLocInfo() { } 11 | virtual ~GridGenericLocInfo() { } 12 | 13 | // seq_no is incremented when location changes ``enough to make a 14 | // difference'' 15 | virtual grid_location get_current_location(unsigned int *seq_no = 0) = 0; 16 | 17 | virtual unsigned int seq_no() = 0; 18 | virtual bool loc_good() = 0; 19 | virtual unsigned short loc_err() = 0; 20 | 21 | 22 | }; 23 | CLICK_ENDDECLS 24 | #endif 25 | -------------------------------------------------------------------------------- /elements/grid/gridsrforwarder.hh: -------------------------------------------------------------------------------- 1 | #ifndef GRIDSRFW 2 | #define GRIDSRFW 3 | 4 | #include 5 | #include 6 | CLICK_DECLS 7 | 8 | class GridSRForwarder : public Element { 9 | 10 | public: 11 | GridSRForwarder() CLICK_COLD; 12 | ~GridSRForwarder() CLICK_COLD; 13 | 14 | const char *class_name() const { return "GridSRForwarder"; } 15 | void *cast(const char *); 16 | const char *port_count() const { return "1/2"; } 17 | const char *processing() const { return "h/h"; } 18 | const char *flow_code() const { return "x/x"; } 19 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 20 | int initialize(ErrorHandler *) CLICK_COLD; 21 | 22 | void push(int port, Packet *); 23 | 24 | private: 25 | IPAddress _ip; 26 | 27 | void handle_host(Packet *p); 28 | }; 29 | 30 | CLICK_ENDDECLS 31 | #endif 32 | -------------------------------------------------------------------------------- /elements/grid/setgridchecksum.hh: -------------------------------------------------------------------------------- 1 | #ifndef SETGRIDCHECKSUM_HH 2 | #define SETGRIDCHECKSUM_HH 3 | 4 | /* 5 | * =c 6 | * SetGridChecksum() 7 | * =s Grid 8 | * =d 9 | * Expects a Grid MAC packet as input. 10 | * Calculates the Grid header's checksum and sets the version and checksum header fields. 11 | * 12 | * =a 13 | * CheckGridHeader */ 14 | 15 | #include 16 | #include 17 | CLICK_DECLS 18 | 19 | class SetGridChecksum : public Element { 20 | public: 21 | SetGridChecksum() CLICK_COLD; 22 | ~SetGridChecksum() CLICK_COLD; 23 | 24 | const char *class_name() const { return "SetGridChecksum"; } 25 | const char *port_count() const { return PORTS_1_1; } 26 | const char *processing() const { return AGNOSTIC; } 27 | 28 | Packet *simple_action(Packet *); 29 | }; 30 | 31 | CLICK_ENDDECLS 32 | #endif 33 | -------------------------------------------------------------------------------- /elements/grid/timeutils.hh: -------------------------------------------------------------------------------- 1 | /* 2 | * timeutils.hh 3 | * File created by Douglas S. J. De Couto 4 | * 15 November 2001 5 | */ 6 | 7 | #ifndef TIMEUTIL_H 8 | #define TIMEUTIL_H 9 | 10 | #ifdef CLICK_USERLEVEL 11 | #include 12 | #endif 13 | #include 14 | #include /* for htonl() and ntohl() */ 15 | CLICK_DECLS 16 | 17 | inline timeval 18 | hton(const timeval &tv) { 19 | struct timeval tv2; 20 | tv2.tv_sec = htonl(tv.tv_sec); 21 | tv2.tv_usec = htonl(tv.tv_usec); 22 | return tv2; 23 | } 24 | 25 | inline timeval 26 | ntoh(const timeval &tv) { 27 | struct timeval tv2; 28 | tv2.tv_sec = ntohl(tv.tv_sec); 29 | tv2.tv_usec = ntohl(tv.tv_usec); 30 | return tv2; 31 | } 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/grid/unstripdsrheader.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_UNSTRIPDSRHEADER_HH 2 | #define CLICK_UNSTRIPDSRHEADER_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * =c 8 | * UnstripDSRHeader() 9 | * =s ip 10 | * restores DSR Header 11 | * =d 12 | * 13 | * Undoes StripDSRHeader: Swaps the IP and the DSR header a second time, 14 | * pushes the dsr_len offset previously saved to VLAN_ANNO. 15 | * 16 | * =a CheckDSRHeader, MarkDSRHeader, StripDSRHeader */ 17 | 18 | class UnstripDSRHeader : public Element { public: 19 | 20 | UnstripDSRHeader() CLICK_COLD; 21 | ~UnstripDSRHeader() CLICK_COLD; 22 | 23 | const char *class_name() const { return "UnstripDSRHeader"; } 24 | const char *port_count() const { return PORTS_1_1; } 25 | 26 | Packet *simple_action(Packet *); 27 | 28 | }; 29 | 30 | CLICK_ENDDECLS 31 | #endif 32 | -------------------------------------------------------------------------------- /elements/ip/checkipheader2.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_CHECKIPHEADER2_HH 2 | #define CLICK_CHECKIPHEADER2_HH 3 | #include "elements/ip/checkipheader.hh" 4 | 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | CheckIPHeader2([OFFSET, I]) 11 | 12 | =s ip 13 | 14 | checks IP header, no checksum 15 | 16 | =d 17 | 18 | This element behaves exactly like CheckIPHeader, except that it does not by 19 | default check packets' IP checksums. 20 | 21 | =a CheckIPHeader, StripIPHeader, MarkIPHeader */ 22 | 23 | class CheckIPHeader2 : public CheckIPHeader { 24 | public: 25 | CheckIPHeader2(); 26 | ~CheckIPHeader2(); 27 | 28 | const char *class_name() const { return "CheckIPHeader2"; } 29 | }; 30 | 31 | CLICK_ENDDECLS 32 | #endif 33 | -------------------------------------------------------------------------------- /elements/ip6/ip6routetable.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_IP6ROUTETABLE_HH 3 | #define CLICK_IP6ROUTETABLE_HH 4 | #include 5 | #include 6 | CLICK_DECLS 7 | 8 | class IP6RouteTable : public Element { public: 9 | 10 | void* cast(const char*); 11 | 12 | virtual int add_route(IP6Address, IP6Address, IP6Address, int, ErrorHandler *); 13 | virtual int remove_route(IP6Address, IP6Address, ErrorHandler *); 14 | virtual String dump_routes(); 15 | 16 | static int add_route_handler(const String&, Element*, void*, ErrorHandler*); 17 | static int remove_route_handler(const String&, Element*, void*, ErrorHandler*); 18 | static int ctrl_handler(const String&, Element*, void*, ErrorHandler*); 19 | static String table_handler(Element*, void*); 20 | 21 | }; 22 | 23 | CLICK_ENDDECLS 24 | #endif 25 | -------------------------------------------------------------------------------- /elements/ip6/setip6address.hh: -------------------------------------------------------------------------------- 1 | #ifndef SETIP6ADDRESS_HH 2 | #define SETIP6ADDRESS_HH 3 | #include 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | * =c 9 | * SetIP6Address(IP6) 10 | * =s ip6 11 | * 12 | * =d 13 | * Set the destination IP6 address annotation of incoming packets to the 14 | * static IP6 address IP6 15 | * 16 | * =a StoreIP6Address, GetIP6Address 17 | */ 18 | 19 | class SetIP6Address : public Element { 20 | 21 | IP6Address _ip6; 22 | 23 | public: 24 | 25 | SetIP6Address(); 26 | ~SetIP6Address(); 27 | 28 | const char *class_name() const { return "SetIP6Address"; } 29 | const char *port_count() const { return PORTS_1_1; } 30 | 31 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 32 | 33 | Packet *simple_action(Packet *); 34 | 35 | }; 36 | 37 | CLICK_ENDDECLS 38 | #endif 39 | -------------------------------------------------------------------------------- /elements/ipsec/satable.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_SATABLE_HH 2 | #define CLICK_SATABLE_HH 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include "sadatatuple.hh" 9 | 10 | CLICK_DECLS 11 | 12 | class SATable : public Element { public: 13 | 14 | SATable() CLICK_COLD; 15 | ~SATable() CLICK_COLD; 16 | 17 | const char *class_name() const { return "SATable"; } 18 | String print_sa_data(); 19 | int insert(SPI this_spi , SADataTuple SA_data) ; 20 | int remove(unsigned int spi); 21 | SADataTuple * lookup(SPI this_spi); 22 | 23 | private: 24 | //Defines a click hashmap object the SA table in our case 25 | typedef HashMap STable; 26 | typedef STable::const_iterator SIter; 27 | STable _table; 28 | 29 | }; 30 | 31 | CLICK_ENDDECLS 32 | #endif 33 | -------------------------------------------------------------------------------- /elements/linuxmodule/perfcountuser.hh: -------------------------------------------------------------------------------- 1 | #ifndef PERFCOUNTUSER_HH 2 | #define PERFCOUNTUSER_HH 3 | #include 4 | 5 | class PerfCountUser : public Element { public: 6 | 7 | PerfCountUser() CLICK_COLD; 8 | ~PerfCountUser() CLICK_COLD; 9 | 10 | bool is_base() const { return _metric0 > -2; } 11 | 12 | int prepare(const String &, ErrorHandler *, int force = -1); 13 | int initialize(ErrorHandler *) CLICK_COLD; 14 | 15 | private: 16 | 17 | int _metric0; 18 | int _metric1; 19 | 20 | }; 21 | 22 | #define MSR_OS (1<<17) 23 | #define MSR_OCCURRENCE (1<<18) 24 | #define MSR_ENABLE (1<<22) 25 | #define MSR_FLAGS0 (MSR_OS|MSR_OCCURRENCE|MSR_ENABLE) 26 | #define MSR_FLAGS1 (MSR_OS|MSR_OCCURRENCE) 27 | 28 | #define MSR_EVNTSEL0 0x186 29 | #define MSR_EVNTSEL1 0x187 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /elements/linuxmodule/schedulelinux.hh: -------------------------------------------------------------------------------- 1 | #ifndef SCHEDULELINUX_HH 2 | #define SCHEDULELINUX_HH 3 | #include 4 | #include 5 | 6 | /* 7 | * =c 8 | * ScheduleLinux 9 | * =s information 10 | * returns to Linux scheduler 11 | * =d 12 | * 13 | * Returns to Linux's scheduler every time it is scheduled by Click. Use 14 | * ScheduleInfo to specify how often this should happen. 15 | * 16 | * =a ScheduleInfo */ 17 | 18 | class ScheduleLinux : public Element { public: 19 | 20 | ScheduleLinux() CLICK_COLD; 21 | ~ScheduleLinux() CLICK_COLD; 22 | 23 | const char *class_name() const { return "ScheduleLinux"; } 24 | 25 | int initialize(ErrorHandler *) CLICK_COLD; 26 | void add_handlers() CLICK_COLD; 27 | 28 | bool run_task(Task *); 29 | 30 | private: 31 | 32 | Task _task; 33 | 34 | }; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /elements/local/duppath.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_DUPPATH_HH 2 | #define CLICK_DUPPATH_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | class DupPath : public Element { 7 | struct { 8 | Packet **_q; 9 | unsigned _head; 10 | unsigned _tail; 11 | } _q; 12 | 13 | int next_i(int i) const { return (i!=128 ? i+1 : 0); } 14 | Packet *deq(); 15 | 16 | public: 17 | 18 | DupPath() CLICK_COLD; 19 | ~DupPath() CLICK_COLD; 20 | 21 | const char *class_name() const { return "DupPath"; } 22 | const char *port_count() const { return "1/2"; } 23 | const char *processing() const { return "h/hl"; } 24 | int initialize(ErrorHandler *) CLICK_COLD; 25 | void cleanup(CleanupStage) CLICK_COLD; 26 | 27 | void push(int port, Packet *); 28 | Packet *pull(int port); 29 | }; 30 | 31 | CLICK_ENDDECLS 32 | #endif 33 | -------------------------------------------------------------------------------- /elements/local/forceicmp.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_FORCEICMP_HH 2 | #define CLICK_FORCEICMP_HH 3 | #include 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | * =c 9 | * ForceICMP([TYPE, CODE]) 10 | * =s icmp 11 | * sets ICMP checksum 12 | * =d 13 | * Sets the ICMP checksum of an ICMP-in-IP packet. Optionally 14 | * sets the TYPE and CODE of the ICMP header. 15 | */ 16 | 17 | class ForceICMP : public Element { 18 | public: 19 | ForceICMP() CLICK_COLD; 20 | ~ForceICMP() CLICK_COLD; 21 | 22 | const char *class_name() const { return "ForceICMP"; } 23 | const char *port_count() const { return PORTS_1_1; } 24 | int configure(Vector &conf, ErrorHandler *errh) CLICK_COLD; 25 | 26 | Packet *simple_action(Packet *); 27 | 28 | private: 29 | int _count; 30 | int _type; 31 | int _code; 32 | }; 33 | 34 | CLICK_ENDDECLS 35 | #endif 36 | -------------------------------------------------------------------------------- /elements/local/forceip.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_FORCEIP_HH 2 | #define CLICK_FORCEIP_HH 3 | #include 4 | #include 5 | #include 6 | CLICK_DECLS 7 | 8 | /* 9 | * =c 10 | * ForceIP() 11 | * =s ip 12 | * Fixes fields to make packets into legal IP packets. 13 | * =d 14 | * 15 | * Fixes various fields in incoming packets to make sure they 16 | * are legal IP packets. 17 | * 18 | * =e 19 | * 20 | * RandomSource(20) 21 | * -> SetIPAddress(1.2.3.4) 22 | * -> StoreIPAddress(16) 23 | * -> ForceIP() -> ... 24 | */ 25 | 26 | class ForceIP : public Element { 27 | 28 | int _count; 29 | 30 | public: 31 | 32 | ForceIP() CLICK_COLD; 33 | ~ForceIP() CLICK_COLD; 34 | 35 | const char *class_name() const { return "ForceIP"; } 36 | const char *port_count() const { return PORTS_1_1; } 37 | 38 | Packet *simple_action(Packet *); 39 | 40 | }; 41 | 42 | CLICK_ENDDECLS 43 | #endif 44 | -------------------------------------------------------------------------------- /elements/local/forceudp.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_FORCEUDP_HH 2 | #define CLICK_FORCEUDP_HH 3 | #include 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | * =c 9 | * ForceUDP([DPORT]) 10 | * =s udp 11 | * sets UDP packet fields 12 | * =d 13 | * Set the checksum and some other fields to try to make a 14 | * packet look like UDP. If DPORT is specified and not -1, forces 15 | * the destination port to be DPORT. 16 | */ 17 | 18 | class ForceUDP : public Element { 19 | public: 20 | ForceUDP() CLICK_COLD; 21 | ~ForceUDP() CLICK_COLD; 22 | 23 | const char *class_name() const { return "ForceUDP"; } 24 | const char *port_count() const { return PORTS_1_1; } 25 | int configure(Vector &conf, ErrorHandler *errh) CLICK_COLD; 26 | 27 | Packet *simple_action(Packet *); 28 | 29 | private: 30 | int _count; 31 | int _dport; 32 | }; 33 | 34 | CLICK_ENDDECLS 35 | #endif 36 | -------------------------------------------------------------------------------- /elements/ns/simpacketanalyzer.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include "simpacketanalyzer.hh" 5 | #include 6 | CLICK_DECLS 7 | 8 | 9 | SimPacketAnalyzer::SimPacketAnalyzer() 10 | { 11 | } 12 | 13 | 14 | SimPacketAnalyzer::~SimPacketAnalyzer() 15 | { 16 | } 17 | 18 | 19 | CLICK_ENDDECLS 20 | ELEMENT_REQUIRES(ns) 21 | ELEMENT_PROVIDES(SimPacketAnalyzer) 22 | -------------------------------------------------------------------------------- /elements/ns/simpacketanalyzer.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_SIMPACKETANALYZER_HH 2 | #define CLICK_SIMPACKETANALYZER_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* =c 7 | * 8 | * SimPacketAnalyzer() 9 | * 10 | * =s traces 11 | * 12 | * superclass for entering packet analyses in an ns2 trace 13 | * 14 | * =d 15 | * 16 | * Implement this interface for specific protocols to allow analysis of 17 | * packets in ToSimTrace. 18 | * 19 | * =a 20 | * ToSimTrace 21 | */ 22 | 23 | 24 | class SimPacketAnalyzer : public Element{ 25 | public: 26 | SimPacketAnalyzer() CLICK_COLD; 27 | ~SimPacketAnalyzer() CLICK_COLD; 28 | 29 | const char *class_name() const { return "SimPacketAnalyzer"; } 30 | const char *processing() const { return PUSH; } 31 | const char *port_count() const { return PORTS_0_0; } 32 | 33 | virtual String analyze(Packet*, int offset) = 0; 34 | 35 | private: 36 | 37 | }; 38 | 39 | CLICK_ENDDECLS 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /elements/radio/b8b10.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_B8B10_HH 2 | #define CLICK_B8B10_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * B8B10(ENCODE) 8 | * 9 | * If ENCODE is 1, encode each packet with a 8b10b code. 10 | * If ENCODE is 0, decode. 11 | * 12 | * Encodes each 8-bit byte into a 10-bit symbol with as 13 | * many 0s as 1s. The point is to keep the BIM-4xx-RS232 14 | * radio happy. 15 | */ 16 | 17 | class B8B10 : public Element { 18 | public: 19 | B8B10(); 20 | ~B8B10(); 21 | 22 | const char *class_name() const { return "B8B10"; } 23 | const char *port_count() const { return PORTS_1_1; } 24 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 25 | int initialize(ErrorHandler *) CLICK_COLD; 26 | 27 | Packet *simple_action(Packet *); 28 | 29 | private: 30 | int _flag; 31 | 32 | }; 33 | 34 | CLICK_ENDDECLS 35 | #endif 36 | -------------------------------------------------------------------------------- /elements/radio/bim-proto.hh: -------------------------------------------------------------------------------- 1 | #define BIM_ESC 0xac 2 | #define BIM_ESC_ESC 0xB2 3 | #define BIM_ESC_START 0xc6 4 | #define BIM_ESC_END 0x87 5 | -------------------------------------------------------------------------------- /elements/radio/checkpattern.hh: -------------------------------------------------------------------------------- 1 | #ifndef CHECKPATTERN_HH 2 | #define CHECKPATTERN_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * CheckPattern(len) 8 | * 9 | * Check the packets generated by SendPattern(n) 10 | */ 11 | 12 | class CheckPattern : public Element { 13 | 14 | unsigned _len; 15 | 16 | public: 17 | 18 | CheckPattern() CLICK_COLD; 19 | ~CheckPattern() CLICK_COLD; 20 | 21 | const char *class_name() const { return "CheckPattern"; } 22 | const char *port_count() const { return PORTS_1_1; } 23 | 24 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 25 | 26 | Packet *simple_action(Packet *); 27 | 28 | }; 29 | 30 | CLICK_ENDDECLS 31 | #endif 32 | -------------------------------------------------------------------------------- /elements/radio/scramble.hh: -------------------------------------------------------------------------------- 1 | #ifndef SCRAMBLE_HH 2 | #define SCRAMBLE_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * Scramble() 8 | * 9 | * Exclusive-or each packet with a fixed repeating 10 | * sequence of bits. The point is to try to end up 11 | * with a balanced number of ones and zeroes so that 12 | * simple transmission equipment will be happy. 13 | * The BIM radio, for example. 14 | * 15 | * Scramble is its own inverse. 16 | */ 17 | 18 | class Scramble : public Element { 19 | public: 20 | Scramble() CLICK_COLD; 21 | ~Scramble() CLICK_COLD; 22 | 23 | const char *class_name() const { return "Scramble"; } 24 | const char *port_count() const { return PORTS_1_1; } 25 | 26 | Packet *simple_action(Packet *); 27 | 28 | }; 29 | 30 | CLICK_ENDDECLS 31 | #endif 32 | -------------------------------------------------------------------------------- /elements/radio/sendpattern.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_SENDPATTERN_HH 2 | #define CLICK_SENDPATTERN_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * SendPattern(len) 8 | * 9 | * Keep sending packets of length len filled with a 10 | * repeating pattern. The point is to help diagnose 11 | * bit errors on a radio link. 12 | * 13 | * Meant to be used with CheckPattern. 14 | */ 15 | 16 | class SendPattern : public Element { 17 | 18 | int _len; 19 | 20 | public: 21 | 22 | SendPattern() CLICK_COLD; 23 | ~SendPattern() CLICK_COLD; 24 | 25 | const char *class_name() const { return "SendPattern"; } 26 | const char *port_count() const { return PORTS_0_1; } 27 | const char *processing() const { return PULL; } 28 | 29 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 30 | 31 | Packet *pull(int); 32 | 33 | }; 34 | 35 | CLICK_ENDDECLS 36 | #endif 37 | -------------------------------------------------------------------------------- /elements/research/randload.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_RandLoad_HH 2 | #define CLICK_RandLoad_HH 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | CLICK_DECLS 10 | 11 | class RandLoad : public BatchElement { 12 | 13 | public: 14 | 15 | RandLoad() CLICK_COLD; 16 | ~RandLoad() CLICK_COLD; 17 | 18 | const char *class_name() const { return "RandLoad"; } 19 | const char *port_count() const { return "1/1"; } 20 | const char *processing() const { return PUSH; } 21 | 22 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 23 | int initialize(ErrorHandler *errh); 24 | 25 | 26 | void push_batch(int, PacketBatch *); 27 | private: 28 | int _min; 29 | int _max; 30 | per_thread _gens; 31 | }; 32 | 33 | 34 | 35 | 36 | 37 | CLICK_ENDDECLS 38 | #endif 39 | -------------------------------------------------------------------------------- /elements/simple/simpleidle.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_SIMPLEIDLE_HH 2 | #define CLICK_SIMPLEIDLE_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * =c 8 | * SimpleIdle 9 | * =s basicsources 10 | * discards packets 11 | * =d 12 | * 13 | * Like Idle, but does not provide notification. 14 | * 15 | * =sa Idle 16 | */ 17 | 18 | class SimpleIdle : public Element { public: 19 | 20 | SimpleIdle() CLICK_COLD; 21 | ~SimpleIdle() CLICK_COLD; 22 | 23 | const char *class_name() const { return "SimpleIdle"; } 24 | const char *port_count() const { return "-/-"; } 25 | const char *processing() const { return "a/a"; } 26 | const char *flow_code() const { return "x/y"; } 27 | 28 | void push(int, Packet *); 29 | Packet *pull(int); 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/standard/burster.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_BURSTER_HH 2 | #define CLICK_BURSTER_HH 3 | #include "timedunqueue.hh" 4 | CLICK_DECLS 5 | 6 | /* 7 | * =c 8 | * Burster(INTERVAL [, BURST]) 9 | * =s shaping 10 | * pull-to-push converter 11 | * =d 12 | * 13 | * Burster is a variant of TimedUnqueue with a default BURST of 8, rather than 14 | * 1. 15 | * 16 | * =a TimedUnqueue 17 | */ 18 | 19 | class Burster : public TimedUnqueue { public: 20 | 21 | Burster() CLICK_COLD; 22 | 23 | const char *class_name() const { return "Burster"; } 24 | void *cast(const char *name); 25 | 26 | }; 27 | 28 | CLICK_ENDDECLS 29 | #endif 30 | -------------------------------------------------------------------------------- /elements/standard/checkcrc32.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_CHECKCRC32_HH 2 | #define CLICK_CHECKCRC32_HH 3 | #include 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | * =c 9 | * CheckCRC32() 10 | * =s crc 11 | * checks packet CRC32s 12 | * =d 13 | * Check that the CRC32 appended by SetCRC32 is OK. 14 | * If so, delete the CRC from the packet. 15 | * Otherwise, drop the packet. 16 | * =a SetCRC32 17 | */ 18 | class CheckCRC32 : public Element { public: 19 | 20 | CheckCRC32(); 21 | 22 | const char *class_name() const { return "CheckCRC32"; } 23 | const char *port_count() const { return PORTS_1_1; } 24 | 25 | Packet *simple_action(Packet *); 26 | 27 | private: 28 | 29 | atomic_uint32_t _drops; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/standard/clickyinfo.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_CLICKYINFO_HH 2 | #define CLICK_CLICKYINFO_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | =c 8 | ClickyInfo(STYLE ...) 9 | 10 | =s information 11 | stores information for the Clicky GUI 12 | 13 | =d 14 | 15 | Click drivers ignore this element; it has no inputs or outputs and ignores its 16 | configuration arguments. The Clicky GUI parses the configuration arguments 17 | and adds them to its styles. 18 | */ 19 | 20 | class ClickyInfo : public Element { public: 21 | 22 | ClickyInfo() CLICK_COLD; 23 | 24 | const char *class_name() const { return "ClickyInfo"; } 25 | int configure(Vector &conf, ErrorHandler *errh) CLICK_COLD; 26 | 27 | }; 28 | 29 | CLICK_ENDDECLS 30 | #endif 31 | -------------------------------------------------------------------------------- /elements/standard/devirtualizeinfo.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_DEVIRTUALIZEINFO_HH 2 | #define CLICK_DEVIRTUALIZEINFO_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | class DevirtualizeInfo : public Element { 7 | 8 | public: 9 | 10 | DevirtualizeInfo() CLICK_COLD; 11 | 12 | const char *class_name() const { return "DevirtualizeInfo"; } 13 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 14 | 15 | }; 16 | 17 | CLICK_ENDDECLS 18 | #endif 19 | -------------------------------------------------------------------------------- /elements/standard/ensureheadroom.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_ENSUREHEADROOM_HH 2 | #define CLICK_ENSUREHEADROOM_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | =c 8 | 9 | EnsureHeadroom 10 | */ 11 | 12 | class EnsureHeadroom : public BatchElement { public: 13 | 14 | EnsureHeadroom() CLICK_COLD; 15 | 16 | const char *class_name() const { return "EnsureHeadroom"; } 17 | const char *port_count() const { return PORTS_1_1; } 18 | 19 | int configure(Vector &conf, ErrorHandler *errh) CLICK_COLD; 20 | 21 | #if HAVE_BATCH 22 | PacketBatch* simple_action_batch(PacketBatch*); 23 | #endif 24 | Packet* simple_action(Packet *); 25 | Packet* smaction(Packet*); 26 | private: 27 | unsigned _headroom; 28 | bool _force; 29 | }; 30 | 31 | CLICK_ENDDECLS 32 | #endif 33 | -------------------------------------------------------------------------------- /elements/standard/flowinfo.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_FLOWINFO_HH 3 | #define CLICK_FLOWINFO_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | FlowInfo(ELEMENT FLOWCODE, ...) 11 | 12 | =s information 13 | 14 | specifies flow codes 15 | 16 | =io 17 | 18 | None 19 | 20 | =d 21 | 22 | Allows the user to override specific elements' flow codes. Each configuration 23 | argument has the form `ELEMENT CODE', meaning that the element named ELEMENT 24 | has flow code CODE. 25 | */ 26 | 27 | class FlowInfo : public Element { public: 28 | 29 | FlowInfo() CLICK_COLD; 30 | 31 | const char* class_name() const { return "FlowInfo"; } 32 | 33 | int configure_phase() const { return CONFIGURE_PHASE_INFO; } 34 | int configure(Vector&, ErrorHandler*) CLICK_COLD; 35 | 36 | }; 37 | 38 | CLICK_ENDDECLS 39 | #endif 40 | -------------------------------------------------------------------------------- /elements/standard/hub.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_HUB_HH 2 | #define CLICK_HUB_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | =c 8 | 9 | Hub() 10 | 11 | =s basictransfer 12 | 13 | duplicates packets like a hub 14 | 15 | =d 16 | 17 | Hub sends a copy of each input packet out each output port. However, a packet 18 | received on input port N is not emitted on output port N. Thus, the element 19 | acts sort of like an Ethernet hub (but it is not Ethernet specific). 20 | 21 | =a 22 | 23 | Tee, EtherSwitch 24 | */ 25 | 26 | class Hub : public Element { public: 27 | 28 | Hub() CLICK_COLD; 29 | 30 | const char *class_name() const { return "Hub"; } 31 | const char *port_count() const { return "-/="; } 32 | const char *processing() const { return PUSH; } 33 | const char *flow_code() const { return "#/[^#]"; } 34 | 35 | void push(int port, Packet* p); 36 | 37 | }; 38 | 39 | CLICK_ENDDECLS 40 | #endif 41 | -------------------------------------------------------------------------------- /elements/standard/msqueue.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include "msqueue.hh" 3 | #include 4 | CLICK_DECLS 5 | 6 | #define PREFETCH 1 7 | 8 | MSQueue::MSQueue() 9 | { 10 | } 11 | 12 | void * 13 | MSQueue::cast(const char *n) 14 | { 15 | if (strcmp(n, "MSQueue") == 0) 16 | return (Element *)this; 17 | else 18 | return ThreadSafeQueue::cast(n); 19 | } 20 | 21 | int 22 | MSQueue::configure(Vector &conf, ErrorHandler *errh) 23 | { 24 | int r = ThreadSafeQueue::configure(conf, errh); 25 | if (r >= 0) 26 | errh->warning("MSQueue is deprecated, use ThreadSafeQueue instead"); 27 | return r; 28 | } 29 | 30 | CLICK_ENDDECLS 31 | ELEMENT_REQUIRES(multithread) 32 | EXPORT_ELEMENT(MSQueue) 33 | -------------------------------------------------------------------------------- /elements/standard/quitwatcher.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_QUITWATCHER_HH 2 | #define CLICK_QUITWATCHER_HH 3 | #include 4 | #include 5 | CLICK_DECLS 6 | class Handler; 7 | 8 | /* 9 | =c 10 | 11 | QuitWatcher(ELEMENT, ...) 12 | 13 | =s control 14 | 15 | stops router processing 16 | 17 | =d 18 | 19 | Stops router processing when at least one of the ELEMENTs is no longer 20 | scheduled. 21 | 22 | */ 23 | 24 | class QuitWatcher : public Element { public: 25 | 26 | QuitWatcher() CLICK_COLD; 27 | 28 | const char *class_name() const { return "QuitWatcher"; } 29 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 30 | int initialize(ErrorHandler *) CLICK_COLD; 31 | 32 | void run_timer(Timer *); 33 | 34 | private: 35 | 36 | Vector _e; 37 | Vector _handlers; 38 | Timer _timer; 39 | 40 | }; 41 | 42 | CLICK_ENDDECLS 43 | #endif 44 | -------------------------------------------------------------------------------- /elements/standard/randomswitch.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_RANDOMSWITCH_HH 3 | #define CLICK_RANDOMSWITCH_HH 4 | #include 5 | #include 6 | CLICK_DECLS 7 | 8 | /* 9 | * =c 10 | * RandomSwitch 11 | * =s classification 12 | * sends packets to random outputs 13 | * =io 14 | * one input, one or more outputs 15 | * =d 16 | * Pushes each arriving packet to one of the N outputs, choosing outputs randomly. 17 | * 18 | * =a Switch, StrideSwitch, RoundRobinSwitch, HashSwitch 19 | */ 20 | 21 | class RandomSwitch : public Element { public: 22 | 23 | RandomSwitch() CLICK_COLD; 24 | 25 | const char *class_name() const { return "RandomSwitch"; } 26 | const char *port_count() const { return "1/1-"; } 27 | const char *processing() const { return PUSH; } 28 | 29 | void push(int, Packet *); 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/standard/setcrc32.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_SETCRC32_HH 2 | #define CLICK_SETCRC32_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * =c 8 | * SetCRC32() 9 | * =s crc 10 | * calculates CRC32 and prepends to packet 11 | * =d 12 | * Computes a CRC32 over each packet and appends the 4 CRC 13 | * bytes to the packet. 14 | * =a CheckCRC32 15 | */ 16 | 17 | class EtherAddress; 18 | 19 | class SetCRC32 : public Element { public: 20 | 21 | SetCRC32(); 22 | 23 | const char *class_name() const { return "SetCRC32"; } 24 | const char *port_count() const { return PORTS_1_1; } 25 | 26 | Packet *simple_action(Packet *); 27 | 28 | }; 29 | 30 | CLICK_ENDDECLS 31 | #endif 32 | -------------------------------------------------------------------------------- /elements/standard/unstripanno.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_UNSTRIPANNO_HH 2 | #define CLICK_UNSTRIPANNO_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * =c 8 | * UnstripAnno(LENGTH) 9 | * =s basicmod 10 | * Unstrip the number of bytes specified by an annotation from front of packets 11 | * =d 12 | * Put the bytes specified in an annotation at the front of the packet. These bytes may be bytes 13 | * previously removed by StripTCPHeader. 14 | * 15 | * =a StripTCPHeader 16 | */ 17 | 18 | class UnstripAnno : public Element { 19 | 20 | public: 21 | 22 | UnstripAnno(); 23 | 24 | const char *class_name() const { return "UnstripAnno"; } 25 | const char *port_count() const { return PORTS_1_1; } 26 | 27 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 28 | 29 | Packet *simple_action(Packet *); 30 | 31 | private: 32 | int _anno; 33 | }; 34 | 35 | CLICK_ENDDECLS 36 | #endif 37 | -------------------------------------------------------------------------------- /elements/tcpudp/statelesstcpresp.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_STATELESSTCPRESP_HH 2 | #define CLICK_STATELESSTCPRESP_HH 3 | #include 4 | #include 5 | #include 6 | CLICK_DECLS 7 | 8 | class StatelessTCPResponder : public Element { public: 9 | 10 | StatelessTCPResponder() { } 11 | ~StatelessTCPResponder() { } 12 | 13 | const char *class_name() const { return "StatelessTCPResponder"; } 14 | 15 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 16 | 17 | Packet *simple_action(Packet *); 18 | 19 | private: 20 | 21 | String _data; 22 | 23 | }; 24 | 25 | CLICK_ENDDECLS 26 | #endif 27 | -------------------------------------------------------------------------------- /elements/test/bhmtest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_BIGHASHMAPTEST_HH 3 | #define CLICK_BIGHASHMAPTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | BigHashMapTest() 11 | 12 | =s test 13 | 14 | runs regression tests for BigHashMap 15 | 16 | =d 17 | 18 | BigHashMapTest runs BigHashMap regression tests at initialization time. It 19 | does not route packets. 20 | 21 | */ 22 | 23 | class BigHashMapTest : public Element { public: 24 | 25 | BigHashMapTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "BigHashMapTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/biginttest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_BIGINTTEST_HH 3 | #define CLICK_BIGINTTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | BigintTest() 11 | 12 | =s test 13 | 14 | Test multiple-precision multiply and divide with some simple tests. 15 | 16 | =d 17 | 18 | This element routes no packets and does all its work at initialization time. 19 | 20 | */ 21 | 22 | class BigintTest : public Element { public: 23 | 24 | BigintTest() CLICK_COLD; 25 | 26 | const char *class_name() const { return "BigintTest"; } 27 | 28 | int initialize(ErrorHandler *) CLICK_COLD; 29 | 30 | }; 31 | 32 | CLICK_ENDDECLS 33 | #endif 34 | -------------------------------------------------------------------------------- /elements/test/bitvectortest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_BITVECTORTEST_HH 3 | #define CLICK_BITVECTORTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | BitvectorTest() 11 | 12 | =s test 13 | 14 | runs regression tests for Bitvector 15 | 16 | =d 17 | 18 | BitvectorTest runs Bitvector regression tests at initialization time. It 19 | does not route packets. 20 | 21 | */ 22 | 23 | class BitvectorTest : public Element { public: 24 | 25 | BitvectorTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "BitvectorTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/clptest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_CLPTEST_HH 3 | #define CLICK_CLPTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | CLPTest([keywords]) 11 | 12 | =s test 13 | 14 | runs regression tests for CLP command line parser 15 | 16 | =d 17 | 18 | CLPTest runs regression tests for the CLP command line parsing library at 19 | initialization time. It does not route packets. 20 | 21 | */ 22 | 23 | class CLPTest : public Element { public: 24 | 25 | CLPTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "CLPTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/confparsetest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_CONFPARSETEST_HH 3 | #define CLICK_CONFPARSETEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | ConfParseTest() 11 | 12 | =s test 13 | 14 | run regression tests for configuration parsing 15 | 16 | =d 17 | 18 | ConfParseTest runs configuration parsing regression tests at initialization 19 | time. It does not route packets. 20 | 21 | */ 22 | 23 | class ConfParseTest : public Element { public: 24 | 25 | ConfParseTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "ConfParseTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/cryptotest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_CRYPTOTEST_HH 3 | #define CLICK_CRYPTOTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | CryptoTest() 11 | 12 | =s test 13 | 14 | runs regression tests for cryptography functions 15 | 16 | =d 17 | 18 | CryptoTest runs regression tests for Click's cryptography functions at 19 | initialization time. It does not route packets. 20 | 21 | */ 22 | 23 | class CryptoTest : public Element { public: 24 | 25 | CryptoTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "CryptoTest"; } 28 | 29 | int initialize(ErrorHandler *errh) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/dequetest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_DEQUETEST_HH 3 | #define CLICK_DEQUETEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | DequeTest() 11 | 12 | =s test 13 | 14 | runs regression tests for Deque 15 | 16 | =d 17 | 18 | DequeTest runs Deque regression tests at initialization time. It does not 19 | route packets. 20 | 21 | */ 22 | 23 | class DequeTest : public Element { public: 24 | 25 | DequeTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "DequeTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/errortest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_ERRORTEST_HH 3 | #define CLICK_ERRORTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | ErrorTest() 11 | 12 | =s test 13 | 14 | runs regression tests for error handling 15 | 16 | =d 17 | 18 | ErrorTest runs error handling regression tests at initialization 19 | time. 20 | 21 | */ 22 | 23 | class ErrorTest : public Element { public: 24 | 25 | ErrorTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "ErrorTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/functiontest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_FUNCTIONTEST_HH 3 | #define CLICK_FUNCTIONTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | FunctionTest() 11 | 12 | =s test 13 | 14 | runs regression tests for other Click functions 15 | 16 | =d 17 | 18 | FunctionTest runs regression tests for other Click functions, such as for 19 | integer functions, at initialization time. It does not route packets. 20 | 21 | */ 22 | 23 | class FunctionTest : public Element { public: 24 | 25 | FunctionTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "FunctionTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/hashtablemptest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_HASHTABLEMPTEST_HH 3 | #define CLICK_HASHTABLEMPTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | HashTableMPTest() 11 | 12 | =s test 13 | 14 | runs regression tests for HashTable 15 | 16 | =d 17 | 18 | HashTableMPTest runs HashTable regression tests at initialization time. It 19 | does not route packets. 20 | 21 | */ 22 | 23 | class HashTableMPTest : public Element { public: 24 | 25 | HashTableMPTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "HashTableMPTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/hashtabletest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_HASHTABLETEST_HH 3 | #define CLICK_HASHTABLETEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | HashTableTest() 11 | 12 | =s test 13 | 14 | runs regression tests for HashTable 15 | 16 | =d 17 | 18 | HashTableTest runs HashTable regression tests at initialization time. It 19 | does not route packets. 20 | 21 | */ 22 | 23 | class HashTableTest : public Element { public: 24 | 25 | HashTableTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "HashTableTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/heaptest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_HEAPTEST_HH 3 | #define CLICK_HEAPTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | HeapTest() 11 | 12 | =s test 13 | 14 | runs regression tests for heap functions 15 | 16 | =d 17 | 18 | HeapTest runs regression tests for Click's heap functions at initialization 19 | time. It does not route packets. 20 | 21 | */ 22 | 23 | class HeapTest : public Element { public: 24 | 25 | HeapTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "HeapTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/jsontest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_JSONTEST_HH 3 | #define CLICK_JSONTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | JsonTest() 11 | 12 | =s test 13 | 14 | runs regression tests for Json 15 | 16 | =d 17 | 18 | JsonTest runs Json regression tests at initialization time. It 19 | does not route packets. 20 | 21 | */ 22 | 23 | class JsonTest : public Element { public: 24 | 25 | JsonTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "JsonTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/listtest.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_LISTTEST_HH 2 | #define CLICK_LISTTEST_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | =c 8 | 9 | ListTest() 10 | 11 | =s test 12 | 13 | runs regression tests for List 14 | 15 | =d 16 | 17 | ListTest runs List regression tests at initialization time. It does not route 18 | packets. 19 | 20 | */ 21 | 22 | class ListTest : public Element { public: 23 | 24 | ListTest() CLICK_COLD; 25 | 26 | const char *class_name() const { return "ListTest"; } 27 | 28 | int initialize(ErrorHandler *errh) CLICK_COLD; 29 | 30 | }; 31 | 32 | CLICK_ENDDECLS 33 | #endif 34 | -------------------------------------------------------------------------------- /elements/test/mtdietest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_MTDIETEST_HH 3 | #define CLICK_MTDIETEST_HH 4 | #include 5 | #include 6 | CLICK_DECLS 7 | 8 | /* 9 | =c 10 | 11 | MTDieTest([I]) 12 | 13 | =s test 14 | 15 | Runs regression tests for router stopping in multithreaded Click. 16 | 17 | */ 18 | 19 | class MTDieTest : public Element { public: 20 | 21 | MTDieTest() CLICK_COLD; 22 | 23 | const char *class_name() const { return "MTDieTest"; } 24 | 25 | int configure(Vector &conf, ErrorHandler *errh) CLICK_COLD; 26 | int initialize(ErrorHandler *errh) CLICK_COLD; 27 | void cleanup(CleanupStage) CLICK_COLD; 28 | bool run_task(Task *t); 29 | 30 | private: 31 | Vector _task; 32 | int _nthreads; 33 | }; 34 | 35 | CLICK_ENDDECLS 36 | #endif 37 | -------------------------------------------------------------------------------- /elements/test/notifiertest.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_NOTIFIERTEST_HH 2 | #define CLICK_NOTIFIERTEST_HH 3 | #include 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | NotifierTest() 10 | 11 | =s test 12 | run regression tests for Notifier 13 | 14 | =d 15 | NotifierTest runs notification regression tests at initialization 16 | time. It does not route packets. 17 | */ 18 | 19 | class NotifierTest : public Element { public: 20 | 21 | NotifierTest() CLICK_COLD; 22 | 23 | const char *class_name() const { return "NotifierTest"; } 24 | int initialize(ErrorHandler *errh) CLICK_COLD; 25 | 26 | }; 27 | 28 | CLICK_ENDDECLS 29 | #endif 30 | -------------------------------------------------------------------------------- /elements/test/packettest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_PACKETTEST_HH 3 | #define CLICK_PACKETTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | PacketTest() 11 | 12 | =s test 13 | 14 | runs regression tests for Packet 15 | 16 | =d 17 | 18 | PacketTest runs Packet regression tests at initialization time. It does not 19 | route packets. 20 | 21 | =a 22 | 23 | CheckPacket */ 24 | 25 | class PacketTest : public Element { public: 26 | 27 | PacketTest() CLICK_COLD; 28 | 29 | const char *class_name() const { return "PacketTest"; } 30 | 31 | int initialize(ErrorHandler *) CLICK_COLD; 32 | 33 | }; 34 | 35 | CLICK_ENDDECLS 36 | #endif 37 | -------------------------------------------------------------------------------- /elements/test/rcutest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_RCUTEST_HH 3 | #define CLICK_RCUTEST_HH 4 | #include 5 | #include 6 | #include 7 | #include "mtdietest.hh" 8 | 9 | CLICK_DECLS 10 | 11 | /* 12 | =c 13 | 14 | RCUTest([I]) 15 | 16 | =s test 17 | 18 | runs regression tests for click_rcu 19 | 20 | */ 21 | 22 | class RCUTest : public MTDieTest { public: 23 | 24 | RCUTest() CLICK_COLD; 25 | 26 | const char *class_name() const { return "RCUTest"; } 27 | 28 | static String read_param(Element *e, void *thunk_p); 29 | void add_handlers(); 30 | bool run_task(Task *t); 31 | 32 | private: 33 | struct nastruct { 34 | int64_t a; 35 | int64_t b; 36 | }; 37 | 38 | click_rcu _rcu; 39 | fast_rcu _fast_rcu; 40 | per_thread _nruns; 41 | }; 42 | 43 | CLICK_ENDDECLS 44 | #endif 45 | -------------------------------------------------------------------------------- /elements/test/stringtest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_STRINGTEST_HH 3 | #define CLICK_STRINGTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | StringTest([keywords]) 11 | 12 | =s test 13 | 14 | runs regression tests for String 15 | 16 | =d 17 | 18 | StringTest runs String regression tests at initialization time. It 19 | does not route packets. 20 | 21 | */ 22 | 23 | class StringTest : public Element { public: 24 | 25 | StringTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "StringTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/tokenbuckettest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_TOKENBUCKETTEST_HH 3 | #define CLICK_TOKENBUCKETTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | TokenBucketTest() 11 | 12 | =s test 13 | 14 | runs regression tests for token bucket 15 | 16 | =d 17 | 18 | TokenBucketTest runs TokenBucket regression tests at initialization 19 | time. It does not route packets. 20 | 21 | */ 22 | 23 | class TokenBucketTest : public Element { public: 24 | 25 | TokenBucketTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "TokenBucketTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/test/vectortest.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_VECTORTEST_HH 3 | #define CLICK_VECTORTEST_HH 4 | #include 5 | CLICK_DECLS 6 | 7 | /* 8 | =c 9 | 10 | VectorTest() 11 | 12 | =s test 13 | 14 | runs regression tests for Vector 15 | 16 | =d 17 | 18 | VectorTest runs Vector regression tests at initialization time. It 19 | does not route packets. 20 | 21 | */ 22 | 23 | class VectorTest : public Element { public: 24 | 25 | VectorTest() CLICK_COLD; 26 | 27 | const char *class_name() const { return "VectorTest"; } 28 | 29 | int initialize(ErrorHandler *) CLICK_COLD; 30 | 31 | }; 32 | 33 | CLICK_ENDDECLS 34 | #endif 35 | -------------------------------------------------------------------------------- /elements/userlevel/dpdkdevclock.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_DPDKDEVCLOCK_HH 2 | #define CLICK_DPDKDEVCLOCK_HH 3 | #include "tscclock.hh" 4 | #include 5 | 6 | CLICK_DECLS 7 | 8 | /* =c 9 | * DPDKDeviceClock() 10 | * =s 11 | * Use DPDK device to get time 12 | * =d 13 | * 14 | * Click needs to be compiled with --enable-user-timestamp for this to be used. 15 | * 16 | */ 17 | 18 | class DPDKDeviceClock : public TSCClock { public: 19 | 20 | DPDKDeviceClock() CLICK_COLD; 21 | ~DPDKDeviceClock() CLICK_COLD; 22 | 23 | const char *class_name() const { return "DPDKDeviceClock"; } 24 | 25 | int configure(Vector &, ErrorHandler *) CLICK_COLD; 26 | int initialize(ErrorHandler *) CLICK_COLD; 27 | 28 | DPDKDevice* _dev; 29 | }; 30 | 31 | 32 | CLICK_ENDDECLS 33 | #endif //CLICK_DPDKDEVCLOCK_HH 34 | -------------------------------------------------------------------------------- /elements/userlevel/netmapinfo.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_NETMAPINFO_HH 2 | #define CLICK_NETMAPINFO_HH 3 | 4 | #include 5 | #include 6 | 7 | CLICK_DECLS 8 | 9 | class NetmapInfo : public Element { public: 10 | const char *class_name() const { return "NetmapInfo"; } 11 | 12 | int configure_phase() const { return CONFIGURE_PHASE_FIRST; } 13 | 14 | int configure(Vector &conf, ErrorHandler *errh); 15 | 16 | static NetmapInfo* instance; 17 | }; 18 | 19 | CLICK_ENDDECLS 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /elements/wifi/bitrate.hh: -------------------------------------------------------------------------------- 1 | #ifndef _BITRATE_H 2 | #define _BITRATE_H 3 | 4 | #include 5 | extern unsigned calc_usecs_wifi_packet_tries(int length, 6 | int rate, 7 | int try0, int tryN); 8 | 9 | extern unsigned calc_backoff(int rate, int t); 10 | 11 | extern unsigned calc_usecs_wifi_packet(int length, 12 | int rate, int retries); 13 | 14 | 15 | extern unsigned calc_transmit_time(int rate, int length); 16 | 17 | #endif /* _BITRATE_H_ */ 18 | -------------------------------------------------------------------------------- /elements/wifi/pushanno.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_PUSHANNO_HH 2 | #define CLICK_PUSHANNO_HH 3 | #include 4 | #include 5 | #include 6 | #include 7 | CLICK_DECLS 8 | 9 | /* 10 | =c 11 | PushAnno([I]) 12 | =s Wifi 13 | Pushes Packet::anno() onto front of packet. 14 | 15 | =d 16 | Pushes Packet::USER_ANNO_SIZE bytes on a packet and copies 17 | Packet::anno() to the beginning of the packet. 18 | 19 | =e 20 | FromDevice(ath0) -> PushAnno() -> ToDump() 21 | 22 | =a ReadAnno 23 | */ 24 | 25 | 26 | class PushAnno : public Element { public: 27 | 28 | PushAnno() CLICK_COLD; 29 | ~PushAnno() CLICK_COLD; 30 | 31 | const char *class_name() const { return "PushAnno"; } 32 | const char *port_count() const { return PORTS_1_1; } 33 | const char *processing() const { return "a/a"; } 34 | 35 | Packet *simple_action(Packet *); 36 | 37 | }; 38 | 39 | CLICK_ENDDECLS 40 | #endif 41 | -------------------------------------------------------------------------------- /elements/wifi/readanno.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_READANNO_HH 2 | #define CLICK_READANNO_HH 3 | #include 4 | #include 5 | #include 6 | #include 7 | CLICK_DECLS 8 | 9 | /* 10 | =c 11 | ReadAnno([I]) 12 | 13 | =s Wifi 14 | Pulls annotation from packet and stores it in Packet::anno() 15 | 16 | =d 17 | Pulls Packet::USER_ANNO_SIZE bytes from a packet and copies 18 | them to Packet::anno() 19 | 20 | =e 21 | FromDump(file) -> ReadAnno() -> xxxx 22 | 23 | =a PushAnno 24 | */ 25 | 26 | 27 | class ReadAnno : public Element { public: 28 | 29 | ReadAnno() CLICK_COLD; 30 | ~ReadAnno() CLICK_COLD; 31 | 32 | const char *class_name() const { return "ReadAnno"; } 33 | const char *port_count() const { return PORTS_1_1; } 34 | const char *processing() const { return "a/a"; } 35 | 36 | Packet *simple_action(Packet *); 37 | 38 | }; 39 | 40 | CLICK_ENDDECLS 41 | #endif 42 | -------------------------------------------------------------------------------- /etc/.gitignore: -------------------------------------------------------------------------------- 1 | pkg-config.mk 2 | -------------------------------------------------------------------------------- /etc/diagrams/.gitignore: -------------------------------------------------------------------------------- 1 | *.[123456789] 2 | *.log 3 | *.mpx 4 | *.aux 5 | *.dvi 6 | mpxerr.tex 7 | -------------------------------------------------------------------------------- /etc/diagrams/README: -------------------------------------------------------------------------------- 1 | This directory contains the macros we use to generate diagrams for Click 2 | papers, and some example diagrams (in the samp*.mp files). 3 | 4 | You will need John Hobby's MetaPost, which is available from 5 | 6 | http://cm.bell-labs.com/who/hobby/MetaPost.html 7 | 8 | or in most Unix TeX distributions. 9 | 10 | Eddie Kohler wrote the macros and most of the diagrams in 1999-2000, with 11 | many updates since. 12 | -------------------------------------------------------------------------------- /etc/diagrams/fonts.mp: -------------------------------------------------------------------------------- 1 | defaultelementfont := "cmti10"; 2 | -------------------------------------------------------------------------------- /etc/libclick/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | -------------------------------------------------------------------------------- /etc/libclick/lc-gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | /Makefile 3 | /click-buildtool 4 | autom4te* 5 | config.log 6 | config.status 7 | include/click/config-userlevel.h 8 | include/click/config.h 9 | include/click/pathvars.h 10 | libsrc/.deps 11 | libsrc/Makefile 12 | libsrc/libclick.a 13 | stamp-h 14 | -------------------------------------------------------------------------------- /etc/make-bsd-patch: -------------------------------------------------------------------------------- 1 | #! /usr/bin/perl -w 2 | 3 | # make-bsd-patch 4 | 5 | # Make a patch file for a BSD kernel that adds our hooks. 6 | # The resulting output can be used thus: 7 | # cd /sys 8 | # patch -p0 -b < patch-file 9 | 10 | # List of files that we modified and that should be patched. 11 | # Each must be accompanied by a file.orig. 12 | my @files = ( 13 | "net/if_var.h", 14 | "net/if_ethersubr.c", 15 | "pci/if_fxpvar.h", 16 | "pci/if_fxpreg.h", 17 | "pci/if_fxp.c", 18 | "pci/if_wxvar.h", 19 | "pci/if_wxreg.h", 20 | "pci/if_wx.c", 21 | "sys/namei.h", 22 | "sys/queue.h", 23 | "sys/libkern.h", 24 | ); 25 | 26 | $| = 1; 27 | my $f; 28 | chdir "/sys"; 29 | foreach $f (@files) { 30 | print "\nIndex: $f\n"; 31 | system("diff -u ${f}.orig $f"); 32 | } 33 | -------------------------------------------------------------------------------- /etc/restore-bsd: -------------------------------------------------------------------------------- 1 | cd /sys 2 | mv net/if_var.h{.orig,} 3 | mv net/if_ethersubr.c{.orig,} 4 | mv pci/if_fxpvar.h{.orig,} 5 | mv pci/if_fxpreg.h{.orig,} 6 | mv pci/if_fxp.c{.orig,} 7 | mv pci/if_wxvar.h{.orig,} 8 | mv pci/if_wxreg.h{.orig,} 9 | mv pci/if_wx.c{.orig,} 10 | mv sys/namei.h{.orig,} 11 | mv sys/queue.h{.orig,} 12 | mv sys/libkern.h{.orig,} 13 | -------------------------------------------------------------------------------- /etc/restore-linux: -------------------------------------------------------------------------------- 1 | mv include/linux/netdevice.h.orig include/linux/netdevice.h 2 | mv include/linux/signal.h.orig include/linux/signal.h 3 | mv include/linux/skbuff.h.orig include/linux/skbuff.h 4 | mv net/core/skbuff.c.orig net/core/skbuff.c 5 | mv net/core/dev.c.orig net/core/dev.c 6 | mv net/sched/sch_generic.c.orig net/sched/sch_generic.c 7 | mv net/netsyms.c.orig net/netsyms.c 8 | mv fs/proc/inode.c.orig fs/proc/inode.c 9 | mv drivers/net/eepro100.c.orig drivers/net/eepro100.c 10 | mv drivers/net/tulip.c.orig drivers/net/tulip.c 11 | mv drivers/net/acenic.c.orig drivers/net/acenic.c 12 | mv drivers/net/acenic.h.orig drivers/net/acenic.h 13 | mv include/net/neighbour.h.orig include/net/neighbour.h 14 | -------------------------------------------------------------------------------- /etc/ron/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.kd 3 | *.ko 4 | *.ko.cmd 5 | *.o 6 | *.o.cmd 7 | *.ud 8 | *.uo 9 | .tmp_versions 10 | Kbuild 11 | Makefile 12 | Module.symvers 13 | autom4te* 14 | config.h 15 | config.log 16 | config.status 17 | configure 18 | elementmap-ron.xml 19 | kelements.conf 20 | kelements.mk 21 | kpackage.cc 22 | kversion.c 23 | modules.order 24 | ron.mod.c 25 | uelements.conf 26 | uelements.mk 27 | upackage.cc 28 | 29 | -------------------------------------------------------------------------------- /etc/ron/changeuid.hh: -------------------------------------------------------------------------------- 1 | #ifndef CHANGEUID_HH 2 | #define CHANGEUID_HH 3 | 4 | /* 5 | * =c 6 | * ChangeUID(UID, TIMEOUT) 7 | * =s 8 | * Changes UID of click process after startup. Waits milliseconds. 9 | * =d 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | class ChangeUID : public Element { 18 | 19 | unsigned int _uid, _timeout; 20 | Timer _timer; 21 | 22 | public: 23 | 24 | ChangeUID(); 25 | ~ChangeUID(); 26 | 27 | const char *class_name() const { return "ChangeUID"; } 28 | const char *port_count() const { return "0/0"; } 29 | const char *processing() const { return AGNOSTIC; } 30 | 31 | int configure(const Vector &, ErrorHandler *); 32 | int initialize(ErrorHandler *); 33 | 34 | static void timer_hook(Timer *, void *); 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /etc/ron/config.h: -------------------------------------------------------------------------------- 1 | /* config.h. Generated automatically by configure. */ 2 | /* Process this file with configure to produce config.h. -*- mode: c -*- */ 3 | #ifndef SAMPLEPACKAGE_CONFIG_H 4 | #define SAMPLEPACKAGE_CONFIG_H 5 | 6 | /* `samplepackage' doesn't need any extra configuration. */ 7 | 8 | #endif /* SAMPLEPACKAGE_CONFIG_H */ 9 | -------------------------------------------------------------------------------- /etc/ron/config.h.in: -------------------------------------------------------------------------------- 1 | /* Process this file with configure to produce config.h. -*- mode: c -*- */ 2 | #ifndef SAMPLEPACKAGE_CONFIG_H 3 | #define SAMPLEPACKAGE_CONFIG_H 4 | 5 | /* `samplepackage' doesn't need any extra configuration. */ 6 | 7 | #endif /* SAMPLEPACKAGE_CONFIG_H */ 8 | -------------------------------------------------------------------------------- /etc/ron/discardnotify.hh: -------------------------------------------------------------------------------- 1 | #ifndef DISCARDNOTIFY_HH 2 | #define DISCARDNOTIFY_HH 3 | #include 4 | #include 5 | #include "../../elements/standard/discard.hh" 6 | #include "queuenotify.hh" 7 | /* 8 | * =c 9 | * DiscardNotify 10 | * =s dropping 11 | * drops all packets 12 | * =d 13 | * Discards all packets received on its single input. 14 | * If used in a Pull context, it initiates pulls whenever 15 | * packets are available. 16 | */ 17 | 18 | class DiscardNotify : public Discard, public NotifiedElement { public: 19 | DiscardNotify(); 20 | ~DiscardNotify(); 21 | 22 | const char *class_name() const { return "DiscardNotify";} 23 | int initialize(ErrorHandler *); 24 | 25 | void notify(int signal); 26 | bool run_task(Task *); 27 | protected: 28 | bool _data_ready; 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /etc/samplellrpc/.gitignore: -------------------------------------------------------------------------------- 1 | click-readcounter 2 | -------------------------------------------------------------------------------- /etc/samplellrpc/Makefile: -------------------------------------------------------------------------------- 1 | CC = cc 2 | 3 | click-readcounter: click-readcounter.c 4 | $(CC) -I../../include click-readcounter.c -o click-readcounter 5 | 6 | clean: 7 | rm click-readcounter 8 | -------------------------------------------------------------------------------- /etc/samplepackage/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.ko 3 | *.ko.cmd 4 | *.o 5 | *.o.cmd 6 | *.uo 7 | .tmp_versions 8 | Kbuild 9 | Makefile 10 | Module.symvers 11 | autom4te* 12 | config.h 13 | config.log 14 | config.status 15 | configure 16 | elementmap-sample.xml 17 | kversion.c 18 | modules.order 19 | sample-kelem.conf 20 | sample-kelem.mk 21 | sample-kmain.cc 22 | sample-uelem.conf 23 | sample-uelem.mk 24 | sample-umain.cc 25 | sample.mod.c 26 | -------------------------------------------------------------------------------- /etc/samplepackage/sampleelt.hh: -------------------------------------------------------------------------------- 1 | #ifndef SAMPLEPACKAGEELEMENT_HH 2 | #define SAMPLEPACKAGEELEMENT_HH 3 | #include 4 | CLICK_DECLS 5 | 6 | /* 7 | * =c 8 | * SamplePackageElement() 9 | * =s debugging 10 | * demonstrates how to write a package 11 | * =d 12 | * 13 | * This is the only element in the `sample' package. It demonstrates how to 14 | * write an element that will be placed in a package. It does nothing except 15 | * report that the package was successfully loaded when it initializes. */ 16 | 17 | class SamplePackageElement : public Element { public: 18 | 19 | SamplePackageElement(); // SEE sample.cc FOR CONSTRUCTOR 20 | ~SamplePackageElement(); // SEE sample.cc FOR DESTRUCTOR 21 | 22 | const char *class_name() const { return "SamplePackageElement"; } 23 | 24 | int initialize(ErrorHandler *errh); 25 | 26 | }; 27 | 28 | CLICK_ENDDECLS 29 | #endif 30 | -------------------------------------------------------------------------------- /etc/samplepackage/test.click: -------------------------------------------------------------------------------- 1 | require(package "sample"); 2 | 3 | test :: SamplePackageElement; 4 | 5 | DriverManager(stop); 6 | -------------------------------------------------------------------------------- /exopc/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.d 3 | click 4 | click.aout 5 | elements.conf 6 | elements.cc 7 | elements.mk 8 | -------------------------------------------------------------------------------- /exopc/cross-compile.sh: -------------------------------------------------------------------------------- 1 | #! /bin/sh -a 2 | 3 | CROSSBIN=$CROSSDIR 4 | CROSSINC=$CROSSDIR/include 5 | 6 | PATH=$CROSSBIN:$PATH 7 | BINFILE=$CROSSBIN/i386-unknown-openbsd2-`basename $0` 8 | 9 | #echo using cross compile binary $BINFILE 10 | exec $BINFILE -nostdinc -I$CROSSINC $@ 11 | 12 | -------------------------------------------------------------------------------- /exopc/samples/icmp.quad: -------------------------------------------------------------------------------- 1 | 2 | ed0_reader :: xokReader(32, 12/0800 30/12170322 23/01); // 18.23.3.34 3 | ed0_writer :: xokWriter(ed0); 4 | 5 | de0_reader :: xokReader(32, 12/0800 30/1217032C 23/01); // 18.23.3.44 6 | de0_writer :: xokWriter(de0); 7 | 8 | de0_reader -> ICMPPing -> de0_writer 9 | ed0_reader -> ICMPPing -> ed0_writer 10 | 11 | -------------------------------------------------------------------------------- /exopc/samples/icmp.smp: -------------------------------------------------------------------------------- 1 | 2 | ed0_reader :: xokReader(32, 12/0800 30/121a0452 23/01); // ender 3 | ed0_writer :: xokWriter(ed0); 4 | 5 | de0_reader :: xokReader(32, 12/0800 30/121a0450 23/01); // naiad 6 | de0_writer :: xokWriter(de0); 7 | 8 | de1_reader :: xokReader(32, 12/0800 30/121a041d 23/01); // sure 9 | de1_writer :: xokWriter(de1); 10 | 11 | ed0_reader -> ICMPPing -> ed0_writer 12 | de0_reader -> ICMPPing -> de0_writer 13 | de1_reader -> ICMPPing -> de1_writer 14 | 15 | -------------------------------------------------------------------------------- /exopc/samples/icmp.uni: -------------------------------------------------------------------------------- 1 | 2 | ed0_reader :: xokReader(32, 12/0800 30/121a0462 23/01); # hera 3 | ed0_writer :: xokWriter(ed0); 4 | 5 | de0_reader :: xokReader(32, 12/0800 30/121a045c 23/01); # plebic 6 | de0_writer :: xokWriter(de0); 7 | 8 | de0_reader -> ICMPPing -> de0_writer 9 | ed0_reader -> ICMPPing -> ed0_writer 10 | 11 | -------------------------------------------------------------------------------- /exopc/syscall.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | 4 | int 5 | xok_sys_self_dpf_insert (u_int a1, u_int a2, void *a3, int a4) 6 | { 7 | return sys_self_dpf_insert(a1, a2, a3, a4); 8 | } 9 | 10 | 11 | int 12 | xok_sys_self_dpf_ref(u_int a1, u_int a2) 13 | { 14 | return sys_self_dpf_ref(a1, a2); 15 | } 16 | 17 | 18 | int 19 | xok_sys_self_dpf_delete (u_int a1, u_int a2) 20 | { 21 | return sys_self_dpf_delete(a1, a2); 22 | } 23 | 24 | 25 | int 26 | vos_prd_ring_id(int fd) 27 | { 28 | extern int prd_ring_id(int); 29 | return prd_ring_id(fd); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /img/metron-agent-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/img/metron-agent-arch.png -------------------------------------------------------------------------------- /include/.gitignore: -------------------------------------------------------------------------------- 1 | click-linuxmodule 2 | -------------------------------------------------------------------------------- /include/click/.gitignore: -------------------------------------------------------------------------------- 1 | config.h 2 | pathvars.h 3 | config-userlevel.h 4 | config-linuxmodule.h 5 | config-bsdmodule.h 6 | config-minios.h 7 | config-ns.h 8 | -------------------------------------------------------------------------------- /include/click/batchbuilder.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_BATCHBUILDER_HH 2 | #define CLICK_BATCHBUILDER_HH 3 | #include 4 | #include 5 | #include 6 | 7 | CLICK_DECLS 8 | class DPDKDevice; 9 | 10 | struct BatchBuilder { 11 | BatchBuilder() : first(0), count(0), last(-1) { 12 | 13 | }; 14 | 15 | Packet* first; 16 | Packet* tail; 17 | int count; 18 | int last; 19 | 20 | inline void init() { 21 | count = 0; 22 | first = 0; 23 | } 24 | 25 | inline PacketBatch* finish() { 26 | if (!first) 27 | return 0; 28 | return PacketBatch::make_from_simple_list(first,tail,count); 29 | } 30 | 31 | inline void append(Packet* p) { 32 | count++; 33 | if (first) { 34 | tail->set_next(p); 35 | tail = p; 36 | } else { 37 | first = p; 38 | tail = p; 39 | } 40 | } 41 | 42 | }; 43 | 44 | 45 | CLICK_ENDDECLS 46 | #endif 47 | -------------------------------------------------------------------------------- /include/click/bighashmap.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * bighashmap.{cc,hh} -- a hash table template that supports removal 3 | * Eddie Kohler 4 | * 5 | * Copyright (c) 2000 Mazu Networks, Inc. 6 | * Copyright (c) 2003 International Computer Science Institute 7 | * 8 | * Permission is hereby granted, free of charge, to any person obtaining a 9 | * copy of this software and associated documentation files (the "Software"), 10 | * to deal in the Software without restriction, subject to the conditions 11 | * listed in the Click LICENSE file. These conditions include: you must 12 | * preserve this copyright notice, and you cannot mention the copyright 13 | * holders in advertising related to the Software without their permission. 14 | * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This 15 | * notice is a summary of the Click LICENSE file; the license in that file is 16 | * legally binding. 17 | */ 18 | 19 | #include 20 | -------------------------------------------------------------------------------- /include/click/bighashmap.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_BIGHASHMAP_HH 2 | #define CLICK_BIGHASHMAP_HH 3 | 4 | // This file is here for compatibility only. 5 | #include 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /include/click/crc32.h: -------------------------------------------------------------------------------- 1 | /* -*- related-file-name: "../../lib/crc32.c" -*- */ 2 | #ifndef CLICK_CRC32_H 3 | #define CLICK_CRC32_H 4 | #ifdef __cplusplus 5 | extern "C" { 6 | #endif 7 | 8 | uint32_t update_crc(uint32_t crc_accum, const char *data_blk_ptr, 9 | int data_blk_size); 10 | 11 | #ifdef __cplusplus 12 | } 13 | #endif 14 | #endif 15 | -------------------------------------------------------------------------------- /include/click/cxxprotect.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | # define new linux_new 3 | # define this linux_this 4 | # define delete linux_delete 5 | # define class linux_class 6 | # define virtual linux_virtual 7 | # define typename linux_typename 8 | # define protected linux_protected 9 | # define public linux_public 10 | # define namespace linux_namespace 11 | # define false linux_false 12 | # define true linux_true 13 | # undef asmlinkage 14 | # define asmlinkage 15 | #endif 16 | 17 | #ifndef CLICK_CXX_PROTECT 18 | # ifdef __cplusplus 19 | # define CLICK_CXX_PROTECT extern "C" { 20 | # define CLICK_CXX_UNPROTECT } 21 | # else 22 | # define CLICK_CXX_PROTECT /* nothing */ 23 | # define CLICK_CXX_UNPROTECT /* nothing */ 24 | # endif 25 | #endif 26 | 27 | #define CLICK_CXX_PROTECTED 1 28 | -------------------------------------------------------------------------------- /include/click/cxxunprotect.h: -------------------------------------------------------------------------------- 1 | #ifdef __cplusplus 2 | # undef new 3 | # undef this 4 | # undef delete 5 | # undef class 6 | # undef virtual 7 | # undef typename 8 | # undef protected 9 | # undef public 10 | # undef namespace 11 | # undef false 12 | # undef true 13 | #endif 14 | 15 | #ifdef CLICK_CXX_PROTECTED 16 | # undef asmlinkage 17 | # define asmlinkage extern "C" 18 | #endif 19 | 20 | #undef CLICK_CXX_PROTECTED 21 | -------------------------------------------------------------------------------- /include/click/dequeue.hh: -------------------------------------------------------------------------------- 1 | #ifndef DEQueue 2 | #warning "DEQueue is deprecated, use Deque and instead" 3 | #include 4 | #define DEQueue Deque 5 | #endif 6 | -------------------------------------------------------------------------------- /include/click/fixconfig.h: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_FIXCONFIG_H 2 | #define CLICK_FIXCONFIG_H 3 | 4 | #if CLICK_LINUXMODULE && __cplusplus 5 | #include 6 | 7 | #define __builtin_types_compatible_p(a, b) \ 8 | (types_compatible::value) 9 | #endif 10 | 11 | #if CLICK_LINUXMODULE && HAVE_LINUX_ASM_ALTERNATIVE_H 12 | // The .smp_locks section and C++-style weak linkage interact badly. 13 | # if CONFIG_SMP && (defined(__i386__) || defined(__x86_64__)) 14 | # include 15 | CLICK_CXX_PROTECT 16 | # include 17 | # undef LOCK_PREFIX 18 | # define LOCK_PREFIX "lock ; " 19 | CLICK_CXX_UNPROTECT 20 | # include 21 | # endif 22 | #endif 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /include/click/flow/flow.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_FLOW 2 | #define CLICK_FLOW 1 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | #include 15 | #include "common.hh" 16 | 17 | CLICK_DECLS 18 | 19 | //Code of MiddleClick to be reverted, one day 20 | 21 | CLICK_ENDDECLS 22 | #endif 23 | -------------------------------------------------------------------------------- /include/click/ipaddresslist.hh: -------------------------------------------------------------------------------- 1 | #error "The IPAddressList class is no longer available. Use Vector instead." 2 | -------------------------------------------------------------------------------- /include/click/skbmgr.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 2; related-file-name: "../../linuxmodule/skbmgr.cc" -*- 2 | #ifndef CLICK_SKBMGR_HH 3 | #define CLICK_SKBMGR_HH 4 | CLICK_DECLS 5 | 6 | void skbmgr_init(); 7 | void skbmgr_cleanup(); 8 | 9 | /* allocate skbs. Number of skbs allocated is stored in the want variable */ 10 | struct sk_buff *skbmgr_allocate_skbs(unsigned headroom, unsigned size, int *want); 11 | 12 | /* recycle skb back into pool */ 13 | void skbmgr_recycle_skbs(struct sk_buff *); 14 | 15 | CLICK_ENDDECLS 16 | #endif 17 | -------------------------------------------------------------------------------- /include/click/standard/threadsched.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_THREADSCHED_HH 3 | #define CLICK_THREADSCHED_HH 4 | 5 | #include 6 | 7 | 8 | CLICK_DECLS 9 | 10 | class ThreadSched { public: 11 | 12 | enum { THREAD_QUIESCENT = -1, THREAD_UNKNOWN = -1000 }; 13 | 14 | ThreadSched() { } 15 | virtual ~ThreadSched() { } 16 | 17 | virtual int initial_home_thread_id(const Element *e); 18 | 19 | virtual Bitvector assigned_thread() { 20 | return Bitvector(click_max_cpu_ids(),0); 21 | }; 22 | 23 | }; 24 | 25 | CLICK_ENDDECLS 26 | #endif 27 | -------------------------------------------------------------------------------- /include/clicknet/gtp.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 4 -*- */ 2 | #ifndef CLICKNET_GTP_H 3 | #define CLICKNET_GTP_H 4 | 5 | 6 | struct click_gtp { 7 | 8 | 9 | 10 | unsigned gtp_flags : 3; /* flags */ 11 | unsigned gtp_reserved : 1; /* reserved */ 12 | unsigned gtp_pt : 1; /* protocol type == 1 */ 13 | unsigned gtp_v : 3; /* version == 1 */ 14 | #define GTP_FLAG_E 0x01 /* extension header flag */ 15 | #define GTP_FLAG_S 0x02 /* sequence number flag */ 16 | #define GTP_FLAG_PN 0x04 /* N-PDU number flag */ 17 | uint8_t gtp_msg_type; /* GTP message type */ 18 | uint16_t gtp_msg_len; /* GTP message length */ 19 | uint32_t gtp_teid; /* Tunnel endpoint identifier */ 20 | }; 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /include/clicknet/rfc1483.h: -------------------------------------------------------------------------------- 1 | /* -*- mode: c; c-basic-offset: 4 -*- */ 2 | #ifndef CLICKNET_RFC1483_H 3 | #define CLICKNET_RFC1483_H 4 | 5 | /* 6 | * 7 | */ 8 | 9 | struct click_rfc1483 { 10 | uint8_t dsap; 11 | uint8_t ssap; 12 | uint8_t ui; 13 | uint8_t orgcode[3]; 14 | uint16_t ether_type; 15 | }; 16 | 17 | #define RFC1483_SNAP_IP_EXPECTED "\xAA\xAA\x03\x00\x00\x00" 18 | #define RFC1483_SNAP_IP_EXPECTED_LEN 6 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /include/clicknet/udp.h: -------------------------------------------------------------------------------- 1 | #ifndef CLICKNET_UDP_H 2 | #define CLICKNET_UDP_H 3 | 4 | /* 5 | * -- UDP header definitions, based on one of the BSDs. 6 | * 7 | * Relevant RFCs include: 8 | * RFC768 User Datagram Protocol 9 | */ 10 | 11 | struct click_udp { 12 | uint16_t uh_sport; /* 0-1 source port */ 13 | uint16_t uh_dport; /* 2-3 destination port */ 14 | uint16_t uh_ulen; /* 4-5 UDP length */ 15 | uint16_t uh_sum; /* 6-7 checksum */ 16 | }; 17 | 18 | #endif 19 | -------------------------------------------------------------------------------- /lib/allocator.cc: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | CLICK_DECLS 5 | 6 | bool pool_allocator_mt_base::_dying = false; 7 | 8 | CLICK_ENDDECLS 9 | -------------------------------------------------------------------------------- /lib/atomic.cc: -------------------------------------------------------------------------------- 1 | /* 2 | * atomic.{cc,hh} -- atomic integers 3 | * Eddie Kohler 4 | * 5 | * Copyright (c) 2000 Mazu Networks, Inc. 6 | * 7 | * Permission is hereby granted, free of charge, to any person obtaining a 8 | * copy of this software and associated documentation files (the "Software"), 9 | * to deal in the Software without restriction, subject to the conditions 10 | * listed in the Click LICENSE file. These conditions include: you must 11 | * preserve this copyright notice, and you cannot mention the copyright 12 | * holders in advertising related to the Software without their permission. 13 | * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This 14 | * notice is a summary of the Click LICENSE file; the license in that file is 15 | * legally binding. 16 | */ 17 | 18 | #include 19 | 20 | #include 21 | #include 22 | -------------------------------------------------------------------------------- /lib/strerror.c: -------------------------------------------------------------------------------- 1 | /* Some operating systems don't have strerror. 2 | This file provides a definition which David Mazieres 3 | assures me works. */ 4 | 5 | #include 6 | 7 | #ifdef __cplusplus 8 | extern "C" { 9 | #endif 10 | 11 | char * 12 | strerror(int errno) 13 | { 14 | extern int sys_nerr; 15 | extern char *sys_errlist[]; 16 | if (errno < 0 || errno >= sys_nerr) 17 | return (char *)"bad error number"; 18 | else 19 | return sys_errlist[errno]; 20 | } 21 | 22 | #ifdef __cplusplus 23 | } 24 | #endif 25 | -------------------------------------------------------------------------------- /linuxmodule/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | .*.cmd 4 | Makefile 5 | Module.symvers 6 | elements.cc 7 | elements.conf 8 | elements.csmk 9 | elements.mk 10 | ksyms.c 11 | modules.order 12 | -------------------------------------------------------------------------------- /linuxmodule/moduleparm.h: -------------------------------------------------------------------------------- 1 | #ifndef MODULEPARM_H 2 | #define MODULEPARM_H 3 | 4 | #define CLICKPARM_ACCESSIBLE 1 5 | #define CLICKPARM_THREADS 2 6 | #define CLICKPARM_GREEDY 3 7 | #define CLICKPARM_UID 4 8 | #define CLICKPARM_GID 5 9 | #define CLICKPARM_CPU 6 10 | 11 | #endif 12 | -------------------------------------------------------------------------------- /mininet/README.md: -------------------------------------------------------------------------------- 1 | # Mininet examples for FastClick configurations 2 | 3 | Use `vagrant up` to build a pre-configured VM with all dependencies. Of course, vagrant and virtualbox must be installed themselves. 4 | 5 | Then, run `vagrant ssh` to jump into the VM. 6 | 7 | Then, simply run the Mininet topology with: 8 | 9 | ``` 10 | sudo mn -c ; cd /vagrant && sudo python EXAMPLE/topology.py 11 | ``` 12 | 13 | EXAMPLE is one of the folder in this repository: 14 | * switch: A switch between two hosts (there is also a topology-mininetonly.py file that does the same switch without Click, for learning purposes) 15 | * router: A router between 4 hosts TODO 16 | 17 | The examples use the click configuration in the conf/EXAMPLE/ folders, just tweaking a few variables through the command line. 18 | -------------------------------------------------------------------------------- /minios/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | build 3 | config.mk 4 | -------------------------------------------------------------------------------- /minios/config.xen: -------------------------------------------------------------------------------- 1 | kernel = './minios/build/clickos_x86_64' 2 | vcpus = '1' 3 | cpus = '2' 4 | memory = '12' 5 | vif = ['mac=00:15:17:15:5d:74,bridge=xenbr0'] 6 | name = 'click0' 7 | on_crash = 'preserve' 8 | -------------------------------------------------------------------------------- /minios/elements.exclude: -------------------------------------------------------------------------------- 1 | Script 2 | AggregateCounter 3 | FromDAGDump 4 | FromCapDump 5 | -------------------------------------------------------------------------------- /ns/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.d 3 | *.o 4 | elements.conf 5 | elements.mk 6 | elements.cc 7 | elements.csmk 8 | libnsclick.so 9 | libnsclick.dylib 10 | -------------------------------------------------------------------------------- /test/IPRewriter/IPAddrPairRewriter-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Simple IPAddrPairRewriter test. 4 | 5 | %script 6 | 7 | $VALGRIND click -e " 8 | FromIPSummaryDump(IN1, STOP true) -> 9 | rw :: IPAddrPairRewriter(pattern 3.0.0.1-3.0.0.255# - 0 0) 10 | -> ToIPSummaryDump(OUT1, FIELDS src dst) 11 | " 12 | 13 | %file IN1 14 | !data src dst 15 | 1.0.0.1 9.9.9.9 16 | 1.0.0.2 9.9.9.8 17 | 1.0.0.1 9.9.9.9 18 | 1.0.0.1 9.9.9.7 19 | 9.9.9.6 3.0.0.1 20 | 9.9.9.7 3.0.0.3 21 | 22 | %ignorex 23 | !.* 24 | 25 | %expect OUT1 26 | 3.0.0.1 9.9.9.9 27 | 3.0.0.2 9.9.9.8 28 | 3.0.0.1 9.9.9.9 29 | 3.0.0.3 9.9.9.7 30 | 3.0.0.4 3.0.0.1 31 | 9.9.9.7 1.0.0.1 32 | -------------------------------------------------------------------------------- /test/IPRewriter/IPAddrPairRewriter-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Check IPAddrPairRewriter transport checksums. 4 | 5 | %script 6 | 7 | $VALGRIND click -e " 8 | FromIPSummaryDump(IN1, STOP true, CHECKSUM true) -> 9 | rw :: IPAddrPairRewriter(pattern 3.0.0.1-3.0.0.255# - 0 0) 10 | -> CheckIPHeader(VERBOSE true) 11 | -> CheckTCPHeader(VERBOSE true) 12 | -> ToIPSummaryDump(OUT1, FIELDS src dst) 13 | " 14 | 15 | %file IN1 16 | !data src dst 17 | 1.0.0.1 9.9.9.9 18 | 1.0.0.2 9.9.9.8 19 | 1.0.0.1 9.9.9.9 20 | 1.0.0.1 9.9.9.7 21 | 9.9.9.6 3.0.0.1 22 | 9.9.9.7 3.0.0.3 23 | 24 | %ignorex 25 | !.* 26 | 27 | %expect OUT1 28 | 3.0.0.1 9.9.9.9 29 | 3.0.0.2 9.9.9.8 30 | 3.0.0.1 9.9.9.9 31 | 3.0.0.3 9.9.9.7 32 | 3.0.0.4 3.0.0.1 33 | 9.9.9.7 1.0.0.1 34 | -------------------------------------------------------------------------------- /test/IPRewriter/IPAddrRewriter-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | IPAddrRewriter pattern parsing. 4 | 5 | %script 6 | 7 | $VALGRIND click -e " 8 | i :: Idle 9 | rw :: IPAddrRewriter(pattern 1.0.0.1 - 0 1, 10 | pattern 1.0.0.1-1.0.255.255 - 0 1, 11 | pattern 1.0.0.1/24 - 0 1, 12 | pattern 1.0.0.1/8 - 0 1) 13 | i -> [0]rw i[1] -> [1]rw i[2] -> [2]rw i[3] -> [3]rw 14 | rw[0] -> i rw[1] -> i 15 | " -h rw.patterns -q 16 | 17 | $VALGRIND click -e " 18 | i :: Idle 19 | rw :: IPAddrRewriter(pattern 1.0.0.x - 0 1, 20 | pattern 1.255.0.0-1.0.255.255 - 0 1) 21 | i -> [0]rw i[1] -> [1]rw 22 | rw[0] -> i rw[1] -> i 23 | " 2>X || true 24 | 25 | %expect stdout 26 | 1.0.0.1 - 27 | 1.0.0.1-1.0.255.255 - 28 | 1.0.0.1-1.0.0.254 - 29 | 1.0.0.1-1.255.255.254 - 30 | 31 | %expect X 32 | input spec 0: bad source address 33 | input spec 1: bad source address 34 | Router could not be initialized! 35 | 36 | %ignorex X 37 | ^==.* 38 | config.* 39 | -------------------------------------------------------------------------------- /test/IPRewriter/IPAddrRewriter-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Simple IPAddrRewriter test. 4 | 5 | %script 6 | 7 | $VALGRIND click -e " 8 | FromIPSummaryDump(IN1, STOP true, CHECKSUM true) -> 9 | rw :: IPAddrRewriter(pattern 3.0.0.1-3.0.0.255# - 0 0) 10 | -> CheckIPHeader(VERBOSE true) 11 | -> ToIPSummaryDump(OUT1, FIELDS src dst) 12 | " 13 | 14 | %file IN1 15 | !data src dst 16 | 1.0.0.1 9.9.9.9 17 | 1.0.0.2 9.9.9.8 18 | 1.0.0.1 9.9.9.7 19 | 9.9.9.6 3.0.0.1 20 | 21 | %ignorex 22 | !.* 23 | 24 | %expect OUT1 25 | 3.0.0.1 9.9.9.9 26 | 3.0.0.2 9.9.9.8 27 | 3.0.0.1 9.9.9.7 28 | 9.9.9.6 1.0.0.1 29 | -------------------------------------------------------------------------------- /test/IPRewriter/IPAddrRewriter-03.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | IPAddrRewriter transport checksums. 4 | 5 | %script 6 | 7 | $VALGRIND click -e " 8 | FromIPSummaryDump(IN1, STOP true, CHECKSUM true) -> 9 | rw :: IPAddrRewriter(pattern 3.0.0.1-3.0.0.255# - 0 0) 10 | -> CheckIPHeader(VERBOSE true) 11 | -> CheckTCPHeader(VERBOSE true) 12 | -> ToIPSummaryDump(OUT1, FIELDS src dst) 13 | " 14 | 15 | %file IN1 16 | !data src dst 17 | 1.0.0.1 9.9.9.9 18 | 1.0.0.2 9.9.9.8 19 | 1.0.0.1 9.9.9.7 20 | 9.9.9.6 3.0.0.1 21 | 22 | %ignorex 23 | !.* 24 | 25 | %expect OUT1 26 | 3.0.0.1 9.9.9.9 27 | 3.0.0.2 9.9.9.8 28 | 3.0.0.1 9.9.9.7 29 | 9.9.9.6 1.0.0.1 30 | -------------------------------------------------------------------------------- /test/IPRewriter/RoundRobinIPMapper-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | RoundRobinIPMapper test. 3 | 4 | %script 5 | $VALGRIND click CONFIG < DUMP | grep -v '^!' 6 | 7 | %file CONFIG 8 | r::RoundRobinIPMapper(- - - - 0 0, - - - - 1 0, - - - - 2 0); 9 | 10 | FromIPSummaryDump(-, STOP true) 11 | -> rw::IPRewriter(r) 12 | -> Paint(0) 13 | -> td::ToIPSummaryDump(-, FIELDS link); 14 | rw[1] -> Paint(1) -> td; 15 | rw[2] -> Paint(2) -> td; 16 | 17 | %file DUMP 18 | !data ip_src sport ip_dst dport ip_proto 19 | 1.0.0.1 1 1.0.0.2 2 U 20 | 1.0.0.1 1 1.0.0.2 3 U 21 | 1.0.0.1 1 1.0.0.2 2 U 22 | 1.0.0.1 1 1.0.0.3 2 U 23 | 1.0.0.1 1 1.0.0.4 2 U 24 | 1.0.0.1 1 1.0.0.2 3 U 25 | 1.0.0.1 1 1.0.0.2 3 U 26 | 27 | %expect stdout 28 | 0 29 | 1 30 | 0 31 | 2 32 | 0 33 | 1 34 | 1 35 | -------------------------------------------------------------------------------- /test/IPRewriter/UDPRewriter-02.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | $VALGRIND click -e " 4 | i :: Idle 5 | rw :: UDPRewriter(pattern 1.0.0.1 1 - - 0 1, 6 | pattern 1.0.0.1 1-65535 - - 0 1, 7 | pattern 1.0.0.1 - - - 0 1) 8 | i -> [0]rw i[1] -> [1]rw i[2] -> [2]rw 9 | rw[0] -> i rw[1] -> i 10 | " -h rw.patterns -q 11 | 12 | $VALGRIND click -e " 13 | i :: Idle 14 | rw :: IPAddrRewriter(pattern 1.0.0.1 1x - - 0 1, 15 | pattern 1.0.0.0 0-255 - - 0 1, 16 | pattern 1.0.0.0 456-19 - - 0 1, 17 | pattern 1.0.0.0 456-65536 - - 0 1) 18 | i -> [0]rw i[1] -> [1]rw i[2] -> [2]rw i[3] -> [3]rw 19 | rw[0] -> i rw[1] -> i 20 | " 2>X || true 21 | 22 | %expect stdout 23 | 1.0.0.1 1 - - 24 | 1.0.0.1 1-65535 - - 25 | 1.0.0.1 - - - 26 | 27 | %expect X 28 | input spec 0: bad source port 29 | input spec 2: bad source port 30 | input spec 3: bad source port 31 | Router could not be initialized! 32 | 33 | %ignorex X 34 | ^==.* 35 | config.* 36 | -------------------------------------------------------------------------------- /test/analysis/AdjustTimestamp-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click CONFIG 3 | 4 | %file CONFIG 5 | FromIPSummaryDump(F, STOP true) 6 | -> t::AdjustTimestamp(-1) 7 | -> ToIPSummaryDump(-, FIELDS timestamp) 8 | -> t2::AdjustTimestamp(+1.5) 9 | -> ToIPSummaryDump(T2, FIELDS timestamp) 10 | -> t3::AdjustTimestamp(+0.1, ALL true) 11 | -> ToIPSummaryDump(T3, FIELDS timestamp) 12 | 13 | %file F 14 | !data timestamp 15 | 0.1 16 | 0.2 17 | 1.0 18 | 1.2 19 | 5.5 20 | 21 | %expect stdout 22 | -0.9{{0*}} 23 | -0.8{{0*}} 24 | 0.0{{0*}} 25 | 0.2{{0*}} 26 | 4.5{{0*}} 27 | 28 | %expect T2 29 | 0.6{{0*}} 30 | 0.7{{0*}} 31 | 0.0{{0*}}{{? Zero-valued timestamps are not adjusted by default }} 32 | 1.7{{0*}} 33 | 6.0{{0*}} 34 | 35 | %expect T3 36 | 0.7{{0*}} 37 | 0.8{{0*}} 38 | 0.1{{0*}} 39 | 1.8{{0*}} 40 | 6.1{{0*}} 41 | 42 | %ignore stdout T2 T3 43 | !{{.*}} 44 | -------------------------------------------------------------------------------- /test/analysis/AggregateCounter-01.testie: -------------------------------------------------------------------------------- 1 | %require -q 2 | click-buildtool provides FromIPSummaryDump 3 | 4 | %script 5 | 6 | click -e " 7 | FromIPSummaryDump(IN1, STOP true, ZERO true, BURST 1) 8 | -> a::AggregateCounter 9 | -> Discard; 10 | DriverManager(pause, write a.write_text_file -, stop) 11 | " >OUT1 12 | 13 | %file IN1 14 | !data aggregate 15 | 1 16 | 1 17 | 0 18 | 0 19 | 0 20 | 2 21 | 3 22 | 2 23 | 24 | %expect OUT1 25 | 0 3 26 | 1 2 27 | 2 2 28 | 3 1 29 | 30 | %ignorex 31 | !.* 32 | 33 | %eof 34 | -------------------------------------------------------------------------------- /test/analysis/AggregateIPFlows-01.testie: -------------------------------------------------------------------------------- 1 | %require -q 2 | click-buildtool provides FromIPSummaryDump 3 | 4 | %script 5 | 6 | click -e " 7 | FromIPSummaryDump(IN1, STOP true, ZERO true) 8 | -> SetTimestamp 9 | -> a::AggregateIPFlows 10 | -> ToIPSummaryDump(OUT1, FIELDS aggregate link ip_len ip_id); 11 | DriverManager(pause, write a.clear, stop) 12 | " 13 | 14 | %file IN1 15 | !data src sport dst dport proto ip_id ip_fragoff ip_len 16 | 18.26.4.44 30 10.0.0.4 40 U 1 0 100 17 | 18.26.4.44 30 18.26.4.44 41 U 2 0 100 18 | 10.0.0.4 40 18.26.4.44 30 U 3 0 100 19 | 18.26.4.44 41 18.26.4.44 30 U 4 0 100 20 | 18.26.4.44 41 18.26.4.44 30 U 5 24 80 21 | 18.26.4.44 30 18.26.4.44 41 U 6 24 84 22 | 18.26.4.44 41 18.26.4.44 30 U 5 0+ 24 23 | 18.26.4.44 30 18.26.4.44 41 U 6 0+ 24 24 | 25 | %expect OUT1 26 | 1 0 100 1 27 | 2 0 100 2 28 | 1 1 100 3 29 | 2 1 100 4 30 | 2 1 80 5 31 | 2 0 84 6 32 | 2 1 24 5 33 | 2 0 24 6 34 | 35 | %ignorex 36 | !.* 37 | 38 | %eof 39 | -------------------------------------------------------------------------------- /test/analysis/FromIPSummaryDump-01.testie: -------------------------------------------------------------------------------- 1 | %require -q 2 | click-buildtool provides FromIPSummaryDump 3 | 4 | %script 5 | 6 | # read from a hand-written IPSummaryDump file; check headers, emit to a dump 7 | click -e " 8 | FromIPSummaryDump(IN1, STOP true, CHECKSUM true) 9 | -> CheckICMPHeader(VERBOSE true) 10 | -> ToIPSummaryDump(-, FIELDS src dst icmp_type_name) 11 | " 12 | %file IN1 13 | !data src dst icmp_type 14 | !proto I 15 | 18.26.4.44 10.0.0.4 echo 16 | 10.0.0.4 18.26.4.44 echo-reply 17 | 18 | %expect stdout 19 | 18.26.4.44 10.0.0.4 echo 20 | 10.0.0.4 18.26.4.44 echo-reply 21 | 22 | %ignorex 23 | !.* 24 | 25 | %eof 26 | -------------------------------------------------------------------------------- /test/analysis/FromIPSummaryDump-02.testie: -------------------------------------------------------------------------------- 1 | %require -q 2 | click-buildtool provides FromIPSummaryDump 3 | 4 | %script 5 | 6 | # read from hand-written IPSummaryDump data; check headers, emit to a dump 7 | click CONFIG 8 | 9 | %file CONFIG 10 | FromIPSummaryDump(STOP true, CHECKSUM true, DATA "!data src dst icmp_type 11 | !proto I 12 | 18.26.4.44 10.0.0.4 echo 13 | 10.0.0.4 18.26.4.44 echo-reply") 14 | -> CheckICMPHeader(VERBOSE true) 15 | -> ToIPSummaryDump(-, FIELDS src dst icmp_type_name) 16 | 17 | %expect stdout 18 | 18.26.4.44 10.0.0.4 echo 19 | 10.0.0.4 18.26.4.44 echo-reply 20 | 21 | %expect stderr 22 | 23 | %ignorex 24 | !.* 25 | 26 | %eof 27 | -------------------------------------------------------------------------------- /test/analysis/IPSummaryDump-01.testie: -------------------------------------------------------------------------------- 1 | %require -q 2 | click-buildtool provides FromIPSummaryDump Truncate 3 | 4 | %script 5 | 6 | # read from a hand-written IPSummaryDump file; check headers, emit to a dump 7 | click -e " 8 | FromIPSummaryDump(IN1, STOP true, ZERO true) 9 | -> s :: RoundRobinSwitch 10 | -> t :: ToIPSummaryDump(OUT1, BAD_PACKETS true, FIELDS sport dport tcp_urp tcp_opt) 11 | s[1] -> Truncate(41) -> t 12 | s[2] -> Truncate(38) -> t 13 | s[3] -> Truncate(23) -> t 14 | s[4] -> Truncate(20) -> t 15 | " 16 | 17 | %file IN1 18 | !data sport dport tcp_urp tcp_opt 19 | 1 2 3 wscale10 20 | 2 3 4 wscale10 21 | 3 4 5 wscale10 22 | 4 5 6 wscale10 23 | 5 6 7 wscale10 24 | 25 | %expect OUT1 26 | 1 2 3 wscale10 27 | 2 3 4 - 28 | 3 4 - - 29 | 4 - - - 30 | - - - - 31 | 32 | %ignorex 33 | !.* 34 | 35 | %eof 36 | -------------------------------------------------------------------------------- /test/analysis/IPSummaryDump-02.testie: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rsspp/fastclick/972e4ad99662000ef887ac96e052a534ca747f5c/test/analysis/IPSummaryDump-02.testie -------------------------------------------------------------------------------- /test/analysis/Replay-Timing-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click --simtime CONFIG 3 | 4 | %file CONFIG 5 | FromIPSummaryDump(IN, TIMING false, STOP false) 6 | -> ReplayUnqueue(STOP 2, TIMING 200, ACTIVE true) 7 | -> SetTimestamp() 8 | -> ToIPSummaryDump(OUT, FIELDS timestamp payload) 9 | 10 | %file IN 11 | !data timestamp payload 12 | 0.000 0 13 | 0.001 A 14 | 0.002 B 15 | 0.004 C 16 | 0.004 D 17 | 0.005 E 18 | 19 | %expect OUT 20 | !IPSummaryDump 1.3 21 | !data timestamp payload 22 | 1000000000.000000{{[0-9]+}} "0" 23 | 1000000000.000500{{[0-9]+}} "A" 24 | 1000000000.001000{{[0-9]+}} "B" 25 | 1000000000.002000{{[0-9]+}} "C" 26 | 1000000000.002000{{[0-9]+}} "D" 27 | 1000000000.002500{{[0-9]+}} "E" 28 | 1000000000.002500{{[0-9]+}} "0" 29 | 1000000000.003000{{[0-9]+}} "A" 30 | 1000000000.003500{{[0-9]+}} "B" 31 | 1000000000.004500{{[0-9]+}} "C" 32 | 1000000000.004500{{[0-9]+}} "D" 33 | 1000000000.005000{{[0-9]+}} "E" 34 | -------------------------------------------------------------------------------- /test/analysis/TimeFilter-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | click CONFIG 4 | 5 | %file CONFIG 6 | FromIPSummaryDump(F, STOP true) 7 | -> t::TimeFilter(0, 1, END_CALL s.run $t) 8 | -> c::Counter 9 | -> Discard 10 | 11 | DriverManager(pause, print >C c.count, stop) 12 | 13 | s::Script(TYPE PASSIVE, 14 | init x 0, 15 | goto exit $(gt $x 1), 16 | set x $(add $x 1), 17 | print $1, 18 | write t.extend_interval 1) 19 | 20 | %file F 21 | !data timestamp 22 | 0.1 23 | 0.2 24 | 1.0 25 | 1.2 26 | 5.5 27 | 28 | %expect C 29 | 4 30 | 31 | %expect stdout 32 | 1.0{{0*}} 33 | 5.5{{0*}} 34 | -------------------------------------------------------------------------------- /test/analysis/latency-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | RecordTimestamp ecosystem 3 | 4 | Test the RecordTimestamp ecosystem (TimestampDiff, NumberPacket, ...) 5 | 6 | %script 7 | click -j 1 CONFIG 8 | 9 | %file CONFIG 10 | 11 | InfiniteSource(LENGTH 64, LIMIT 10000, STOP true) 12 | -> MarkMACHeader 13 | -> NumberPacket 14 | -> record:: RecordTimestamp() 15 | -> counter :: AverageCounter() 16 | -> CheckNumberPacket(OFFSET 40, COUNT 10000) 17 | -> diff :: TimestampDiff(RECORDER record) 18 | -> Discard 19 | 20 | DriverManager(wait,read diff.average, read diff.perc100, read diff.perc 100, print "$(eq $(diff.perc100) $(diff.perc 100))", read counter.count) 21 | 22 | %expect stdout 23 | true 24 | 25 | %expect stderr 26 | diff.average: 27 | {{[0-9]{1,2}[.][0-9]+}} 28 | diff.perc100: 29 | {{[0-9]+}} 30 | diff.perc: 31 | {{[0-9]+}} 32 | counter.count: 33 | 10000 34 | -------------------------------------------------------------------------------- /test/compound/variables-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test indexed variable expansion 3 | 4 | %script 5 | click -e ' 6 | elementclass Foo { 7 | $a | input -> Print("$a") -> Print("${a[0]}") -> Print("${a[2]}") -> Print("${a[3]}") -> output 8 | } 9 | elementclass Bar { 10 | $a, $n | input -> Print("${a[$n]}") -> output 11 | } 12 | elementclass Baz { 13 | $a | input -> Bar(${a[1]} ${a[0]}, ${a[2]}) -> output 14 | } 15 | InfiniteSource(DATA "", LIMIT 1, STOP true) 16 | -> Foo(A B C) 17 | -> Bar(D E F, 2) 18 | -> Baz(G H 1) 19 | -> Baz(I J 0) 20 | -> Discard 21 | ' 22 | 23 | %expect stderr 24 | A B C: 0 25 | A: 0 26 | C: 0 27 | 0 28 | F: 0 29 | G: 0 30 | J: 0 31 | -------------------------------------------------------------------------------- /test/ethernet/ARPQuerier-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Check that ARPQuerier correctly rate-limits queries per IP address. 3 | 4 | %script 5 | click --simtime CONFIG 6 | 7 | %file CONFIG 8 | RatedSource(RATE 1000, LIMIT 1500, STOP true) 9 | -> IPEncap(tcp, 1.0.0.1, 2.0.0.2) 10 | -> arpq::ARPQuerier(1.0.0.3, 2:1:1:1:1:1) 11 | -> c::Counter 12 | -> Discard; 13 | Idle -> [1]arpq; 14 | 15 | RatedSource(RATE 10, LIMIT 15, STOP true) 16 | -> IPEncap(tcp, 1.0.0.1, 2.0.0.2) 17 | -> arpq2::ARPQuerier(1.0.0.3, 2:1:1:1:1:1) 18 | -> c2::Counter 19 | -> Discard; 20 | Idle -> [1]arpq2; 21 | 22 | RatedSource(RATE 8, LIMIT 3, STOP true) 23 | -> IPEncap(tcp, 1.0.0.1, 2.0.0.2) 24 | -> arpq3::ARPQuerier(1.0.0.3, 2:1:1:1:1:1) 25 | -> c3::Counter 26 | -> Discard; 27 | Idle -> [1]arpq3; 28 | 29 | DriverManager(wait_stop 3, print c.count, print c2.count, print c3.count) 30 | 31 | %expect stdout 32 | {{9|10}} 33 | {{8|9|10}} 34 | {{2|3}} 35 | -------------------------------------------------------------------------------- /test/ethernet/ARPQuerier-08.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Check that ARPQuerier correctly rate-limits queries per IP address. 3 | 4 | %script 5 | $VALGRIND click --simtime CONFIG 6 | 7 | %file CONFIG 8 | ( InfiniteSource(LIMIT 50) -> IPEncap(tcp, 1.0.0.1, 2.0.0.2) -> [0]; 9 | InfiniteSource(LIMIT 50) -> IPEncap(tcp, 1.0.0.1, 2.0.0.3) -> [0]; 10 | Idle -> [1]; ) 11 | => arpq::ARPQuerier(1.0.0.3, 2:1:1:1:1:1, ENTRY_PACKET_CAPACITY 10) 12 | -> Discard; 13 | 14 | ( InfiniteSource(LIMIT 100) -> IPEncap(tcp, 1.0.0.1, 2.0.0.2) -> [0]; 15 | Idle -> [1]; ) 16 | => arpq2::ARPQuerier(1.0.0.3, 2:1:1:1:1:1, CAPACITY 10) 17 | -> Discard; 18 | 19 | Script(wait 1, read arpq.stats, read arpq2.stats, write stop); 20 | 21 | %expect -w stderr 22 | arpq.stats: 23 | 80 packets killed 24 | 2 ARP queries sent 25 | 26 | arpq2.stats: 27 | 90 packets killed 28 | 1 ARP queries sent 29 | -------------------------------------------------------------------------------- /test/ethernet/EtherEncap-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click --simtime CONFIG 3 | 4 | %file CONFIG 5 | Idle -> e :: EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2) -> Idle; 6 | 7 | DriverManager(print e.ethertype, write e.ethertype 0x0801, print e.ethertype, stop) 8 | 9 | %expect stdout 10 | 2048 11 | 2049 12 | -------------------------------------------------------------------------------- /test/ethernet/VLANEncap-02.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click CONFIG 3 | 4 | %file CONFIG 5 | InfiniteSource(DATA \, LIMIT 1, STOP true) 6 | -> Print(x) 7 | -> EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2) 8 | -> VLANEncap(0x1234, ETHERTYPE 0x88a8) 9 | -> Print(a) 10 | -> VLANDecap() 11 | -> Print(b) 12 | -> VLANDecap(ETHERTYPE 0x88a8) 13 | -> Print(c) 14 | -> Discard; 15 | 16 | %expect stderr 17 | x: 4 | aaabacad 18 | a: 22 | 02020202 02020101 01010101 88a81234 0800aaab acad 19 | b: 22 | 02020202 02020101 01010101 88a81234 0800aaab acad 20 | c: 18 | 02020202 02020101 01010101 0800aaab acad 21 | -------------------------------------------------------------------------------- /test/flow/flowspace-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | TCPRewriter and FTPPortMapper sequence number translation, even for SACK. 4 | 5 | %require 6 | click-buildtool provides flow 7 | 8 | %script 9 | $VALGRIND click -e " 10 | Idle -> FlowIPManagerHMP(RESERVE 2) 11 | -> RoundRobinSwitch()[0-1] => par :: { [0] 12 | -> t1 :: TestFlowSpace -> t2 :: TestFlowSpace -> [0]; [1] -> t3 :: TestFlowSpace -> [0] } 13 | -> CheckIPHeader(VERBOSE true) 14 | -> t4 :: TestFlowSpace 15 | -> Discard; 16 | DriverManager(stop); 17 | " 18 | 19 | %expect stderr 20 | Placing par/t1 :: TestFlowSpace at [2-5] 21 | Placing par/t3 :: TestFlowSpace at [2-5] 22 | Placing par/t2 :: TestFlowSpace at [6-9] 23 | Placing t4 :: TestFlowSpace at [10-13] 24 | -------------------------------------------------------------------------------- /test/handlers/KernelHandlerProxy-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | This test checks whether KernelHandlerProxy works. 4 | 5 | %require 6 | [ `whoami` = root ] 7 | 8 | %script 9 | click-install KERNELCONFIG 10 | click USERCONFIG -h khp.i.config -h khp.i/q1.config -h khp.i/q2.config -q > USEROUT 11 | click-uninstall 12 | 13 | %file KERNELCONFIG 14 | config :: Idle; 15 | i :: Idle; 16 | i/q1 :: Queue(1); 17 | i/q2 :: Queue(2); 18 | i -> i/q1 -> i; i[1] -> i/q2 -> [1]i; 19 | 20 | %file USERCONFIG 21 | khp :: KernelHandlerProxy; 22 | 23 | %expect USEROUT 24 | khp.i.config: 25 | 26 | khp.i/q1.config: 27 | 1 28 | 29 | khp.i/q2.config: 30 | 2 31 | -------------------------------------------------------------------------------- /test/handlers/expansion-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test Script expansion. 3 | 4 | %script 5 | click -e ' 6 | define($j sub) 7 | Script(print $(add 1 2), 8 | set i add, 9 | print $($i 3 4), 10 | print $($(s.run).name), 11 | print $($j 8 5), 12 | print $($j.run), 13 | stop) 14 | s :: Script(TYPE PASSIVE, 15 | return i2) 16 | sub :: Script(TYPE PASSIVE, return Hello) 17 | i1, i2 :: Idle' 18 | 19 | %expect stdout 20 | 3 21 | 7 22 | i2 23 | 3 24 | Hello 25 | -------------------------------------------------------------------------------- /test/handlers/handlercall-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | click -e ' 4 | InfiniteSource(LIMIT 100, STOP true) 5 | -> Counter(COUNT_CALL 5 s.switch 1) 6 | -> s :: Switch 7 | -> c :: Counter 8 | -> d :: Discard 9 | s[1] -> d 10 | DriverManager(wait_stop, print c.count) 11 | ' -h c.count 12 | 13 | %expect stdout 14 | 4 15 | 4 16 | -------------------------------------------------------------------------------- /test/handlers/privatehandler-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that private handlers are hidden from ControlSocket. 3 | 4 | %require 5 | which nc >/dev/null 2>&1 6 | 7 | %script 8 | msleep () { 9 | click -e "DriverManager(wait $1ms)" 10 | } 11 | 12 | (while [ ! -f PORT ]; do msleep 1; done && msleep 200 && cat CSIN | nc localhost `cat PORT` >CSOUT) & 13 | click -e 'cs :: ControlSocket(tcp, 41930+); 14 | s :: Script(print >PORT $(cs.port), 15 | print "SCARY => $(cat SCARY)", 16 | wait 1s, stop)' 17 | 18 | %file CSIN 19 | read s.add 1 1 20 | read s.cat SCARY 21 | 22 | %file SCARY 23 | This is a scary file! 24 | 25 | %expect CSOUT 26 | Click::ControlSocket/1.{{\d+}} 27 | 200 Read handler{{.*}} 28 | DATA 1 29 | 2511 No handler named 's.cat' 30 | 31 | %expect stdout 32 | SCARY => This is a scary file! 33 | -------------------------------------------------------------------------------- /test/icmp/ICMPError-sourceroute-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | # read from a hand-written IPSummaryDump file; check headers, emit to a dump 4 | click -e " 5 | FromIPSummaryDump(IN1, STOP true, ZERO true) 6 | -> ICMPError(19.19.19.19, timeexceeded) 7 | -> CheckIPHeader 8 | -> CheckICMPHeader 9 | -> ToIPSummaryDump(OUT1, FIELDS src dst proto payload_len ip_opt) 10 | " 11 | 12 | %file IN1 13 | !data src sport dst dport proto ip_opt ip_ttl 14 | 18.26.4.44 20 10.0.0.8 80 T ssrr{128.4.45.60,128.4.49.61,^1.2.3.4,5.6.7.8} 0 15 | 16 | %expect OUT1 17 | 19.19.19.19 18.26.4.44 I 68 ssrr{^128.4.49.61,128.4.45.60} 18 | 19 | %ignorex 20 | !.* 21 | -------------------------------------------------------------------------------- /test/icmp/ICMPIPEncap-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests ICMPIPEncap functionality. 3 | 4 | %script 5 | click -e " 6 | InfiniteSource(LIMIT 3, STOP true) 7 | -> r :: RoundRobinSwitch 8 | -> ICMPIPEncap(1.0.0.1, 1.0.0.1, TYPE 8, CODE 0) 9 | -> p :: ToIPSummaryDump(-, FIELDS ip_src ip_dst ip_proto icmp_type icmp_code); 10 | r[1] -> ICMPIPEncap(1.0.0.2, 1.0.0.2, TYPE 3, CODE 1) -> p; 11 | r[2] -> ICMPIPEncap(1.0.0.3, 1.0.0.3, TYPE 5, CODE 3) -> p; 12 | " | grep -v '^!' 13 | 14 | %expect stdout 15 | 1.0.0.1 1.0.0.1 I 8 0 16 | 1.0.0.2 1.0.0.2 I 3 1 17 | 1.0.0.3 1.0.0.3 I 5 3 18 | -------------------------------------------------------------------------------- /test/icmp/ICMPPingEncap-01.testie: -------------------------------------------------------------------------------- 1 | %require 2 | printf '\xd4\xc3\xb2\xa1\x02\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x00\xd0\x07\x00\x00\x01\x00\x00\x00' > TESTDUMP 3 | tcpdump -r TESTDUMP >/dev/null 2>&1 4 | 5 | %script 6 | 7 | # read from a hand-written IPSummaryDump file; check headers, emit to a dump 8 | click -e " 9 | InfiniteSource('', LIMIT 2, STOP true) 10 | -> ICMPPingEncap(1.0.0.1, 2.0.0.2, IDENTIFIER 3) 11 | -> CheckICMPHeader 12 | -> CheckIPHeader 13 | -> ICMPPingResponder 14 | -> ToDump(FOO, ENCAP IP) 15 | " 16 | tcpdump -n -r FOO > CHECK 17 | 18 | %file FOO 19 | %expectx -i CHECK 20 | .* 2\.0\.0\.2 > 1\.0\.0\.1: icmp.* echo reply.* 21 | .* 2\.0\.0\.2 > 1\.0\.0\.1: icmp.* echo reply.* 22 | -------------------------------------------------------------------------------- /test/ip/AddressInfo-bcast-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests AddressInfo's "NAME:bcast" functionality. 3 | 4 | %script 5 | click -q -h rt.table -e 'AddressInfo(foo 1.2.3.4/20); 6 | 7 | rt::LinearIPLookup( 8 | foo 0, 9 | foo:ipnet 1, 10 | foo:bcast 2); 11 | 12 | Idle -> rt; 13 | rt[0] -> Discard; 14 | rt[1] -> Discard; 15 | rt[2] -> Discard;' 16 | 17 | %expect -w stdout 18 | 1.2.3.4/32 - 0 19 | 1.2.0.0/20 - 1 20 | 1.2.15.255/32 - 2 21 | -------------------------------------------------------------------------------- /test/ip/IPFilter-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Test that IPFilter correctly handles short packets. 4 | 5 | %script 6 | click SCRIPT 7 | 8 | %file SCRIPT 9 | FromIPSummaryDump(IN, STOP true) -> ps::PaintSwitch; 10 | 11 | ps[0] -> f0::IPFilter(0 ip[19]&128==0) -> IPPrint(A) -> d::Discard; 12 | ps[1] -> f1::IPFilter(0 transp[1]&128==0) -> IPPrint(B) -> d; 13 | ps[2] -> EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2) -> f0; 14 | ps[3] -> EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2) -> f1; 15 | ps[4] -> Truncate(19) -> f0; 16 | ps[5] -> Truncate(21) -> f1; 17 | ps[6] -> Truncate(19) -> EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2) -> f0; 18 | ps[7] -> Truncate(21) -> EtherEncap(0x0800, 1:1:1:1:1:1, 2:2:2:2:2:2) -> f1; 19 | 20 | %file IN 21 | !data link timestamp sport 22 | 0 1 0 23 | 1 3 0 24 | 2 5 0 25 | 3 7 0 26 | 4 9 0 27 | 5 11 0 28 | 6 13 0 29 | 7 15 0 30 | 31 | %expect stderr 32 | A: 1{{.*}} 33 | B: 3{{.*}} 34 | A: 5{{.*}} 35 | B: 7{{.*}} 36 | -------------------------------------------------------------------------------- /test/ip/IPFilter-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Test that IPFilter does not optimize away necessary length comparisons. 4 | 5 | %script 6 | click SCRIPT 7 | 8 | %file SCRIPT 9 | FromIPSummaryDump(IN, STOP true) -> ps::PaintSwitch; 10 | 11 | ps[0] -> f0::IPFilter(0 transp[1]&128==0, 1 -) -> IPPrint(A) -> 12 | fx::IPFilter(0 transp[1]&128==0 || transp[1]&128==128) -> IPPrint(C) -> Discard; 13 | ps[1] -> f1::IPFilter(0 transp[1]&128!=0, 1 -) -> IPPrint(B) -> fx; 14 | ps[2] -> Truncate(21) -> f0; 15 | ps[3] -> Truncate(21) -> f1; 16 | f0[1] -> fx; 17 | f1[1] -> fx; 18 | 19 | %file IN 20 | !data link timestamp sport 21 | 0 1 0 22 | 0 2 128 23 | 1 3 0 24 | 1 4 128 25 | 2 5 0 26 | 2 6 128 27 | 3 7 0 28 | 3 8 128 29 | 30 | %expect stderr 31 | A: 1{{.*}} 32 | C: 1{{.*}} 33 | C: 2{{.*}} 34 | C: 3{{.*}} 35 | B: 4{{.*}} 36 | C: 4{{.*}} 37 | 38 | %ignore 39 | expensive{{.*}} 40 | -------------------------------------------------------------------------------- /test/ip/IPFilter-03.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Test that IPFilter does not optimize away necessary length comparisons. 4 | 5 | %script 6 | click SCRIPT 7 | 8 | %file SCRIPT 9 | FromIPSummaryDump(IN, STOP true) -> ps::PaintSwitch; 10 | 11 | ps[0] -> f0::IPFilter(0 transp[1]&128!=0, 1 -) -> IPPrint(A) 12 | -> f1::IPFilter(0 not (transp[1]&128==0)) -> IPPrint(B) -> Discard; 13 | f0[1] -> f1; 14 | ps[1] -> Truncate(21) -> f0; 15 | 16 | %file IN 17 | !data link timestamp sport 18 | 0 1 0 19 | 0 2 128 20 | 1 3 0 21 | 1 4 128 22 | 23 | %expect stderr 24 | A: 2{{.*}} 25 | B: 2{{.*}} 26 | B: 3{{.*}} 27 | B: 4{{.*}} 28 | 29 | %ignore 30 | expensive{{.*}} 31 | -------------------------------------------------------------------------------- /test/ip/IPFilter-05.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Test IPFilter assertions and optimizations. 4 | 5 | %script 6 | click SCRIPT -qh c.program 7 | 8 | %file SCRIPT 9 | i :: Idle 10 | -> c :: IPFilter(allow tcp && dst 10.0.0.0/32 && src 2.0.0.0/32, 11 | allow tcp && dst 10.0.0.0/32 && dst port 80 && src 2.0.0.0/32, 12 | allow all) 13 | -> i; 14 | 15 | %expect stdout 16 | all->[0] 17 | safe length 0 18 | alignment offset 0 19 | 20 | %expect stderr 21 | -------------------------------------------------------------------------------- /test/ip/IPFilter-06.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Test IPFilter Ethernet header support. 4 | 5 | %script 6 | click SCRIPT -qh c.program 7 | 8 | %file SCRIPT 9 | i :: Idle 10 | -> c :: IPFilter(allow src 0:1:2:3:4:5, 11 | allow src 10.0.0.0 & 8.0.0.0 = 8.0.0.0, 12 | allow dst 10:20:30:40:50:60, 13 | allow host 9:A:B:C:D:E, 14 | deny all) 15 | -> i; 16 | 17 | %expect stdout 18 | 0 8/00010203%ffffffff yes->step 1 no->step 2 19 | 1 12/04050000%ffff0000 yes->[0] no->step 2 20 | 2 268/0a000000%ffffffff yes->[0] no->step 3 21 | 3 0/00001020%0000ffff yes->step 4 no->step 5 22 | 4 4/30405060%ffffffff yes->[0] no->step 5 23 | 5 8/090a0b0c%ffffffff yes->step 6 no->step 7 24 | 6 12/0d0e0000%ffff0000 yes->[0] no->step 7 25 | 7 0/0000090a%0000ffff yes->step 8 no->[X] 26 | 8 4/0b0c0d0e%ffffffff yes->[0] no->[X] 27 | safe length 272 28 | alignment offset 0 29 | -------------------------------------------------------------------------------- /test/ip/IPFragmenter-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Checks IPFragmenter's IP option handling. 3 | 4 | %script 5 | click CONFIG1 6 | 7 | %file CONFIG1 8 | InfiniteSource(DATA "\<4600002c 00000000 64063482 121a042c 0a000004 01010000 001e0028 00000000 00000000 50000000 8f550000>", LIMIT 1, STOP true) 9 | -> MarkIPHeader(OFFSET 0) 10 | -> IPFragmenter(40, HONOR_DF false) 11 | -> Print(CONTENTS true, MAXLENGTH 1000) 12 | -> Discard; 13 | 14 | %expect stderr 15 | 40 | 46000028 00002000 64061486 121a042c 0a000004 01010000 001e0028 00000000 00000000 50000000 16 | 24 | 45000018 00000002 64063695 121a042c 0a000004 8f550000 17 | 18 | %ignorex 19 | !.* 20 | 21 | %eof 22 | -------------------------------------------------------------------------------- /test/ip/IPFragmenter-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Checks IPFragmenter's bad IP option handling. 3 | 4 | %script 5 | click CONFIG1 6 | 7 | %file CONFIG1 8 | InfiniteSource(DATA "\<4600002c 00000000 64063383 121a042c 0a000004 02000000 001e0028 00000000 00000000 50000000 8f550000>", LIMIT 1, STOP true) 9 | -> CheckIPHeader(OFFSET 0) 10 | -> IPFragmenter(40, HONOR_DF false) 11 | -> Print(CONTENTS true, MAXLENGTH 1000) 12 | -> Discard; 13 | 14 | %expect stderr 15 | 40 | 46000028 00002000 64061387 121a042c 0a000004 02000000 001e0028 00000000 00000000 50000000 16 | 24 | 45000018 00000002 64063695 121a042c 0a000004 8f550000 17 | 18 | %ignorex 19 | !.* 20 | 21 | %eof 22 | -------------------------------------------------------------------------------- /test/ip/IPPrint-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click -e "FromIPSummaryDump(IN, STOP true) -> IPPrint -> ToIPSummaryDump(OUT, FIELDS timestamp src dst sport dport proto ip_len ip_hl tcp_off tcp_flags)" 3 | 4 | %file IN 5 | !data timestamp src dst sport dport proto ip_len ip_hl tcp_off tcp_flags 6 | 1.00002 1.0.0.1 1.0.0.2 10 20 T 1500 40 20 A 7 | 1.00003 1.0.0.2 1.0.0.3 20 30 T 1000 20 20 SA 8 | 1.00004 1.0.0.3 1.0.0.4 30 40 T 1000 20 40 SF 9 | 1.00005 1.0.0.4 1.0.0.5 40 50 T 1000 32 40 A 10 | 11 | %expect stderr 12 | 1.000020: 1.0.0.1.10 > 1.0.0.2.20: . 0:1440(1440,60,1500) ack 0 win 0 13 | 1.000030: 1.0.0.2.20 > 1.0.0.3.30: S 0:961(961,40,1000) ack 0 win 0 14 | 1.000040: 1.0.0.3.30 > 1.0.0.4.40: SF 0:942(942,60,1000) win 0 15 | 1.000050: 1.0.0.4.40 > 1.0.0.5.50: . 0:928(928,72,1000) ack 0 win 0 16 | 17 | %ignore 18 | expensive{{.*}} 19 | -------------------------------------------------------------------------------- /test/ip/SetIPDSCP-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test read_keyword_handler via SetIPDSCP. 3 | 4 | %script 5 | click C 6 | 7 | %file C 8 | Idle -> s::SetIPDSCP(DSCP 10) -> Idle; 9 | DriverManager(read s.dscp, 10 | write s.dscp 2, 11 | read s.dscp, 12 | stop) 13 | 14 | %expect stderr 15 | s.dscp: 16 | 10 17 | s.dscp: 18 | 2 19 | -------------------------------------------------------------------------------- /test/standard/AlignmentInfo-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | click -e " 4 | AlignmentInfo(src 8 2) 5 | AlignmentInfo(dst 8 2) 6 | src :: Idle -> dst :: Discard 7 | DriverManager(wait 0.1s, stop) 8 | " 9 | echo foo 10 | 11 | %expect stdout 12 | foo 13 | -------------------------------------------------------------------------------- /test/standard/Bypass-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Bypass. 3 | 4 | %require 5 | click-buildtool provides -i batch 6 | 7 | %script 8 | click --simtime CONFIG 2>OUT 1>&2 9 | click --simtime CONFIG2 2>>OUT 1>&2 10 | 11 | %file CONFIG 12 | InfiniteSource(\<11>, LIMIT 4, STOP true) 13 | -> Counter(COUNT_CALL 3 b.active true) 14 | -> b :: Bypass 15 | -> Print(A) 16 | -> Discard; 17 | b[1] -> Print(B) -> [1]b; 18 | 19 | %file CONFIG2 20 | InfiniteSource(\<11>, LIMIT 4, STOP true) 21 | -> PullNull 22 | -> Counter(COUNT_CALL 3 b.active true) 23 | -> b :: Bypass 24 | -> Print(C) 25 | -> Discard; 26 | b[1] -> Print(D) -> [1]b; 27 | 28 | %expect OUT 29 | A: 1 | 11 30 | A: 1 | 11 31 | B: 1 | 11 32 | A: 1 | 11 33 | B: 1 | 11 34 | A: 1 | 11 35 | C: 1 | 11 36 | C: 1 | 11 37 | C: 1 | 11 38 | D: 1 | 11 39 | C: 1 | 11 40 | -------------------------------------------------------------------------------- /test/standard/Classifier-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Test simple Classifier program. 4 | 5 | %script 6 | click -e 'i::Idle -> c::Classifier(1/01, -) -> i; c[1] -> i' -qh c.program 7 | 8 | %expect stdout 9 | 0 0/00010000%00ff0000 yes->[0] no->[1] 10 | safe length 2 11 | alignment offset 0 12 | -------------------------------------------------------------------------------- /test/standard/Classifier-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that an empty Classifier program doesn't crash and does the right thing. 3 | 4 | %script 5 | click --simtime CONFIG 2>OUT 1>&2 6 | 7 | %file CONFIG 8 | InfiniteSource(LIMIT 1, STOP true) 9 | -> Classifier(-) 10 | -> Print(A) 11 | -> Discard; 12 | 13 | %expect OUT 14 | A:{{.*}} 15 | -------------------------------------------------------------------------------- /test/standard/Clipboard-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test Clipboard. 3 | 4 | %script 5 | click --simtime CONFIG 6 | 7 | %file CONFIG 8 | clipboard :: Clipboard(0/1, 2/1, 9/1); 9 | 10 | TimedSource(0.0019, "Simplistic", LIMIT 1) 11 | -> [0]clipboard[0] 12 | -> Discard(); 13 | 14 | TimedSource(0.0029, "Dance tour", LIMIT 1) 15 | -> [0]clipboard; 16 | 17 | TimedSource(0.0039, "Ionize tub", LIMIT 1) 18 | -> [0]clipboard; 19 | 20 | TimedSource(0.001, ".a. is a .at,", LIMIT 4, STOP true) 21 | -> [1]clipboard[1] 22 | -> Print(CONTENTS ASCII) 23 | -> Discard(); 24 | 25 | %expect stderr 26 | 13 | .a. is a .at, 27 | 13 | Sam is a cat, 28 | 13 | Dan is a rat, 29 | 13 | Ian is a bat, 30 | -------------------------------------------------------------------------------- /test/standard/FrontDropQueue-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests that FrontDropQueue doesn't crash on live_reconfigure() 3 | 4 | %script 5 | click --simtime -e " 6 | Idle -> q::FrontDropQueue -> Discard; 7 | 8 | Script(write q.capacity 100, 9 | wait 1, 10 | write stop); 11 | " 12 | 13 | %expect stdout 14 | %expect stderr 15 | -------------------------------------------------------------------------------- /test/standard/FullNoteQueue-upstream-notifier-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests upstream Notifier functionality -- Ensure that InfiniteSource 3 | doesn't overflow the queu in front of it, even when that 4 | queue is drained slower than it can produce packets. 5 | 6 | %script 7 | click -e " 8 | src :: InfiniteSource(<0800>, 2, 1, true, STOP true) 9 | -> q :: FullNoteQueue(1) 10 | -> count :: Counter() 11 | -> unq :: Unqueue 12 | -> Discard; 13 | ScheduleInfo(unq 1, 14 | src 2); 15 | DriverManager(wait, 16 | read q.drops, 17 | read count.count); 18 | " 19 | 20 | %expect stderr 21 | q.drops: 22 | 0 23 | 24 | count.count: 25 | 2 26 | -------------------------------------------------------------------------------- /test/standard/Hub-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | click CONFIG 4 | 5 | %file CONFIG 6 | FromIPSummaryDump(X, STOP true) 7 | -> p::PaintSwitch 8 | -> h::Hub 9 | -> Paint(0) 10 | -> t::ToIPSummaryDump(Y, FIELDS link ip_src) 11 | 12 | p[1] -> [1]h[1] -> Paint(1) -> t 13 | p[2] -> [2]h[2] -> Paint(2) -> t 14 | p[3] -> [3]h[3] -> Paint(3) -> t 15 | 16 | %file X 17 | !data link ip_src 18 | 0 1.0.0.0 19 | 1 1.0.0.1 20 | 2 1.0.0.2 21 | 3 1.0.0.3 22 | 23 | %file Y 24 | 1 1.0.0.0 25 | 2 1.0.0.0 26 | 3 1.0.0.0 27 | 0 1.0.0.1 28 | 2 1.0.0.1 29 | 3 1.0.0.1 30 | 0 1.0.0.2 31 | 1 1.0.0.2 32 | 3 1.0.0.2 33 | 0 1.0.0.3 34 | 1 1.0.0.3 35 | 2 1.0.0.3 36 | 37 | %ignore Y 38 | !{{.*}} 39 | -------------------------------------------------------------------------------- /test/standard/Idle-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that inline port layout works properly. 3 | 4 | %script 5 | click -q CONFIG 6 | 7 | %file CONFIG 8 | i, j :: Idle; 9 | i[0] -> [0]j; 10 | i[1] -> [1]j; 11 | i[2] -> [2]j; 12 | i[3] -> [3]j; 13 | 14 | %expect stdout 15 | 16 | -------------------------------------------------------------------------------- /test/standard/LinkUnqueue-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click --simtime CONFIG < DUMP | grep -v '^!' 3 | 4 | %file CONFIG 5 | FromIPSummaryDump(-, STOP true) 6 | -> Queue -> LinkUnqueue(0.005s, 100kb/s) 7 | -> SetTimestampDelta 8 | -> ToIPSummaryDump(-, FIELDS timestamp ip_src); 9 | DriverManager(wait, wait_time 0.38s, stop) 10 | 11 | %file DUMP 12 | !data ip_src ip_len 13 | 1.0.0.1 20 14 | 1.0.0.2 20 15 | 1.0.0.3 1600 16 | 1.0.0.4 20 17 | 1.0.0.5 1600 18 | 1.0.0.6 20 19 | 20 | %expect stdout 21 | 0.000000 1.0.0.1 22 | 0.001600 1.0.0.2 23 | 0.129600 1.0.0.3 24 | 0.131200 1.0.0.4 25 | 0.259200 1.0.0.5 26 | 0.260800 1.0.0.6 27 | -------------------------------------------------------------------------------- /test/standard/MixedQueue-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click --simtime CONFIG < DUMP | grep -v '^!' 3 | 4 | %file CONFIG 5 | FromIPSummaryDump(-, STOP true) 6 | -> c::IPClassifier(src 1.0.0.1, src 1.0.0.2) 7 | -> m::MixedQueue 8 | -> u::Unqueue(ACTIVE false) 9 | -> ToIPSummaryDump(-, FIELDS ip_dst); 10 | c[1] -> [1]m; 11 | DriverManager(wait, write u.active true, wait_time 0.1s, stop) 12 | 13 | %file DUMP 14 | !data ip_src ip_dst ip_proto 15 | 1.0.0.1 1.0.0.1 U 16 | 1.0.0.1 1.0.0.2 U 17 | 1.0.0.2 1.0.0.3 U 18 | 1.0.0.1 1.0.0.4 U 19 | 1.0.0.2 1.0.0.5 U 20 | 21 | %expect stdout 22 | 1.0.0.5 23 | 1.0.0.3 24 | 1.0.0.1 25 | 1.0.0.2 26 | 1.0.0.4 27 | -------------------------------------------------------------------------------- /test/standard/MixedQueue-02.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click --simtime CONFIG < DUMP | grep -v '^!' 3 | 4 | %file CONFIG 5 | FromIPSummaryDump(-, STOP true) 6 | -> c::IPClassifier(src 1.0.0.1, src 1.0.0.2) 7 | -> m::MixedQueue(5) 8 | -> u::Unqueue(ACTIVE false) 9 | -> ToIPSummaryDump(-, FIELDS ip_dst); 10 | c[1] -> [1]m; 11 | DriverManager(wait, write u.active true, wait_time 0.1s, stop) 12 | 13 | %file DUMP 14 | !data ip_src ip_dst ip_proto 15 | 1.0.0.1 1.0.0.1 U 16 | 1.0.0.1 1.0.0.2 U 17 | 1.0.0.2 1.0.0.3 U 18 | 1.0.0.1 1.0.0.4 U 19 | 1.0.0.2 1.0.0.5 U 20 | 1.0.0.1 1.0.0.6 U # should drop 1.0.0.6 21 | 1.0.0.2 1.0.0.7 U # should drop 1.0.0.1 22 | 23 | %expect stdout 24 | 1.0.0.7 25 | 1.0.0.5 26 | 1.0.0.3 27 | 1.0.0.1 28 | 1.0.0.2 29 | -------------------------------------------------------------------------------- /test/standard/MoveData-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that MoveData works correctly. 3 | 4 | %script 5 | click CONFIG 6 | 7 | %file CONFIG 8 | RatedSource(DATA "ABCD", LIMIT 1, STOP true) 9 | -> Print(CONTENTS ascii) 10 | -> MoveData(SRC_OFFSET 0, DST_OFFSET 2, LENGTH 2) 11 | -> Print(CONTENTS ascii) 12 | -> MoveData(SRC_OFFSET 1, DST_OFFSET 4, LENGTH 2, GROW true) 13 | -> Print(CONTENTS ascii) 14 | -> MoveData(SRC_OFFSET 1, DST_OFFSET 6, LENGTH 2, GROW false) 15 | -> Print(CONTENTS ascii) 16 | -> MoveData(SRC_OFFSET 60, DST_OFFSET 0, LENGTH 2, GROW true) 17 | -> Print(CONTENTS ascii) 18 | -> Discard(); 19 | 20 | %expect stderr 21 | 4 | ABCD 22 | 4 | ABAB 23 | 6 | ABABBA 24 | 6 | ABABBA 25 | 6 | ABABBA 26 | -------------------------------------------------------------------------------- /test/standard/PaintRR-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test PaintRR 3 | 4 | %script 5 | click CONFIG 6 | 7 | %file IN 8 | !data aggregate 9 | 0 10 | 1 11 | 2 12 | 3 13 | 4 14 | 15 | %file CONFIG 16 | 17 | FromIPSummaryDump(IN, STOP true) 18 | -> pr :: PaintRR(20); 19 | 20 | pr[0] -> Print(1) -> Discard; 21 | pr[1] -> Print(2) -> Discard; 22 | pr[2] -> Print(3) -> Discard; 23 | %expect stderr 24 | 1: 0 25 | 2: 0 26 | 3: 0 27 | 1: 0 28 | 2: 0 29 | -------------------------------------------------------------------------------- /test/standard/Queue-notifiers-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests FullNoteQueue nonfull notifications and capacity changing. 3 | 4 | %script 5 | click --simtime -e ' 6 | i :: InfiniteSource -> q :: Queue -> Idle; 7 | DriverManager(wait 0.02s, print i.count, write q.capacity 10, print q.config, 8 | wait 0.02s, print i.count, write q.capacity 1000, print q.config, 9 | wait 0.02s, print i.count, wait 0.02s, print i.count) 10 | ' >OUT 11 | 12 | %expect OUT 13 | 1000 14 | CAPACITY 10 15 | 1000 16 | CAPACITY 1000 17 | 1990 18 | 1990 -------------------------------------------------------------------------------- /test/standard/Queue-yank-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click --simtime -e ' 3 | Idle -> q::Queue(6) -> Idle 4 | qyt::QueueYankTest(q) 5 | DriverManager(wait_time 0.1s, stop) 6 | ' 7 | 8 | %expect stderr 9 | qyt :: QueueYankTest: All tests pass! 10 | -------------------------------------------------------------------------------- /test/standard/QuickNoteQueue-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests QuickNoteQueue notifications. 3 | 4 | %require 5 | click-buildtool provides NotifierDebug 6 | 7 | %script 8 | click --simtime -e ' 9 | i :: InfiniteSource(LIMIT 1, ACTIVE false) 10 | -> d1 :: NotifierDebug 11 | -> q :: QuickNoteQueue 12 | -> d2 :: NotifierDebug 13 | -> s :: PullSwitch 14 | -> c :: Counter(COUNT_CALL 1 s.switch 1) 15 | -> d :: Discard; 16 | Idle -> [1] s; 17 | 18 | DriverManager(wait 0.01s, 19 | print d1.signal, print d2.signal, 20 | write i.active true, 21 | wait 0.01s, 22 | print d1.signal, print d2.signal, 23 | write s.switch 1, 24 | wait 0.01s, 25 | print d1.signal, print d2.signal, 26 | stop) 27 | ' >OUT 28 | 29 | %expect OUT 30 | full.0/1:1* 31 | empty.0/{{\d+}}:0 32 | full.0/1:1* 33 | empty.0/{{\d+}}:0 34 | full.0/1:1* 35 | empty.0/{{\d+}}:0 36 | -------------------------------------------------------------------------------- /test/standard/Resize-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that Resize works correctly. 3 | 4 | %script 5 | click CONFIG 6 | 7 | %file CONFIG 8 | RatedSource(DATA "ABCD", LIMIT 1, STOP true) 9 | -> Print() 10 | -> Resize(HEAD -2) 11 | -> Print() 12 | -> Resize(+4, -2) 13 | -> Print() 14 | -> Resize() 15 | -> Print() 16 | -> Resize(HEAD -8) 17 | -> Print() 18 | -> Discard(); 19 | 20 | %expect stderr 21 | 4 | 41424344 22 | 2 | 4344 23 | 4 | {{....}}4142 24 | 4 | {{....}}4142 25 | 0 26 | -------------------------------------------------------------------------------- /test/standard/Script-02.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click CONFIG 3 | cat FILE | wc -c 4 | 5 | %file CONFIG 6 | s0 :: Script(printn >FILE $(s.run "\<0a 09 01>"), 7 | readq length "\<0a 09 01>", 8 | stop) 9 | s :: Script(TYPE PASSIVE, returnq $1) 10 | 11 | %expect stdout 12 | {{\s*}}3 13 | 14 | %expect stderr 15 | s0.length: 16 | 3 17 | 18 | %expectv +3 FILE 19 | 20 |  21 | -------------------------------------------------------------------------------- /test/standard/Script-03.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click --simtime CONFIG 3 | 4 | %file CONFIG 5 | s0 :: Script(label a, goto a); 6 | s1 :: Script(wait 1, stop); 7 | 8 | %expect stderr 9 | s0 :: Script: too many jumps, giving up 10 | 11 | -------------------------------------------------------------------------------- /test/standard/Script-04.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click CONFIG 3 | 4 | %file CONFIG 5 | s0 :: Script( 6 | print $(add 1 2 3), 7 | print $(avg 1 2 3), 8 | print $(count 1 0 3), 9 | print $(popcount 1 0 3), 10 | print $(popcount .01 0.32 0), 11 | print $(sub 10 2 2), 12 | print $(min 10 6 20), 13 | print $(max -1 6 3), 14 | print $(mul 1 2 3), 15 | print $(div 75 2.5 5), 16 | print $(idiv 60 2 5), 17 | print $(htonl $(ntohl 6)), 18 | print $(htons $(ntohs 6)), 19 | write set foovar foo bar baz, 20 | print $(shift foovar), 21 | print $(shift foovar), 22 | print $(get foovar), 23 | print $(gt_vec 0 0.01 0.32 0), 24 | print $(gt_vec 0.02 0.01 0.32 0), 25 | stop) 26 | 27 | %expect stdout 28 | 6 29 | 2 30 | 3 31 | 2 32 | 2 33 | 6 34 | 6 35 | 6 36 | 6 37 | 6 38 | 6 39 | 6 40 | 6 41 | foo 42 | bar 43 | baz 44 | 2 45 | 1 46 | 47 | %expect stderr 48 | -------------------------------------------------------------------------------- /test/standard/Script-05.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click CONFIG 3 | 4 | %file CONFIG 5 | FromIPSummaryDump(STOP true, DATA "!data ip_dst timestamp 6 | 1.0.0.1 1 7 | 1.0.0.3 2 8 | 1.0.0.3 3 9 | 1.0.0.2 4 10 | 1.0.0.3 5 11 | 1.0.0.3 6 12 | 1.0.0.1 7 13 | 1.0.0.3 8") 14 | -> ip :: IPClassifier(dst 1.0.0.1, dst 1.0.0.2, dst 1.0.0.3); 15 | td :: ToIPSummaryDump(-, FIELDS ts_sec); 16 | 17 | ip[0] -> Script(write sw.switch 0) -> td; 18 | ip[1] -> Script(write sw.switch -1) -> td; 19 | ip[2] -> sw::Switch -> td; 20 | 21 | %expect stdout 22 | 1 23 | 2 24 | 3 25 | 4 26 | 7 27 | 8 28 | 29 | %expect stderr 30 | 31 | %ignorex 32 | !.* 33 | -------------------------------------------------------------------------------- /test/standard/StrideSched-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | click -e ' 3 | i1 :: InfiniteSource(\<11>, LIMIT 10) 4 | i2 :: InfiniteSource(\<22>, LIMIT 10) 5 | i3 :: InfiniteSource(\<33>, LIMIT 10, STOP true) 6 | ss :: StrideSched(4, 2, 1) 7 | i1 -> [0] ss; i2 -> [1]ss; i3 -> [2]ss 8 | ss -> Print -> Discard 9 | ' 2>OUT 10 | 11 | %expect OUT 12 | 1 | 11 13 | 1 | 11 14 | 1 | 22 15 | 1 | 11 16 | 1 | 11 17 | 1 | 22 18 | 1 | 33 19 | 1 | 11 20 | 1 | 11 21 | 1 | 22 22 | 1 | 11 23 | 1 | 11 24 | 1 | 22 25 | 1 | 33 26 | 1 | 11 27 | 1 | 11 28 | 1 | 22 29 | 1 | 22 30 | 1 | 33 31 | 1 | 22 32 | 1 | 22 33 | 1 | 33 34 | 1 | 22 35 | 1 | 22 36 | 1 | 33 37 | 1 | 33 38 | 1 | 33 39 | 1 | 33 40 | 1 | 33 41 | 1 | 33 42 | -------------------------------------------------------------------------------- /test/standard/Tee-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Simple Tee test. 3 | 4 | %script 5 | click CONFIG 6 | 7 | %file CONFIG 8 | InfiniteSource(LIMIT 1) -> 9 | q::Queue(CAPACITY 1) -> 10 | Unqueue() -> 11 | t::Tee(); 12 | t[1] -> Discard(); 13 | t[0] -> q; 14 | DriverManager(wait 0.1s, stop) 15 | 16 | %expect stdout 17 | -------------------------------------------------------------------------------- /test/standard/Unqueue-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that Unqueue updates its "count" handler as it goes. 3 | 4 | %script 5 | click CONFIG 6 | 7 | %file CONFIG 8 | InfiniteSource(LIMIT 5, STOP true) 9 | -> SimpleQueue 10 | -> unqueue :: Unqueue(LIMIT 1) 11 | -> s :: Script(TYPE PACKET, export count 0, 12 | set count $(add $count 1), 13 | write unqueue.reset); 14 | DriverManager(pause, wait 0.1s, print s.count); 15 | 16 | %expect stdout 17 | 5 18 | -------------------------------------------------------------------------------- /test/standard/bigint-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Bigint multiple-precision arithmetic with the BigintTest element. 3 | 4 | %require 5 | click-buildtool provides BigintTest 6 | 7 | %script 8 | click -qe BigintTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/bitvector-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests bitvector functionality with the BitvectorTest element. 3 | 4 | %require 5 | click-buildtool provides BitvectorTest 6 | 7 | %script 8 | click -qe 'BitvectorTest' 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/confparse-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests configuration parsing functionality with the ConfParseTest element. 3 | 4 | %require 5 | click-buildtool provides ConfParseTest 6 | 7 | %script 8 | click -qe 'AddressInfo(ip4_addr 1.2.3.4); ConfParseTest' 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/crypto-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests crypto algorithms with the CryptoTest element. 3 | 4 | %require 5 | click-buildtool provides CryptoTest 6 | 7 | %script 8 | click -qe CryptoTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/deque-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Deque functionality with the DequeTest element. 3 | 4 | %require 5 | click-buildtool provides DequeTest 6 | 7 | %script 8 | click -qe DequeTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/error-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests ErrorHandler functionality with the ErrorTest element. 3 | 4 | %require 5 | click-buildtool provides ErrorTest 6 | 7 | %script 8 | click -qe ErrorTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/functions-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests helper functions with the FunctionTest element. 3 | 4 | %require 5 | click-buildtool provides FunctionTest 6 | 7 | %script 8 | click -qe FunctionTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/hashtable-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests hash table functionality with the HashTableTest element. 3 | 4 | %require 5 | click-buildtool provides HashTableTest 6 | 7 | %script 8 | click -qe 'HashTableTest' 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | 14 | %ignore stderr 15 | Time: {{.*}} 16 | -------------------------------------------------------------------------------- /test/standard/hashtablemp-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests hash table functionality with the HashTableMPTest element. 3 | 4 | %require 5 | click-buildtool provides HashTableMPTest 6 | 7 | %script 8 | click -qe 'HashTableMPTest' 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | 14 | %ignore stderr 15 | Time: {{.*}} 16 | -------------------------------------------------------------------------------- /test/standard/heap-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests heap algorithms with the HeapTest element. 3 | 4 | %require 5 | click-buildtool provides HeapTest 6 | 7 | %script 8 | click -qe HeapTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/landmarks-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests landmarks for configuration errors. 3 | 4 | %script 5 | cpp A | click || true 6 | 7 | %file A 8 | 9 | x :: Idle; 10 | yy :: Idle; 11 | #include "B" 12 | y :: PushNull; 13 | x[1] -> y -> x; 14 | y -> [1]x; 15 | 16 | %file B 17 | x :: Idle; 18 | 19 | %expect stderr 20 | {{\./|}}B:1: redeclaration of element 'x' 21 | A:2: element 'x' previously declared here 22 | -------------------------------------------------------------------------------- /test/standard/library-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test require(library) lexer support 3 | 4 | %script 5 | click -q -h list main 6 | click-flatten main 7 | 8 | %file main 9 | require(library lib, library lib3) 10 | a :: A; 11 | 12 | %file lib 13 | require(library dir/lib2) 14 | elementclass A { b :: B; } 15 | 16 | %file dir/lib2 17 | elementclass B { i :: Idle; } 18 | 19 | %file lib3 20 | require(library lib) 21 | 22 | %expect stdout 23 | 1 24 | a/b/i 25 | a/b/i :: Idle; 26 | 27 | %ignore stdout 28 | #{{.*}} 29 | -------------------------------------------------------------------------------- /test/standard/list-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests List functionality with the ListTest element. 3 | 4 | %require 5 | click-buildtool provides ListTest 6 | 7 | %script 8 | click -qe ListTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/notifier-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Notifier functionality at userlevel. 3 | 4 | %script 5 | click --simtime CONFIG -h c.count > OUT 6 | 7 | %file CONFIG 8 | i :: InfiniteSource(ACTIVE false, LIMIT 5) 9 | -> q :: Queue 10 | -> p :: PrioSched 11 | -> u :: Unqueue 12 | -> c :: Counter 13 | -> d :: Discard 14 | Idle -> [1]p 15 | 16 | DriverManager(wait 0.1s, write i.active true, wait 0.1s) 17 | 18 | %expect OUT 19 | 5 20 | -------------------------------------------------------------------------------- /test/standard/notifier-03.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Notifier functionality in the kernel. 3 | 4 | %require 5 | click-buildtool provides linuxmodule 6 | [ `whoami` = root ] || sudo -n true 7 | 8 | %script 9 | SUDO=; if ! [ `whoami` = root ]; then SUDO="sudo -n"; fi 10 | test -n "`which click-install`" 11 | usleep () { click -e "DriverManager(wait ${1}us)"; } 12 | $SUDO "`which click-install`" CONFIG 13 | usleep 200000 14 | cat /click/c/count > OUT 15 | $SUDO "`which click-uninstall`" 16 | 17 | %file CONFIG 18 | i :: InfiniteSource(ACTIVE false, LIMIT 5) 19 | -> q :: Queue 20 | -> p :: PrioSched 21 | -> u :: Unqueue 22 | -> c :: Counter 23 | -> d :: Discard 24 | Idle -> [1]p 25 | 26 | DriverManager(wait 0.1s, write i.active true, wait 0.1s) 27 | 28 | %expect OUT 29 | 5 30 | -------------------------------------------------------------------------------- /test/standard/notifier-06.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Notifier and NotifierSignal functionality with the NotifierTest element. 3 | 4 | %require 5 | click-buildtool provides NotifierTest 6 | 7 | %script 8 | click -qe NotifierTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/search-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests String class with the StringTest element. 3 | 4 | %require 5 | click-buildtool provides StringTest 6 | 7 | %script 8 | click -e 'InfiniteSource("HELLO WORLD !", STOP 1, LIMIT 1) -> s :: Search("LO ") -> Print(FOUND) -> UnstripAnno() -> Print(FOUNDFULL) -> Discard; s[1] -> Print(NOTFOUND)-> Discard;' 9 | 10 | %expect stderr 11 | FOUND: 7 | 574f524c 442021 12 | FOUNDFULL: 13 | 48454c4c 4f20574f 524c4420 21 13 | -------------------------------------------------------------------------------- /test/standard/sort-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests click_qsort functionality with the SortTest element. 3 | 4 | %require 5 | click-buildtool provides SortTest 6 | 7 | %script 8 | click -qe SortTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/string-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests String functionality with the StringTest element. 3 | 4 | %require 5 | click-buildtool provides StringTest 6 | 7 | %script 8 | click -qe 'StringTest' 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/standard/timer-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Timer functionality with the TimerTest element. 3 | 4 | %require 5 | click-buildtool provides TimerTest 6 | 7 | %script 8 | click -qe tt::TimerTest 9 | 10 | %expect stderr 11 | Initializing default_constructor_timer 12 | Initializing explicit_do_nothing_timer 13 | -------------------------------------------------------------------------------- /test/standard/timer-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Timer rescheduling functionality. 3 | 4 | %require 5 | click-buildtool provides TimerTest 6 | 7 | %script 8 | click --simtime CONFIG 9 | 10 | %file CONFIG 11 | t1 :: TimerTest(DELAY .03s); 12 | t2 :: TimerTest(DELAY .02s); 13 | t3 :: TimerTest(DELAY .01s); 14 | DriverManager(write t1.schedule_after 0, wait .05s, stop); 15 | 16 | %expect stderr 17 | {{[\d]+0000|0}}.00{{[\d]+}}: t1 :: TimerTest fired 18 | {{[\d]+0000|0}}.01{{[\d]+}}: t3 :: TimerTest fired 19 | {{[\d]+0000|0}}.02{{[\d]+}}: t2 :: TimerTest fired 20 | -------------------------------------------------------------------------------- /test/standard/tokenbucket-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests TokenBucket 3 | 4 | %script 5 | click -qe TokenBucketTest 6 | 7 | %expect stderr 8 | config:1:{{.*}} 9 | All tests pass! 10 | -------------------------------------------------------------------------------- /test/standard/vector-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests Vector functionality with the VectorTest element. 3 | 4 | %require 5 | click-buildtool provides VectorTest 6 | 7 | %script 8 | click -qe VectorTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/tcpudp/UDPIPEncap-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests UDPIPEncap and PortInfo functionality. 3 | 4 | %script 5 | click -e " 6 | InfiniteSource(LIMIT 3, STOP true) 7 | -> r :: RoundRobinSwitch 8 | -> UDPIPEncap(1.0.0.1, foo, 1.0.0.1, ssh) 9 | -> p :: ToIPSummaryDump(-, FIELDS ip_src sport ip_dst dport ip_proto); 10 | r[1] -> UDPIPEncap(1.0.0.2, 20, 1.0.0.2, 30) -> p; 11 | r[2] -> { input -> UDPIPEncap(1.0.0.3, foo, 1.0.0.3, ssh) -> output; 12 | PortInfo(foo 80/udp ssh) } -> p; 13 | PortInfo(foo 79/udp # ssh 25/udp comment, # ssh 26/udp comment, ) 14 | " | grep -v '^!' 15 | 16 | %expect stdout 17 | 1.0.0.1 79 1.0.0.1 22 U 18 | 1.0.0.2 20 1.0.0.2 30 U 19 | 1.0.0.3 80 1.0.0.3 80 U 20 | -------------------------------------------------------------------------------- /test/threads/Pipeliner-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests the Pipeliner element 3 | 4 | %require 5 | click-buildtool provides umultithread 6 | 7 | %script 8 | $VALGRIND click -j 8 -e ' 9 | elementclass Core { 10 | $thid | 11 | rs :: RatedSource(LENGTH 4, RATE 1000000, LIMIT 10000, STOP true) 12 | -> output 13 | StaticThreadSched(rs $thid) 14 | } 15 | 16 | cin :: CounterMP -> Pipeliner(BLOCKING true) -> cpu::CPUSwitch -> cout :: Counter -> Discard 17 | 18 | Core(1) -> cin 19 | Core(2) -> cin 20 | Core(3) -> cin 21 | Core(4) -> cin 22 | Core(5) -> cin 23 | Core(6) -> cin 24 | Core(7) -> cin 25 | 26 | cpu[1,2,3,4,5,6,7] => [0] Print(BUG) -> Discard 27 | 28 | DriverManager(wait,wait,wait,wait,wait,wait,wait,wait 100ms, 29 | print "$(cin.count)/$(cout.count)", stop) 30 | ' 31 | 32 | %expect stdout 33 | 70000/70000 34 | -------------------------------------------------------------------------------- /test/threads/Pipeliner-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests the Pipeliner element in non-blocking mode 3 | 4 | %require 5 | click-buildtool provides umultithread 6 | 7 | %script 8 | $VALGRIND click -j 8 -e ' 9 | elementclass Core { 10 | $thid | 11 | rs :: RatedSource(LENGTH 4, RATE 40, LIMIT 40) 12 | -> output 13 | StaticThreadSched(rs $thid) 14 | } 15 | 16 | cin :: CounterMP -> Pipeliner(BLOCKING false, CAPACITY 4) -> cpu::CPUSwitch -> cout :: Counter -> Discard 17 | 18 | Core(1) -> cin 19 | Core(2) -> cin 20 | Core(3) -> cin 21 | Core(4) -> cin 22 | Core(5) -> cin 23 | Core(6) -> cin 24 | Core(7) -> cin 25 | 26 | cpu[1,2,3,4,5,6,7] => [0] Print(BUG) -> Discard 27 | 28 | Script(wait 1.1s, print cin.count, print cout.count, stop) 29 | ' 30 | 31 | %expect stdout 32 | 280 33 | 280 34 | -------------------------------------------------------------------------------- /test/threads/Pipeliner-03.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests the Pipeliner element, in ALWAYS_UP mode 3 | 4 | %require 5 | click-buildtool provides umultithread 6 | 7 | %script 8 | $VALGRIND click -j 8 -e ' 9 | elementclass Core { 10 | $thid | 11 | rs :: RatedSource(LENGTH 4, RATE 1000000, LIMIT 10000, STOP true) 12 | -> output 13 | StaticThreadSched(rs $thid) 14 | } 15 | 16 | cin :: CounterMP -> Pipeliner(BLOCKING true, ALWAYS_UP true) -> cpu::CPUSwitch -> cout :: Counter -> Discard 17 | 18 | Core(1) -> cin 19 | Core(2) -> cin 20 | Core(3) -> cin 21 | Core(4) -> cin 22 | Core(5) -> cin 23 | Core(6) -> cin 24 | Core(7) -> cin 25 | 26 | cpu[1,2,3,4,5,6,7] => [0] Print(BUG) -> Discard 27 | 28 | DriverManager(wait,wait,wait,wait,wait,wait,wait,wait 100ms, 29 | print "$(cin.count)/$(cout.count)", stop) 30 | ' 31 | 32 | %expect stdout 33 | 70000/70000 34 | -------------------------------------------------------------------------------- /test/threads/RCUTest-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests RCU data structure 3 | 4 | %require 5 | click-buildtool provides umultithread 6 | 7 | %script 8 | $VALGRIND click -j 16 -e ' 9 | 10 | t :: RCUTest() 11 | DriverManager(wait,wait,wait,wait,wait,wait,wait,wait,wait,wait,wait,wait,wait,wait,wait,wait, 12 | wait 10ms, 13 | print t.rcu, print t.fast_rcu, print t.status, stop) 14 | ' 15 | 16 | %expect stdout 17 | 80000 18 | 80000 19 | 160000 20 | -------------------------------------------------------------------------------- /test/threads/StaticThreadSched-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests thread assignment. 3 | 4 | %require 5 | click-buildtool provides umultithread 6 | 7 | %script 8 | click --simtime --threads=2 -e ' 9 | StaticThreadSched(rs1 0, d1 0, rs2 1, d2 1); 10 | rs1 :: RatedSource -> q1 :: Queue -> d1 :: Discard; 11 | rs2 :: RatedSource -> q2 :: Queue -> d2 :: Discard; 12 | Script(wait 1s, print rs1.home_thread, print d1.home_thread, 13 | print rs2.home_thread, print d2.home_thread, stop) 14 | ' 15 | 16 | %expect stdout 17 | 0 18 | 0 19 | 1 20 | 1 21 | -------------------------------------------------------------------------------- /test/threads/StaticThreadSched-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests thread assignment for compounds. 3 | 4 | %require 5 | click-buildtool provides umultithread 6 | 7 | %script 8 | click --simtime --threads=2 -e ' 9 | StaticThreadSched(sub0 1); 10 | sub0, sub1 :: { 11 | src :: RatedSource -> q :: Queue -> d :: Discard; 12 | StaticThreadSched(d 0); 13 | } 14 | Script(wait 1s, print sub0/src.home_thread, print sub0/d.home_thread, 15 | print sub1/src.home_thread, print sub1/d.home_thread, stop) 16 | ' 17 | 18 | %expect stdout 19 | 1 20 | 0 21 | 0 22 | 0 23 | -------------------------------------------------------------------------------- /test/threads/threadvector-cpuswitch.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test CPU switch threadvector 3 | 4 | %require 5 | click-buildtool provides umultithread 6 | 7 | %script 8 | click -j 4 CONFIG 9 | 10 | %file CONFIG 11 | cpu :: CPUSwitch(); 12 | is0 :: InfiniteSource -> cpu; 13 | is1 :: InfiniteSource -> cpu; 14 | is2 :: InfiniteSource -> cpu; 15 | is3 :: InfiniteSource -> cpu; 16 | 17 | StaticThreadSched(is0 0, is1 1, is2 2, is3 3); 18 | 19 | cpu[0] -> out0 :: Discard; 20 | cpu[1] -> out1 :: Discard; 21 | cpu[2] -> out2 :: Discard; 22 | 23 | Script( read cpu.passing_threads, 24 | read out0.passing_threads, 25 | read out1.passing_threads, 26 | read out2.passing_threads, 27 | stop) 28 | 29 | %expect stderr 30 | cpu.passing_threads: 31 | 0-3 32 | out0.passing_threads: 33 | 0,3 34 | out1.passing_threads: 35 | 1 36 | out2.passing_threads: 37 | 2 38 | -------------------------------------------------------------------------------- /test/threads/threadvector-exactcpuswitch.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test Exact CPU switch threadvector 3 | 4 | 5 | %require 6 | click-buildtool provides umultithread 7 | 8 | 9 | %script 10 | click -j 4 CONFIG 11 | 12 | %file CONFIG 13 | cpu :: ExactCPUSwitch(); 14 | is0 :: InfiniteSource -> cpu; 15 | is2 :: InfiniteSource -> cpu; 16 | is3 :: InfiniteSource -> cpu; 17 | 18 | StaticThreadSched(is0 0, is2 2, is3 3); 19 | 20 | cpu[0] -> out0 :: Discard; 21 | cpu[1] -> out1 :: Discard; 22 | cpu[2] -> out2 :: Discard; 23 | 24 | Script( read cpu.passing_threads, 25 | read out0.passing_threads, 26 | read out1.passing_threads, 27 | read out2.passing_threads, 28 | stop) 29 | 30 | %expect stderr 31 | cpu.passing_threads: 32 | 0,2-3 33 | out0.passing_threads: 34 | 0 35 | out1.passing_threads: 36 | 2 37 | out2.passing_threads: 38 | 3 39 | -------------------------------------------------------------------------------- /test/tools/align-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | click-align -e " 4 | src :: Whatever 5 | -> c :: Classifier(12/0800) 6 | -> s :: Strip(14) 7 | -> ch :: CheckIPHeader 8 | -> d :: Discard 9 | " 10 | 11 | %expect stdout 12 | src :: Whatever; 13 | c :: Classifier(12/0800); 14 | s :: Strip(14); 15 | ch :: CheckIPHeader; 16 | d :: Discard; 17 | Align@click_align@{{\d+}} :: Align(4, 2); 18 | AlignmentInfo@click_align@{{\d+}} :: AlignmentInfo(c 4 2); 19 | src -> Align@click_align@{{\d+}} 20 | -> c 21 | -> s 22 | -> ch 23 | -> d; 24 | 25 | %ignorex 26 | #.* 27 | -------------------------------------------------------------------------------- /test/tools/combine-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | click-combine -n A -f AI -n B -f BI A.eth1=B.eth0 > C 4 | click-uncombine C A | click-flatten --config > AO 5 | click-uncombine C B | click-flatten --config > BO 6 | 7 | %file AI 8 | x::ThisIsA -> y::ToDevice(eth1) 9 | 10 | %file BI 11 | x::FromDevice(eth0) -> y::ThisIsB 12 | 13 | %file C 14 | 15 | %expect AO 16 | x :: ThisIsA; 17 | y :: ToDevice(eth1); 18 | x -> y; 19 | 20 | %expect BO 21 | y :: ThisIsB; 22 | x :: FromDevice(eth0); 23 | x -> y; 24 | 25 | %ignorex 26 | #.* 27 | -------------------------------------------------------------------------------- /test/tools/fastclassifier-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | 3 | Test that click-fastclassifier does not optimize away necessary length 4 | comparisons. 5 | 6 | %require -q 7 | test -z "$CLICKTEST_PREINSTALL" 8 | 9 | %script 10 | click SCRIPT 11 | click-fastclassifier -qu SCRIPT | click 12 | 13 | %file SCRIPT 14 | FromIPSummaryDump(IN, STOP true) -> ps::PaintSwitch; 15 | 16 | ps[0] -> f0::IPFilter(0 transp[1]>=16, 1 -) -> IPPrint(A) 17 | -> f1::IPFilter(0 not (transp[1]<16)) -> IPPrint(B) -> Discard; 18 | f0[1] -> f1; 19 | ps[1] -> Truncate(21) -> f0; 20 | 21 | %file IN 22 | !data link timestamp sport 23 | 0 1 0 24 | 0 2 128 25 | 1 3 0 26 | 1 4 128 27 | 28 | %expect stderr 29 | A: 2{{.*}} 30 | B: 2{{.*}} 31 | B: 3{{.*}} 32 | B: 4{{.*}} 33 | 34 | A: 2{{.*}} 35 | B: 2{{.*}} 36 | B: 3{{.*}} 37 | B: 4{{.*}} 38 | 39 | %ignore 40 | expensive{{.*}} 41 | make{{.*jobserver.*}} 42 | g++{{.*}}: warning{{.*}} 43 | -------------------------------------------------------------------------------- /test/tools/lexer-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | click-flatten -o/dev/null -e " 4 | elementclass Foo { 5 | A -> B; 6 | } 7 | A :: Idle; 8 | " || true 9 | 10 | click-flatten -o/dev/null -e " 11 | elementclass Foo { 12 | A :: A -> B; 13 | } 14 | A :: Idle; 15 | " || true 16 | 17 | click-flatten -o/dev/null -e " 18 | elementclass Foo { 19 | A :: AA -> B; 20 | } 21 | A :: Idle; 22 | " || true 23 | 24 | %expect stderr 25 | config:5: class 'A' used as element name 26 | config:3: class 'A' used as element name 27 | config:5: class 'A' used as element name 28 | 29 | %ignorex 30 | #.* 31 | -------------------------------------------------------------------------------- /test/tools/lexer-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Check lexical scoping of formals 3 | %script 4 | 5 | click-flatten A.click > AO_TOOL 6 | click -qo- A.click > AO_USERLEVEL 7 | 8 | click-flatten B.click > BO_TOOL 9 | click -qo- B.click > BO_USERLEVEL 10 | 11 | %file A.click 12 | elementclass Foo { 13 | $a | 14 | DriverManager($a); 15 | } 16 | elementclass Far { 17 | $a, $b | 18 | Foo($b); 19 | } 20 | Far(wait_stop stop, stop); 21 | 22 | %expect AO_TOOL AO_USERLEVEL 23 | Far@1/Foo@1/DriverManager@1 :: DriverManager(stop); 24 | 25 | %file B.click 26 | elementclass Foo { 27 | $a | 28 | elementclass Bar { 29 | $b | 30 | DriverManager($a); 31 | } 32 | elementclass Baz { 33 | $a | 34 | Idle; Bar($a); 35 | } 36 | Baz(fuckola); 37 | } 38 | Foo(stop); 39 | 40 | %expect BO_TOOL BO_USERLEVEL 41 | Foo@1/Baz@1/Idle@1 :: Idle; 42 | Foo@1/Baz@1/Bar@2/DriverManager@1 :: DriverManager(stop); 43 | 44 | %ignorex 45 | #.* 46 | -------------------------------------------------------------------------------- /test/tools/lexer-03.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Check port reuse and missing port errors 3 | 4 | %script 5 | click -q X || true 6 | click -q Y || true 7 | click -q Z || true 8 | 9 | %file X 10 | i::InfiniteSource -> Print -> d::Discard; 11 | InfiniteSource -> Print -> d; 12 | 13 | %file Y 14 | i::InfiniteSource -> Print -> d::Discard; 15 | i -> Print -> d; 16 | 17 | %file Z 18 | i::InfiniteSource -> Print -> d::Discard; 19 | InfiniteSource -> p::Print; 20 | 21 | %expect stderr 22 | Y:1: illegal reuse of 'i :: InfiniteSource' push output 0 23 | Z:2: 'p :: Print' output 0 unused 24 | 25 | %ignore stderr 26 | Router could not be initialized! 27 | -------------------------------------------------------------------------------- /test/tools/lexer-07.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Check backslash quoting 3 | %script 4 | fix () { 5 | perl -e 'undef($/); $_ = ; s/\n / /g; print;' | sort 6 | } 7 | 8 | click -qo- A.click | fix > AO_USERLEVEL 9 | click-flatten A.click | fix > AO_TOOL 10 | 11 | %file A.click 12 | m :: Message("\\"); 13 | 14 | %expect AO_USERLEVEL AO_TOOL 15 | m :: Message("\\"); 16 | 17 | %ignorex 18 | #.* 19 | -------------------------------------------------------------------------------- /test/tools/lexer-08.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Check cpp processor directives 3 | %script 4 | 5 | click A.click 6 | 7 | %file A.click 8 | m :: Message( 9 | # 100 "foobar.click" 10 | "test"); 11 | m2 :: Message("test2"); 12 | DriverManager(stop); 13 | 14 | %expect -w stdout 15 | %expect -w stderr 16 | A.click:1: While configuring 'm :: Message': 17 | test 18 | foobar.click:101: While configuring 'm2 :: Message': 19 | test2 20 | -------------------------------------------------------------------------------- /test/tools/lexer-09.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Check unspecified top-level elements 3 | %script 4 | ulimit -t 1 5 | click A.click || true 6 | click-flatten A.click || true 7 | 8 | %file A.click 9 | ->Null; 10 | 11 | %expect -w stdout 12 | %expect -w stderr 13 | A.click:1: syntax error near '->' 14 | A.click:1: syntax error near '->' 15 | -------------------------------------------------------------------------------- /test/tools/testie-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Meta-test. 3 | 4 | %script 5 | testie -V TEST1 TEST2 TEST3 TEST4 || true 6 | 7 | %file -d TEST1 8 | %script 9 | false 10 | 11 | %file -d TEST2 12 | %script 13 | true 14 | 15 | %file -d TEST3 16 | %script 17 | echo Money >FOO 18 | %expect FOO 19 | Money 20 | 21 | %file -d TEST4 22 | %script 23 | echo Money >FOO 24 | echo Honey >>FOO 25 | %expect -a FOO 26 | Funny 27 | %expect -a FOO 28 | Money 29 | %ignorex FOO 30 | Woman 31 | %ignorex FOO 32 | Honey 33 | 34 | %ignorex stderr 35 | .*Running.* 36 | 37 | %expect stderr 38 | TEST1:2: failure at 'false' 39 | TEST2: Success! 40 | TEST3: Success! 41 | TEST4: Success! 42 | testie: 3 successes, 1 failure, 0 skipped 43 | -------------------------------------------------------------------------------- /test/tools/testie-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test testie files that include directories 3 | 4 | %script 5 | cat X/Y > Y/X 6 | testie TEST1 7 | 8 | %file X/Y 9 | Hello 10 | 11 | %expect Y/X 12 | Hello 13 | 14 | %file -d TEST1 15 | %script 16 | true 17 | %file ../ 18 | %file /A 19 | %file A/ 20 | %file A//B 21 | 22 | %expect stderr 23 | TEST1:3: bad filename '%file ../' 24 | TEST1:4: bad filename '%file /A' 25 | TEST1:5: bad filename '%file A/' 26 | TEST1:6: bad filename '%file A//B' 27 | testie: 1 success, 0 failures, 0 skipped 28 | -------------------------------------------------------------------------------- /test/tools/testie-03.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test LC_ALL setting 3 | 4 | %script 5 | export LC_ALL=POSIX 6 | echo $LC_ALL 7 | testie TEST1 8 | testie LC_ALL=POSIX TEST2 9 | 10 | %file -d TEST1 11 | %script 12 | echo $LC_ALL 13 | %expect stdout 14 | C 15 | 16 | %file -d TEST2 17 | %script 18 | echo $LC_ALL 19 | %expect stdout 20 | POSIX 21 | 22 | %expect stdout 23 | POSIX 24 | 25 | %expect stderr 26 | testie: 1 success, 0 failures, 0 skipped 27 | testie: 1 success, 0 failures, 0 skipped 28 | -------------------------------------------------------------------------------- /test/tools/undead-01.testie: -------------------------------------------------------------------------------- 1 | %script 2 | 3 | click-undead CONFIG 4 | click-undead CONFIG2 5 | 6 | %file CONFIG 7 | Idle -> Counter -> td1 :: ToDump(a); 8 | is :: InfiniteSource -> ss :: StaticSwitch(1); 9 | ss[0] -> ToDump(c); 10 | ss[1] -> q :: Queue -> rr :: RoundRobinSched; 11 | Idle -> [1]rr; 12 | rr -> td2 :: ToDump(b); 13 | 14 | %file CONFIG2 15 | fa::FromDevice(a) -> arpq::ARPQuerier -> td::ToDump; 16 | fb::FromDevice(b) -> [1]arpq; 17 | 18 | %expect stderr 19 | 20 | %expect stdout 21 | is :: InfiniteSource; 22 | q :: Queue; 23 | td2 :: ToDump(b); 24 | is -> q 25 | -> td2; 26 | 27 | fa :: FromDevice(a); 28 | arpq :: ARPQuerier; 29 | td :: ToDump; 30 | fb :: FromDevice(b); 31 | fa -> arpq 32 | -> td; 33 | fb -> [1] arpq; 34 | 35 | %ignorex 36 | #.* 37 | -------------------------------------------------------------------------------- /test/userlevel/ControlSocket-llrpc-01.testie: -------------------------------------------------------------------------------- 1 | %require 2 | which nc >/dev/null 2>&1 3 | 4 | %script 5 | usleep () { click -e "DriverManager(wait ${1}us)"; } 6 | click -e "cs :: ControlSocket(tcp, 41900+); 7 | Idle -> s :: Switch(0) -> Idle; s[1] -> Idle; 8 | Script(print >PORT cs.port)" & 9 | while [ ! -f PORT ]; do usleep 1; done 10 | { cat CSIN; usleep 1000; } | nc localhost `cat PORT` >CSOUT 11 | 12 | %file CSIN 13 | read s.switch 14 | llrpc s#4004C005 15 | write s.switch 1 16 | read s.switch 17 | llrpc s#80044006 4 18 | 19 | read s.switch 20 | write stop true 21 | 22 | %expect CSOUT 23 | Click::ControlSocket/1.{{\d+}} 24 | 200 Read handler{{.*}} 25 | DATA 1 26 | 0200 LLRPC{{.*}} 27 | DATA 4 28 | 200 Write handler{{.*}} 29 | 200 Read handler{{.*}} 30 | DATA 1 31 | 1200 LLRPC{{.*}} 32 | DATA 0 33 | 200 Read handler{{.*}} 34 | DATA 1 35 | 0200 Write handler{{.*}} 36 | -------------------------------------------------------------------------------- /test/userlevel/ControlSocket-llrpc-02.testie: -------------------------------------------------------------------------------- 1 | %require 2 | [ `whoami` = root ] 3 | 4 | %script 5 | usleep () { click -e "DriverManager(wait ${1}us)"; } 6 | click-install -e "Idle -> s :: Switch(0) -> Idle; s[1] -> Idle" 7 | (sleep 1 && ( cat CSIN; usleep 1000; ) | nc localhost 41900 >CSOUT) & 8 | click -e "khp::KernelHandlerProxy; ControlSocket(TCP, 41900, PROXY khp); DriverManager(wait_time 2s)" 9 | click-uninstall 10 | 11 | %file CSIN 12 | read s.switch 13 | llrpc s#4004C005 14 | write s.switch 1 15 | read s.switch 16 | llrpc s#80044006 4 17 | 18 | read s.switch 19 | quit 20 | 21 | %expect CSOUT 22 | Click::ControlSocket/1.{{\d+}} 23 | 200 Read handler{{.*}} 24 | DATA 2 25 | 0 26 | 200 LLRPC{{.*}} 27 | DATA 4 28 | 200 Write handler{{.*}} 29 | 200 Read handler{{.*}} 30 | DATA 2 31 | 1 32 | 200 LLRPC{{.*}} 33 | DATA 0 34 | 200 Read handler{{.*}} 35 | DATA 2 36 | 0 37 | 200 Goodbye! 38 | -------------------------------------------------------------------------------- /test/userlevel/McastSocket-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test MulticastSocket (with loop filtering). 3 | 4 | %script 5 | { 6 | # Run two click instances in parallel. 7 | { click CONFIG WHO=A >&2; } | { click CONFIG WHO=B; }; 8 | } 2>&1 | sort -u 9 | # Sort to ensure reproducible output. 10 | 11 | %file CONFIG 12 | RatedSource("$WHO says hi.", LIMIT 5, STOP true) 13 | -> McastSocket(233.252.0.0, 1234, 127.0.0.1) 14 | -> Print("$WHO got", CONTENTS ASCII) 15 | -> Discard(); 16 | 17 | %expect stdout 18 | A got: 10 | B says h i. 19 | B got: 10 | A says h i. 20 | -------------------------------------------------------------------------------- /test/userlevel/McastSocket-03.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test MulticastSocket without loop. 3 | 4 | %script 5 | # Assumes that a multicast route exists to any network device but 'lo'. 6 | # Most hosts have a default route to this effect. 7 | { 8 | # Run two click instances in parallel. 9 | { click CONFIG WHO=A >&2; } | { click CONFIG WHO=B; }; 10 | } 2>&1 | sort -u 11 | # Sort to ensure reproducible output. 12 | 13 | %file CONFIG 14 | // LOOP is disabled, and since we're not sending over loopback, we 15 | // won't see any messages on localhost. 16 | RatedSource("$WHO says hi.", LIMIT 5, STOP true) 17 | -> McastSocket(233.252.0.0, 1234, LOOP false) 18 | -> Print("$WHO got", CONTENTS ASCII) 19 | -> Discard(); 20 | 21 | %expect stdout 22 | -------------------------------------------------------------------------------- /test/userlevel/Script-signal-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that all Script-installed signal handlers execute when a signal is 3 | received. 4 | 5 | %script 6 | /bin/sh THING 7 | 8 | %file THING 9 | click -e " 10 | Script(TYPE SIGNAL INT, print >>OUT 'Hello', stop); 11 | Script(TYPE SIGNAL INT, print >>OUT 'Goodbye'); 12 | Script(print >RUNNING \$\$, wait 100ms, stop); 13 | " & 14 | 15 | while ! [ -f RUNNING ]; do click -e "Script(wait 1ms, stop)"; done 16 | kill -INT `cat RUNNING` 17 | 18 | %expect OUT 19 | Hello 20 | Goodbye 21 | -------------------------------------------------------------------------------- /test/userlevel/Script-signal-03.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that signal redelivery works correctly in multithread userlevel Click. 3 | 4 | %require 5 | click-buildtool provides umultithread 6 | 7 | %script 8 | click --threads 2 CONFIG || echo "Died 1" 9 | 10 | %file CONFIG 11 | i :: InfiniteSource(LIMIT 10) 12 | -> s :: Script(TYPE PACKET, set y $(kill USR1 $$), end) 13 | -> d :: Discard; 14 | j :: InfiniteSource(LIMIT 30) 15 | -> s; 16 | Script(TYPE SIGNAL USR1, 17 | init x 0, 18 | set x $(add $x 1), 19 | goto l1 $(gt $x 1), 20 | print "got USR1", 21 | label l1, 22 | write bt.block 0.01s, 23 | end) 24 | Script(wait 0.02s, stop) 25 | StaticThreadSched(i 0, j 1) 26 | bt :: BlockThread 27 | 28 | %expect stdout 29 | got USR1 30 | 31 | %ignore stdout 32 | T{{.*}} 33 | -------------------------------------------------------------------------------- /test/userlevel/clp-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests CLP command line parser with the CLPTest element. 3 | 4 | %require 5 | click-buildtool provides CLPTest 6 | 7 | %script 8 | click -qe CLPTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/userlevel/dpdk.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that Click launches with DPDK and works using a virtual ring-based dev 3 | 4 | %require 5 | click-buildtool provides dpdk 6 | test ! $TRAVIS 7 | 8 | %script 9 | click --dpdk --no-huge -m 128MB -c 0x3 -n 1 --vdev=eth_ring0 -- CONFIG 10 | 11 | %file CONFIG 12 | DPDKInfo(2048) 13 | 14 | i :: InfiniteSource("A", LIMIT 2, ACTIVE false, STOP false) -> ToDPDKDevice(0) 15 | FromDPDKDevice(0) -> Print() -> Discard 16 | 17 | Script(wait 10ms, print "Starting pktgen" ,write i.active true, wait 100ms, stop) 18 | 19 | %expect stdout 20 | Starting pktgen 21 | 22 | %expect stderr 23 | Initializing DPDK 24 | 1 | 41 25 | 1 | 41 26 | 27 | 28 | %ignorex stdout 29 | EAL.* 30 | PMD.* 31 | 32 | %ignorex stderr 33 | EAL.* 34 | PMD.* 35 | -------------------------------------------------------------------------------- /test/userlevel/packetpool-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that the packet pool remains in bounds. 3 | 4 | %script 5 | click --simtime -e ' 6 | src :: InfiniteSource(LIMIT 1000, END_CALL s0.run) 7 | -> q :: Queue(3000) 8 | -> d :: Discard(ACTIVE false); 9 | s0 :: Script(TYPE PASSIVE, write src.length 2, write d.active true); 10 | DriverManager(wait 1s, stop); 11 | ' -h q.highwater_length 12 | 13 | %expect stdout 14 | 1000 15 | -------------------------------------------------------------------------------- /test/userlevel/packetpool-02.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that the packet pool remains in bounds. 3 | 4 | %script 5 | click --simtime -e ' 6 | src :: InfiniteSource(LIMIT 1000, END_CALL s0.run) 7 | -> q :: Queue(3000) 8 | -> d :: Discard(ACTIVE false); 9 | s0 :: Script(TYPE PASSIVE, write src.length 2); 10 | DriverManager(wait 1s, stop); 11 | ' -h q.highwater_length 12 | 13 | %expect stdout 14 | 1000 15 | -------------------------------------------------------------------------------- /test/userlevel/string-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Tests String class with the StringTest element. 3 | 4 | %require 5 | click-buildtool provides StringTest 6 | 7 | %script 8 | click -qe StringTest 9 | 10 | %expect stderr 11 | config:1:{{.*}} 12 | All tests pass! 13 | -------------------------------------------------------------------------------- /test/userlevel/timer-systime-01.testie: -------------------------------------------------------------------------------- 1 | %info 2 | Test that timers still go off after a system time adjustment. 3 | 4 | %require 5 | [ `whoami` = root ] 6 | expr `date +%s.%N` : '[0-9.]*' 7 | false 8 | 9 | %script 10 | echo begin >OUT 11 | adjusted_now=`click -e 'Script(print $(sub $(now) 1), stop)'` 12 | click -e 'Script(wait 0.2s, print >>OUT "timer", wait 2s)' & 13 | click="$!" 14 | date -s @$adjusted_now >/dev/null 2>&1 15 | echo presleep >>OUT 16 | sleep 1 17 | echo postsleep >>OUT 18 | kill $click 19 | adjusted_now=`click -e 'Script(print $(add $(now) 1), stop)'` 20 | date -s @$adjusted_now 21 | 22 | %expect OUT 23 | begin 24 | presleep 25 | timer 26 | postsleep 27 | -------------------------------------------------------------------------------- /tools/.gitignore: -------------------------------------------------------------------------------- 1 | Makefile 2 | *.d 3 | -------------------------------------------------------------------------------- /tools/click-align/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-align 5 | -------------------------------------------------------------------------------- /tools/click-check/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-check 5 | -------------------------------------------------------------------------------- /tools/click-combine/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-combine 5 | click-uncombine 6 | -------------------------------------------------------------------------------- /tools/click-devirtualize/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-devirtualize 5 | -------------------------------------------------------------------------------- /tools/click-fastclassifier/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-fastclassifier 5 | -------------------------------------------------------------------------------- /tools/click-flatten/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-flatten 5 | -------------------------------------------------------------------------------- /tools/click-install/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-install 5 | click-uninstall 6 | -------------------------------------------------------------------------------- /tools/click-mkmindriver/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-mkmindriver 5 | click-shrink 6 | -------------------------------------------------------------------------------- /tools/click-pretty/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-pretty 5 | -------------------------------------------------------------------------------- /tools/click-undead/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-undead 5 | -------------------------------------------------------------------------------- /tools/click-viz: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | # click-viz : a program to graphically visualize click scripts. 4 | # 5 | # The output of this program is meant to be piped to dot to 6 | # generate a graph. Examples: 7 | # click-viz demo.click | dot -Tpng >demo.png 8 | # click-flatten demo.click | click-viz | dot -Tpng >demo.png 9 | # 10 | # Note: dot may be obtained from http://www.graphviz.org 11 | # 12 | # Original author: Jose Vasconcellos 13 | # Rewritten in click-pretty by Eddie Kohler 14 | 15 | click-pretty --dot "$@" 16 | -------------------------------------------------------------------------------- /tools/click-xform/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click-xform 5 | -------------------------------------------------------------------------------- /tools/click2xml/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click2xml 5 | xml2click 6 | -------------------------------------------------------------------------------- /tools/lib/.gitignore: -------------------------------------------------------------------------------- 1 | *.bd 2 | *.bo 3 | *.d 4 | *.hd 5 | *.o 6 | Makefile 7 | libclicktool.a 8 | libclicktool_build.a 9 | -------------------------------------------------------------------------------- /tools/lib/runparse.hh: -------------------------------------------------------------------------------- 1 | // -*- c-basic-offset: 4 -*- 2 | #ifndef CLICK_RUNPARSE_HH 3 | #define CLICK_RUNPARSE_HH 4 | #include "routert.hh" 5 | #include 6 | 7 | class RouterUnparserT { public: 8 | 9 | RouterUnparserT(ErrorHandler *); 10 | 11 | struct Pair { 12 | ElementClassT *first; 13 | ElementClassT *second; 14 | Pair(ElementClassT *a, ElementClassT *b) : first(a), second(b) { } 15 | }; 16 | 17 | private: 18 | 19 | HashTable _tuid_map; 20 | Vector _types; 21 | 22 | enum { X_BAD = 0, X_UNK = 1, X_LT = 2, X_LEQ = 3, X_EQ = 4, X_GEQ = 5, X_GT = 6, X_NUM = 7 }; 23 | static int relation_negater[X_NUM]; 24 | static uint8_t relation_combiner[X_NUM][X_NUM]; 25 | HashTable, int> _relation; 26 | 27 | ErrorHandler *_errh; 28 | 29 | }; 30 | 31 | #endif 32 | -------------------------------------------------------------------------------- /tools/lib/toolutils.hh: -------------------------------------------------------------------------------- 1 | #ifndef CLICK_TOOLUTILS_HH 2 | #define CLICK_TOOLUTILS_HH 3 | #include 4 | class RouterT; 5 | class VariableEnvironment; 6 | 7 | extern VariableEnvironment global_scope; 8 | extern bool ignore_line_directives; 9 | 10 | int click_maybe_define(const char *arg, ErrorHandler *errh); 11 | RouterT *read_router_string(const String &text, const String &landmark, ErrorHandler *); 12 | RouterT *read_router_string(String text, const String &landmark, bool, RouterT *, ErrorHandler *); 13 | RouterT *read_router_file(const char *filename, ErrorHandler *); 14 | RouterT *read_router_file(const char *filename, bool empty_ok, ErrorHandler *); 15 | RouterT *read_router(const String &, bool is_expr, ErrorHandler *); 16 | void write_router_file(RouterT *, FILE *, ErrorHandler * = 0); 17 | int write_router_file(RouterT *, const char *, ErrorHandler * = 0); 18 | 19 | String xml_quote(const String &); 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /tools/make-linux-patch: -------------------------------------------------------------------------------- 1 | #! /usr/local/bin/perl -w 2 | 3 | # make-linux-patch 4 | 5 | # Make a patch file for a Linux kernel that adds our hooks. 6 | # The resulting output can be used thus: 7 | # cd /usr/src/linux 8 | # patch -p0 -b < patch-file 9 | 10 | # Directory of patched kernel source: 11 | my $nd = "/home/ny2/rtm/linux-2.2.10"; 12 | 13 | # List of files that we modified and that should be patched. 14 | # Each must be accompanied by a file.orig. 15 | my @files = ( 16 | "include/linux/netdevice.h", 17 | "net/core/dev.c", 18 | "net/sched/sch_generic.c", 19 | "net/netsyms.c", 20 | "include/linux/signal.h" 21 | ); 22 | 23 | chdir($nd); 24 | 25 | $| = 1; 26 | my $f; 27 | foreach $f (@files) { 28 | print "\nIndex: $f\n"; 29 | system("diff -u ${f}.orig $f"); 30 | } 31 | -------------------------------------------------------------------------------- /userlevel/.gitignore: -------------------------------------------------------------------------------- 1 | *.d 2 | *.o 3 | Makefile 4 | click 5 | elements.cc 6 | elements.conf 7 | elements.csmk 8 | elements.mk 9 | libclick.a 10 | -------------------------------------------------------------------------------- /vendor/nicscheduler/methods/metron.hh: -------------------------------------------------------------------------------- 1 | #ifndef LIBNICSCHEDULER_METHODMETRON_HH 2 | #define LIBNICSCHEDULER_METHODMETRON_HH 1 3 | /** 4 | * Metron's reimplemented balancing method 5 | */ 6 | class MethodMetron : public BalanceMethodDevice, public LoadTracker { public: 7 | 8 | MethodMetron(NICScheduler* b, EthernetDevice* fd) : BalanceMethodDevice(b,fd) { 9 | 10 | } 11 | 12 | virtual std::string name() override CLICK_COLD { return "metron"; } 13 | 14 | int initialize(ErrorHandler *errh, int startwith) override CLICK_COLD; 15 | 16 | void rebalance(std::vector> load) override; 17 | 18 | String _rules_file; 19 | int _min_movement; 20 | int _deflation_factor; 21 | }; 22 | #endif 23 | -------------------------------------------------------------------------------- /vendor/nicscheduler/methods/rssrr.cc: -------------------------------------------------------------------------------- 1 | 2 | /** 3 | * RSS - RoundRobin 4 | */ 5 | 6 | MethodRSSRR::MethodRSSRR(NICScheduler* b, EthernetDevice* fd) : MethodRSS(b,fd) { 7 | }; 8 | 9 | MethodRSSRR::~MethodRSSRR() { 10 | }; 11 | 12 | void MethodRSSRR::rebalance(std::vector> load) { 13 | for (int r = 0; r < _table.size(); r++) { 14 | _table[r] = (_table[r] + 1) % load.size(); 15 | } 16 | update_reta(); 17 | }; 18 | 19 | -------------------------------------------------------------------------------- /vendor/nicscheduler/methods/rssrr.hh: -------------------------------------------------------------------------------- 1 | 2 | class MethodRSSRR : public MethodRSS { public: 3 | 4 | MethodRSSRR(NICScheduler* b, EthernetDevice* fd); 5 | 6 | ~MethodRSSRR(); 7 | 8 | virtual std::string name() override CLICK_COLD { return "rssrr"; } 9 | 10 | void rebalance(std::vector> load) override; 11 | }; 12 | --------------------------------------------------------------------------------