aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsreejith <sreejith.surendrannair@linaro.org>2017-03-29 01:15:02 -0400
committersreejith <sreejith.surendrannair@linaro.org>2017-03-29 02:23:59 -0400
commita23197980e40d4d9414bcfaf59005a1dc2a89251 (patch)
treeda3fc5410a9cda99e05d2e0f6dae06072a0c50b8
parent746b57564deede624261ab8a96c94f562f24d22c (diff)
Added vpp intial source code from master branch 17.01.1
Change-Id: I81bdace6f330825a1746a853766779dfb24765fd Signed-off-by: sreejith <sreejith.surendrannair@linaro.org>
-rw-r--r--vpp/.gitignore90
-rw-r--r--vpp/.gitreview5
-rw-r--r--vpp/LICENSE202
-rw-r--r--vpp/Makefile375
-rw-r--r--vpp/README.md102
-rw-r--r--vpp/RELEASE.md280
-rw-r--r--vpp/build-data/packages/cavium-dpdk.mk55
-rw-r--r--vpp/build-data/packages/dpdk.mk44
-rw-r--r--vpp/build-data/packages/g2.mk5
-rw-r--r--vpp/build-data/packages/gmod.mk9
-rw-r--r--vpp/build-data/packages/perftool.mk5
-rw-r--r--vpp/build-data/packages/plugins.mk45
-rw-r--r--vpp/build-data/packages/svm.mk5
-rw-r--r--vpp/build-data/packages/vlib-api-cavium-dpdk.mk6
-rw-r--r--vpp/build-data/packages/vlib-api.mk4
-rw-r--r--vpp/build-data/packages/vlib-cavium-dpdk.mk7
-rw-r--r--vpp/build-data/packages/vlib.mk16
-rw-r--r--vpp/build-data/packages/vnet-cavium-dpdk.mk29
-rw-r--r--vpp/build-data/packages/vnet.mk44
-rw-r--r--vpp/build-data/packages/vpp-api-test-cavium-dpdk.mk32
-rw-r--r--vpp/build-data/packages/vpp-api-test.mk39
-rw-r--r--vpp/build-data/packages/vpp-api.mk23
-rw-r--r--vpp/build-data/packages/vpp-cavium-dpdk.mk30
-rw-r--r--vpp/build-data/packages/vpp-platform-scripts.mk1
-rw-r--r--vpp/build-data/packages/vpp.mk51
-rw-r--r--vpp/build-data/packages/vppinfra.mk5
-rw-r--r--vpp/build-data/platforms.mk105
-rw-r--r--vpp/build-data/platforms/arm32.mk45
-rw-r--r--vpp/build-data/platforms/dpaa2.mk66
-rw-r--r--vpp/build-data/platforms/qppc.mk34
-rw-r--r--vpp/build-data/platforms/thunder.mk36
-rw-r--r--vpp/build-data/platforms/vpp.mk68
-rw-r--r--vpp/build-data/platforms/vpp_lite.mk51
-rw-r--r--vpp/build-data/suffix-rules.mk27
-rw-r--r--vpp/build-root/Makefile1171
-rwxr-xr-xvpp/build-root/autowank307
-rwxr-xr-xvpp/build-root/bootstrap.sh52
-rw-r--r--vpp/build-root/build-config.mk.README3
-rw-r--r--vpp/build-root/config.site105
-rwxr-xr-xvpp/build-root/copyimg83
-rw-r--r--vpp/build-root/deb/debian/.gitignore14
-rwxr-xr-xvpp/build-root/deb/debian/README.vpp56
-rwxr-xr-xvpp/build-root/deb/debian/compat1
-rw-r--r--vpp/build-root/deb/debian/control68
-rw-r--r--vpp/build-root/deb/debian/copyright9
-rwxr-xr-xvpp/build-root/deb/debian/rules31
-rwxr-xr-xvpp/build-root/deb/debian/source/format1
-rw-r--r--vpp/build-root/deb/debian/vpp-bin.README.Debian53
-rw-r--r--vpp/build-root/deb/debian/vpp-python-api.postinst5
-rw-r--r--vpp/build-root/deb/debian/vpp-python-api.prerm8
-rw-r--r--vpp/build-root/deb/debian/vpp.postinst8
-rw-r--r--vpp/build-root/deb/debian/vpp.postrm21
-rw-r--r--vpp/build-root/deb/debian/vpp.preinst4
-rw-r--r--vpp/build-root/deb/debian/vpp.service14
-rw-r--r--vpp/build-root/deb/debian/vpp.upstart21
-rw-r--r--vpp/build-root/emacs-lisp/README86
-rw-r--r--vpp/build-root/emacs-lisp/all-skel.el41
-rw-r--r--vpp/build-root/emacs-lisp/cli-cmd-skel.el32
-rw-r--r--vpp/build-root/emacs-lisp/config-skel.el28
-rw-r--r--vpp/build-root/emacs-lisp/dual-loop-skel.el302
-rw-r--r--vpp/build-root/emacs-lisp/elog-4-int-skel.el31
-rw-r--r--vpp/build-root/emacs-lisp/elog-4-int-track-skel.el34
-rw-r--r--vpp/build-root/emacs-lisp/elog-enum-skel.el35
-rw-r--r--vpp/build-root/emacs-lisp/elog-one-datum-skel.el28
-rwxr-xr-xvpp/build-root/emacs-lisp/fix-coding-style.el162
-rwxr-xr-xvpp/build-root/emacs-lisp/make-plugin.sh4
-rw-r--r--vpp/build-root/emacs-lisp/periodic-skel.el86
-rw-r--r--vpp/build-root/emacs-lisp/pipe-skel.el132
-rw-r--r--vpp/build-root/emacs-lisp/plugin-all-apih-skel.el43
-rw-r--r--vpp/build-root/emacs-lisp/plugin-api-skel.el48
-rw-r--r--vpp/build-root/emacs-lisp/plugin-configure-skel.el33
-rw-r--r--vpp/build-root/emacs-lisp/plugin-h-skel.el66
-rw-r--r--vpp/build-root/emacs-lisp/plugin-main-skel.el275
-rw-r--r--vpp/build-root/emacs-lisp/plugin-makefile-skel.el75
-rw-r--r--vpp/build-root/emacs-lisp/plugin-msg-enum-skel.el55
-rw-r--r--vpp/build-root/emacs-lisp/plugin-node-skel.el320
-rw-r--r--vpp/build-root/emacs-lisp/plugin-test-skel.el235
-rw-r--r--vpp/build-root/emacs-lisp/plugin.el35
-rw-r--r--vpp/build-root/emacs-lisp/tunnel-c-skel.el441
-rw-r--r--vpp/build-root/emacs-lisp/tunnel-decap-skel.el299
-rw-r--r--vpp/build-root/emacs-lisp/tunnel-encap-skel.el245
-rw-r--r--vpp/build-root/emacs-lisp/tunnel-h-skel.el128
-rw-r--r--vpp/build-root/packages/vppapigen.mk5
-rw-r--r--vpp/build-root/packages/vppinfra.mk4
-rw-r--r--vpp/build-root/platforms.mk50
-rw-r--r--vpp/build-root/rpm/vpp.service14
-rw-r--r--vpp/build-root/rpm/vpp.spec264
-rwxr-xr-xvpp/build-root/scripts/checkstyle.sh92
-rwxr-xr-xvpp/build-root/scripts/csit-test-branch2
-rwxr-xr-xvpp/build-root/scripts/find-api-core-contents9
-rwxr-xr-xvpp/build-root/scripts/find-api-lib-contents6
-rwxr-xr-xvpp/build-root/scripts/find-dev-contents31
-rwxr-xr-xvpp/build-root/scripts/find-dpdk-contents29
-rwxr-xr-xvpp/build-root/scripts/find-plugins-contents15
-rwxr-xr-xvpp/build-root/scripts/find-python-api-contents8
-rwxr-xr-xvpp/build-root/scripts/generate-deb-changelog37
-rwxr-xr-xvpp/build-root/scripts/lsnet20
-rwxr-xr-xvpp/build-root/scripts/make-plugin-toolkit40
-rwxr-xr-xvpp/build-root/scripts/pci-nic-bind94
-rwxr-xr-xvpp/build-root/scripts/pci-nic-bind-to-kernel19
-rwxr-xr-xvpp/build-root/scripts/remove-rpath24
-rwxr-xr-xvpp/build-root/scripts/verdist31
-rwxr-xr-xvpp/build-root/scripts/version54
-rw-r--r--vpp/build-root/vagrant/.gitignore1
-rw-r--r--vpp/build-root/vagrant/README28
-rw-r--r--vpp/build-root/vagrant/Vagrantfile113
-rw-r--r--vpp/build-root/vagrant/WELCOME61
-rwxr-xr-xvpp/build-root/vagrant/build.sh74
-rwxr-xr-xvpp/build-root/vagrant/clearinterfaces.sh17
-rw-r--r--vpp/build-root/vagrant/env.sh6
-rw-r--r--vpp/build-root/vagrant/install.sh30
-rwxr-xr-xvpp/build-root/vagrant/run.sh23
-rwxr-xr-xvpp/build-root/vagrant/update.sh48
-rw-r--r--vpp/doxygen/Makefile256
-rw-r--r--vpp/doxygen/assets/doxy-vpp.css47
-rw-r--r--vpp/doxygen/assets/logo_fdio.pngbin0 -> 3092 bytes
-rw-r--r--vpp/doxygen/dir.dox.sample30
-rw-r--r--vpp/doxygen/doxygen.cfg2456
-rwxr-xr-xvpp/doxygen/filter_api.py45
-rwxr-xr-xvpp/doxygen/filter_c.py87
-rwxr-xr-xvpp/doxygen/filter_h.py53
-rw-r--r--vpp/doxygen/layout.xml194
-rwxr-xr-xvpp/doxygen/siphon-generate74
-rwxr-xr-xvpp/doxygen/siphon-process71
-rw-r--r--vpp/doxygen/siphon/__init__.py24
-rw-r--r--vpp/doxygen/siphon/generate.py304
-rw-r--r--vpp/doxygen/siphon/generate_clicmd.py22
-rw-r--r--vpp/doxygen/siphon/generate_syscfg.py22
-rw-r--r--vpp/doxygen/siphon/parsers.py149
-rw-r--r--vpp/doxygen/siphon/process.py311
-rw-r--r--vpp/doxygen/siphon/process_clicmd.py56
-rw-r--r--vpp/doxygen/siphon/process_syscfg.py30
-rw-r--r--vpp/doxygen/siphon_templates/itemlist/clicmd/item_format.itemlist17
-rw-r--r--vpp/doxygen/siphon_templates/itemlist/default/index_entry.itemlist15
-rw-r--r--vpp/doxygen/siphon_templates/itemlist/default/index_header.itemlist15
-rw-r--r--vpp/doxygen/siphon_templates/itemlist/default/index_section.itemlist15
-rw-r--r--vpp/doxygen/siphon_templates/itemlist/default/item_format.itemlist16
-rw-r--r--vpp/doxygen/siphon_templates/itemlist/default/item_header.itemlist15
-rw-r--r--vpp/doxygen/siphon_templates/itemlist/syscfg/item_format.itemlist17
-rw-r--r--vpp/doxygen/siphon_templates/markdown/clicmd/index_entry.md17
-rw-r--r--vpp/doxygen/siphon_templates/markdown/clicmd/index_header.md130
-rw-r--r--vpp/doxygen/siphon_templates/markdown/clicmd/item_format.md59
-rw-r--r--vpp/doxygen/siphon_templates/markdown/default/index_entry.md16
-rw-r--r--vpp/doxygen/siphon_templates/markdown/default/index_section.md18
-rw-r--r--vpp/doxygen/siphon_templates/markdown/default/item_format.md16
-rw-r--r--vpp/doxygen/siphon_templates/markdown/default/item_header.md18
-rw-r--r--vpp/doxygen/siphon_templates/markdown/syscfg/index_header.md111
-rw-r--r--vpp/doxygen/siphon_templates/markdown/syscfg/item_format.md42
-rw-r--r--vpp/doxygen/user_doc.md14
-rw-r--r--vpp/dpdk/Makefile197
-rw-r--r--vpp/dpdk/README34
-rw-r--r--vpp/dpdk/dkms/Makefile10
-rwxr-xr-xvpp/dpdk/dkms/create_deb_manifest.sh28
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0001-i40e-Add-packet_type-metadata-in-the-i40e-vPMD.patch1210
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0002-i40e-Enable-bad-checksum-flags-in-i40e-vPMD.patch111
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0003-enic-Set-PKT_RX_VLAN_PKT-iff-returned-packet-has-VLA.patch42
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0004-Revert-ixgbe-fix-packet-type-from-vector-Rx.patch133
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0005-NXP-DPAA2-Poll-Mode-Driver-Support-dpdk-16.07.patch40106
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0005-drivers-reset-packet_type-before-using-buffer.patch70
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0006-Allow-applications-to-override-rte_delay_us.patch43
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0007-UIO-Fix-a-crash-in-igb_uio-driver-when-the-device-is.patch38
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0008-Temporarily-disable-unthrottled-log-message.patch26
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0009-enic-bad-L4-checksum-ptype-set-on-ICMP-packets.patch18
-rw-r--r--vpp/dpdk/dpdk-16.07_patches/0010-virtio-enable-indirect-descriptors-feature.patch34
-rw-r--r--vpp/dpdk/dpdk-16.11_patches/0001-virtio-tx-with-can_push-when-VERSION_1-is-set.patch38
-rw-r--r--vpp/g2/Makefile.am34
-rw-r--r--vpp/g2/clib.c154
-rw-r--r--vpp/g2/configure.ac12
-rw-r--r--vpp/g2/cpel.c470
-rw-r--r--vpp/g2/cpel.h83
-rw-r--r--vpp/g2/events.c475
-rw-r--r--vpp/g2/g2.h195
-rw-r--r--vpp/g2/g2version.c19
-rw-r--r--vpp/g2/main.c196
-rw-r--r--vpp/g2/menu1.c565
-rw-r--r--vpp/g2/mkversion.c77
-rw-r--r--vpp/g2/pointsel.c854
-rw-r--r--vpp/g2/props.c279
-rw-r--r--vpp/g2/props.h21
-rw-r--r--vpp/g2/view1.c3077
-rw-r--r--vpp/gmod/Makefile.am27
-rw-r--r--vpp/gmod/configure.ac8
-rw-r--r--vpp/gmod/gmod/mod_vpp.c156
-rw-r--r--vpp/gmod/gmod/vpp.conf31
-rw-r--r--vpp/perftool/Makefile.am44
-rw-r--r--vpp/perftool/c2cpel.c248
-rw-r--r--vpp/perftool/configure.ac12
-rw-r--r--vpp/perftool/cpel.h83
-rw-r--r--vpp/perftool/cpel_util.c456
-rw-r--r--vpp/perftool/cpel_util.h68
-rw-r--r--vpp/perftool/cpelatency.c927
-rw-r--r--vpp/perftool/cpeldump.c638
-rw-r--r--vpp/perftool/cpelinreg.c892
-rw-r--r--vpp/perftool/cpelstate.c822
-rw-r--r--vpp/perftool/delsvec.c315
-rw-r--r--vpp/perftool/linreg.c78
-rw-r--r--vpp/perftool/new.cpelbin0 -> 1672 bytes
-rw-r--r--vpp/perftool/new.elogbin0 -> 4525 bytes
-rw-r--r--vpp/perftool/props.c280
-rw-r--r--vpp/plugins/Makefile.am61
-rw-r--r--vpp/plugins/acl-plugin/Makefile.am114
-rw-r--r--vpp/plugins/acl-plugin/acl/acl.api444
-rw-r--r--vpp/plugins/acl-plugin/acl/acl.c1952
-rw-r--r--vpp/plugins/acl-plugin/acl/acl.h147
-rw-r--r--vpp/plugins/acl-plugin/acl/acl_all_api_h.h321
-rw-r--r--vpp/plugins/acl-plugin/acl/acl_msg_enum.h28
-rw-r--r--vpp/plugins/acl-plugin/acl/acl_test.c1024
-rw-r--r--vpp/plugins/acl-plugin/acl/jvpp/io/fd/vpp/jvpp/acl/test/AclExpectedDumpData.java135
-rw-r--r--vpp/plugins/acl-plugin/acl/jvpp/io/fd/vpp/jvpp/acl/test/AclTestData.java101
-rw-r--r--vpp/plugins/acl-plugin/acl/jvpp/io/fd/vpp/jvpp/acl/test/AclTestRequests.java141
-rw-r--r--vpp/plugins/acl-plugin/acl/jvpp/io/fd/vpp/jvpp/acl/test/FutureApiTest.java68
-rw-r--r--vpp/plugins/acl-plugin/acl/jvpp/io/fd/vpp/jvpp/acl/test/Readme.txt1
-rw-r--r--vpp/plugins/acl-plugin/acl/jvpp_acl.c124
-rw-r--r--vpp/plugins/acl-plugin/acl/jvpp_acl.h45
-rw-r--r--vpp/plugins/acl-plugin/acl/l2sess.c251
-rw-r--r--vpp/plugins/acl-plugin/acl/l2sess.h149
-rw-r--r--vpp/plugins/acl-plugin/acl/l2sess_node.c763
-rw-r--r--vpp/plugins/acl-plugin/acl/node_in.c168
-rw-r--r--vpp/plugins/acl-plugin/acl/node_in.h12
-rw-r--r--vpp/plugins/acl-plugin/acl/node_out.c169
-rw-r--r--vpp/plugins/acl-plugin/acl/node_out.h12
-rw-r--r--vpp/plugins/acl-plugin/configure.ac24
-rwxr-xr-xvpp/plugins/acl-plugin/test/run-python28
-rwxr-xr-xvpp/plugins/acl-plugin/test/run-scapy26
-rw-r--r--vpp/plugins/acl-plugin/test/test_acl_plugin.py118
-rw-r--r--vpp/plugins/configure.ac68
-rw-r--r--vpp/plugins/flowperpkt-plugin/Makefile.am63
-rw-r--r--vpp/plugins/flowperpkt-plugin/configure.ac9
-rw-r--r--vpp/plugins/flowperpkt-plugin/flowperpkt/flowperpkt.api42
-rw-r--r--vpp/plugins/flowperpkt-plugin/flowperpkt/flowperpkt.c518
-rw-r--r--vpp/plugins/flowperpkt-plugin/flowperpkt/flowperpkt.h72
-rw-r--r--vpp/plugins/flowperpkt-plugin/flowperpkt/flowperpkt_all_api_h.h18
-rw-r--r--vpp/plugins/flowperpkt-plugin/flowperpkt/flowperpkt_msg_enum.h31
-rw-r--r--vpp/plugins/flowperpkt-plugin/flowperpkt/flowperpkt_test.c231
-rw-r--r--vpp/plugins/flowperpkt-plugin/flowperpkt/node.c552
-rw-r--r--vpp/plugins/flowperpkt-plugin/flowperpkt_plugin_doc.md13
-rw-r--r--vpp/plugins/ila-plugin/Makefile.am29
-rw-r--r--vpp/plugins/ila-plugin/configure.ac9
-rw-r--r--vpp/plugins/ila-plugin/ila/ila.c1070
-rw-r--r--vpp/plugins/ila-plugin/ila/ila.h116
-rw-r--r--vpp/plugins/ioam-plugin/Makefile.am359
-rw-r--r--vpp/plugins/ioam-plugin/configure.ac25
-rw-r--r--vpp/plugins/ioam-plugin/ioam/dir.dox18
-rw-r--r--vpp/plugins/ioam-plugin/ioam/encap/ip6_ioam_e2e.c216
-rw-r--r--vpp/plugins/ioam-plugin/ioam/encap/ip6_ioam_e2e.h47
-rw-r--r--vpp/plugins/ioam-plugin/ioam/encap/ip6_ioam_pot.c276
-rw-r--r--vpp/plugins/ioam-plugin/ioam/encap/ip6_ioam_seqno.c109
-rw-r--r--vpp/plugins/ioam-plugin/ioam/encap/ip6_ioam_seqno.h70
-rw-r--r--vpp/plugins/ioam-plugin/ioam/encap/ip6_ioam_seqno_analyse.c141
-rw-r--r--vpp/plugins/ioam-plugin/ioam/encap/ip6_ioam_trace.c451
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export-common/ioam_export.h617
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export.api42
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export.c271
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_all_api_h.h16
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_msg_enum.h28
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_test.c215
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export-vxlan-gpe/vxlan_gpe_ioam_export_thread.c49
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export-vxlan-gpe/vxlan_gpe_node.c162
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/ioam_export.api42
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/ioam_export.c265
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/ioam_export_all_api_h.h16
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/ioam_export_msg_enum.h28
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/ioam_export_test.c206
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/ioam_export_thread.c38
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/jvpp_ioam_export.c124
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/jvpp_ioam_export.h45
-rw-r--r--vpp/plugins/ioam-plugin/ioam/export/node.c151
-rw-r--r--vpp/plugins/ioam-plugin/ioam/ioam_plugin_doc.md464
-rw-r--r--vpp/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamexport/test/IoamExportApiTest.java56
-rw-r--r--vpp/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamexport/test/Readme.txt1
-rw-r--r--vpp/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioampot/test/IoamPotApiTest.java75
-rw-r--r--vpp/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioampot/test/Readme.txt1
-rw-r--r--vpp/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/IoamTraceApiTest.java77
-rw-r--r--vpp/plugins/ioam-plugin/ioam/jvpp/io/fd/vpp/jvpp/ioamtrace/test/Readme.txt1
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/jvpp_ioam_pot.c124
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/jvpp_ioam_pot.h45
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/math64.h159
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/pot.api133
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/pot_all_api_h.h16
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/pot_api.c276
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/pot_msg_enum.h28
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/pot_test.c365
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/pot_util.c445
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-pot/pot_util.h195
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/jvpp_ioam_trace.c124
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/jvpp_ioam_trace.h45
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/trace.api92
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/trace_all_api_h.h16
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/trace_api.c237
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/trace_msg_enum.h28
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/trace_test.c292
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/trace_util.c206
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-trace/trace_util.h247
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/ioam_decap.c223
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/ioam_encap.c194
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/ioam_pop.c353
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/ioam_transit.c188
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe.api181
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_all_api_h.h16
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_api.c361
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_ioam.c773
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_ioam.h183
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_ioam_packet.h61
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_ioam_trace.c552
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_ioam_util.h172
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_msg_enum.h28
-rw-r--r--vpp/plugins/ioam-plugin/ioam/lib-vxlan-gpe/vxlan_gpe_test.c600
-rw-r--r--vpp/plugins/lb-plugin/Makefile.am55
-rw-r--r--vpp/plugins/lb-plugin/configure.ac9
-rw-r--r--vpp/plugins/lb-plugin/lb/api.c228
-rw-r--r--vpp/plugins/lb-plugin/lb/cli.c250
-rw-r--r--vpp/plugins/lb-plugin/lb/lb.api71
-rw-r--r--vpp/plugins/lb-plugin/lb/lb.c844
-rw-r--r--vpp/plugins/lb-plugin/lb/lb.h333
-rw-r--r--vpp/plugins/lb-plugin/lb/lb_test.c293
-rw-r--r--vpp/plugins/lb-plugin/lb/lbhash.h216
-rw-r--r--vpp/plugins/lb-plugin/lb/node.c419
-rw-r--r--vpp/plugins/lb-plugin/lb/refcount.c41
-rw-r--r--vpp/plugins/lb-plugin/lb/refcount.h67
-rw-r--r--vpp/plugins/lb-plugin/lb/util.c72
-rw-r--r--vpp/plugins/lb-plugin/lb/util.h40
-rw-r--r--vpp/plugins/lb-plugin/lb_plugin_doc.md141
-rw-r--r--vpp/plugins/sample-plugin/Makefile.am56
-rw-r--r--vpp/plugins/sample-plugin/configure.ac9
-rw-r--r--vpp/plugins/sample-plugin/sample/node.c295
-rw-r--r--vpp/plugins/sample-plugin/sample/sample.api39
-rw-r--r--vpp/plugins/sample-plugin/sample/sample.c255
-rw-r--r--vpp/plugins/sample-plugin/sample/sample.h40
-rw-r--r--vpp/plugins/sample-plugin/sample/sample_all_api_h.h16
-rw-r--r--vpp/plugins/sample-plugin/sample/sample_msg_enum.h28
-rw-r--r--vpp/plugins/sample-plugin/sample/sample_test.c213
-rw-r--r--vpp/plugins/sixrd-plugin/Makefile.am38
-rw-r--r--vpp/plugins/sixrd-plugin/configure.ac9
-rw-r--r--vpp/plugins/sixrd-plugin/sixrd/ip4_sixrd.c127
-rw-r--r--vpp/plugins/sixrd-plugin/sixrd/ip6_sixrd.c129
-rw-r--r--vpp/plugins/sixrd-plugin/sixrd/sixrd.c369
-rw-r--r--vpp/plugins/sixrd-plugin/sixrd/sixrd.h141
-rw-r--r--vpp/plugins/sixrd-plugin/sixrd/sixrd_dpo.c132
-rw-r--r--vpp/plugins/sixrd-plugin/sixrd/sixrd_dpo.h61
-rw-r--r--vpp/plugins/snat-plugin/Makefile.am113
-rw-r--r--vpp/plugins/snat-plugin/configure.ac32
-rw-r--r--vpp/plugins/snat-plugin/snat/in2out.c1597
-rw-r--r--vpp/plugins/snat-plugin/snat/jvpp/io/fd/vpp/jvpp/snat/test/CallbackApiTest.java68
-rw-r--r--vpp/plugins/snat-plugin/snat/jvpp/io/fd/vpp/jvpp/snat/test/Readme.txt1
-rw-r--r--vpp/plugins/snat-plugin/snat/jvpp_snat.c124
-rw-r--r--vpp/plugins/snat-plugin/snat/jvpp_snat.h45
-rw-r--r--vpp/plugins/snat-plugin/snat/out2in.c1268
-rw-r--r--vpp/plugins/snat-plugin/snat/snat.api283
-rw-r--r--vpp/plugins/snat-plugin/snat/snat.c1957
-rw-r--r--vpp/plugins/snat-plugin/snat/snat.h259
-rw-r--r--vpp/plugins/snat-plugin/snat/snat_all_api_h.h19
-rw-r--r--vpp/plugins/snat-plugin/snat/snat_msg_enum.h31
-rw-r--r--vpp/plugins/snat-plugin/snat/snat_test.c602
-rw-r--r--vpp/plugins/vcgn-plugin/Makefile.am97
-rw-r--r--vpp/plugins/vcgn-plugin/configure.ac9
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/README100
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cgn_bitmap.h133
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cgse_defs.h88
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_bulk_port.c964
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_bulk_port.h157
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_bulk_port_defs.h57
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_cli.h206
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_cli_handler.c961
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_common_api.h22
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_config.c77
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_config.h582
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_config_api.h46
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_db.h701
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_db_scanner.c493
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_db_v2.c3806
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_debug_msg_handler.c1780
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_global.c79
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_global.h87
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_icmp.h60
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_icmp_error_inside_input.c476
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_icmp_error_outside_input.c452
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_icmp_query_inside_input.c404
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_icmp_query_inside_input_exception.c235
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_icmp_query_outside_input.c381
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_tcp_inside_input.c424
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_tcp_inside_input_exceptions.c314
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_tcp_outside_input.c382
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_udp.h41
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_udp_inside_input.c508
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_udp_inside_input_exceptions.c283
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ipv4_udp_outside_input.c605
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_log_api.h114
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_log_common.h79
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_logging.c3500
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_logging.h1091
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_pcp_server.h398
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ports.c1113
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_ports.h208
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_show.c810
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_show_api.h40
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_show_response.h580
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_syslog.c1787
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_syslog.h190
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_util.c2256
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_v4_ftp_alg.h133
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_v4_functions.c364
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_v4_functions.h342
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_v4_pptp_alg.h150
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_v4_tcp_in2out_stages.c679
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_va_db.c286
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/cnat_va_db.h121
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/dslite_db.h170
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/dslite_defs.h336
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/index_list.c336
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/index_list.h118
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/nat64_db.h480
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/nat64_defs.h576
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/nat64_tcp_sm.h91
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/platform_common.h136
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/platform_common_override.h304
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/spp_ctx.h76
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/spp_platform_trace_log.c989
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/spp_platform_trace_log.h358
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/spp_timers.h139
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/tcp_header_definitions.h1582
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/vcgn_classify.c1508
-rw-r--r--vpp/plugins/vcgn-plugin/vcgn/vcgn_db.h117
-rw-r--r--vpp/svm/Makefile.am30
-rw-r--r--vpp/svm/configure.ac7
-rw-r--r--vpp/svm/dir.dox21
-rw-r--r--vpp/svm/persist.c258
-rw-r--r--vpp/svm/ssvm.c178
-rw-r--r--vpp/svm/ssvm.h155
-rw-r--r--vpp/svm/svm.c1237
-rw-r--r--vpp/svm/svm.h207
-rw-r--r--vpp/svm/svm_test.c79
-rw-r--r--vpp/svm/svmdb.c671
-rw-r--r--vpp/svm/svmdb.h135
-rw-r--r--vpp/svm/svmdbtool.c537
-rw-r--r--vpp/svm/svmtool.c528
-rw-r--r--vpp/test/Makefile109
-rw-r--r--vpp/test/bfd.py217
-rw-r--r--vpp/test/doc/Makefile243
-rw-r--r--vpp/test/doc/conf.py341
-rw-r--r--vpp/test/doc/index.rst165
-rw-r--r--vpp/test/framework.py697
-rw-r--r--vpp/test/hook.py227
-rw-r--r--vpp/test/log.py72
-rw-r--r--vpp/test/patches/scapy-2.3.3/gre-layers.patch25
-rw-r--r--vpp/test/patches/scapy-2.3.3/mpls.py.patch13
-rw-r--r--vpp/test/run_tests.py12
-rw-r--r--vpp/test/scapy_handlers/__init__.py0
-rw-r--r--vpp/test/template_bd.py174
-rw-r--r--vpp/test/test_bfd.py275
-rw-r--r--vpp/test/test_classifier.py343
-rw-r--r--vpp/test/test_fib.py30
-rw-r--r--vpp/test/test_gre.py672
-rw-r--r--vpp/test/test_ip4.py469
-rw-r--r--vpp/test/test_ip4_irb.py266
-rw-r--r--vpp/test/test_ip6.py212
-rw-r--r--vpp/test/test_l2_fib.py382
-rw-r--r--vpp/test/test_l2bd.py286
-rw-r--r--vpp/test/test_l2bd_multi_instance.py498
-rw-r--r--vpp/test/test_l2xc.py230
-rw-r--r--vpp/test/test_l2xc_multi_instance.py345
-rw-r--r--vpp/test/test_lb.py217
-rw-r--r--vpp/test/test_mpls.py743
-rw-r--r--vpp/test/test_snat.py626
-rw-r--r--vpp/test/test_span.py193
-rw-r--r--vpp/test/test_vxlan.py196
-rw-r--r--vpp/test/util.py87
-rw-r--r--vpp/test/vpp_gre_interface.py36
-rw-r--r--vpp/test/vpp_interface.py264
-rw-r--r--vpp/test/vpp_ip_route.py116
-rw-r--r--vpp/test/vpp_lo_interface.py13
-rw-r--r--vpp/test/vpp_object.py79
-rw-r--r--vpp/test/vpp_papi_provider.py986
-rw-r--r--vpp/test/vpp_pg_interface.py326
-rw-r--r--vpp/test/vpp_sub_interface.py140
-rw-r--r--vpp/vlib-api/Makefile.am84
-rw-r--r--vpp/vlib-api/configure.ac9
l---------vpp/vlib-api/suffix-rules.mk1
-rw-r--r--vpp/vlib-api/vlibapi/api.h281
-rw-r--r--vpp/vlib-api/vlibapi/api_helper_macros.h243
-rw-r--r--vpp/vlib-api/vlibapi/api_shared.c1377
-rw-r--r--vpp/vlib-api/vlibapi/node_serialize.c399
-rw-r--r--vpp/vlib-api/vlibmemory/api.h163
-rw-r--r--vpp/vlib-api/vlibmemory/memclnt.api91
-rw-r--r--vpp/vlib-api/vlibmemory/memory_client.c283
-rw-r--r--vpp/vlib-api/vlibmemory/memory_shared.c847
-rw-r--r--vpp/vlib-api/vlibmemory/memory_vlib.c1349
-rw-r--r--vpp/vlib-api/vlibmemory/unix_shared_memory_queue.c324
-rw-r--r--vpp/vlib-api/vlibmemory/unix_shared_memory_queue.h69
-rw-r--r--vpp/vlib-api/vlibmemory/vl_memory_api_h.h32
-rw-r--r--vpp/vlib-api/vlibmemory/vl_memory_msg_enum.h42
-rw-r--r--vpp/vlib-api/vlibsocket/api.h87
-rw-r--r--vpp/vlib-api/vlibsocket/sock_test.c155
-rw-r--r--vpp/vlib-api/vlibsocket/sockclnt.api50
-rw-r--r--vpp/vlib-api/vlibsocket/sockclnt_vlib.c209
-rw-r--r--vpp/vlib-api/vlibsocket/socksvr_vlib.c706
-rw-r--r--vpp/vlib-api/vlibsocket/vl_socket_api_h.h33
-rw-r--r--vpp/vlib-api/vlibsocket/vl_socket_msg_enum.h42
-rw-r--r--vpp/vlib/.gitignore1
-rw-r--r--vpp/vlib/Makefile.am104
-rw-r--r--vpp/vlib/configure.ac25
-rw-r--r--vpp/vlib/dir.dox21
-rw-r--r--vpp/vlib/example/dir.dox22
-rw-r--r--vpp/vlib/example/main_stub.c418
-rw-r--r--vpp/vlib/example/mc_test.c384
-rw-r--r--vpp/vlib/example/plex_test.c527
-rw-r--r--vpp/vlib/vlib/buffer.c1987
-rw-r--r--vpp/vlib/vlib/buffer.h417
-rw-r--r--vpp/vlib/vlib/buffer_funcs.h755
-rw-r--r--vpp/vlib/vlib/buffer_node.h337
-rw-r--r--vpp/vlib/vlib/cli.c1173
-rw-r--r--vpp/vlib/vlib/cli.h192
-rw-r--r--vpp/vlib/vlib/cli_funcs.h58
-rw-r--r--vpp/vlib/vlib/counter.c151
-rw-r--r--vpp/vlib/vlib/counter.h379
-rw-r--r--vpp/vlib/vlib/defs.h82
-rw-r--r--vpp/vlib/vlib/dir.dox23
-rw-r--r--vpp/vlib/vlib/elog_samples.c122
-rw-r--r--vpp/vlib/vlib/error.c338
-rw-r--r--vpp/vlib/vlib/error.h101
-rw-r--r--vpp/vlib/vlib/error_funcs.h88
-rw-r--r--vpp/vlib/vlib/format.c196
-rw-r--r--vpp/vlib/vlib/format_funcs.h75
-rw-r--r--vpp/vlib/vlib/global_funcs.h45
-rw-r--r--vpp/vlib/vlib/i2c.c231
-rw-r--r--vpp/vlib/vlib/i2c.h67
-rw-r--r--vpp/vlib/vlib/init.c168
-rw-r--r--vpp/vlib/vlib/init.h238
-rw-r--r--vpp/vlib/vlib/lex.c271
-rw-r--r--vpp/vlib/vlib/lex.h145
-rw-r--r--vpp/vlib/vlib/main.c1703
-rw-r--r--vpp/vlib/vlib/main.h333
-rw-r--r--vpp/vlib/vlib/mc.c2609
-rw-r--r--vpp/vlib/vlib/mc.h687
-rw-r--r--vpp/vlib/vlib/node.c631
-rw-r--r--vpp/vlib/vlib/node.h725
-rw-r--r--vpp/vlib/vlib/node_cli.c466
-rw-r--r--vpp/vlib/vlib/node_format.c187
-rw-r--r--vpp/vlib/vlib/node_funcs.h1130
-rw-r--r--vpp/vlib/vlib/parse.c1007
-rw-r--r--vpp/vlib/vlib/parse.h221
-rw-r--r--vpp/vlib/vlib/parse_builtin.c150
-rw-r--r--vpp/vlib/vlib/pci/linux_pci.c642
-rw-r--r--vpp/vlib/vlib/pci/pci.c178
-rw-r--r--vpp/vlib/vlib/pci/pci.h249
-rw-r--r--vpp/vlib/vlib/pci/pci_config.h731
-rw-r--r--vpp/vlib/vlib/physmem.h108
-rw-r--r--vpp/vlib/vlib/threads.c1492
-rw-r--r--vpp/vlib/vlib/threads.h470
-rw-r--r--vpp/vlib/vlib/threads_cli.c579
-rw-r--r--vpp/vlib/vlib/trace.c545
-rw-r--r--vpp/vlib/vlib/trace.h100
-rw-r--r--vpp/vlib/vlib/trace_funcs.h185
-rw-r--r--vpp/vlib/vlib/unix/cj.c271
-rw-r--r--vpp/vlib/vlib/unix/cj.h79
-rw-r--r--vpp/vlib/vlib/unix/cli.c2989
-rw-r--r--vpp/vlib/vlib/unix/dir.dox28
-rw-r--r--vpp/vlib/vlib/unix/input.c265
-rw-r--r--vpp/vlib/vlib/unix/main.c557
-rw-r--r--vpp/vlib/vlib/unix/mc_socket.c1049
-rw-r--r--vpp/vlib/vlib/unix/mc_socket.h137
-rw-r--r--vpp/vlib/vlib/unix/physmem.c470
-rw-r--r--vpp/vlib/vlib/unix/physmem.h65
-rw-r--r--vpp/vlib/vlib/unix/plugin.c260
-rw-r--r--vpp/vlib/vlib/unix/plugin.h98
-rw-r--r--vpp/vlib/vlib/unix/unix.h232
-rw-r--r--vpp/vlib/vlib/unix/util.c231
-rw-r--r--vpp/vlib/vlib/vlib.h86
-rw-r--r--vpp/vlib/vlib/vlib_process_doc.h147
-rw-r--r--vpp/vnet/.gitignore1
-rw-r--r--vpp/vnet/Makefile.am947
-rw-r--r--vpp/vnet/configure.ac49
-rw-r--r--vpp/vnet/etc/scripts/arp421
-rw-r--r--vpp/vnet/etc/scripts/arp4-mpls24
-rw-r--r--vpp/vnet/etc/scripts/arp621
-rw-r--r--vpp/vnet/etc/scripts/bvi76
-rw-r--r--vpp/vnet/etc/scripts/dhcp/dhcpd.conf8
-rw-r--r--vpp/vnet/etc/scripts/dhcp/left-ping-target.sh4
-rw-r--r--vpp/vnet/etc/scripts/dhcp/leftpeer.conf17
-rw-r--r--vpp/vnet/etc/scripts/icmp16
-rw-r--r--vpp/vnet/etc/scripts/icmp616
-rw-r--r--vpp/vnet/etc/scripts/ige19
-rw-r--r--vpp/vnet/etc/scripts/ip615
-rw-r--r--vpp/vnet/etc/scripts/ip6-hbh84
-rw-r--r--vpp/vnet/etc/scripts/ixge15
-rw-r--r--vpp/vnet/etc/scripts/l2efpfilter83
-rw-r--r--vpp/vnet/etc/scripts/l2efpfilter_perf58
-rw-r--r--vpp/vnet/etc/scripts/l2fib46
-rw-r--r--vpp/vnet/etc/scripts/l2fib_perf29
-rw-r--r--vpp/vnet/etc/scripts/l2fib_xc31
-rw-r--r--vpp/vnet/etc/scripts/l2flood42
-rw-r--r--vpp/vnet/etc/scripts/l2tp134
-rwxr-xr-xvpp/vnet/etc/scripts/leftpeer/leftpeer-classify8
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-classify65
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-classifyl28
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-dhcp23
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-ioam.conf15
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-l3vxlan.conf12
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-lisp.conf18
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-mpls.conf17
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-sr.conf24
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer-vxlan.conf17
-rw-r--r--vpp/vnet/etc/scripts/leftpeer/leftpeer.script9
-rw-r--r--vpp/vnet/etc/scripts/lfib/ip4-to-mpls26
-rw-r--r--vpp/vnet/etc/scripts/lfib/mpls-pop-to-mpls28
-rw-r--r--vpp/vnet/etc/scripts/lfib/mpls-to-ip427
-rw-r--r--vpp/vnet/etc/scripts/lfib/mpls-to-mpls26
-rw-r--r--vpp/vnet/etc/scripts/mpls-o-ethernet/leftpeer.conf17
-rw-r--r--vpp/vnet/etc/scripts/mpls-o-ethernet/pg10
-rw-r--r--vpp/vnet/etc/scripts/mpls-o-ethernet/rightpeer.conf15
-rw-r--r--vpp/vnet/etc/scripts/mpls-o-ethernet/single.conf17
-rw-r--r--vpp/vnet/etc/scripts/mpls-o-gre/dhcpd.conf116
-rw-r--r--vpp/vnet/etc/scripts/mpls-o-gre/leftpeer.conf14
-rw-r--r--vpp/vnet/etc/scripts/mpls-o-gre/rightpeer.conf14
-rw-r--r--vpp/vnet/etc/scripts/mpls-tunnel87
-rw-r--r--vpp/vnet/etc/scripts/pcap18
-rw-r--r--vpp/vnet/etc/scripts/probe411
-rw-r--r--vpp/vnet/etc/scripts/probe67
-rw-r--r--vpp/vnet/etc/scripts/rewrite62
-rw-r--r--vpp/vnet/etc/scripts/rightpeer/rightpeer-ioam.conf14
-rw-r--r--vpp/vnet/etc/scripts/rightpeer/rightpeer-l3vxlan.conf9
-rw-r--r--vpp/vnet/etc/scripts/rightpeer/rightpeer-lisp.conf16
-rw-r--r--vpp/vnet/etc/scripts/rightpeer/rightpeer-mpls-l2.conf24
-rw-r--r--vpp/vnet/etc/scripts/rightpeer/rightpeer-mpls.conf17
-rw-r--r--vpp/vnet/etc/scripts/rightpeer/rightpeer-sr.conf28
-rw-r--r--vpp/vnet/etc/scripts/rightpeer/rightpeer-vxlan.conf16
-rw-r--r--vpp/vnet/etc/scripts/rightpeer/rightpeer.script9
-rw-r--r--vpp/vnet/etc/scripts/rpf18
-rw-r--r--vpp/vnet/etc/scripts/rtt-test31
-rw-r--r--vpp/vnet/etc/scripts/snat34
-rw-r--r--vpp/vnet/etc/scripts/snat_static44
-rw-r--r--vpp/vnet/etc/scripts/snat_static_with_port44
-rw-r--r--vpp/vnet/etc/scripts/source_and_port_range_check63
-rw-r--r--vpp/vnet/etc/scripts/speed14
-rwxr-xr-xvpp/vnet/etc/scripts/sr/left-linux-ping.sh3
-rw-r--r--vpp/vnet/etc/scripts/sr/leftpeer.conf27
-rwxr-xr-xvpp/vnet/etc/scripts/sr/right-linux-ping.sh4
-rw-r--r--vpp/vnet/etc/scripts/sr/rightpeer.conf22
-rwxr-xr-xvpp/vnet/etc/scripts/sr/srlocal.sh4
-rw-r--r--vpp/vnet/etc/scripts/srp27
-rw-r--r--vpp/vnet/etc/scripts/tcp16
-rw-r--r--vpp/vnet/etc/scripts/tcp-test6
-rw-r--r--vpp/vnet/etc/scripts/tf-ucs-116
-rw-r--r--vpp/vnet/etc/scripts/urpf86
-rw-r--r--vpp/vnet/etc/scripts/virl/ip6sr.virl874
-rw-r--r--vpp/vnet/etc/scripts/virl/ip6sr_notes.txt38
-rw-r--r--vpp/vnet/etc/scripts/virl/mplsogre.virl319
-rw-r--r--vpp/vnet/etc/scripts/virl/simple.virl389
-rw-r--r--vpp/vnet/etc/scripts/vlan23
l---------vpp/vnet/suffix-rules.mk1
-rw-r--r--vpp/vnet/test/README10
-rw-r--r--vpp/vnet/test/lisp-cp/test_cp_serdes.c635
-rw-r--r--vpp/vnet/test/lisp-cp/test_lisp_types.c561
-rw-r--r--vpp/vnet/test/lisp-gpe/test.c18
-rw-r--r--vpp/vnet/vnet/adj/adj.c454
-rw-r--r--vpp/vnet/vnet/adj/adj.h122
-rw-r--r--vpp/vnet/vnet/adj/adj_glean.c285
-rw-r--r--vpp/vnet/vnet/adj/adj_glean.h61
-rw-r--r--vpp/vnet/vnet/adj/adj_internal.h104
-rw-r--r--vpp/vnet/vnet/adj/adj_l2.c194
-rw-r--r--vpp/vnet/vnet/adj/adj_l2.h24
-rw-r--r--vpp/vnet/vnet/adj/adj_midchain.c559
-rw-r--r--vpp/vnet/vnet/adj/adj_midchain.h102
-rw-r--r--vpp/vnet/vnet/adj/adj_nbr.c1087
-rw-r--r--vpp/vnet/vnet/adj/adj_nbr.h176
-rw-r--r--vpp/vnet/vnet/adj/adj_rewrite.c53
-rw-r--r--vpp/vnet/vnet/adj/adj_rewrite.h49
-rw-r--r--vpp/vnet/vnet/adj/adj_types.h53
-rw-r--r--vpp/vnet/vnet/api_errno.h113
-rw-r--r--vpp/vnet/vnet/bfd/bfd_api.h46
-rw-r--r--vpp/vnet/vnet/bfd/bfd_debug.h79
-rw-r--r--vpp/vnet/vnet/bfd/bfd_doc.md1
-rw-r--r--vpp/vnet/vnet/bfd/bfd_main.c969
-rw-r--r--vpp/vnet/vnet/bfd/bfd_main.h220
-rw-r--r--vpp/vnet/vnet/bfd/bfd_protocol.c74
-rw-r--r--vpp/vnet/vnet/bfd/bfd_protocol.h154
-rw-r--r--vpp/vnet/vnet/bfd/bfd_udp.c639
-rw-r--r--vpp/vnet/vnet/bfd/bfd_udp.h56
-rw-r--r--vpp/vnet/vnet/bfd/dir.dox18
-rw-r--r--vpp/vnet/vnet/buffer.h381
-rw-r--r--vpp/vnet/vnet/cdp/cdp.pg7
-rw-r--r--vpp/vnet/vnet/cdp/cdp_input.c506
-rw-r--r--vpp/vnet/vnet/cdp/cdp_node.c208
-rw-r--r--vpp/vnet/vnet/cdp/cdp_node.h147
-rw-r--r--vpp/vnet/vnet/cdp/cdp_periodic.c512
-rw-r--r--vpp/vnet/vnet/cdp/cdp_protocol.h186
-rw-r--r--vpp/vnet/vnet/classify/README180
-rw-r--r--vpp/vnet/vnet/classify/flow_classify.c212
-rw-r--r--vpp/vnet/vnet/classify/flow_classify.h51
-rw-r--r--vpp/vnet/vnet/classify/flow_classify_node.c338
-rw-r--r--vpp/vnet/vnet/classify/input_acl.c283
-rw-r--r--vpp/vnet/vnet/classify/input_acl.h54
-rw-r--r--vpp/vnet/vnet/classify/ip_classify.c365
-rw-r--r--vpp/vnet/vnet/classify/policer_classify.c227
-rw-r--r--vpp/vnet/vnet/classify/policer_classify.h55
-rw-r--r--vpp/vnet/vnet/classify/vnet_classify.c2436
-rw-r--r--vpp/vnet/vnet/classify/vnet_classify.h523
-rw-r--r--vpp/vnet/vnet/config.c361
-rw-r--r--vpp/vnet/vnet/config.h176
-rw-r--r--vpp/vnet/vnet/cop/cop.c387
-rw-r--r--vpp/vnet/vnet/cop/cop.h89
-rw-r--r--vpp/vnet/vnet/cop/ip4_whitelist.c356
-rw-r--r--vpp/vnet/vnet/cop/ip6_whitelist.c298
-rw-r--r--vpp/vnet/vnet/cop/node1.c319
-rw-r--r--vpp/vnet/vnet/devices/af_packet/af_packet.c366
-rw-r--r--vpp/vnet/vnet/devices/af_packet/af_packet.h69
-rw-r--r--vpp/vnet/vnet/devices/af_packet/cli.c144
-rw-r--r--vpp/vnet/vnet/devices/af_packet/device.c250
-rw-r--r--vpp/vnet/vnet/devices/af_packet/node.c288
-rw-r--r--vpp/vnet/vnet/devices/devices.c91
-rw-r--r--vpp/vnet/vnet/devices/devices.h53
-rw-r--r--vpp/vnet/vnet/devices/dpdk/cli.c1296
-rw-r--r--vpp/vnet/vnet/devices/dpdk/device.c840
-rw-r--r--vpp/vnet/vnet/devices/dpdk/dpdk.h532
-rw-r--r--vpp/vnet/vnet/devices/dpdk/dpdk_priv.h137
-rw-r--r--vpp/vnet/vnet/devices/dpdk/format.c755
-rw-r--r--vpp/vnet/vnet/devices/dpdk/hqos.c775
-rwxr-xr-xvpp/vnet/vnet/devices/dpdk/init.c1769
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/cli.c141
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/crypto_node.c210
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/dir.dox18
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/dpdk_crypto_ipsec_doc.md73
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/esp.h295
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/esp_decrypt.c583
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/esp_encrypt.c598
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/ipsec.c313
-rw-r--r--vpp/vnet/vnet/devices/dpdk/ipsec/ipsec.h227
-rw-r--r--vpp/vnet/vnet/devices/dpdk/node.c687
-rw-r--r--vpp/vnet/vnet/devices/dpdk/qos_doc.md404
-rw-r--r--vpp/vnet/vnet/devices/netmap/cli.c146
-rw-r--r--vpp/vnet/vnet/devices/netmap/device.c261
-rw-r--r--vpp/vnet/vnet/devices/netmap/net_netmap.h650
-rw-r--r--vpp/vnet/vnet/devices/netmap/netmap.c316
-rw-r--r--vpp/vnet/vnet/devices/netmap/netmap.h164
-rw-r--r--vpp/vnet/vnet/devices/netmap/node.c300
-rw-r--r--vpp/vnet/vnet/devices/nic/ixge.c2938
-rw-r--r--vpp/vnet/vnet/devices/nic/ixge.h1293
-rw-r--r--vpp/vnet/vnet/devices/nic/sfp.c117
-rw-r--r--vpp/vnet/vnet/devices/nic/sfp.h117
-rw-r--r--vpp/vnet/vnet/devices/ssvm/node.c343
-rw-r--r--vpp/vnet/vnet/devices/ssvm/ssvm_eth.c491
-rw-r--r--vpp/vnet/vnet/devices/ssvm/ssvm_eth.h141
-rw-r--r--vpp/vnet/vnet/devices/virtio/dir.dox27
-rw-r--r--vpp/vnet/vnet/devices/virtio/vhost-user.c3322
-rw-r--r--vpp/vnet/vnet/devices/virtio/vhost-user.h350
-rw-r--r--vpp/vnet/vnet/dhcp/client.c1031
-rw-r--r--vpp/vnet/vnet/dhcp/client.h118
-rw-r--r--vpp/vnet/vnet/dhcp/packet.h61
-rw-r--r--vpp/vnet/vnet/dhcp/proxy.h92
-rw-r--r--vpp/vnet/vnet/dhcp/proxy_error.def30
-rw-r--r--vpp/vnet/vnet/dhcp/proxy_node.c1114
-rw-r--r--vpp/vnet/vnet/dhcpv6/packet.h183
-rw-r--r--vpp/vnet/vnet/dhcpv6/proxy.h95
-rw-r--r--vpp/vnet/vnet/dhcpv6/proxy_error.def29
-rw-r--r--vpp/vnet/vnet/dhcpv6/proxy_node.c1195
-rw-r--r--vpp/vnet/vnet/dpo/classify_dpo.c131
-rw-r--r--vpp/vnet/vnet/dpo/classify_dpo.h56
-rw-r--r--vpp/vnet/vnet/dpo/dpo.c500
-rw-r--r--vpp/vnet/vnet/dpo/dpo.h381
-rw-r--r--vpp/vnet/vnet/dpo/drop_dpo.c106
-rw-r--r--vpp/vnet/vnet/dpo/drop_dpo.h31
-rw-r--r--vpp/vnet/vnet/dpo/ip_null_dpo.c408
-rw-r--r--vpp/vnet/vnet/dpo/ip_null_dpo.h56
-rw-r--r--vpp/vnet/vnet/dpo/load_balance.c996
-rw-r--r--vpp/vnet/vnet/dpo/load_balance.h211
-rw-r--r--vpp/vnet/vnet/dpo/load_balance_map.c575
-rw-r--r--vpp/vnet/vnet/dpo/load_balance_map.h79
-rw-r--r--vpp/vnet/vnet/dpo/lookup_dpo.c1185
-rw-r--r--vpp/vnet/vnet/dpo/lookup_dpo.h108
-rw-r--r--vpp/vnet/vnet/dpo/mpls_label_dpo.c570
-rw-r--r--vpp/vnet/vnet/dpo/mpls_label_dpo.h101
-rw-r--r--vpp/vnet/vnet/dpo/punt_dpo.c100
-rw-r--r--vpp/vnet/vnet/dpo/punt_dpo.h30
-rw-r--r--vpp/vnet/vnet/dpo/receive_dpo.c165
-rw-r--r--vpp/vnet/vnet/dpo/receive_dpo.h62
-rw-r--r--vpp/vnet/vnet/ethernet/arp.c2368
-rw-r--r--vpp/vnet/vnet/ethernet/arp_packet.h173
-rw-r--r--vpp/vnet/vnet/ethernet/dir.dox24
-rw-r--r--vpp/vnet/vnet/ethernet/error.def46
-rw-r--r--vpp/vnet/vnet/ethernet/ethernet.h561
-rw-r--r--vpp/vnet/vnet/ethernet/format.c366
-rw-r--r--vpp/vnet/vnet/ethernet/init.c128
-rw-r--r--vpp/vnet/vnet/ethernet/interface.c730
-rw-r--r--vpp/vnet/vnet/ethernet/mac_swap.c397
-rwxr-xr-xvpp/vnet/vnet/ethernet/node.c1368
-rw-r--r--vpp/vnet/vnet/ethernet/packet.h152
-rw-r--r--vpp/vnet/vnet/ethernet/pg.c183
-rw-r--r--vpp/vnet/vnet/ethernet/types.def113
-rw-r--r--vpp/vnet/vnet/feature/feature.c463
-rw-r--r--vpp/vnet/vnet/feature/feature.h382
-rw-r--r--vpp/vnet/vnet/feature/registration.c301
-rw-r--r--vpp/vnet/vnet/fib/fib.c41
-rw-r--r--vpp/vnet/vnet/fib/fib.h652
-rw-r--r--vpp/vnet/vnet/fib/fib_api.h54
-rw-r--r--vpp/vnet/vnet/fib/fib_attached_export.c580
-rw-r--r--vpp/vnet/vnet/fib/fib_attached_export.h57
-rw-r--r--vpp/vnet/vnet/fib/fib_entry.c1504
-rw-r--r--vpp/vnet/vnet/fib/fib_entry.h530
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_cover.c225
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_cover.h47
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_delegate.c149
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_delegate.h124
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src.c1464
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src.h296
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_adj.c207
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_api.c119
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_default.c121
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_default_route.c58
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_interface.c195
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_lisp.c133
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_mpls.c196
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_rr.c293
-rw-r--r--vpp/vnet/vnet/fib/fib_entry_src_special.c71
-rw-r--r--vpp/vnet/vnet/fib/fib_internal.h69
-rw-r--r--vpp/vnet/vnet/fib/fib_node.c277
-rw-r--r--vpp/vnet/vnet/fib/fib_node.h371
-rw-r--r--vpp/vnet/vnet/fib/fib_node_list.c390
-rw-r--r--vpp/vnet/vnet/fib/fib_node_list.h64
-rw-r--r--vpp/vnet/vnet/fib/fib_path.c2001
-rw-r--r--vpp/vnet/vnet/fib/fib_path.h158
-rw-r--r--vpp/vnet/vnet/fib/fib_path_ext.c231
-rw-r--r--vpp/vnet/vnet/fib/fib_path_ext.h69
-rw-r--r--vpp/vnet/vnet/fib/fib_path_list.c1233
-rw-r--r--vpp/vnet/vnet/fib/fib_path_list.h160
-rw-r--r--vpp/vnet/vnet/fib/fib_table.c1104
-rw-r--r--vpp/vnet/vnet/fib/fib_table.h732
-rw-r--r--vpp/vnet/vnet/fib/fib_test.c7112
-rw-r--r--vpp/vnet/vnet/fib/fib_types.c326
-rw-r--r--vpp/vnet/vnet/fib/fib_types.h340
-rw-r--r--vpp/vnet/vnet/fib/fib_urpf_list.c260
-rw-r--r--vpp/vnet/vnet/fib/fib_urpf_list.h146
-rw-r--r--vpp/vnet/vnet/fib/fib_walk.c1108
-rw-r--r--vpp/vnet/vnet/fib/fib_walk.h58
-rw-r--r--vpp/vnet/vnet/fib/ip4_fib.c664
-rw-r--r--vpp/vnet/vnet/fib/ip4_fib.h141
-rw-r--r--vpp/vnet/vnet/fib/ip6_fib.c784
-rw-r--r--vpp/vnet/vnet/fib/ip6_fib.h130
-rw-r--r--vpp/vnet/vnet/fib/mpls_fib.c439
-rw-r--r--vpp/vnet/vnet/fib/mpls_fib.h106
-rw-r--r--vpp/vnet/vnet/flow/flow_report.c482
-rw-r--r--vpp/vnet/vnet/flow/flow_report.h145
-rw-r--r--vpp/vnet/vnet/flow/flow_report_classify.c529
-rw-r--r--vpp/vnet/vnet/flow/flow_report_classify.h122
-rw-r--r--vpp/vnet/vnet/flow/ipfix_info_elements.h429
-rw-r--r--vpp/vnet/vnet/flow/ipfix_packet.h188
-rw-r--r--vpp/vnet/vnet/global_funcs.h32
-rw-r--r--vpp/vnet/vnet/gre/error.def23
-rw-r--r--vpp/vnet/vnet/gre/gre.c455
-rw-r--r--vpp/vnet/vnet/gre/gre.h235
-rw-r--r--vpp/vnet/vnet/gre/interface.c606
-rw-r--r--vpp/vnet/vnet/gre/node.c531
-rw-r--r--vpp/vnet/vnet/gre/packet.h55
-rw-r--r--vpp/vnet/vnet/gre/pg.c77
-rw-r--r--vpp/vnet/vnet/handoff.c594
-rw-r--r--vpp/vnet/vnet/handoff.h259
-rw-r--r--vpp/vnet/vnet/hdlc/error.def42
-rw-r--r--vpp/vnet/vnet/hdlc/hdlc.c249
-rw-r--r--vpp/vnet/vnet/hdlc/hdlc.h127
-rw-r--r--vpp/vnet/vnet/hdlc/node.c351
-rw-r--r--vpp/vnet/vnet/hdlc/packet.h72
-rw-r--r--vpp/vnet/vnet/hdlc/pg.c105
-rw-r--r--vpp/vnet/vnet/interface.api339
-rw-r--r--vpp/vnet/vnet/interface.c1408
-rw-r--r--vpp/vnet/vnet/interface.h658
-rw-r--r--vpp/vnet/vnet/interface_api.c725
-rw-r--r--vpp/vnet/vnet/interface_cli.c1165
-rw-r--r--vpp/vnet/vnet/interface_format.c401
-rw-r--r--vpp/vnet/vnet/interface_funcs.h318
-rw-r--r--vpp/vnet/vnet/interface_output.c1404
-rw-r--r--vpp/vnet/vnet/ip/dir.dox26
-rw-r--r--vpp/vnet/vnet/ip/format.c121
-rw-r--r--vpp/vnet/vnet/ip/format.h114
-rw-r--r--vpp/vnet/vnet/ip/icmp4.c784
-rw-r--r--vpp/vnet/vnet/ip/icmp4.h60
-rw-r--r--vpp/vnet/vnet/ip/icmp46_packet.h398
-rw-r--r--vpp/vnet/vnet/ip/icmp6.c882
-rw-r--r--vpp/vnet/vnet/ip/icmp6.h86
-rw-r--r--vpp/vnet/vnet/ip/igmp_packet.h155
-rw-r--r--vpp/vnet/vnet/ip/ip.api434
-rw-r--r--vpp/vnet/vnet/ip/ip.h195
-rw-r--r--vpp/vnet/vnet/ip/ip4.h322
-rw-r--r--vpp/vnet/vnet/ip/ip46_cli.c236
-rw-r--r--vpp/vnet/vnet/ip/ip4_error.h95
-rw-r--r--vpp/vnet/vnet/ip/ip4_format.c256
-rw-r--r--vpp/vnet/vnet/ip/ip4_forward.c3345
-rw-r--r--vpp/vnet/vnet/ip/ip4_input.c507
-rw-r--r--vpp/vnet/vnet/ip/ip4_mtrie.c568
-rw-r--r--vpp/vnet/vnet/ip/ip4_mtrie.h188
-rw-r--r--vpp/vnet/vnet/ip/ip4_packet.h384
-rw-r--r--vpp/vnet/vnet/ip/ip4_pg.c387
-rw-r--r--vpp/vnet/vnet/ip/ip4_source_and_port_range_check.c1415
-rw-r--r--vpp/vnet/vnet/ip/ip4_source_check.c573
-rw-r--r--vpp/vnet/vnet/ip/ip4_test.c340
-rw-r--r--vpp/vnet/vnet/ip/ip6.h476
-rw-r--r--vpp/vnet/vnet/ip/ip6_error.h92
-rw-r--r--vpp/vnet/vnet/ip/ip6_format.c383
-rw-r--r--vpp/vnet/vnet/ip/ip6_forward.c3402
-rw-r--r--vpp/vnet/vnet/ip/ip6_hop_by_hop.c1194
-rw-r--r--vpp/vnet/vnet/ip/ip6_hop_by_hop.h217
-rw-r--r--vpp/vnet/vnet/ip/ip6_hop_by_hop_packet.h66
-rw-r--r--vpp/vnet/vnet/ip/ip6_input.c353
-rw-r--r--vpp/vnet/vnet/ip/ip6_neighbor.c4079
-rw-r--r--vpp/vnet/vnet/ip/ip6_neighbor.h52
-rw-r--r--vpp/vnet/vnet/ip/ip6_packet.h499
-rw-r--r--vpp/vnet/vnet/ip/ip6_pg.c231
-rw-r--r--vpp/vnet/vnet/ip/ip_api.c1196
-rw-r--r--vpp/vnet/vnet/ip/ip_checksum.c228
-rw-r--r--vpp/vnet/vnet/ip/ip_frag.c581
-rw-r--r--vpp/vnet/vnet/ip/ip_frag.h96
-rw-r--r--vpp/vnet/vnet/ip/ip_init.c152
-rw-r--r--vpp/vnet/vnet/ip/ip_input_acl.c450
-rw-r--r--vpp/vnet/vnet/ip/ip_packet.h180
-rw-r--r--vpp/vnet/vnet/ip/ip_source_and_port_range_check.h148
-rw-r--r--vpp/vnet/vnet/ip/lookup.c967
-rw-r--r--vpp/vnet/vnet/ip/lookup.h498
-rw-r--r--vpp/vnet/vnet/ip/ping.c888
-rw-r--r--vpp/vnet/vnet/ip/ping.h108
-rw-r--r--vpp/vnet/vnet/ip/ports.def757
-rw-r--r--vpp/vnet/vnet/ip/protocols.def162
-rw-r--r--vpp/vnet/vnet/ip/punt.c323
-rw-r--r--vpp/vnet/vnet/ip/punt.h43
-rw-r--r--vpp/vnet/vnet/ip/punt_error.def19
-rw-r--r--vpp/vnet/vnet/ip/tcp_packet.h138
-rw-r--r--vpp/vnet/vnet/ip/udp.h313
-rw-r--r--vpp/vnet/vnet/ip/udp_error.def21
-rw-r--r--vpp/vnet/vnet/ip/udp_format.c91
-rw-r--r--vpp/vnet/vnet/ip/udp_init.c71
-rw-r--r--vpp/vnet/vnet/ip/udp_local.c645
-rw-r--r--vpp/vnet/vnet/ip/udp_packet.h65
-rw-r--r--vpp/vnet/vnet/ip/udp_pg.c237
-rw-r--r--vpp/vnet/vnet/ipsec-gre/dir.dox18
-rw-r--r--vpp/vnet/vnet/ipsec-gre/error.def26
-rw-r--r--vpp/vnet/vnet/ipsec-gre/interface.c311
-rw-r--r--vpp/vnet/vnet/ipsec-gre/ipsec_gre.c407
-rw-r--r--vpp/vnet/vnet/ipsec-gre/ipsec_gre.h114
-rw-r--r--vpp/vnet/vnet/ipsec-gre/ipsec_gre_doc.md74
-rw-r--r--vpp/vnet/vnet/ipsec-gre/node.c433
-rw-r--r--vpp/vnet/vnet/ipsec/esp.h320
-rw-r--r--vpp/vnet/vnet/ipsec/esp_decrypt.c430
-rw-r--r--vpp/vnet/vnet/ipsec/esp_encrypt.c425
-rw-r--r--vpp/vnet/vnet/ipsec/ikev2.c2186
-rw-r--r--vpp/vnet/vnet/ipsec/ikev2.h410
-rw-r--r--vpp/vnet/vnet/ipsec/ikev2_cli.c479
-rw-r--r--vpp/vnet/vnet/ipsec/ikev2_crypto.c765
-rw-r--r--vpp/vnet/vnet/ipsec/ikev2_format.c155
-rw-r--r--vpp/vnet/vnet/ipsec/ikev2_payload.c535
-rw-r--r--vpp/vnet/vnet/ipsec/ikev2_priv.h321
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec.c581
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec.h344
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec_cli.c807
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec_format.c141
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec_if.c372
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec_if_in.c175
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec_if_out.c161
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec_input.c455
-rw-r--r--vpp/vnet/vnet/ipsec/ipsec_output.c478
-rw-r--r--vpp/vnet/vnet/l2/dir.dox24
-rw-r--r--vpp/vnet/vnet/l2/feat_bitmap.c185
-rw-r--r--vpp/vnet/vnet/l2/feat_bitmap.h96
-rw-r--r--vpp/vnet/vnet/l2/l2.api38
-rw-r--r--vpp/vnet/vnet/l2/l2_api.c140
-rw-r--r--vpp/vnet/vnet/l2/l2_bd.c1079
-rw-r--r--vpp/vnet/vnet/l2/l2_bd.h150
-rw-r--r--vpp/vnet/vnet/l2/l2_bvi.c40
-rw-r--r--vpp/vnet/vnet/l2/l2_bvi.h117
-rw-r--r--vpp/vnet/vnet/l2/l2_classify.h116
-rw-r--r--vpp/vnet/vnet/l2/l2_efp_filter.c614
-rw-r--r--vpp/vnet/vnet/l2/l2_efp_filter.h33
-rw-r--r--vpp/vnet/vnet/l2/l2_fib.c857
-rw-r--r--vpp/vnet/vnet/l2/l2_fib.h341
-rw-r--r--vpp/vnet/vnet/l2/l2_flood.c568
-rw-r--r--vpp/vnet/vnet/l2/l2_flood.h35
-rw-r--r--vpp/vnet/vnet/l2/l2_fwd.c544
-rw-r--r--vpp/vnet/vnet/l2/l2_fwd.h36
-rw-r--r--vpp/vnet/vnet/l2/l2_input.c1117
-rw-r--r--vpp/vnet/vnet/l2/l2_input.h266
-rw-r--r--vpp/vnet/vnet/l2/l2_input_acl.c434
-rw-r--r--vpp/vnet/vnet/l2/l2_input_classify.c655
-rw-r--r--vpp/vnet/vnet/l2/l2_input_vtr.c401
-rw-r--r--vpp/vnet/vnet/l2/l2_input_vtr.h54
-rw-r--r--vpp/vnet/vnet/l2/l2_learn.c597
-rw-r--r--vpp/vnet/vnet/l2/l2_learn.h64
-rw-r--r--vpp/vnet/vnet/l2/l2_output.c708
-rw-r--r--vpp/vnet/vnet/l2/l2_output.h298
-rw-r--r--vpp/vnet/vnet/l2/l2_output_acl.c358
-rw-r--r--vpp/vnet/vnet/l2/l2_output_classify.c657
-rw-r--r--vpp/vnet/vnet/l2/l2_patch.c452
-rw-r--r--vpp/vnet/vnet/l2/l2_rw.c719
-rw-r--r--vpp/vnet/vnet/l2/l2_rw.h95
-rw-r--r--vpp/vnet/vnet/l2/l2_vtr.c770
-rw-r--r--vpp/vnet/vnet/l2/l2_vtr.h270
-rw-r--r--vpp/vnet/vnet/l2/l2_xcrw.c591
-rw-r--r--vpp/vnet/vnet/l2/l2_xcrw.h91
-rw-r--r--vpp/vnet/vnet/l2tp/decap.c309
-rw-r--r--vpp/vnet/vnet/l2tp/encap.c238
-rw-r--r--vpp/vnet/vnet/l2tp/l2tp.c739
-rw-r--r--vpp/vnet/vnet/l2tp/l2tp.h147
-rw-r--r--vpp/vnet/vnet/l2tp/packet.h44
-rw-r--r--vpp/vnet/vnet/l2tp/pg.c106
-rw-r--r--vpp/vnet/vnet/l3_types.h59
-rw-r--r--vpp/vnet/vnet/lawful-intercept/lawful_intercept.c112
-rw-r--r--vpp/vnet/vnet/lawful-intercept/lawful_intercept.h45
-rw-r--r--vpp/vnet/vnet/lawful-intercept/node.c275
-rw-r--r--vpp/vnet/vnet/lisp-cp/control.c4955
-rw-r--r--vpp/vnet/vnet/lisp-cp/control.h314
-rw-r--r--vpp/vnet/vnet/lisp-cp/gid_dictionary.c865
-rw-r--r--vpp/vnet/vnet/lisp-cp/gid_dictionary.h120
-rw-r--r--vpp/vnet/vnet/lisp-cp/lisp_cp_dpo.c117
-rw-r--r--vpp/vnet/vnet/lisp-cp/lisp_cp_dpo.h45
-rw-r--r--vpp/vnet/vnet/lisp-cp/lisp_cp_messages.h613
-rw-r--r--vpp/vnet/vnet/lisp-cp/lisp_msg_serdes.c372
-rw-r--r--vpp/vnet/vnet/lisp-cp/lisp_msg_serdes.h58
-rw-r--r--vpp/vnet/vnet/lisp-cp/lisp_types.c1577
-rw-r--r--vpp/vnet/vnet/lisp-cp/lisp_types.h354
-rw-r--r--vpp/vnet/vnet/lisp-cp/packets.c269
-rw-r--r--vpp/vnet/vnet/lisp-cp/packets.h82
-rw-r--r--vpp/vnet/vnet/lisp-gpe/decap.c501
-rw-r--r--vpp/vnet/vnet/lisp-gpe/dir.dox26
-rw-r--r--vpp/vnet/vnet/lisp-gpe/interface.c709
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe.c327
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe.h257
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_adjacency.c542
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_adjacency.h136
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_error.def18
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.c1053
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_fwd_entry.h188
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_packet.h149
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_sub_interface.c278
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_sub_interface.h157
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_tenant.c330
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_tenant.h88
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_tunnel.c289
-rw-r--r--vpp/vnet/vnet/lisp-gpe/lisp_gpe_tunnel.h89
-rw-r--r--vpp/vnet/vnet/lisp-gpe/rfc.txt826
-rw-r--r--vpp/vnet/vnet/llc/llc.c241
-rw-r--r--vpp/vnet/vnet/llc/llc.h194
-rw-r--r--vpp/vnet/vnet/llc/node.c331
-rw-r--r--vpp/vnet/vnet/llc/pg.c113
-rw-r--r--vpp/vnet/vnet/lldp/dir.dox18
-rw-r--r--vpp/vnet/vnet/lldp/lldp_cli.c646
-rw-r--r--vpp/vnet/vnet/lldp/lldp_doc.md84
-rw-r--r--vpp/vnet/vnet/lldp/lldp_input.c302
-rw-r--r--vpp/vnet/vnet/lldp/lldp_node.c341
-rw-r--r--vpp/vnet/vnet/lldp/lldp_node.h145
-rw-r--r--vpp/vnet/vnet/lldp/lldp_output.c216
-rw-r--r--vpp/vnet/vnet/lldp/lldp_protocol.h142
-rwxr-xr-xvpp/vnet/vnet/map/examples/gen-rules.py186
-rw-r--r--vpp/vnet/vnet/map/examples/health_check.c109
-rwxr-xr-xvpp/vnet/vnet/map/examples/test_map.py141
-rwxr-xr-xvpp/vnet/vnet/map/gen-rules.py107
-rw-r--r--vpp/vnet/vnet/map/ip4_map.c813
-rw-r--r--vpp/vnet/vnet/map/ip4_map_t.c1363
-rw-r--r--vpp/vnet/vnet/map/ip6_map.c1269
-rw-r--r--vpp/vnet/vnet/map/ip6_map_t.c1517
-rw-r--r--vpp/vnet/vnet/map/map.api178
-rw-r--r--vpp/vnet/vnet/map/map.c2166
-rw-r--r--vpp/vnet/vnet/map/map.h591
-rw-r--r--vpp/vnet/vnet/map/map_api.c295
-rw-r--r--vpp/vnet/vnet/map/map_doc.md69
-rw-r--r--vpp/vnet/vnet/map/map_dpo.c191
-rw-r--r--vpp/vnet/vnet/map/map_dpo.h67
-rw-r--r--vpp/vnet/vnet/map/test.c205
-rw-r--r--vpp/vnet/vnet/mcast/mcast.c565
-rw-r--r--vpp/vnet/vnet/mcast/mcast.h50
-rw-r--r--vpp/vnet/vnet/mcast/mcast_test.c149
-rw-r--r--vpp/vnet/vnet/misc.c124
-rw-r--r--vpp/vnet/vnet/mpls/error.def31
-rw-r--r--vpp/vnet/vnet/mpls/interface.c121
-rw-r--r--vpp/vnet/vnet/mpls/mpls.c511
-rw-r--r--vpp/vnet/vnet/mpls/mpls.h172
-rw-r--r--vpp/vnet/vnet/mpls/mpls_features.c156
-rw-r--r--vpp/vnet/vnet/mpls/mpls_lookup.c531
-rw-r--r--vpp/vnet/vnet/mpls/mpls_output.c479
-rw-r--r--vpp/vnet/vnet/mpls/mpls_tunnel.c787
-rw-r--r--vpp/vnet/vnet/mpls/mpls_tunnel.h98
-rw-r--r--vpp/vnet/vnet/mpls/mpls_types.h39
-rw-r--r--vpp/vnet/vnet/mpls/node.c303
-rw-r--r--vpp/vnet/vnet/mpls/packet.h125
-rw-r--r--vpp/vnet/vnet/mpls/pg.c71
-rw-r--r--vpp/vnet/vnet/osi/node.c326
-rw-r--r--vpp/vnet/vnet/osi/osi.c201
-rw-r--r--vpp/vnet/vnet/osi/osi.h171
-rw-r--r--vpp/vnet/vnet/osi/pg.c106
-rw-r--r--vpp/vnet/vnet/pg/cli.c636
-rw-r--r--vpp/vnet/vnet/pg/edit.c186
-rw-r--r--vpp/vnet/vnet/pg/edit.h210
-rw-r--r--vpp/vnet/vnet/pg/example.script6
-rw-r--r--vpp/vnet/vnet/pg/init.c72
-rw-r--r--vpp/vnet/vnet/pg/input.c1667
-rw-r--r--vpp/vnet/vnet/pg/output.c85
-rw-r--r--vpp/vnet/vnet/pg/pg.h383
-rw-r--r--vpp/vnet/vnet/pg/stream.c497
-rw-r--r--vpp/vnet/vnet/pipeline.h456
-rw-r--r--vpp/vnet/vnet/plugin/p1.c52
-rw-r--r--vpp/vnet/vnet/plugin/plugin.h32
-rw-r--r--vpp/vnet/vnet/policer/node_funcs.c938
-rw-r--r--vpp/vnet/vnet/policer/police.h214
-rw-r--r--vpp/vnet/vnet/policer/policer.c528
-rw-r--r--vpp/vnet/vnet/policer/policer.h107
-rw-r--r--vpp/vnet/vnet/policer/xlate.c1505
-rw-r--r--vpp/vnet/vnet/policer/xlate.h186
-rw-r--r--vpp/vnet/vnet/ppp/error.def42
-rw-r--r--vpp/vnet/vnet/ppp/node.c368
-rw-r--r--vpp/vnet/vnet/ppp/packet.h199
-rw-r--r--vpp/vnet/vnet/ppp/pg.c114
-rw-r--r--vpp/vnet/vnet/ppp/ppp.c261
-rw-r--r--vpp/vnet/vnet/ppp/ppp.h135
-rw-r--r--vpp/vnet/vnet/replication.c293
-rw-r--r--vpp/vnet/vnet/replication.h136
-rw-r--r--vpp/vnet/vnet/rewrite.c329
-rw-r--r--vpp/vnet/vnet/rewrite.h305
-rw-r--r--vpp/vnet/vnet/snap/node.c353
-rw-r--r--vpp/vnet/vnet/snap/pg.c116
-rw-r--r--vpp/vnet/vnet/snap/snap.c204
-rw-r--r--vpp/vnet/vnet/snap/snap.h209
-rw-r--r--vpp/vnet/vnet/span/node.c286
-rw-r--r--vpp/vnet/vnet/span/span.api60
-rw-r--r--vpp/vnet/vnet/span/span.c197
-rw-r--r--vpp/vnet/vnet/span/span.h62
-rw-r--r--vpp/vnet/vnet/span/span.md65
-rw-r--r--vpp/vnet/vnet/span/span_api.c153
-rw-r--r--vpp/vnet/vnet/sr/dir.dox25
-rw-r--r--vpp/vnet/vnet/sr/examples/sr_multicastmap.script4
-rw-r--r--vpp/vnet/vnet/sr/rfc_draft_05.txt1265
-rw-r--r--vpp/vnet/vnet/sr/sr.c3333
-rw-r--r--vpp/vnet/vnet/sr/sr.h262
-rw-r--r--vpp/vnet/vnet/sr/sr_error.def20
-rw-r--r--vpp/vnet/vnet/sr/sr_fix_dst_error.def17
-rw-r--r--vpp/vnet/vnet/sr/sr_packet.h251
-rw-r--r--vpp/vnet/vnet/sr/sr_replicate.c490
-rw-r--r--vpp/vnet/vnet/srp/format.c147
-rw-r--r--vpp/vnet/vnet/srp/interface.c458
-rw-r--r--vpp/vnet/vnet/srp/node.c932
-rw-r--r--vpp/vnet/vnet/srp/packet.h204
-rw-r--r--vpp/vnet/vnet/srp/pg.c157
-rw-r--r--vpp/vnet/vnet/srp/srp.h222
-rw-r--r--vpp/vnet/vnet/unix/gdb_funcs.c171
-rw-r--r--vpp/vnet/vnet/unix/pcap.c241
-rw-r--r--vpp/vnet/vnet/unix/pcap.h230
-rw-r--r--vpp/vnet/vnet/unix/pcap2pg.c182
-rw-r--r--vpp/vnet/vnet/unix/tap.api123
-rw-r--r--vpp/vnet/vnet/unix/tap_api.c257
-rw-r--r--vpp/vnet/vnet/unix/tapcli.c1328
-rw-r--r--vpp/vnet/vnet/unix/tapcli.h52
-rw-r--r--vpp/vnet/vnet/unix/tuntap.c1000
-rw-r--r--vpp/vnet/vnet/unix/tuntap.h36
-rw-r--r--vpp/vnet/vnet/vnet.h96
-rw-r--r--vpp/vnet/vnet/vnet_all_api_h.h45
-rw-r--r--vpp/vnet/vnet/vnet_msg_enum.h37
-rw-r--r--vpp/vnet/vnet/vxlan-gpe/decap.c733
-rw-r--r--vpp/vnet/vnet/vxlan-gpe/dir.dox32
-rw-r--r--vpp/vnet/vnet/vxlan-gpe/encap.c388
-rw-r--r--vpp/vnet/vnet/vxlan-gpe/vxlan-gpe-rfc.txt868
-rw-r--r--vpp/vnet/vnet/vxlan-gpe/vxlan_gpe.c659
-rw-r--r--vpp/vnet/vnet/vxlan-gpe/vxlan_gpe.h221
-rw-r--r--vpp/vnet/vnet/vxlan-gpe/vxlan_gpe_error.def16
-rw-r--r--vpp/vnet/vnet/vxlan-gpe/vxlan_gpe_packet.h110
-rw-r--r--vpp/vnet/vnet/vxlan/decap.c1130
-rw-r--r--vpp/vnet/vnet/vxlan/dir.dox24
-rw-r--r--vpp/vnet/vnet/vxlan/encap.c553
-rw-r--r--vpp/vnet/vnet/vxlan/vxlan.c903
-rw-r--r--vpp/vnet/vnet/vxlan/vxlan.h199
-rw-r--r--vpp/vnet/vnet/vxlan/vxlan_error.def17
-rw-r--r--vpp/vnet/vnet/vxlan/vxlan_packet.h69
-rw-r--r--vpp/vpp-api-test/Makefile.am37
-rw-r--r--vpp/vpp-api-test/configure.ac40
-rwxr-xr-xvpp/vpp-api-test/scripts/vppctl121
-rw-r--r--vpp/vpp-api-test/vat/api_format.c17806
-rw-r--r--vpp/vpp-api-test/vat/json_format.c304
-rw-r--r--vpp/vpp-api-test/vat/json_format.h254
-rw-r--r--vpp/vpp-api-test/vat/json_test.c75
-rw-r--r--vpp/vpp-api-test/vat/main.c401
-rw-r--r--vpp/vpp-api-test/vat/plugin.c201
-rw-r--r--vpp/vpp-api-test/vat/plugin.h61
-rw-r--r--vpp/vpp-api-test/vat/plugin_api.c216
-rw-r--r--vpp/vpp-api-test/vat/restart.c246
-rw-r--r--vpp/vpp-api-test/vat/vat.h232
-rw-r--r--vpp/vpp-api/Makefile.am2
-rw-r--r--vpp/vpp-api/configure.ac13
-rw-r--r--vpp/vpp-api/java/Makefile.am121
-rw-r--r--vpp/vpp-api/java/Readme.txt236
-rw-r--r--vpp/vpp-api/java/configure.ac24
-rw-r--r--vpp/vpp-api/java/jvpp-common/jvpp_common.c65
-rw-r--r--vpp/vpp-api/java/jvpp-common/jvpp_common.h67
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/CallbackApiTest.java96
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/CallbackJVppFacadeNotificationTest.java87
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/CallbackJVppFacadeTest.java103
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/CallbackNotificationApiTest.java94
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/ControlPingTest.java68
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/CreateSubInterfaceTest.java120
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/FutureApiNotificationTest.java55
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/FutureApiTest.java123
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/L2AclTest.java195
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/LispAdjacencyTest.java124
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/NotificationUtils.java53
-rw-r--r--vpp/vpp-api/java/jvpp-core/io/fd/vpp/jvpp/core/test/Readme.txt17
-rw-r--r--vpp/vpp-api/java/jvpp-core/jvpp_core.c117
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVpp.java56
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVppRegistry.java76
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/JVppRegistryImpl.java147
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/NativeLibraryLoader.java73
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/VppBaseCallException.java60
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/VppCallbackException.java47
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/VppConnection.java45
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/VppInvocationException.java33
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/VppJNIConnection.java137
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/callback/ControlPingCallback.java29
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/callback/JVppCallback.java29
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/callback/JVppNotificationCallback.java24
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/dto/ControlPing.java34
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/dto/ControlPingReply.java58
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/dto/JVppDump.java24
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/dto/JVppNotification.java23
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/dto/JVppReply.java24
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/dto/JVppReplyDump.java25
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/dto/JVppRequest.java34
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/future/AbstractFutureJVppInvoker.java141
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/future/FutureJVppInvoker.java49
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/notification/NotificationRegistry.java25
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/notification/NotificationRegistryProvider.java28
-rw-r--r--vpp/vpp-api/java/jvpp-registry/io/fd/vpp/jvpp/test/ConnectionTest.java44
-rw-r--r--vpp/vpp-api/java/jvpp-registry/jvpp_registry.c352
-rwxr-xr-xvpp/vpp-api/java/jvpp/gen/jvpp_gen.py166
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/__init__.py0
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/callback_gen.py105
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/dto_gen.py308
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/jni_gen.py295
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/jvpp_c_gen.py343
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/jvpp_callback_facade_gen.py324
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/jvpp_future_facade_gen.py331
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/jvpp_impl_gen.py219
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/notification_gen.py199
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/types_gen.py227
-rw-r--r--vpp/vpp-api/java/jvpp/gen/jvppgen/util.py220
-rw-r--r--vpp/vpp-api/java/m4/ax_check_java_home.m480
-rw-r--r--vpp/vpp-api/java/m4/ax_check_java_plugin.m4101
-rw-r--r--vpp/vpp-api/java/m4/ax_java_check_class.m485
-rw-r--r--vpp/vpp-api/java/m4/ax_java_options.m448
-rw-r--r--vpp/vpp-api/java/m4/ax_libgcj_jar.m483
-rw-r--r--vpp/vpp-api/java/m4/ax_prog_jar.m449
-rw-r--r--vpp/vpp-api/java/m4/ax_prog_java.m4115
-rw-r--r--vpp/vpp-api/java/m4/ax_prog_java_cc.m4104
-rw-r--r--vpp/vpp-api/java/m4/ax_prog_java_works.m4134
-rw-r--r--vpp/vpp-api/java/m4/ax_prog_javac.m479
-rw-r--r--vpp/vpp-api/java/m4/ax_prog_javac_works.m472
-rw-r--r--vpp/vpp-api/java/m4/ax_prog_javadoc.m450
-rw-r--r--vpp/vpp-api/java/m4/ax_prog_javah.m464
-rw-r--r--vpp/vpp-api/java/m4/ax_try_compile_java.m455
-rw-r--r--vpp/vpp-api/java/m4/ax_try_run_java.m456
-rw-r--r--vpp/vpp-api/lua/README.md50
-rw-r--r--vpp/vpp-api/lua/bench.lua70
-rw-r--r--vpp/vpp-api/lua/examples/cli/README.md5
-rw-r--r--vpp/vpp-api/lua/examples/cli/lua-cli.lua747
-rw-r--r--vpp/vpp-api/lua/examples/example-acl-plugin.lua110
-rw-r--r--vpp/vpp-api/lua/examples/example-classifier.lua51
-rw-r--r--vpp/vpp-api/lua/examples/example-cli.lua44
-rw-r--r--vpp/vpp-api/lua/examples/lute/README.md66
-rw-r--r--vpp/vpp-api/lua/examples/lute/lute.lua777
-rw-r--r--vpp/vpp-api/lua/examples/lute/script-inout-acl-noacl.lute329
-rw-r--r--vpp/vpp-api/lua/examples/lute/script-inout-acl-old.lute329
-rw-r--r--vpp/vpp-api/lua/examples/lute/script-inout-acl.lute329
-rw-r--r--vpp/vpp-api/lua/examples/lute/script.lute7
-rw-r--r--vpp/vpp-api/lua/examples/lute/sessions-acl.lute308
-rw-r--r--vpp/vpp-api/lua/vpp-lapi.lua989
-rw-r--r--vpp/vpp-api/python/Makefile.am51
-rw-r--r--vpp/vpp-api/python/README.rst0
-rw-r--r--vpp/vpp-api/python/pneum/pneum.c259
-rw-r--r--vpp/vpp-api/python/pneum/pneum.h31
-rw-r--r--vpp/vpp-api/python/pneum/test_pneum.c143
-rw-r--r--vpp/vpp-api/python/setup.cfg5
-rw-r--r--vpp/vpp-api/python/setup.py35
-rwxr-xr-xvpp/vpp-api/python/tests/test_cli.py52
-rwxr-xr-xvpp/vpp-api/python/tests/test_modules.py18
-rwxr-xr-xvpp/vpp-api/python/tests/test_papi.py119
-rwxr-xr-xvpp/vpp-api/python/tests/test_version.py35
-rwxr-xr-xvpp/vpp-api/python/tests/test_vpp_papi2.py487
-rw-r--r--vpp/vpp-api/python/vpp_papi/__init__.py3
-rw-r--r--vpp/vpp-api/python/vpp_papi/pneum_wrap.c200
-rw-r--r--vpp/vpp-api/python/vpp_papi/vpp_papi.py585
-rw-r--r--vpp/vpp/Makefile.am155
-rw-r--r--vpp/vpp/app/l2t.c557
-rw-r--r--vpp/vpp/app/l2t_l2.c267
-rw-r--r--vpp/vpp/app/sticky_hash.c581
-rw-r--r--vpp/vpp/app/version.c102
-rw-r--r--vpp/vpp/app/vpe_cli.c123
-rw-r--r--vpp/vpp/conf/80-vpp.conf15
-rw-r--r--vpp/vpp/conf/startup.conf99
-rw-r--r--vpp/vpp/conf/startup.uiopcigeneric.conf18
-rw-r--r--vpp/vpp/configure.ac67
-rw-r--r--vpp/vpp/oam/oam.c648
-rw-r--r--vpp/vpp/oam/oam.h96
-rw-r--r--vpp/vpp/stats/stats.c987
-rw-r--r--vpp/vpp/stats/stats.h76
l---------vpp/vpp/suffix-rules.mk1
-rw-r--r--vpp/vpp/vnet/main.c414
-rw-r--r--vpp/vpp/vpp-api/api.c7485
-rw-r--r--vpp/vpp/vpp-api/custom_dump.c3139
-rw-r--r--vpp/vpp/vpp-api/gmon.c319
-rw-r--r--vpp/vpp/vpp-api/summary_stats_client.c302
-rw-r--r--vpp/vpp/vpp-api/test_client.c1531
-rw-r--r--vpp/vpp/vpp-api/test_ha.c249
-rw-r--r--vpp/vpp/vpp-api/vpe.api4848
-rw-r--r--vpp/vpp/vpp-api/vpe_all_api_h.h37
-rw-r--r--vpp/vpp/vpp-api/vpe_msg_enum.h37
-rw-r--r--vpp/vpp/vpp-api/vpp_get_metrics.c253
-rw-r--r--vpp/vppapigen/Makefile.am29
-rw-r--r--vpp/vppapigen/configure.ac14
-rw-r--r--vpp/vppapigen/gram.y90
-rw-r--r--vpp/vppapigen/lex.c1067
-rw-r--r--vpp/vppapigen/lex.h50
-rw-r--r--vpp/vppapigen/node.c1531
-rw-r--r--vpp/vppapigen/node.h94
-rw-r--r--vpp/vppinfra/.gitignore1
-rw-r--r--vpp/vppinfra/INSTALL236
-rw-r--r--vpp/vppinfra/Make.defs129
-rw-r--r--vpp/vppinfra/Makefile.am275
-rw-r--r--vpp/vppinfra/README43
-rw-r--r--vpp/vppinfra/configure.ac52
-rw-r--r--vpp/vppinfra/dir.dox19
-rwxr-xr-xvpp/vppinfra/mkinstalldirs111
-rw-r--r--vpp/vppinfra/tools/dir.dox19
-rw-r--r--vpp/vppinfra/tools/elftool.c464
-rw-r--r--vpp/vppinfra/unix_error.def145
-rw-r--r--vpp/vppinfra/vppinfra/anneal.c172
-rw-r--r--vpp/vppinfra/vppinfra/anneal.h89
-rw-r--r--vpp/vppinfra/vppinfra/asm_mips.h351
-rw-r--r--vpp/vppinfra/vppinfra/asm_x86.c1947
-rw-r--r--vpp/vppinfra/vppinfra/asm_x86.h125
-rw-r--r--vpp/vppinfra/vppinfra/backtrace.c267
-rw-r--r--vpp/vppinfra/vppinfra/bihash_24_8.h85
-rw-r--r--vpp/vppinfra/vppinfra/bihash_8_8.h98
-rw-r--r--vpp/vppinfra/vppinfra/bihash_doc.h149
-rw-r--r--vpp/vppinfra/vppinfra/bihash_template.c455
-rw-r--r--vpp/vppinfra/vppinfra/bihash_template.h214
-rw-r--r--vpp/vppinfra/vppinfra/bitmap.h774
-rw-r--r--vpp/vppinfra/vppinfra/bitops.h179
-rw-r--r--vpp/vppinfra/vppinfra/byte_order.h202
-rw-r--r--vpp/vppinfra/vppinfra/cache.h104
-rw-r--r--vpp/vppinfra/vppinfra/clib.h359
-rw-r--r--vpp/vppinfra/vppinfra/cpu.c133
-rw-r--r--vpp/vppinfra/vppinfra/cpu.h112
-rw-r--r--vpp/vppinfra/vppinfra/dir.dox19
-rw-r--r--vpp/vppinfra/vppinfra/dlist.h156
-rw-r--r--vpp/vppinfra/vppinfra/elf.c2040
-rw-r--r--vpp/vppinfra/vppinfra/elf.h1062
-rw-r--r--vpp/vppinfra/vppinfra/elf_clib.c377
-rw-r--r--vpp/vppinfra/vppinfra/elf_clib.h144
-rw-r--r--vpp/vppinfra/vppinfra/elog.c1061
-rw-r--r--vpp/vppinfra/vppinfra/elog.h460
-rw-r--r--vpp/vppinfra/vppinfra/error.c292
-rw-r--r--vpp/vppinfra/vppinfra/error.h201
-rw-r--r--vpp/vppinfra/vppinfra/error_bootstrap.h106
-rw-r--r--vpp/vppinfra/vppinfra/fheap.c473
-rw-r--r--vpp/vppinfra/vppinfra/fheap.h140
-rw-r--r--vpp/vppinfra/vppinfra/fifo.c137
-rw-r--r--vpp/vppinfra/vppinfra/fifo.h304
-rw-r--r--vpp/vppinfra/vppinfra/format.c814
-rw-r--r--vpp/vppinfra/vppinfra/format.h331
-rw-r--r--vpp/vppinfra/vppinfra/graph.c182
-rw-r--r--vpp/vppinfra/vppinfra/graph.h127
-rw-r--r--vpp/vppinfra/vppinfra/hash.c1095
-rw-r--r--vpp/vppinfra/vppinfra/hash.h699
-rw-r--r--vpp/vppinfra/vppinfra/heap.c828
-rw-r--r--vpp/vppinfra/vppinfra/heap.h357
-rw-r--r--vpp/vppinfra/vppinfra/longjmp.S690
-rw-r--r--vpp/vppinfra/vppinfra/longjmp.h124
-rw-r--r--vpp/vppinfra/vppinfra/macros.c266
-rw-r--r--vpp/vppinfra/vppinfra/macros.h54
-rw-r--r--vpp/vppinfra/vppinfra/math.h63
-rw-r--r--vpp/vppinfra/vppinfra/md5.c317
-rw-r--r--vpp/vppinfra/vppinfra/md5.h57
-rw-r--r--vpp/vppinfra/vppinfra/mem.h291
-rw-r--r--vpp/vppinfra/vppinfra/mem_mheap.c165
-rw-r--r--vpp/vppinfra/vppinfra/memcheck.h317
-rw-r--r--vpp/vppinfra/vppinfra/memcpy_avx.h293
-rw-r--r--vpp/vppinfra/vppinfra/memcpy_sse3.h355
-rw-r--r--vpp/vppinfra/vppinfra/mhash.c408
-rw-r--r--vpp/vppinfra/vppinfra/mhash.h179
-rw-r--r--vpp/vppinfra/vppinfra/mheap.c1649
-rw-r--r--vpp/vppinfra/vppinfra/mheap.h94
-rw-r--r--vpp/vppinfra/vppinfra/mheap_bootstrap.h374
-rw-r--r--vpp/vppinfra/vppinfra/mod_test_hash.c27
-rw-r--r--vpp/vppinfra/vppinfra/os.h72
-rw-r--r--vpp/vppinfra/vppinfra/pfhash.c689
-rw-r--r--vpp/vppinfra/vppinfra/pfhash.h276
-rw-r--r--vpp/vppinfra/vppinfra/phash.c1017
-rw-r--r--vpp/vppinfra/vppinfra/phash.h194
-rw-r--r--vpp/vppinfra/vppinfra/pipeline.h176
-rw-r--r--vpp/vppinfra/vppinfra/pool.h405
-rw-r--r--vpp/vppinfra/vppinfra/ptclosure.c125
-rw-r--r--vpp/vppinfra/vppinfra/ptclosure.h40
-rw-r--r--vpp/vppinfra/vppinfra/qhash.c858
-rw-r--r--vpp/vppinfra/vppinfra/qhash.h169
-rw-r--r--vpp/vppinfra/vppinfra/qsort.c269
-rw-r--r--vpp/vppinfra/vppinfra/random.c51
-rw-r--r--vpp/vppinfra/vppinfra/random.h178
-rw-r--r--vpp/vppinfra/vppinfra/random_buffer.c86
-rw-r--r--vpp/vppinfra/vppinfra/random_buffer.h118
-rw-r--r--vpp/vppinfra/vppinfra/random_isaac.c434
-rw-r--r--vpp/vppinfra/vppinfra/random_isaac.h81
-rw-r--r--vpp/vppinfra/vppinfra/serialize.c1254
-rw-r--r--vpp/vppinfra/vppinfra/serialize.h443
-rw-r--r--vpp/vppinfra/vppinfra/slist.c336
-rw-r--r--vpp/vppinfra/vppinfra/slist.h145
-rw-r--r--vpp/vppinfra/vppinfra/smp.c325
-rw-r--r--vpp/vppinfra/vppinfra/smp.h81
-rw-r--r--vpp/vppinfra/vppinfra/smp_fifo.c91
-rw-r--r--vpp/vppinfra/vppinfra/smp_fifo.h313
-rw-r--r--vpp/vppinfra/vppinfra/socket.c422
-rw-r--r--vpp/vppinfra/vppinfra/socket.h160
-rw-r--r--vpp/vppinfra/vppinfra/sparse_vec.h244
-rw-r--r--vpp/vppinfra/vppinfra/std-formats.c330
-rw-r--r--vpp/vppinfra/vppinfra/string.c94
-rw-r--r--vpp/vppinfra/vppinfra/string.h83
-rw-r--r--vpp/vppinfra/vppinfra/test_bihash_template.c297
-rw-r--r--vpp/vppinfra/vppinfra/test_dlist.c193
-rw-r--r--vpp/vppinfra/vppinfra/test_elf.c217
-rw-r--r--vpp/vppinfra/vppinfra/test_elog.c262
-rw-r--r--vpp/vppinfra/vppinfra/test_fifo.c144
-rw-r--r--vpp/vppinfra/vppinfra/test_format.c199
-rw-r--r--vpp/vppinfra/vppinfra/test_hash.c458
-rw-r--r--vpp/vppinfra/vppinfra/test_heap.c198
-rw-r--r--vpp/vppinfra/vppinfra/test_longjmp.c129
-rw-r--r--vpp/vppinfra/vppinfra/test_macros.c64
-rw-r--r--vpp/vppinfra/vppinfra/test_md5.c141
-rw-r--r--vpp/vppinfra/vppinfra/test_mheap.c242
-rw-r--r--vpp/vppinfra/vppinfra/test_pfhash.c322
-rw-r--r--vpp/vppinfra/vppinfra/test_phash.c149
-rw-r--r--vpp/vppinfra/vppinfra/test_pool.c86
-rw-r--r--vpp/vppinfra/vppinfra/test_pool_iterate.c59
-rw-r--r--vpp/vppinfra/vppinfra/test_ptclosure.c212
-rw-r--r--vpp/vppinfra/vppinfra/test_qhash.c333
-rw-r--r--vpp/vppinfra/vppinfra/test_random.c148
-rw-r--r--vpp/vppinfra/vppinfra/test_random_isaac.c142
-rw-r--r--vpp/vppinfra/vppinfra/test_serialize.c274
-rw-r--r--vpp/vppinfra/vppinfra/test_slist.c228
-rw-r--r--vpp/vppinfra/vppinfra/test_socket.c134
-rw-r--r--vpp/vppinfra/vppinfra/test_time.c104
-rw-r--r--vpp/vppinfra/vppinfra/test_timing_wheel.c389
-rw-r--r--vpp/vppinfra/vppinfra/test_vec.c1159
-rw-r--r--vpp/vppinfra/vppinfra/test_vec.h243
-rw-r--r--vpp/vppinfra/vppinfra/test_vhash.c757
-rw-r--r--vpp/vppinfra/vppinfra/test_zvec.c117
-rw-r--r--vpp/vppinfra/vppinfra/time.c226
-rw-r--r--vpp/vppinfra/vppinfra/time.h298
-rw-r--r--vpp/vppinfra/vppinfra/timer.c322
-rw-r--r--vpp/vppinfra/vppinfra/timer.h46
-rw-r--r--vpp/vppinfra/vppinfra/timing_wheel.c750
-rw-r--r--vpp/vppinfra/vppinfra/timing_wheel.h155
-rw-r--r--vpp/vppinfra/vppinfra/types.h174
-rw-r--r--vpp/vppinfra/vppinfra/unformat.c1077
-rw-r--r--vpp/vppinfra/vppinfra/unix-formats.c918
-rw-r--r--vpp/vppinfra/vppinfra/unix-kelog.c415
-rw-r--r--vpp/vppinfra/vppinfra/unix-misc.c242
-rw-r--r--vpp/vppinfra/vppinfra/unix.h64
-rw-r--r--vpp/vppinfra/vppinfra/valgrind.h4030
-rw-r--r--vpp/vppinfra/vppinfra/vec.c171
-rw-r--r--vpp/vppinfra/vppinfra/vec.h973
-rw-r--r--vpp/vppinfra/vppinfra/vec_bootstrap.h201
-rw-r--r--vpp/vppinfra/vppinfra/vector.c54
-rw-r--r--vpp/vppinfra/vppinfra/vector.h268
-rw-r--r--vpp/vppinfra/vppinfra/vector_altivec.h178
-rw-r--r--vpp/vppinfra/vppinfra/vector_funcs.h334
-rw-r--r--vpp/vppinfra/vppinfra/vector_iwmmxt.h149
-rw-r--r--vpp/vppinfra/vppinfra/vector_neon.h71
-rw-r--r--vpp/vppinfra/vppinfra/vector_sse2.h711
-rw-r--r--vpp/vppinfra/vppinfra/vhash.c772
-rw-r--r--vpp/vppinfra/vppinfra/vhash.h850
-rw-r--r--vpp/vppinfra/vppinfra/vm_linux_kernel.h78
-rw-r--r--vpp/vppinfra/vppinfra/vm_standalone.h74
-rw-r--r--vpp/vppinfra/vppinfra/vm_unix.h106
-rw-r--r--vpp/vppinfra/vppinfra/xxhash.h86
-rw-r--r--vpp/vppinfra/vppinfra/xy.h56
-rw-r--r--vpp/vppinfra/vppinfra/zvec.c442
-rw-r--r--vpp/vppinfra/vppinfra/zvec.h166
1474 files changed, 520405 insertions, 0 deletions
diff --git a/vpp/.gitignore b/vpp/.gitignore
new file mode 100644
index 0000000..c12eedf
--- /dev/null
+++ b/vpp/.gitignore
@@ -0,0 +1,90 @@
+*~
+*.sw[op]
+
+/build-root/.ccache
+/build-root/build-*/
+/build-root/install-*/
+/build-root/tools
+/build-root/dpdk-includes/
+/build-root/packages-vpp/
+/build-root/path_setup
+/build-root/build-config.mk
+/build-root/deb/debian/vpp-plugins/
+/build-root/*.deb
+/build-root/*.rpm
+/build-root/*.changes
+/build-root/test-doc/
+/build-root/test-cov/
+/build-root/python/
+/build-config.mk
+/dpdk/*.tar.gz
+/dpdk/*.tar.xz
+/path_setup
+/tools/
+# start autotools ignore
+autom4te.cache/
+config/
+Makefile
+Makefile.in
+aclocal.m4
+app.info
+compile
+config.h
+config.h.in
+config.log
+config.guess
+config.sub
+config.status
+configure
+configure.scan
+coverage_report
+depcomp
+install-sh
+libtool
+m4
+missing
+stamp-h1
+ltmain.sh
+ylwrap
+test-driver
+
+.cproject
+*.iml
+.bootstrap.ok
+.settings
+# stop autotools ignore
+
+# OSX and some IDE
+.DS_Store
+.idea/
+.project
+
+# cscope and ctags
+/cscope.*
+/tags
+ID
+TAGS
+# ggtags
+GPATH
+GRTAGS
+GTAGS
+# Generated documentation
+/build-root/docs
+/build-root/.doxygen-bootstrap.ok
+/build-root/.doxygen-siphon.dep
+
+# indent backup files
+*.BAK
+
+# Python bytecode
+*.pyc
+
+# Python api generator
+/vpp-api/python/build
+/vpp-api/python/dist
+/vpp-api/python/vpp_papi.egg-info
+/vpp-api/python/vpp_papi/memclnt.py
+/vpp-api/python/vpp_papi/vpe.py
+
+# Build files in the test directory
+/test/*.ok
diff --git a/vpp/.gitreview b/vpp/.gitreview
new file mode 100644
index 0000000..3f0281c
--- /dev/null
+++ b/vpp/.gitreview
@@ -0,0 +1,5 @@
+[gerrit]
+host=gerrit.fd.io
+port=29418
+project=vpp
+defaultbranch=stable/1701
diff --git a/vpp/LICENSE b/vpp/LICENSE
new file mode 100644
index 0000000..7a4a3ea
--- /dev/null
+++ b/vpp/LICENSE
@@ -0,0 +1,202 @@
+
+ Apache License
+ Version 2.0, January 2004
+ http://www.apache.org/licenses/
+
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+ 1. Definitions.
+
+ "License" shall mean the terms and conditions for use, reproduction,
+ and distribution as defined by Sections 1 through 9 of this document.
+
+ "Licensor" shall mean the copyright owner or entity authorized by
+ the copyright owner that is granting the License.
+
+ "Legal Entity" shall mean the union of the acting entity and all
+ other entities that control, are controlled by, or are under common
+ control with that entity. For the purposes of this definition,
+ "control" means (i) the power, direct or indirect, to cause the
+ direction or management of such entity, whether by contract or
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
+ outstanding shares, or (iii) beneficial ownership of such entity.
+
+ "You" (or "Your") shall mean an individual or Legal Entity
+ exercising permissions granted by this License.
+
+ "Source" form shall mean the preferred form for making modifications,
+ including but not limited to software source code, documentation
+ source, and configuration files.
+
+ "Object" form shall mean any form resulting from mechanical
+ transformation or translation of a Source form, including but
+ not limited to compiled object code, generated documentation,
+ and conversions to other media types.
+
+ "Work" shall mean the work of authorship, whether in Source or
+ Object form, made available under the License, as indicated by a
+ copyright notice that is included in or attached to the work
+ (an example is provided in the Appendix below).
+
+ "Derivative Works" shall mean any work, whether in Source or Object
+ form, that is based on (or derived from) the Work and for which the
+ editorial revisions, annotations, elaborations, or other modifications
+ represent, as a whole, an original work of authorship. For the purposes
+ of this License, Derivative Works shall not include works that remain
+ separable from, or merely link (or bind by name) to the interfaces of,
+ the Work and Derivative Works thereof.
+
+ "Contribution" shall mean any work of authorship, including
+ the original version of the Work and any modifications or additions
+ to that Work or Derivative Works thereof, that is intentionally
+ submitted to Licensor for inclusion in the Work by the copyright owner
+ or by an individual or Legal Entity authorized to submit on behalf of
+ the copyright owner. For the purposes of this definition, "submitted"
+ means any form of electronic, verbal, or written communication sent
+ to the Licensor or its representatives, including but not limited to
+ communication on electronic mailing lists, source code control systems,
+ and issue tracking systems that are managed by, or on behalf of, the
+ Licensor for the purpose of discussing and improving the Work, but
+ excluding communication that is conspicuously marked or otherwise
+ designated in writing by the copyright owner as "Not a Contribution."
+
+ "Contributor" shall mean Licensor and any individual or Legal Entity
+ on behalf of whom a Contribution has been received by Licensor and
+ subsequently incorporated within the Work.
+
+ 2. Grant of Copyright License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ copyright license to reproduce, prepare Derivative Works of,
+ publicly display, publicly perform, sublicense, and distribute the
+ Work and such Derivative Works in Source or Object form.
+
+ 3. Grant of Patent License. Subject to the terms and conditions of
+ this License, each Contributor hereby grants to You a perpetual,
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+ (except as stated in this section) patent license to make, have made,
+ use, offer to sell, sell, import, and otherwise transfer the Work,
+ where such license applies only to those patent claims licensable
+ by such Contributor that are necessarily infringed by their
+ Contribution(s) alone or by combination of their Contribution(s)
+ with the Work to which such Contribution(s) was submitted. If You
+ institute patent litigation against any entity (including a
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
+ or a Contribution incorporated within the Work constitutes direct
+ or contributory patent infringement, then any patent licenses
+ granted to You under this License for that Work shall terminate
+ as of the date such litigation is filed.
+
+ 4. Redistribution. You may reproduce and distribute copies of the
+ Work or Derivative Works thereof in any medium, with or without
+ modifications, and in Source or Object form, provided that You
+ meet the following conditions:
+
+ (a) You must give any other recipients of the Work or
+ Derivative Works a copy of this License; and
+
+ (b) You must cause any modified files to carry prominent notices
+ stating that You changed the files; and
+
+ (c) You must retain, in the Source form of any Derivative Works
+ that You distribute, all copyright, patent, trademark, and
+ attribution notices from the Source form of the Work,
+ excluding those notices that do not pertain to any part of
+ the Derivative Works; and
+
+ (d) If the Work includes a "NOTICE" text file as part of its
+ distribution, then any Derivative Works that You distribute must
+ include a readable copy of the attribution notices contained
+ within such NOTICE file, excluding those notices that do not
+ pertain to any part of the Derivative Works, in at least one
+ of the following places: within a NOTICE text file distributed
+ as part of the Derivative Works; within the Source form or
+ documentation, if provided along with the Derivative Works; or,
+ within a display generated by the Derivative Works, if and
+ wherever such third-party notices normally appear. The contents
+ of the NOTICE file are for informational purposes only and
+ do not modify the License. You may add Your own attribution
+ notices within Derivative Works that You distribute, alongside
+ or as an addendum to the NOTICE text from the Work, provided
+ that such additional attribution notices cannot be construed
+ as modifying the License.
+
+ You may add Your own copyright statement to Your modifications and
+ may provide additional or different license terms and conditions
+ for use, reproduction, or distribution of Your modifications, or
+ for any such Derivative Works as a whole, provided Your use,
+ reproduction, and distribution of the Work otherwise complies with
+ the conditions stated in this License.
+
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
+ any Contribution intentionally submitted for inclusion in the Work
+ by You to the Licensor shall be under the terms and conditions of
+ this License, without any additional terms or conditions.
+ Notwithstanding the above, nothing herein shall supersede or modify
+ the terms of any separate license agreement you may have executed
+ with Licensor regarding such Contributions.
+
+ 6. Trademarks. This License does not grant permission to use the trade
+ names, trademarks, service marks, or product names of the Licensor,
+ except as required for reasonable and customary use in describing the
+ origin of the Work and reproducing the content of the NOTICE file.
+
+ 7. Disclaimer of Warranty. Unless required by applicable law or
+ agreed to in writing, Licensor provides the Work (and each
+ Contributor provides its Contributions) on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ implied, including, without limitation, any warranties or conditions
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+ PARTICULAR PURPOSE. You are solely responsible for determining the
+ appropriateness of using or redistributing the Work and assume any
+ risks associated with Your exercise of permissions under this License.
+
+ 8. Limitation of Liability. In no event and under no legal theory,
+ whether in tort (including negligence), contract, or otherwise,
+ unless required by applicable law (such as deliberate and grossly
+ negligent acts) or agreed to in writing, shall any Contributor be
+ liable to You for damages, including any direct, indirect, special,
+ incidental, or consequential damages of any character arising as a
+ result of this License or out of the use or inability to use the
+ Work (including but not limited to damages for loss of goodwill,
+ work stoppage, computer failure or malfunction, or any and all
+ other commercial damages or losses), even if such Contributor
+ has been advised of the possibility of such damages.
+
+ 9. Accepting Warranty or Additional Liability. While redistributing
+ the Work or Derivative Works thereof, You may choose to offer,
+ and charge a fee for, acceptance of support, warranty, indemnity,
+ or other liability obligations and/or rights consistent with this
+ License. However, in accepting such obligations, You may act only
+ on Your own behalf and on Your sole responsibility, not on behalf
+ of any other Contributor, and only if You agree to indemnify,
+ defend, and hold each Contributor harmless for any liability
+ incurred by, or claims asserted against, such Contributor by reason
+ of your accepting any such warranty or additional liability.
+
+ END OF TERMS AND CONDITIONS
+
+ APPENDIX: How to apply the Apache License to your work.
+
+ To apply the Apache License to your work, attach the following
+ boilerplate notice, with the fields enclosed by brackets "[]"
+ replaced with your own identifying information. (Don't include
+ the brackets!) The text should be enclosed in the appropriate
+ comment syntax for the file format. We also recommend that a
+ file or class name and description of purpose be included on the
+ same "printed page" as the copyright notice for easier
+ identification within third-party archives.
+
+ Copyright [yyyy] [name of copyright owner]
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License. \ No newline at end of file
diff --git a/vpp/Makefile b/vpp/Makefile
new file mode 100644
index 0000000..31b0019
--- /dev/null
+++ b/vpp/Makefile
@@ -0,0 +1,375 @@
+# Copyright (c) 2016 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+WS_ROOT=$(CURDIR)
+BR=$(WS_ROOT)/build-root
+CCACHE_DIR?=$(BR)/.ccache
+GDB?=gdb
+PLATFORM?=vpp
+
+MINIMAL_STARTUP_CONF="unix { interactive }"
+
+GDB_ARGS= -ex "handle SIGUSR1 noprint nostop"
+
+#
+# OS Detection
+#
+# We allow Darwin (MacOS) for docs generation; VPP build will still fail.
+ifneq ($(shell uname),Darwin)
+OS_ID = $(shell grep '^ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+OS_VERSION_ID= $(shell grep '^VERSION_ID=' /etc/os-release | cut -f2- -d= | sed -e 's/\"//g')
+endif
+
+DEB_DEPENDS = curl build-essential autoconf automake bison libssl-dev ccache
+DEB_DEPENDS += debhelper dkms git libtool libganglia1-dev libapr1-dev dh-systemd
+DEB_DEPENDS += libconfuse-dev git-review exuberant-ctags cscope
+DEB_DEPENDS += python-dev python-virtualenv python-pip lcov chrpath autoconf
+ifeq ($(OS_VERSION_ID),14.04)
+ DEB_DEPENDS += openjdk-8-jdk-headless
+else
+ DEB_DEPENDS += default-jdk-headless
+endif
+
+RPM_DEPENDS_GROUPS = 'Development Tools'
+RPM_DEPENDS = redhat-lsb glibc-static java-1.8.0-openjdk-devel yum-utils
+RPM_DEPENDS += openssl-devel https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm apr-devel
+RPM_DEPENDS += python-devel python-virtualenv lcov chrpath
+EPEL_DEPENDS = libconfuse-devel ganglia-devel
+
+ifneq ($(wildcard $(STARTUP_DIR)/startup.conf),)
+ STARTUP_CONF ?= $(STARTUP_DIR)/startup.conf
+endif
+
+ifeq ($(findstring y,$(UNATTENDED)),y)
+CONFIRM=-y
+FORCE=--force-yes
+endif
+
+.PHONY: help bootstrap wipe wipe-release build build-release rebuild rebuild-release
+.PHONY: run run-release debug debug-release build-vat run-vat pkg-deb pkg-rpm
+.PHONY: ctags cscope plugins plugins-release build-vpp-api
+.PHONY: test test-debug retest retest-debug test-doc test-wipe-doc test-help test-wipe
+.PHONY: test-cov test-wipe-cov
+
+help:
+ @echo "Make Targets:"
+ @echo " bootstrap - prepare tree for build"
+ @echo " install-dep - install software dependencies"
+ @echo " wipe - wipe all products of debug build "
+ @echo " wipe-release - wipe all products of release build "
+ @echo " build - build debug binaries"
+ @echo " build-release - build release binaries"
+ @echo " plugins - build debug plugin binaries"
+ @echo " plugins-release - build release plugin binaries"
+ @echo " rebuild - wipe and build debug binares"
+ @echo " rebuild-release - wipe and build release binares"
+ @echo " run - run debug binary"
+ @echo " run-release - run release binary"
+ @echo " debug - run debug binary with debugger"
+ @echo " debug-release - run release binary with debugger"
+ @echo " test - build and run functional tests"
+ @echo " test-debug - build and run functional tests (debug build)"
+ @echo " test-wipe - wipe files generated by unit tests"
+ @echo " retest - run functional tests"
+ @echo " retest-debug - run functional tests (debug build)"
+ @echo " test-help - show help on test framework"
+ @echo " build-vat - build vpp-api-test tool"
+ @echo " build-vpp-api - build vpp-api"
+ @echo " run-vat - run vpp-api-test tool"
+ @echo " pkg-deb - build DEB packages"
+ @echo " pkg-rpm - build RPM packages"
+ @echo " ctags - (re)generate ctags database"
+ @echo " gtags - (re)generate gtags database"
+ @echo " cscope - (re)generate cscope database"
+ @echo " checkstyle - check coding style"
+ @echo " fixstyle - fix coding style"
+ @echo " doxygen - (re)generate documentation"
+ @echo " bootstrap-doxygen - setup Doxygen dependencies"
+ @echo " wipe-doxygen - wipe all generated documentation"
+ @echo " test-doc - generate documentation for test framework"
+ @echo " test-wipe-doc - wipe documentation for test framework"
+ @echo " test-cov - generate code coverage report for test framework"
+ @echo " test-wipe-cov - wipe code coverage report for test framework"
+ @echo ""
+ @echo "Make Arguments:"
+ @echo " V=[0|1] - set build verbosity level"
+ @echo " STARTUP_CONF=<path> - startup configuration file"
+ @echo " (e.g. /etc/vpp/startup.conf)"
+ @echo " STARTUP_DIR=<path> - startup drectory (e.g. /etc/vpp)"
+ @echo " It also sets STARTUP_CONF if"
+ @echo " startup.conf file is present"
+ @echo " GDB=<path> - gdb binary to use for debugging"
+ @echo " PLATFORM=<name> - target platform. default is vpp"
+ @echo " TEST=<name> - only run specific test"
+ @echo ""
+ @echo "Current Argument Values:"
+ @echo " V = $(V)"
+ @echo " STARTUP_CONF = $(STARTUP_CONF)"
+ @echo " STARTUP_DIR = $(STARTUP_DIR)"
+ @echo " GDB = $(GDB)"
+ @echo " PLATFORM = $(PLATFORM)"
+ @echo " DPDK_VERSION = $(DPDK_VERSION)"
+
+$(BR)/.bootstrap.ok:
+ifeq ($(findstring y,$(UNATTENDED)),y)
+ make install-dep
+endif
+ifeq ($(OS_ID),ubuntu)
+ @MISSING=$$(apt-get install -y -qq -s $(DEB_DEPENDS) | grep "^Inst ") ; \
+ if [ -n "$$MISSING" ] ; then \
+ echo "\nPlease install missing packages: \n$$MISSING\n" ; \
+ echo "by executing \"make install-dep\"\n" ; \
+ exit 1 ; \
+ fi ; \
+ exit 0
+endif
+ @echo "SOURCE_PATH = $(WS_ROOT)" > $(BR)/build-config.mk
+ @echo "#!/bin/bash\n" > $(BR)/path_setup
+ @echo 'export PATH=$(BR)/tools/ccache-bin:$$PATH' >> $(BR)/path_setup
+ @echo 'export PATH=$(BR)/tools/bin:$$PATH' >> $(BR)/path_setup
+ @echo 'export CCACHE_DIR=$(CCACHE_DIR)' >> $(BR)/path_setup
+
+ifeq ("$(wildcard /usr/bin/ccache )","")
+ @echo "WARNING: Please install ccache AYEC and re-run this script"
+else
+ @rm -rf $(BR)/tools/ccache-bin
+ @mkdir -p $(BR)/tools/ccache-bin
+ @ln -s /usr/bin/ccache $(BR)/tools/ccache-bin/gcc
+ @ln -s /usr/bin/ccache $(BR)/tools/ccache-bin/g++
+endif
+ @make -C $(BR) V=$(V) is_build_tool=yes vppapigen-install
+ @touch $@
+
+bootstrap: $(BR)/.bootstrap.ok
+
+install-dep:
+ifeq ($(OS_ID),ubuntu)
+ifeq ($(OS_VERSION_ID),14.04)
+ @sudo -E apt-get $(CONFIRM) $(FORCE) install software-properties-common
+ @sudo -E add-apt-repository ppa:openjdk-r/ppa $(CONFIRM)
+endif
+ @sudo -E apt-get update
+ @sudo -E apt-get $(CONFIRM) $(FORCE) install $(DEB_DEPENDS)
+else ifneq ("$(wildcard /etc/redhat-release)","")
+ @sudo yum groupinstall $(CONFIRM) $(RPM_DEPENDS_GROUPS)
+ @sudo yum install $(CONFIRM) $(RPM_DEPENDS)
+ @sudo yum install $(CONFIRM) --enablerepo=epel $(EPEL_DEPENDS)
+ @sudo debuginfo-install $(CONFIRM) glibc-2.17-106.el7_2.4.x86_64 openssl-libs-1.0.1e-51.el7_2.4.x86_64 zlib-1.2.7-15.el7.x86_64
+else
+ $(error "This option currently works only on Ubuntu or Centos systems")
+endif
+
+define make
+ @make -C $(BR) PLATFORM=$(PLATFORM) TAG=$(1) $(2)
+endef
+
+$(BR)/scripts/.version:
+ifneq ("$(wildcard /etc/redhat-release)","")
+ $(shell $(BR)/scripts/version rpm-string > $(BR)/scripts/.version)
+else
+ $(shell $(BR)/scripts/version > $(BR)/scripts/.version)
+endif
+
+dist: $(BR)/scripts/.version
+ $(MAKE) verstring=$(PLATFORM)-$(shell cat $(BR)/scripts/.version) prefix=$(PLATFORM) distversion
+
+distversion: $(BR)/scripts/.version
+ $(BR)/scripts/verdist ${BR} ${prefix}-$(shell $(BR)/scripts/version rpm-version) ${verstring}
+ mv $(verstring).tar.gz $(BR)/rpm
+
+build: $(BR)/.bootstrap.ok
+ $(call make,$(PLATFORM)_debug,vpp-install)
+
+wipedist:
+ $(RM) $(BR)/scripts/.version $(BR)/rpm/*.tar.gz
+
+wipe: wipedist $(BR)/.bootstrap.ok
+ $(call make,$(PLATFORM)_debug,vpp-wipe)
+
+rebuild: wipe build
+
+build-release: $(BR)/.bootstrap.ok
+ $(call make,$(PLATFORM),vpp-install)
+
+wipe-release: $(BR)/.bootstrap.ok
+ $(call make,$(PLATFORM),vpp-wipe)
+
+rebuild-release: wipe-release build-release
+
+plugins: $(BR)/.bootstrap.ok
+ $(call make,$(PLATFORM)_debug,plugins-install)
+
+plugins-release: $(BR)/.bootstrap.ok
+ $(call make,$(PLATFORM),plugins-install)
+
+build-vpp-api: $(BR)/.bootstrap.ok
+ $(call make,$(PLATFORM)_debug,vpp-api-install)
+
+VPP_PYTHON_PREFIX=$(BR)/python
+
+define test
+ $(if $(filter-out $(3),retest),make -C $(BR) PLATFORM=$(1) TAG=$(2) vpp-api-install plugins-install vpp-install,)
+ make -C test \
+ BR=$(BR) \
+ VPP_TEST_BUILD_DIR=$(BR)/build-$(2)-native \
+ VPP_TEST_BIN=$(BR)/install-$(2)-native/vpp/bin/vpp \
+ VPP_TEST_API_TEST_BIN=$(BR)/install-$(2)-native/vpp-api-test/bin/vpp_api_test \
+ VPP_TEST_PLUGIN_PATH=$(BR)/install-$(2)-native/plugins/lib64/vpp_plugins \
+ VPP_TEST_INSTALL_PATH=$(BR)/install-$(2)-native/ \
+ LD_LIBRARY_PATH=$(BR)/install-$(2)-native/vpp-api/lib64/ \
+ WS_ROOT=$(WS_ROOT) V=$(V) TEST=$(TEST) VPP_PYTHON_PREFIX=$(VPP_PYTHON_PREFIX) $(3)
+endef
+
+test: bootstrap
+ $(call test,vpp_lite,vpp_lite,test)
+
+test-debug: bootstrap
+ $(call test,vpp_lite,vpp_lite_debug,test)
+
+test-help:
+ @make -C test help
+
+test-wipe:
+ @make -C test wipe
+
+test-doc:
+ @make -C test WS_ROOT=$(WS_ROOT) BR=$(BR) VPP_PYTHON_PREFIX=$(VPP_PYTHON_PREFIX) doc
+
+test-wipe-doc:
+ @make -C test wipe-doc BR=$(BR)
+
+test-cov: bootstrap
+ $(call test,vpp_lite,vpp_lite_gcov,cov)
+
+test-wipe-cov:
+ @make -C test wipe-cov BR=$(BR)
+
+retest:
+ $(call test,vpp_lite,vpp_lite,retest)
+
+retest-debug:
+ $(call test,vpp_lite,vpp_lite_debug,retest)
+
+STARTUP_DIR ?= $(PWD)
+ifeq ("$(wildcard $(STARTUP_CONF))","")
+define run
+ @echo "WARNING: STARTUP_CONF not defined or file doesn't exist."
+ @echo " Running with minimal startup config: $(MINIMAL_STARTUP_CONF)\n"
+ @cd $(STARTUP_DIR) && \
+ sudo $(2) $(1)/vpp/bin/vpp $(MINIMAL_STARTUP_CONF) plugin_path $(1)/plugins/lib64/vpp_plugins
+endef
+else
+define run
+ @cd $(STARTUP_DIR) && \
+ sudo $(2) $(1)/vpp/bin/vpp $(shell cat $(STARTUP_CONF) | sed -e 's/#.*//') plugin_path $(1)/plugins/lib64/vpp_plugins
+endef
+endif
+
+%.files: .FORCE
+ @find . \( -name '*\.[chyS]' -o -name '*\.java' -o -name '*\.lex' \) -and \
+ \( -not -path './build-root*' -o -path \
+ './build-root/build-vpp_debug-native/dpdk*' \) > $@
+
+.FORCE:
+
+run:
+ $(call run, $(BR)/install-$(PLATFORM)_debug-native)
+
+run-release:
+ $(call run, $(BR)/install-$(PLATFORM)-native)
+
+debug:
+ $(call run, $(BR)/install-$(PLATFORM)_debug-native,$(GDB) $(GDB_ARGS) --args)
+
+debug-release:
+ $(call run, $(BR)/install-$(PLATFORM)-native,$(GDB) $(GDB_ARGS) --args)
+
+build-vat:
+ $(call make,$(PLATFORM)_debug,vpp-api-test-install)
+
+run-vat:
+ @sudo $(BR)/install-$(PLATFORM)_debug-native/vpp-api-test/bin/vpp_api_test
+
+pkg-deb:
+ $(call make,$(PLATFORM),install-deb)
+
+pkg-rpm: dist
+ $(call make,$(PLATFORM),install-rpm)
+
+ctags: ctags.files
+ @ctags --totals --tag-relative -L $<
+ @rm $<
+
+gtags: ctags
+ @gtags --gtagslabel=ctags
+
+cscope: cscope.files
+ @cscope -b -q -v
+
+checkstyle:
+ @build-root/scripts/checkstyle.sh
+
+fixstyle:
+ @build-root/scripts/checkstyle.sh --fix
+
+#
+# Build the documentation
+#
+
+# Doxygen configuration and our utility scripts
+export DOXY_DIR ?= $(WS_ROOT)/doxygen
+
+define make-doxy
+ @OS_ID="$(OS_ID)" WS_ROOT="$(WS_ROOT)" BR="$(BR)" make -C $(DOXY_DIR) $@
+endef
+
+.PHONY: bootstrap-doxygen doxygen wipe-doxygen
+
+bootstrap-doxygen:
+ $(call make-doxy)
+
+doxygen:
+ $(call make-doxy)
+
+wipe-doxygen:
+ $(call make-doxy)
+
+define banner
+ @echo "========================================================================"
+ @echo " $(1)"
+ @echo "========================================================================"
+ @echo " "
+endef
+
+verify: install-dep $(BR)/.bootstrap.ok
+ $(call banner,"Building for PLATFORM=vpp using gcc")
+ @make -C build-root PLATFORM=vpp TAG=vpp wipe-all install-packages
+ $(call banner,"Building for PLATFORM=vpp_lite using gcc")
+ @make -C build-root PLATFORM=vpp_lite TAG=vpp_lite wipe-all install-packages
+ifeq ($(OS_ID),ubuntu)
+ifeq ($(OS_VERSION_ID),16.04)
+ $(call banner,"Installing dependencies")
+ @sudo -E apt-get update
+ @sudo -E apt-get $(CONFIRM) $(FORCE) install clang
+ $(call banner,"Building for PLATFORM=vpp using clang")
+ @make -C build-root CC=clang PLATFORM=vpp TAG=vpp_clang wipe-all install-packages
+endif
+ $(call banner,"Building deb packages")
+ @make pkg-deb
+endif
+ifeq ($(OS_ID),centos)
+ $(call banner,"Building rpm packages")
+ @make pkg-rpm
+endif
+
+
diff --git a/vpp/README.md b/vpp/README.md
new file mode 100644
index 0000000..cf43a4d
--- /dev/null
+++ b/vpp/README.md
@@ -0,0 +1,102 @@
+Vector Packet Processing
+========================
+
+## Introduction
+
+The VPP platform is an extensible framework that provides out-of-the-box
+production quality switch/router functionality. It is the open source version
+of Cisco's Vector Packet Processing (VPP) technology: a high performance,
+packet-processing stack that can run on commodity CPUs.
+
+The benefits of this implementation of VPP are its high performance, proven
+technology, its modularity and flexibility, and rich feature set.
+
+For more information on VPP and its features please visit the
+[FD.io website](http://fd.io/) and
+[What is VPP?](https://wiki.fd.io/view/VPP/What_is_VPP%3F) pages.
+
+
+## Changes
+
+Details of the changes leading up to this version of VPP can be found under
+@ref release_notes.
+
+
+## Directory layout
+
+Directory name | Description
+---------------------- | -------------------------------------------
+ build-data | Build metadata
+ build-root | Build output directory
+ doxygen | Documentation generator configuration
+ dpdk | DPDK patches and build infrastructure
+ g2 | Event log visualization tool
+ perftool | Performance tool
+@ref plugins | VPP bundled plugins directory
+@ref svm | Shared virtual memory allocation library
+ test | Unit tests
+@ref vlib | VPP application library source
+@ref vlib-api | VPP API library source
+@ref vnet | VPP networking source
+@ref vpp | VPP application source
+@ref vpp-api | VPP application API source
+ vppapigen | VPP API generator source
+ vpp-api-test | VPP API test program source
+@ref vppinfra | VPP core library source
+
+(If the page you are viewing is not generated by Doxygen then
+ignore any @@ref labels in the above table.)
+
+
+## Getting started
+
+In general anyone interested in building, developing or running VPP should
+consult the [VPP wiki](https://wiki.fd.io/view/VPP) for more complete
+documentation.
+
+In particular, readers are recommended to take a look at [Pulling, Building,
+Running, Hacking, Pushing](https://wiki.fd.io/view/VPP/Pulling,_Building,_Run
+ning,_Hacking_and_Pushing_VPP_Code) which provides extensive step-by-step
+coverage of the topic.
+
+For the impatient, some salient information is distilled below.
+
+
+### Quick-start: On an existing Linux host
+
+To install system dependencies, build VPP and then install it, simply run the
+build script. This should be performed a non-privileged user with `sudo`
+access from the project base directory:
+
+ ./build-root/vagrant/build.sh
+
+If you want a more fine-grained approach because you intend to do some
+development work, the `Makefile` in the root directory of the source tree
+provides several convenience shortcuts as `make` targets that may be of
+interest. To see the available targets run:
+
+ make
+
+
+### Quick-start: Vagrant
+
+The directory `build-root/vagrant` contains a `VagrantFile` and supporting
+scripts to bootstrap a working VPP inside a Vagrant-managed Virtual Machine.
+This VM can then be used to test concepts with VPP or as a development
+platform to extend VPP. Some obvious caveats apply when using a VM for VPP
+since its performance will never match that of bare metal; if your work is
+timing or performance sensitive, consider using bare metal in addition or
+instead of the VM.
+
+For this to work you will need a working installation of Vagrant. Instructions
+for this can be found [on the Setting up Vagrant wiki page]
+(https://wiki.fd.io/view/DEV/Setting_Up_Vagrant).
+
+
+## More information
+
+Several modules provide documentation, see @subpage user_doc for more
+information.
+
+Visit the [VPP wiki](https://wiki.fd.io/view/VPP) for details on more
+advanced building strategies and development notes.
diff --git a/vpp/RELEASE.md b/vpp/RELEASE.md
new file mode 100644
index 0000000..d86cfd6
--- /dev/null
+++ b/vpp/RELEASE.md
@@ -0,0 +1,280 @@
+# Release Notes {#release_notes}
+
+* @subpage release_notes_17011
+* @subpage release_notes_1701
+* @subpage release_notes_1609
+* @subpage release_notes_1606
+
+@page release_notes_17011 Release notes for VPP 17.01.1
+
+This is bug fix release.
+
+For the full list of fixed issues please reffer to:
+- fd.io [JIRA](https://jira.fd.io)
+- git [commit log](https://git.fd.io/vpp/log/?h=stable/1701)
+
+@page release_notes_1701 Release notes for VPP 17.01
+
+@note This release was for a while known as 16.12.
+
+## Features
+
+- [Integrated November 2016 DPDK release](http://www.dpdk.org/doc/guides/rel_notes/release_16_11.html)
+
+- Complete rework of Forwarding Information Base (FIB)
+
+- Performance Improvements
+ - Improvements in DPDK input and output nodes
+ - Improvements in L2 path
+ - Improvmeents in IPv4 lookup node
+
+- Feature Arcs Improvements
+ - Consolidation of the code
+ - New feature arcs
+ - device-input
+ - interface-output
+
+- DPDK Cryptodev Support
+ - Software and Hardware Crypto Support
+
+- DPDK HQoS support
+
+- Simple Port Analyzer (SPAN)
+
+- Bidirectional Forwarding Detection
+ - Basic implementation
+
+- IPFIX Improvements
+
+- L2 GRE over IPSec tunnels
+
+- Link Layer Discovery Protocol (LLDP)
+
+- Vhost-user Improvements
+ - Performance Improvements
+ - Multiqueue
+ - Reconnect
+
+- LISP Enhancements
+ - Source/Dest control plane support
+ - L2 over LISP and GRE
+ - Map-Register/Map-Notify/RLOC-probing support
+ - L2 API improvements, overall code hardening
+
+- Plugins:
+ - New: ACL
+ - New: Flow per Packet
+ - Improved: SNAT
+ - Mutlithreading
+ - Flow export
+
+- Doxygen Enhancements
+
+- Luajit API bindings
+
+- API Refactoring
+ - file split
+ - message signatures
+
+- Python and Scapy based unit testing infrastructure
+ - Infrastructure
+ - Various tests
+
+- Packet Generator improvements
+
+- TUN/TAP jumbo frames support
+
+- Other various bug fixes and improvements
+
+## Known issues
+
+For the full list of issues please reffer to fd.io [JIRA](https://jira.fd.io).
+
+## Issues fixed
+
+For the full list of fixed issues please reffer to:
+- fd.io [JIRA](https://jira.fd.io)
+- git [commit log](https://git.fd.io/vpp/log/?h=stable/1701)
+
+@page release_notes_1609 Release notes for VPP 16.09
+
+## Features
+
+- [Integrated July 2016 DPDK release](http://www.dpdk.org/doc/guides/rel_notes/release_16_07.html)
+ - DPDK-vhost is depreciated pending a complete rework of the original integration and
+ addressing of rx performance deltas.
+ - Patches required for DPDK 16.07:
+ - Correctly setting the Packet Type in the IGB, IXGBE and i40e drivers.
+ - Correctly setting checksum in the i40e driver.
+ - NXP DPAA2 PMD Driver.
+ - rte_delay (yield) functionality.
+
+- Add “in tree” plugins:
+ - IPv6 ILA.
+ - iOAM.
+ - Load Balancer.
+ - SNAT.
+
+- High-performance (line-rate) “neutron like” L4 port-filtering.
+
+- API refactoring - addressing some of the issues around JVPP bindings.
+ - Accommodating plugins [(e.g. NSH_SFC)](https://wiki.fd.io/view/NSH_SFC)
+ - Binding for [python](https://wiki.fd.io/view/VPP/Python_API)
+
+- LISP
+ - L2 LISP overlays
+ - Multitenancy
+ - Multihoming
+ - RTR mode
+ - Map-resolver failover algorithm
+
+- Support 64-bit vector lengths, huge shared-memory segments.
+
+- Dynamic IP Feature ordering
+ - IP Features can now specify features they appear before and after
+
+- 16.09 Builds
+ - Ubuntu 14.04 LTS - Trusty Tahr
+ - Ubuntu 16.04 LTS - Xenial Xerus
+ - CentOS 7
+ - More information on [VPP wiki](https://wiki.fd.io/view/VPP/Installing_VPP_binaries_from_packages)
+
+- Performance, characterize and document performance for this release
+ [(more information on CSIT page)](https://wiki.fd.io/view/CSIT)
+
+ - IPv4 and IPv6 Scale - performance tests.
+ - Bidirectional 10k/100k/1M flows.
+ - 64B,570B, 1518B,9000B packet sizes.
+ - IPv6 iACL - performance
+ - DUT1 and DUT2 are configured with IPv6 routing, two static IPv6 /64 routes and IPv6 iAcl
+ security whitelist ingress /64 filter entries applied on links.
+ - TG traffic profile contains two L3 flow-groups (flow-group per direction, 253 flows per
+ flow-group) with all packets containing Ethernet header, IPv6 header and generated payload.
+ MAC addresses are matching MAC addresses of the TG node interfaces.
+
+ - L2XC VXLANoIPv4 - performance
+ - DUT1 and DUT2 are configured with L2 cross-connect. VXLAN tunnels are configured between
+ L2XCs on DUT1 and DUT2.
+ - TG traffic profile contains two L3 flow-groups (flow-group per direction, 253 flows per
+ flow-group) with all packets containing Ethernet header, IPv4 header with IP protocol=61
+ and generated payload. MAC addresses are matching MAC addresses of the TG node interfaces.
+
+- Documentation
+ - Autogenerated CLI documentation.
+ - Using doxygen to automate API/Node documentation.
+ - [(available online)](https://docs.fd.io/vpp/16.09/)
+
+- Resolved all static analysis issues found by Coverity
+ - Beginning of 16.09 cycle: 505 issues.
+ - Release: 0 outstanding issues.
+
+
+## Known issues
+
+Issues in fd.io are tracked in [JIRA](https://jira.fd.io).
+
+Issue | Description
+--- | ---
+VPP-391 | vpp debug version assert appeared in the process of start
+VPP-380 | Mapping algorithm compute wrong ea-bits when IPv4 prefix 0.0.0.0/0
+VPP-371 | load_one_plugin:63: Loaded plugin: message from vppctl
+VPP-367 | vpp packages need to depend on specific versions of each other
+VPP-312 | IP6 FIB gets in indeterminate state by duplicating commands
+VPP-224 | Lookup-in-vrf can not be set correctly
+VPP-206 | Fix classify table delete
+VPP-203 | Fix binary API for reading vpp node graph
+VPP-147 | Inconsistent behaviour when adding L2 FIB filter entry
+VPP-99 | VPP doesn't discard DHCPOFFER message with wrong XID
+
+
+## Issues fixed
+
+Issues in fd.io are tracked in [JIRA](https://jira.fd.io).
+
+Issue | Description
+--- | ---
+VPP-396 | Ubuntu systems Graphviz bug
+VPP-390 | vpp-lib rpm fails to include *.so symlinks, causing linking problems with out of tree builds
+VPP-388 | IPSec output feature assumes packets have been ethernet rewritten
+VPP-385 | ARP for indirect adjacencies not working correctly
+VPP-361 | Memory leak on delete of VXLAN over IPv6 tunnel
+VPP-357 | VNI not set correctly when removing LISP fwd entries
+VPP-349 | sw_interface_vhost_user_dump not working
+VPP-345 | net/enic: bad L4 checksum ptype set on ICMP packets
+VPP-340 | MAP-T wrong destination address
+VPP-330 | Use fifo to store LISP pending map-requests
+VPP-326 | map_add_domain VAT command: unable to configure domain with mtu parameter
+VPP-318 | The map_add_domain VAT command accepts invalid arguments
+VPP-315 | Fix "show vxlan-gpe" issue
+VPP-310 | Mapping algorithm compute wrong ea-bits
+VPP-239 | LISP IP forwarding does not tag packets that hit negative mapping entries
+VPP-235 | Invalid help in VAT for sw_interface_set_l2_bridge
+VPP-228 | Mapping algorithm sends packet to wrong IPv6 address
+VPP-214 | vpp-api-test: api_ipsec_sad_add_del_entry: vector "ck" not initialized
+VPP-200 | VPP - TAP port create problem
+VPP-189 | Coverity Issues for 16.09
+VPP-184 | u16 translating to char ,not short
+VPP-179 | Adjacency share-count botch
+VPP-163 | "show ip6 interface" ignores non-global addresses
+VPP-155 | Netmap: Inconsistency in interface state between "show hardware" and "show interface"
+VPP-145 | Dynamically compute IP feature ordering based on constraints
+VPP-137 | VPP sends ARP with wrong requested IP
+VPP-118 | JVpp: 0 length arrays not handled properly in VPP responses
+VPP-112 | linux kernel info missing from build log
+VPP-110 | vxlan encap node should never touch a deleted tunnel
+VPP-107 | RPM build broken in master
+VPP-92 | segment routing is not properly filling out the segment list
+VPP-91 | segment routing add/del tunnel lookup doesn't work
+VPP-84 | af_packet throws a fatal error on EAGAIN
+VPP-74 | Clang compile fails due to warning in vlib/unix/cli.c
+VPP-64 | Top level "make pkg-deb" fails if CDPATH is set in user env.
+VPP-48 | Traceroute does not terminate when VPP is the target
+VPP-23 | CLI pager does not gracefully handle lines longer than the terminal width
+
+
+@page release_notes_1606 Release notes for VPP 16.06
+
+
+The FD.io Project, relentlessly focused on data IO speed and efficiency
+supporting the creation of high performance, flexible, and scalable software
+defined infrastructures, announces the availability of the community’s first
+software release (16.06).
+
+In the four months since launching, FD.io has brought together more than 75
+developers from 11 different companies including network operators, solution
+providers chip vendors, and network equipment vendors who are collaborating to
+enhance and innovate around the Vector Packet Processing (VPP) technology. The
+FD.io community has quickly formed to grow the number of projects from the
+initial VPP project to an additional 6 projects addressing a diverse set of
+requirements and usability across a variety of deployment environments.
+
+The 16.06 release brings unprecedented performance: 480Gbps/200mpps with 8
+million routes and 2k whitelist entries on standard high volume x86 servers.
+
+
+## Features
+
+In addition to the existing full suite of vswitch/vrouter features, the new
+16.06 release adds:
+
+* Enhanced Switching and Routing:
+ * IPv6 Segment Routing multicast support.
+ * LISP xTR support.
+ * VXLAN over IPv6 underlay.
+ * Per interface whitelists.
+ * Shared adjacencies in FIB.
+
+* New and improved interface support:
+ * Jumbo frame support for vhost-user.
+ * Netmap interface support.
+ * AF_Packet interface support.
+
+* Expanded and improved programmability:
+ * Python API bindings.
+ * Enhanced JVPP Java API bindings.
+ * Debugging CLI.
+
+* Expanded Hardware and Software Support:
+ * Support for ARM 32 targets including Rasberry Pi single-board computer.
+ * Support for DPDK 16.04.
+
diff --git a/vpp/build-data/packages/cavium-dpdk.mk b/vpp/build-data/packages/cavium-dpdk.mk
new file mode 100644
index 0000000..ce8ee22
--- /dev/null
+++ b/vpp/build-data/packages/cavium-dpdk.mk
@@ -0,0 +1,55 @@
+# Temporary until Cavium upstreams their work
+
+cavium-dpdk_configure = \
+ src_dir=$(call find_source_fn,$(PACKAGE_SOURCE)) ; \
+ dst_dir=$(PACKAGE_BUILD_DIR) ; \
+ tar -C $${src_dir} -cf - . | tar -C $${dst_dir} -xf - ; \
+ cd $${dst_dir} ; \
+ : colossal hemorrhoid to configure headroom ; \
+ if [ x$($(PACKAGE)_configure_args_$(PLATFORM)) = "x" ] ; then \
+ HR=256 ; \
+ else \
+ dpdk_configure_args=$($(PACKAGE)_configure_args_$(PLATFORM)) ; \
+ if [ $$dpdk_configure_args = "--with-headroom=256" ] ; then \
+ HR=256 ; \
+ elif [ $$dpdk_configure_args = "--with-headroom=384" ] ; then \
+ HR=384 ; \
+ else \
+ HR=256 ; \
+ fi ; \
+ fi ; \
+ env HR=$$HR \
+ spp -o \
+ $(PACKAGE_BUILD_DIR)/config/common_linuxapp \
+ $(PACKAGE_BUILD_DIR)/config/common_linuxapp.spp \
+ ; \
+ env $(CONFIGURE_ENV) \
+ make config T=arm64-thunderx-linuxapp-gcc RTE_ARCH=arm64 \
+ CC=aarch64-thunderx-linux-gnu-gcc V=0 \
+ RTE_SDK=$(PACKAGE_BUILD_DIR) \
+ RTE_TARGET=arm-default-linuxapp-gcc
+
+# Note: add e.g. "-O0" to EXTRA_CFLAGS if desired: EXTRA_CFLAGS='-g -O0'
+
+cavium-dpdk_make_args = install T=arm64-thunderx-linuxapp-gcc RTE_ARCH=arm64 \
+ CC=aarch64-thunderx-linux-gnu-gcc V=0 \
+ RTE_SDK=$(PACKAGE_BUILD_DIR) \
+ RTE_TARGET=arm-default-linuxapp-gcc
+
+cavium-dpdk_install = \
+ src_dir=$(PACKAGE_BUILD_DIR) ; \
+ dst_dir=$(PACKAGE_INSTALL_DIR) ; \
+ tar -h -C $${src_dir}/arm64-thunderx-linuxapp-gcc -cf - . \
+ | tar -C $${dst_dir} -xf -
+
+# dpdk libraries end up in .../lib not .../lib64. Fix it.
+cavium-dpdk_post_install = \
+ if [ "$(arch_lib_dir)" != "lib" ] ; then \
+ mkdir -p $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir) ; \
+ cd $(PACKAGE_INSTALL_DIR)/lib ; \
+ tar cf - . | ( cd $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir); tar xf - ) ; \
+ fi
+
+# nothing to install, all static libraries
+cavium-dpdk_image_include = echo
+
diff --git a/vpp/build-data/packages/dpdk.mk b/vpp/build-data/packages/dpdk.mk
new file mode 100644
index 0000000..a529e36
--- /dev/null
+++ b/vpp/build-data/packages/dpdk.mk
@@ -0,0 +1,44 @@
+
+DPDK_MARCH = $(strip $($(PLATFORM)_dpdk_arch))
+ifeq ($(DPDK_MARCH),)
+ DPDK_MARCH="native"
+endif
+
+DPDK_TUNE = $(strip $($(PLATFORM)_mtune))
+ifeq ($(DPDK_TUNE),)
+ DPDK_TUNE="generic"
+endif
+
+ifneq (,$(findstring debug,$(TAG)))
+ DPDK_DEBUG=y
+else
+ DPDK_DEBUG=n
+endif
+
+DPDK_MAKE_ARGS = -C $(call find_source_fn,$(PACKAGE_SOURCE)) \
+ DPDK_BUILD_DIR=$(PACKAGE_BUILD_DIR) \
+ DPDK_INSTALL_DIR=$(PACKAGE_INSTALL_DIR) \
+ DPDK_MARCH=$(DPDK_MARCH) \
+ DPDK_TUNE=$(DPDK_TUNE) \
+ DPDK_DEBUG=$(DPDK_DEBUG)
+
+DPDK_CRYPTO_PMD=$(strip $($(PLATFORM)_uses_dpdk_cryptodev))
+ifneq ($(DPDK_CRYPTO_PMD),)
+DPDK_MAKE_ARGS += DPDK_CRYPTO_PMD=y
+endif
+
+DPDK_PLATFORM_TARGET=$(strip $($(PLATFORM)_dpdk_target))
+ifneq ($(DPDK_PLATFORM_TARGET),)
+DPDK_MAKE_ARGS += DPDK_TARGET=$(DPDK_PLATFORM_TARGET)
+endif
+
+DPDK_MAKE_EXTRA_ARGS = $(strip $($(PLATFORM)_dpdk_make_extra_args))
+ifneq ($(DPDK_MAKE_EXTRA_ARGS),)
+DPDK_MAKE_ARGS += DPDK_MAKE_EXTRA_ARGS="$(DPDK_MAKE_EXTRA_ARGS)"
+endif
+
+dpdk_configure = echo
+
+dpdk_make_args = $(DPDK_MAKE_ARGS) config
+
+dpdk_install = make $(DPDK_MAKE_ARGS) build
diff --git a/vpp/build-data/packages/g2.mk b/vpp/build-data/packages/g2.mk
new file mode 100644
index 0000000..258eff1
--- /dev/null
+++ b/vpp/build-data/packages/g2.mk
@@ -0,0 +1,5 @@
+g2_configure_depend = vppinfra-install
+
+g2_CPPFLAGS = $(call installed_includes_fn, vppinfra)
+
+g2_LDFLAGS = $(call installed_libs_fn, vppinfra)
diff --git a/vpp/build-data/packages/gmod.mk b/vpp/build-data/packages/gmod.mk
new file mode 100644
index 0000000..a6ba42d
--- /dev/null
+++ b/vpp/build-data/packages/gmod.mk
@@ -0,0 +1,9 @@
+gmod_configure_depend = vppinfra-install svm-install
+
+gmod_configure_args = --libdir=$(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)/ganglia
+
+gmod_CPPFLAGS = $(call installed_includes_fn, vppinfra svm)
+gmod_CPPFLAGS += -I/usr/include/apr-1.0 -I/usr/include/apr-1 -I/usr/include
+gmod_LDFLAGS = $(call installed_libs_fn, vppinfra svm)
+
+gmod_image_include = echo $(arch_lib_dir)/ganglia/libgmodvpp.so etc
diff --git a/vpp/build-data/packages/perftool.mk b/vpp/build-data/packages/perftool.mk
new file mode 100644
index 0000000..300f902
--- /dev/null
+++ b/vpp/build-data/packages/perftool.mk
@@ -0,0 +1,5 @@
+perftool_configure_depend = vppinfra-install
+
+perftool_CPPFLAGS = $(call installed_includes_fn, vppinfra)
+
+perftool_LDFLAGS = $(call installed_libs_fn, vppinfra)
diff --git a/vpp/build-data/packages/plugins.mk b/vpp/build-data/packages/plugins.mk
new file mode 100644
index 0000000..44a8e2b
--- /dev/null
+++ b/vpp/build-data/packages/plugins.mk
@@ -0,0 +1,45 @@
+plugins_configure_depend = \
+ vppinfra-install \
+ vlib-api-install \
+ vpp-api-test-install \
+ vnet-install \
+ vlib-install \
+ vpp-api-install
+
+plugins_CPPFLAGS = $(call installed_includes_fn, \
+ vppinfra \
+ vlib \
+ vnet \
+ svm \
+ vpp-api-test \
+ vlib-api \
+ vpp-api)
+
+plugins_LDFLAGS = $(call installed_libs_fn, \
+ vppinfra \
+ vlib \
+ vlib-api)
+
+ifeq ($($(PLATFORM)_enable_tests),yes)
+plugins_configure_args += --enable-tests
+endif
+
+# Platform dependent configure flags
+plugins_configure_args += $(plugins_configure_args_$(PLATFORM))
+
+# include & link with openssl only if needed
+ifneq ($($(PLATFORM)_uses_openssl),no)
+plugins_CPPFLAGS += $(call installed_includes_fn, openssl)
+plugins_LDFLAGS += $(call installed_libs_fn, openssl)
+endif
+
+ifneq ($($(PLATFORM)_uses_dpdk),no)
+ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
+plugins_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
+plugins_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
+else
+plugins_configure_depend += dpdk-install
+plugins_CPPFLAGS += $(call installed_includes_fn, dpdk)
+plugins_LDFLAGS += $(call installed_libs_fn, dpdk)
+endif
+endif
diff --git a/vpp/build-data/packages/svm.mk b/vpp/build-data/packages/svm.mk
new file mode 100644
index 0000000..3971fe8
--- /dev/null
+++ b/vpp/build-data/packages/svm.mk
@@ -0,0 +1,5 @@
+svm_top_srcdir = $(call find_source_fn,svm)
+svm_configure_depend = vppinfra-install
+
+svm_CPPFLAGS = $(call installed_includes_fn, vppinfra)
+svm_LDFLAGS = $(call installed_libs_fn, vppinfra)
diff --git a/vpp/build-data/packages/vlib-api-cavium-dpdk.mk b/vpp/build-data/packages/vlib-api-cavium-dpdk.mk
new file mode 100644
index 0000000..7a4fe2c
--- /dev/null
+++ b/vpp/build-data/packages/vlib-api-cavium-dpdk.mk
@@ -0,0 +1,6 @@
+vlib-api-cavium-dpdk_source = vlib-api
+
+vlib-api-cavium-dpdk_configure_depend = vppinfra-install svm-install vlib-cavium-dpdk-install
+
+vlib-api-cavium-dpdk_CPPFLAGS = $(call installed_includes_fn, vppinfra svm vlib-cavium-dpdk)
+vlib-api-cavium-dpdk_LDFLAGS = $(call installed_libs_fn, vppinfra svm vlib-cavium-dpdk)
diff --git a/vpp/build-data/packages/vlib-api.mk b/vpp/build-data/packages/vlib-api.mk
new file mode 100644
index 0000000..29b0d17
--- /dev/null
+++ b/vpp/build-data/packages/vlib-api.mk
@@ -0,0 +1,4 @@
+vlib-api_configure_depend = vppinfra-install svm-install vlib-install
+
+vlib-api_CPPFLAGS = $(call installed_includes_fn, vppinfra svm vlib)
+vlib-api_LDFLAGS = $(call installed_libs_fn, vppinfra svm vlib)
diff --git a/vpp/build-data/packages/vlib-cavium-dpdk.mk b/vpp/build-data/packages/vlib-cavium-dpdk.mk
new file mode 100644
index 0000000..0f2f132
--- /dev/null
+++ b/vpp/build-data/packages/vlib-cavium-dpdk.mk
@@ -0,0 +1,7 @@
+vlib-cavium-dpdk_source = vlib
+vlib-cavium-dpdk_configure_depend = vppinfra-install cavium-dpdk-install
+
+vlib-cavium-dpdk_configure_args += --with-dpdk
+
+vlib-cavium-dpdk_CPPFLAGS = $(call installed_includes_fn, vppinfra cavium-dpdk)
+vlib-cavium-dpdk_LDFLAGS = $(call installed_libs_fn, vppinfra cavium-dpdk)
diff --git a/vpp/build-data/packages/vlib.mk b/vpp/build-data/packages/vlib.mk
new file mode 100644
index 0000000..2172708
--- /dev/null
+++ b/vpp/build-data/packages/vlib.mk
@@ -0,0 +1,16 @@
+vlib_configure_depend = vppinfra-install
+
+vlib_CPPFLAGS = $(call installed_includes_fn, vppinfra)
+vlib_LDFLAGS = $(call installed_libs_fn, vppinfra)
+
+ifneq ($($(PLATFORM)_uses_dpdk),no)
+vlib_configure_args += --with-dpdk
+ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
+vlib_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
+vlib_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
+else
+vlib_configure_depend += dpdk-install
+vlib_CPPFLAGS += $(call installed_includes_fn, dpdk)
+vlib_LDFLAGS += $(call installed_libs_fn, dpdk)
+endif
+endif
diff --git a/vpp/build-data/packages/vnet-cavium-dpdk.mk b/vpp/build-data/packages/vnet-cavium-dpdk.mk
new file mode 100644
index 0000000..4c35b04
--- /dev/null
+++ b/vpp/build-data/packages/vnet-cavium-dpdk.mk
@@ -0,0 +1,29 @@
+vnet-cavium-dpdk_source = vnet
+
+vnet-cavium-dpdk_configure_depend = \
+ vppinfra-install \
+ cavium-dpdk-install \
+ svm-install \
+ vlib-api-cavium-dpdk-install \
+ vlib-cavium-dpdk-install
+
+
+vnet-cavium-dpdk_CPPFLAGS = $(call installed_includes_fn, \
+ vppinfra \
+ cavium-dpdk \
+ openssl \
+ svm \
+ vlib-cavium-dpdk \
+ vlib-api-cavium-dpdk)
+
+vnet-cavium-dpdk_LDFLAGS = $(call installed_libs_fn, \
+ vppinfra \
+ cavium-dpdk \
+ openssl \
+ svm \
+ vlib-cavium-dpdk \
+ vlib-api-cavium-dpdk)
+
+# Platform dependent configure flags
+vnet-cavium-dpdk_configure_args += $(vnet-cavium-dpdk_configure_args_$(PLATFORM))
+
diff --git a/vpp/build-data/packages/vnet.mk b/vpp/build-data/packages/vnet.mk
new file mode 100644
index 0000000..399ca1b
--- /dev/null
+++ b/vpp/build-data/packages/vnet.mk
@@ -0,0 +1,44 @@
+vnet_configure_depend = \
+ vppinfra-install \
+ svm-install \
+ vlib-api-install \
+ vlib-install
+
+vnet_CPPFLAGS = $(call installed_includes_fn, \
+ vppinfra \
+ svm \
+ vlib \
+ vlib-api)
+
+vnet_LDFLAGS = $(call installed_libs_fn, \
+ vppinfra \
+ svm \
+ vlib \
+ vlib-api)
+
+ifeq ($($(PLATFORM)_enable_tests),yes)
+vnet_configure_args += --enable-tests
+endif
+
+# Platform dependent configure flags
+vnet_configure_args += $(vnet_configure_args_$(PLATFORM))
+
+# include & link with openssl only if needed
+ifneq ($($(PLATFORM)_uses_openssl),no)
+vnet_CPPFLAGS += $(call installed_includes_fn, openssl)
+vnet_LDFLAGS += $(call installed_libs_fn, openssl)
+endif
+
+ifneq ($($(PLATFORM)_uses_dpdk),no)
+ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
+vnet_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
+vnet_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
+else
+vnet_configure_depend += dpdk-install
+vnet_CPPFLAGS += $(call installed_includes_fn, dpdk)
+vnet_LDFLAGS += $(call installed_libs_fn, dpdk)
+endif
+ifeq ($($(PLATFORM)_uses_dpdk_cryptodev),yes)
+vnet_configure_args += --with-dpdk-crypto
+endif
+endif
diff --git a/vpp/build-data/packages/vpp-api-test-cavium-dpdk.mk b/vpp/build-data/packages/vpp-api-test-cavium-dpdk.mk
new file mode 100644
index 0000000..e352317
--- /dev/null
+++ b/vpp/build-data/packages/vpp-api-test-cavium-dpdk.mk
@@ -0,0 +1,32 @@
+vpp-api-test-cavium-dpdk_source = vpp-api-test
+
+vpp-api-test-cavium-dpdk_configure_depend = \
+ vppinfra-install \
+ cavium-dpdk-install \
+ svm-install \
+ vlib-api-cavium-dpdk-install \
+ vlib-cavium-dpdk-install \
+ vnet-cavium-dpdk-install \
+ vpp-cavium-dpdk-install
+
+#
+vpp-api-test-cavium-dpdk_configure_args = --with-dpdk
+
+vpp-api-test-cavium-dpdk_CPPFLAGS = $(call installed_includes_fn, \
+ vppinfra \
+ cavium-dpdk \
+ svm \
+ vlib-cavium-dpdk \
+ vlib-api-cavium-dpdk \
+ vnet-cavium-dpdk \
+ vpp-cavium-dpdk)
+
+vpp-api-test-cavium-dpdk_LDFLAGS = $(call installed_libs_fn, \
+ vppinfra \
+ cavium-dpdk \
+ svm \
+ vlib-cavium-dpdk \
+ vlib-api-cavium-dpdk \
+ vnet-cavium-dpdk \
+ vpp-cavium-dpdk)
+
diff --git a/vpp/build-data/packages/vpp-api-test.mk b/vpp/build-data/packages/vpp-api-test.mk
new file mode 100644
index 0000000..c9eae36
--- /dev/null
+++ b/vpp/build-data/packages/vpp-api-test.mk
@@ -0,0 +1,39 @@
+vpp-api-test_configure_depend = \
+ vppinfra-install \
+ svm-install \
+ vlib-api-install \
+ vlib-install \
+ vnet-install \
+ vpp-install
+
+vpp-api-test_CPPFLAGS = $(call installed_includes_fn, \
+ vppinfra \
+ svm \
+ vlib \
+ vlib-api \
+ vnet \
+ vpp)
+
+vpp-api-test_LDFLAGS = $(call installed_libs_fn, \
+ vppinfra \
+ svm \
+ vlib \
+ vlib-api \
+ vnet \
+ vpp)
+
+ifneq ($($(PLATFORM)_uses_dpdk),no)
+vpp-api-test_configure_args = --with-dpdk
+ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
+vpp-api-test_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
+vpp-api-test_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
+else
+vpp-api-test_configure_depend += dpdk-install
+vpp-api-test_CPPFLAGS += $(call installed_includes_fn, dpdk)
+vpp-api-test_LDFLAGS += $(call installed_libs_fn, dpdk)
+endif
+endif
+ifeq ($($(PLATFORM)_uses_dpdk_cryptodev),yes)
+vpp-api-test_configure_args += --with-dpdk-crypto
+endif
+
diff --git a/vpp/build-data/packages/vpp-api.mk b/vpp/build-data/packages/vpp-api.mk
new file mode 100644
index 0000000..4937023
--- /dev/null
+++ b/vpp/build-data/packages/vpp-api.mk
@@ -0,0 +1,23 @@
+vpp-api_configure_depend = \
+ vppinfra-install \
+ svm-install \
+ vlib-api-install \
+ vlib-install \
+ vnet-install \
+ vpp-install
+
+vpp-api_CPPFLAGS = $(call installed_includes_fn, \
+ vppinfra \
+ svm \
+ vlib \
+ vlib-api \
+ vnet \
+ vpp)
+
+vpp-api_LDFLAGS = $(call installed_libs_fn, \
+ vppinfra \
+ svm \
+ vlib \
+ vlib-api)
+
+vpp-api_CPPFLAGS += -I/usr/lib/jvm/java-8-openjdk-amd64/include
diff --git a/vpp/build-data/packages/vpp-cavium-dpdk.mk b/vpp/build-data/packages/vpp-cavium-dpdk.mk
new file mode 100644
index 0000000..704e3a9
--- /dev/null
+++ b/vpp/build-data/packages/vpp-cavium-dpdk.mk
@@ -0,0 +1,30 @@
+vpp-cavium-dpdk_source = vpp
+
+vpp-cavium-dpdk_configure_depend = \
+ vppinfra-install \
+ cavium-dpdk-install \
+ svm-install \
+ vlib-api-cavium-dpdk-install \
+ vlib-cavium-dpdk-install \
+ vnet-cavium-dpdk-install
+
+# Platform dependent configure flags
+vpp-cavium-dpdk_configure_args += $(vpp-cavium-dpdk_configure_args_$(PLATFORM))
+
+vpp-cavium-dpdk_CPPFLAGS = $(call installed_includes_fn, \
+ vppinfra \
+ cavium-dpdk \
+ openssl \
+ svm \
+ vlib-cavium-dpdk \
+ vlib-api-cavium-dpdk \
+ vnet-cavium-dpdk)
+
+vpp-cavium-dpdk_LDFLAGS = $(call installed_libs_fn, \
+ vppinfra \
+ cavium-dpdk \
+ openssl \
+ svm \
+ vlib-cavium-dpdk \
+ vlib-api-cavium-dpdk \
+ vnet-cavium-dpdk)
diff --git a/vpp/build-data/packages/vpp-platform-scripts.mk b/vpp/build-data/packages/vpp-platform-scripts.mk
new file mode 100644
index 0000000..792d600
--- /dev/null
+++ b/vpp/build-data/packages/vpp-platform-scripts.mk
@@ -0,0 +1 @@
+#
diff --git a/vpp/build-data/packages/vpp.mk b/vpp/build-data/packages/vpp.mk
new file mode 100644
index 0000000..6831c6b
--- /dev/null
+++ b/vpp/build-data/packages/vpp.mk
@@ -0,0 +1,51 @@
+vpp_configure_depend = \
+ vppinfra-install \
+ svm-install \
+ vlib-api-install \
+ vlib-install \
+ vnet-install \
+
+#
+ifeq ($($(PLATFORM)_dpdk_shared_lib),yes)
+vpp_configure_args = --enable-dpdk-shared
+else
+vpp_configure_args =
+endif
+
+# Platform dependent configure flags
+vpp_configure_args += $(vpp_configure_args_$(PLATFORM))
+
+
+vpp_CPPFLAGS = $(call installed_includes_fn, \
+ vppinfra \
+ svm \
+ vlib \
+ vlib-api \
+ vnet)
+
+vpp_LDFLAGS = $(call installed_libs_fn, \
+ vppinfra \
+ svm \
+ vlib \
+ vlib-api \
+ vnet)
+
+# include & link with openssl only if needed
+ifneq ($($(PLATFORM)_uses_openssl),no)
+vpp_CPPFLAGS += $(call installed_includes_fn, openssl)
+vpp_LDFLAGS += $(call installed_libs_fn, openssl)
+endif
+
+ifneq ($($(PLATFORM)_uses_dpdk),no)
+ifeq ($($(PLATFORM)_uses_external_dpdk),yes)
+vpp_CPPFLAGS += -I$($(PLATFORM)_dpdk_inc_dir)
+vpp_LDFLAGS += -L$($(PLATFORM)_dpdk_lib_dir)
+else
+vpp_configure_depend += dpdk-install
+vpp_CPPFLAGS += $(call installed_includes_fn, dpdk)
+vpp_LDFLAGS += $(call installed_libs_fn, dpdk)
+endif
+ifeq ($($(PLATFORM)_uses_dpdk_cryptodev),yes)
+vpp_configure_args += --with-dpdk-crypto
+endif
+endif
diff --git a/vpp/build-data/packages/vppinfra.mk b/vpp/build-data/packages/vppinfra.mk
new file mode 100644
index 0000000..6ca6eb2
--- /dev/null
+++ b/vpp/build-data/packages/vppinfra.mk
@@ -0,0 +1,5 @@
+
+ifeq ($($(PLATFORM)_enable_tests),yes)
+vppinfra_configure_args += --enable-tests
+endif
+
diff --git a/vpp/build-data/platforms.mk b/vpp/build-data/platforms.mk
new file mode 100644
index 0000000..a568c7a
--- /dev/null
+++ b/vpp/build-data/platforms.mk
@@ -0,0 +1,105 @@
+# Copyright (c) 2015 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Pick up per-platform makefile fragments
+$(foreach d,$(SOURCE_PATH_BUILD_DATA_DIRS), \
+ $(eval -include $(d)/platforms/*.mk))
+
+.PHONY: install-deb
+install-deb: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
+ @$(BUILD_ENV) ; \
+ set -eu$(BUILD_DEBUG) ; \
+ $(MAKE) -C $(MU_BUILD_ROOT_DIR) \
+ $(patsubst %,%-install, \
+ $(ROOT_PACKAGES)) || exit 1; \
+ \
+ : generate file manifests ; \
+ find $(INSTALL_PREFIX)$(ARCH)/*/bin -type f -print \
+ | sed -e 's:.*:../& /usr/bin:' \
+ > deb/debian/vpp.install ; \
+ \
+ : core api definitions ; \
+ ./scripts/find-api-core-contents $(INSTALL_PREFIX)$(ARCH) \
+ deb/debian/vpp.install ; \
+ \
+ : need symbolic links in the lib pkg ; \
+ find $(INSTALL_PREFIX)$(ARCH)/*/lib* \( -type f -o -type l \) \
+ -print | egrep -e '*\.so\.*\.*\.*' \
+ | grep -v plugins\/ \
+ | sed -e 's:.*:../& /usr/lib/x86_64-linux-gnu:' \
+ > deb/debian/vpp-lib.install ; \
+ \
+ : vnet api definitions ; \
+ ./scripts/find-api-lib-contents $(INSTALL_PREFIX)$(ARCH) \
+ deb/debian/vpp-lib.install ; \
+ \
+ : dev package ; \
+ ./scripts/find-dev-contents $(INSTALL_PREFIX)$(ARCH) \
+ deb/debian/vpp-dev.install ; \
+ \
+ : plugins package ; \
+ ./scripts/find-plugins-contents $(INSTALL_PREFIX)$(ARCH) \
+ deb/debian/vpp-plugins.install ; \
+ \
+ : python-api package ; \
+ ./scripts/find-python-api-contents $(INSTALL_PREFIX)$(ARCH) \
+ deb/debian/vpp-python-api.install ; \
+ \
+ : dpdk headers ; \
+ ./scripts/find-dpdk-contents $(INSTALL_PREFIX)$(ARCH) \
+ deb/debian/vpp-dpdk-dev.install ; \
+ \
+ : bin package needs startup config ; \
+ echo ../../vpp/conf/startup.conf /etc/vpp \
+ >> deb/debian/vpp.install ; \
+ \
+ : and sysctl config ; \
+ echo ../../vpp/conf/80-vpp.conf /etc/sysctl.d \
+ >> deb/debian/vpp.install ; \
+ \
+ : dev package needs a couple of additions ; \
+ echo ../build-tool-native/vppapigen/vppapigen /usr/bin \
+ >> deb/debian/vpp-dev.install ; \
+ echo ../../vpp-api/java/jvpp/gen/jvpp_gen.py /usr/bin \
+ >> deb/debian/vpp-dev.install ; \
+ for i in $$(ls ../vpp-api/java/jvpp/gen/jvppgen/*.py); do \
+ echo ../$${i} /usr/lib/python2.7/dist-packages/jvppgen \
+ >> deb/debian/vpp-dev.install; \
+ done; \
+ \
+ : generate changelog; \
+ ./scripts/generate-deb-changelog \
+ \
+ : Go fabricate the actual Debian packages ; \
+ ( \
+ cd deb && \
+ dpkg-buildpackage -us -uc -b \
+ )
+
+.PHONY: install-rpm
+install-rpm: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
+ @$(BUILD_ENV) ; \
+ set -eu$(BUILD_DEBUG) ; \
+ $(MAKE) -C $(MU_BUILD_ROOT_DIR) \
+ $(patsubst %,%-install, \
+ $(ROOT_PACKAGES)) || exit 1; \
+ \
+ cd rpm ; \
+ mkdir -p SOURCES ; \
+ if test -f *.tar.gz ; then mv *.tar.gz SOURCES ; fi ; \
+ rpmbuild -bb --define "_topdir $$PWD" --define \
+ "_install_dir $(INSTALL_PREFIX)$(ARCH)" \
+ --define "_mu_build_root_dir $(MU_BUILD_ROOT_DIR)" \
+ vpp.spec ; \
+ mv $$(find RPMS -name \*.rpm -type f) ..
+
diff --git a/vpp/build-data/platforms/arm32.mk b/vpp/build-data/platforms/arm32.mk
new file mode 100644
index 0000000..7b80061
--- /dev/null
+++ b/vpp/build-data/platforms/arm32.mk
@@ -0,0 +1,45 @@
+# Copyright (c) 2016 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# vector packet processor
+arm32_arch = native
+arm32_native_tools = vppapigen
+
+arm32_uses_dpdk = yes
+arm32_uses_openssl = no
+
+arm32_root_packages = vpp vlib vlib-api vnet svm vpp-api-test \
+ jvpp gmod
+
+vlib_configure_args_arm32 = --with-pre-data=128
+vnet_configure_args_arm32 = --with-dpdk --without-ipsec --without-ipv6sr
+vpp_configure_args_arm32 = --with-dpdk --without-ipsec --without-ipv6sr
+
+arm32_dpdk_arch = "armv7a"
+arm32_dpdk_target = "arm-armv7a-linuxapp-gcc"
+arm32_dpdk_make_extra_args = "CPU_CFLAGS='-mfloat-abi=hard' \
+ CONFIG_RTE_EAL_IGB_UIO=y \
+ CONFIG_RTE_LIBRTE_E1000_PMD=y \
+ CONFIG_RTE_MAX_LCORE=4 \
+ CONFIG_RTE_MAX_NUMA_NODES=1"
+
+
+arm32_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -DVLIB_MAX_CPUS=4 -march=armv7-a \
+ -fstack-protector-all -fPIC -Werror
+arm32_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -DVLIB_MAX_CPUS=4 -march=armv7-a \
+ -fstack-protector-all -fPIC -Werror
+
+arm32_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -DVLIB_MAX_CPUS=4 -march=armv7-a \
+ -fstack-protector -fPIC -Werror
+arm32_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -DVLIB_MAX_CPUS=4 -march=armv7-a \
+ -fstack-protector -fPIC -Werror
diff --git a/vpp/build-data/platforms/dpaa2.mk b/vpp/build-data/platforms/dpaa2.mk
new file mode 100644
index 0000000..0ec627a
--- /dev/null
+++ b/vpp/build-data/platforms/dpaa2.mk
@@ -0,0 +1,66 @@
+# Copyright (c) 2016 Freescale Semiconductor, Inc. All rights reserved.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Configuration for NXP DPAA2 ARM64 based platform
+dpaa2_arch = aarch64
+dpaa2_os = linux-gnu
+dpaa2_target = aarch64-linux-gnu
+dpaa2_mtune = cortex-A57
+dpaa2_march = "armv8-a+fp+simd+crc+crypto"
+dpaa2_cross_ldflags = \
+ -Wl,--dynamic-linker=/lib/ld-linux-aarch64.so.1 \
+ -Wl,-rpath=/usr/lib64
+
+dpaa2_native_tools = vppapigen
+dpaa2_root_packages = vpp vlib vlib-api vnet svm vpp-api-test
+
+# DPDK configuration parameters
+dpaa2_uses_dpdk = yes
+# Compile with external DPDK only if "DPDK_PATH" variable is defined where we have
+# installed DPDK libraries and headers.
+ifeq ($(PLATFORM),dpaa2)
+ifneq ($(DPDK_PATH),)
+dpaa2_uses_dpdk = yes
+dpaa2_uses_external_dpdk = yes
+dpaa2_dpdk_inc_dir = $(DPDK_PATH)/include/dpdk
+dpaa2_dpdk_lib_dir = $(DPDK_PATH)/lib
+else
+# compile using internal DPDK + NXP DPAA2 Driver patch
+dpaa2_dpdk_arch = "armv8a"
+dpaa2_dpdk_target = "arm64-dpaa2-linuxapp-gcc"
+dpaa2_dpdk_make_extra_args = "CROSS=$(dpaa2_target)- DPDK_PKTMBUF_HEADROOM=256"
+endif
+endif
+
+vpp_configure_args_dpaa2 = --with-dpdk --without-ipsec \
+ --without-ipv6sr --with-sysroot=$(SYSROOT)
+vnet_configure_args_dpaa2 = --with-dpdk --without-ipsec \
+ --without-ipv6sr --with-sysroot=$(SYSROOT)
+
+# Set these parameters carefully. The vlib_buffer_t is 256 bytes, i.e.
+vlib_configure_args_dpaa2 = --with-pre-data=256
+
+
+dpaa2_debug_TAG_CFLAGS = -g -O2 -DCLIB_DEBUG -fPIC -fstack-protector-all \
+ -march=$(MARCH) -Werror -DCLIB_LOG2_CACHE_LINE_BYTES=6
+dpaa2_debug_TAG_LDFLAGS = -g -O2 -DCLIB_DEBUG -fstack-protector-all \
+ -march=$(MARCH) -Werror -DCLIB_LOG2_CACHE_LINE_BYTES=6
+
+# Use -rdynamic is for stack tracing, O0 for debugging....default is O2
+# Use -DCLIB_LOG2_CACHE_LINE_BYTES to change cache line size
+dpaa2_TAG_CFLAGS = -g -O2 -fPIC -march=$(MARCH) -mcpu=$(dpaa2_mtune) \
+ -mtune=$(dpaa2_mtune) -funroll-all-loops -Werror -DCLIB_LOG2_CACHE_LINE_BYTES=6
+dpaa2_TAG_LDFLAGS = -g -O2 -fPIC -march=$(MARCH) -mcpu=$(dpaa2_mtune) \
+ -mtune=$(dpaa2_mtune) -funroll-all-loops -Werror -DCLIB_LOG2_CACHE_LINE_BYTES=6
+
+
diff --git a/vpp/build-data/platforms/qppc.mk b/vpp/build-data/platforms/qppc.mk
new file mode 100644
index 0000000..244747e
--- /dev/null
+++ b/vpp/build-data/platforms/qppc.mk
@@ -0,0 +1,34 @@
+# Qemu "p-series" powerpc64
+
+qppc_os = linux-gnu
+
+qppc_cross_ldflags = \
+ -Wl,--dynamic-linker=/lib64/ld64.so.1
+
+qppc_arch = powerpc
+
+qppc_root_packages = vppinfra vlib vlib-api vnet svm \
+ vpp vpp-api-test
+
+vnet_configure_args_qppc = \
+ --without-ipsec --without-ipv6sr
+
+vpp_configure_args_qppc = \
+ --without-ipsec --without-ipv6sr
+
+vlib_configure_args_qppc = --with-pre-data=128
+
+qppc_march=powerpc64
+
+# native tool chain additions for this platform
+qppc_native_tools = vppapigen
+
+qppc_uses_dpdk = no
+
+qppc_debug_TAG_CFLAGS = -m64 -g -O0 -DCLIB_DEBUG -DCLIB_LOG2_CACHE_LINE_BYTES=6 -maltivec
+qppc_debug_TAG_LDFLAGS = -m64 -g -O0 -DCLIB_DEBUG -DCLIB_LOG2_CACHE_LINE_BYTES=6 -maltivec
+
+qppc_TAG_CFLAGS = -m64 -g -O2 -DCLIB_LOG2_CACHE_LINE_BYTES=6 -maltivec
+qppc_TAG_LDFLAGS = -m64 -g -O2 -DCLIB_LOG2_CACHE_LINE_BYTES=6 -maltivec
+
+
diff --git a/vpp/build-data/platforms/thunder.mk b/vpp/build-data/platforms/thunder.mk
new file mode 100644
index 0000000..f891f4a
--- /dev/null
+++ b/vpp/build-data/platforms/thunder.mk
@@ -0,0 +1,36 @@
+# Override OS so we can use the sdk toolchain instead of building one
+thunder_os = thunderx-linux-gnu
+
+# Override CROSS_LDFLAGS so we can use
+# /lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 instead of building glibc
+thunder_cross_ldflags = \
+ -Wl,--dynamic-linker=/lib/aarch64-linux-gnu/ld-linux-aarch64.so.1 \
+ -Wl,-rpath -Wl,$(lots_of_slashes_to_pad_names)$(TOOL_INSTALL_LIB_DIR)
+
+thunder_arch = aarch64
+# suppress -march=foo, the cross compiler doesn't understand it
+thunder_march = " "
+
+thunder_root_packages = vppinfra vlib-cavium-dpdk vnet-cavium-dpdk cavium-dpdk \
+ vpp-cavium-dpdk vpp-api-test-cavium-dpdk
+
+vnet-cavium-dpdk_configure_args_thunder = \
+ --with-dpdk --without-ipsec --without-ipv6sr
+
+vpp-cavium-dpdk_configure_args_thunder = \
+ --with-dpdk --without-ipsec --without-ipv6sr
+
+cavium-dpdk_configure_args_thunder = --with-headroom=256
+
+vlib-cavium-dpdk_configure_args_thunder = --with-pre-data=128
+
+# native tool chain additions for this platform
+thunder_native_tools = vppapigen
+
+thunder_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG
+thunder_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG
+
+thunder_TAG_CFLAGS = -g -O2
+thunder_TAG_LDFLAGS = -g -O2
+
+
diff --git a/vpp/build-data/platforms/vpp.mk b/vpp/build-data/platforms/vpp.mk
new file mode 100644
index 0000000..15d4dc3
--- /dev/null
+++ b/vpp/build-data/platforms/vpp.mk
@@ -0,0 +1,68 @@
+# Copyright (c) 2015 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# vector packet processor
+vpp_arch = native
+ifeq ($(shell uname -m),x86_64)
+vpp_march = corei7 # Nehalem Instruction set
+vpp_mtune = corei7-avx # Optimize for Sandy Bridge
+vpp_dpdk_arch = corei7
+else
+vpp_march = native
+vpp_mtune = generic
+vpp_dpdk_arch = native
+endif
+vpp_native_tools = vppapigen
+
+vpp_uses_dpdk = yes
+
+# Uncoment to enable building unit tests
+# vpp_enable_tests = yes
+
+vpp_root_packages = vpp vlib vlib-api vnet svm vpp-api-test \
+ vpp-api gmod plugins
+
+vpp_configure_args_vpp = --with-dpdk
+vnet_configure_args_vpp = --with-dpdk
+
+# Set these parameters carefully. The vlib_buffer_t is 128 bytes, i.e.
+vlib_configure_args_vpp = --with-pre-data=128
+
+plugins_configure_args_vpp = --with-dpdk
+
+# DPDK configuration parameters
+# vpp_uses_dpdk_cryptodev = yes
+# vpp_uses_external_dpdk = yes
+# vpp_dpdk_inc_dir = /usr/include/dpdk
+# vpp_dpdk_lib_dir = /usr/lib
+# vpp_dpdk_shared_lib = yes
+
+vpp_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
+ -fstack-protector-all -fPIC -Werror
+vpp_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
+ -fstack-protector-all -fPIC -Werror
+
+vpp_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) -mtune=$(MTUNE) \
+ -fstack-protector -fPIC -Werror
+vpp_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) -mtune=$(MTUNE) \
+ -fstack-protector -fPIC -Werror
+
+vpp_clang_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) -mtune=$(MTUNE) \
+ -fstack-protector -fPIC -Werror
+vpp_clang_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) -mtune=$(MTUNE) \
+ -fstack-protector -fPIC -Werror
+
+vpp_gcov_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -march=$(MARCH) \
+ -fPIC -Werror -fprofile-arcs -ftest-coverage
+vpp_gcov_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -march=$(MARCH) \
+ -fPIC -Werror -coverage
diff --git a/vpp/build-data/platforms/vpp_lite.mk b/vpp/build-data/platforms/vpp_lite.mk
new file mode 100644
index 0000000..ef2ec44
--- /dev/null
+++ b/vpp/build-data/platforms/vpp_lite.mk
@@ -0,0 +1,51 @@
+# Copyright (c) 2016 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# vector packet processor
+vpp_lite_arch = native
+ifeq ($(shell uname -m),x86_64)
+vpp_lite_march = corei7 # Nehalem Instruction set
+vpp_lite_mtune = corei7-avx # Optimize for Sandy Bridge
+else
+vpp_lite_march = native
+vpp_lite_mtune = generic
+endif
+vpp_lite_native_tools = vppapigen
+
+vpp_lite_uses_dpdk = no
+
+# Uncoment to enable building unit tests
+#vpp_lite_enable_tests = yes
+
+vpp_lite_root_packages = vpp vlib vlib-api vnet svm vpp-api-test \
+ vpp-api gmod
+
+vlib_configure_args_vpp_lite = --with-pre-data=128
+
+vnet_configure_args_vpp_lite =
+vpp_configure_args_vpp_lite =
+
+vpp_lite_debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
+ -fstack-protector-all -fPIC -Werror
+vpp_lite_debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
+ -fstack-protector-all -fPIC -Werror
+
+vpp_lite_TAG_CFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) -mtune=$(MTUNE) \
+ -fstack-protector -fPIC -Werror
+vpp_lite_TAG_LDFLAGS = -g -O2 -DFORTIFY_SOURCE=2 -march=$(MARCH) -mtune=$(MTUNE) \
+ -fstack-protector -fPIC -Werror
+
+vpp_lite_gcov_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -march=$(MARCH) \
+ -fPIC -Werror -fprofile-arcs -ftest-coverage
+vpp_lite_gcov_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -march=$(MARCH) \
+ -fPIC -Werror -coverage
diff --git a/vpp/build-data/suffix-rules.mk b/vpp/build-data/suffix-rules.mk
new file mode 100644
index 0000000..e3eeb92
--- /dev/null
+++ b/vpp/build-data/suffix-rules.mk
@@ -0,0 +1,27 @@
+# Copyright (c) 2016 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Shared suffix rules
+# Please do not set "SUFFIXES = .api.h .api" here
+
+%.api.h: %.api
+ @echo " APIGEN " $@ ; \
+ mkdir -p `dirname $@` ; \
+ $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
+ | vppapigen --input - --output $@ --show-name $@
+
+%.api.json: %.api
+ @echo " JSON APIGEN " $@ ; \
+ mkdir -p `dirname $@` ; \
+ $(CC) $(CPPFLAGS) -E -P -C -x c $^ \
+ | vppapigen --input - --json $@
diff --git a/vpp/build-root/Makefile b/vpp/build-root/Makefile
new file mode 100644
index 0000000..6e26e90
--- /dev/null
+++ b/vpp/build-root/Makefile
@@ -0,0 +1,1171 @@
+# Copyright (c) 2015 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+#
+# Copyright (c) 2007-2008 Eliot Dresselhaus
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject to
+# the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+
+######################################################################
+# Collect makefile fragments
+######################################################################
+
+# Scripts require non-POSIX parts of bash
+SHELL := /bin/bash
+
+# Where this makefile lives
+MU_BUILD_ROOT_DIR = $(shell pwd)
+MU_BUILD_NAME = $(shell basename $(MU_BUILD_ROOT_DIR))
+
+# Search path (e.g. multiple directories) where sources are found.
+SOURCE_PATH =
+
+# Pick up user's definitions for variables e.g. SOURCE_PATH, etc.
+-include build-config.mk
+
+MU_BUILD_ROOT_NAME = $(shell basename $(MU_BUILD_ROOT_DIR))
+MU_BUILD_DATA_DIR_NAME = build-data
+
+ABSOLUTE_SOURCE_PATH = $(foreach d,$(SOURCE_PATH),$(shell cd $(d) && pwd))
+
+SOURCE_PATH_BUILD_ROOT_DIRS = $(addsuffix /$(MU_BUILD_NAME),$(ABSOLUTE_SOURCE_PATH))
+SOURCE_PATH_BUILD_DATA_DIRS = $(addsuffix /$(MU_BUILD_DATA_DIR_NAME),$(ABSOLUTE_SOURCE_PATH))
+
+# For tools use build-root as source path, otherwise use given source path
+FIND_SOURCE_PATH = \
+ $(if $(is_build_tool), \
+ $(SOURCE_PATH_BUILD_ROOT_DIRS) $(MU_BUILD_ROOT_DIR), \
+ $(SOURCE_PATH_BUILD_DATA_DIRS))
+
+# First search given source path, then default to build-root
+FULL_SOURCE_PATH = $(SOURCE_PATH_BUILD_DATA_DIRS) $(MU_BUILD_ROOT_DIR)
+
+# Misc functions
+is_in_fn = $(strip $(filter $(1),$(2)))
+last_fn = $(lastword $1)
+chop_fn = $(wordlist 2,$(words $1),x $1)
+uniq_fn = $(strip $(if $1,$(call uniq_fn,$(call chop_fn,$1)) \
+ $(if $(filter $(call last_fn,$1),$(call chop_fn,$1)),,$(call last_fn,$1))))
+ifdef3_fn = $(if $(patsubst undefined,,$(origin $(1))),$(3),$(2))
+ifdef_fn = $(call ifdef3_fn,$(1),$(2),$($(1)))
+
+_mu_debug = $(warning "$(1) = $($(1))")
+
+$(foreach d,$(FIND_SOURCE_PATH), \
+ $(eval _mu_package_mk_in_$(d) = $(shell find $(d)/packages/*.mk 2> /dev/null)) \
+ $(eval _mu_srcdirs_in_$(d) = \
+ $(shell find $(d)/.. \
+ -maxdepth 1 \
+ -type d \
+ -and -not -name ".." \
+ -and -not -name $(MU_BUILD_ROOT_NAME) \
+ -and -not -name $(MU_BUILD_DATA_DIR_NAME))) \
+ $(eval _mu_non_package_files_in_$(d) = \
+ $(shell find $(d)/packages \
+ -type f \
+ -and -not -name '*.mk' \
+ -and -not -name '*~' 2> /dev/null)) \
+ $(foreach p,$(patsubst %.mk,%,$(notdir $(_mu_package_mk_in_$(d)))), \
+ $(eval _mu_package_dir_$(p) = $(d)) \
+ $(eval _mu_package_mk_$(p) = $(d)/packages/$(p).mk) \
+ ) \
+ $(foreach p,$(notdir $(_mu_srcdirs_in_$(d))), \
+ $(eval _mu_package_srcdir_$(p) = $(shell cd $(d)/../$(p) && pwd)) \
+ ) \
+)
+
+# Find root directory for package based on presence of package .mk
+# makefile fragment on source path.
+_find_build_data_dir_for_package_fn = $(shell \
+ set -eu$(BUILD_DEBUG) ; \
+ for d in $(FIND_SOURCE_PATH) ; do \
+ f="$${d}/packages/$(1).mk" ; \
+ [[ -f $${f} ]] && echo `cd $${d} && pwd` && exit 0 ; \
+ done ; \
+ echo "")
+find_build_data_dir_for_package_fn = $(call ifdef_fn,_mu_package_dir_$(1),)
+
+# dir/PACKAGE
+_find_source_fn = $(shell \
+ set -eu$(BUILD_DEBUG) ; \
+ d="$(call find_build_data_dir_for_package_fn,$(1))" ; \
+ [[ -n "$${d}" ]] && d="$${d}/../$(1)" ; \
+ echo "$${d}")
+find_source_fn = $(call ifdef3_fn,_mu_package_dir_$(1),,$(_mu_package_dir_$(1))/../$(1))
+
+# Find given FILE in source path as build-data/packages/FILE
+find_package_file_fn = $(shell \
+ set -eu$(BUILD_DEBUG) ; \
+ d="$(call find_build_data_dir_for_package_fn,$(1))" ; \
+ [[ -n "$${d}" ]] && d="$${d}/packages/$(2)" ; \
+ [[ -f "$${d}" ]] && echo "$${d}")
+
+# Find first FILE in source path with name PATH/build-data/FILE
+find_build_data_file_fn = $(shell \
+ set -eu$(BUILD_DEBUG) ; \
+ for d in $(FIND_SOURCE_PATH) ; do \
+ f="$${d}/$(1)" ; \
+ [[ -f $${f} ]] && echo `cd $${d} && pwd`/$(1) && exit 0 ; \
+ done ; \
+ echo "")
+
+######################################################################
+# ARCH, PLATFORM
+######################################################################
+
+NATIVE_ARCH = $(shell gcc -dumpmachine | sed -e 's/\([a-zA-Z_0-9]*\)-.*/\1/')
+
+# Find all platforms.mk that we can, including those from build-root
+$(foreach d,$(FULL_SOURCE_PATH), \
+ $(eval -include $(d)/platforms.mk))
+
+# Platform should be defined somewhere by specifying $($(PLATFORM)_arch)
+ARCH = $(strip $($(PLATFORM)_arch))
+ifeq ($(ARCH),)
+ $(error "Unknown platform `$(PLATFORM)'")
+endif
+
+# map e.g. ppc7450 -> ppc
+BASIC_ARCH = \
+ ${shell case '$(ARCH)' in \
+ (native) echo $(NATIVE_ARCH) ;; \
+ (i*86*) echo i386 ;; \
+ (ppc*|powerpc*) echo ppc ;; \
+ (*) echo '$(ARCH)' ;; \
+ esac }
+
+# x86_64 can be either 32/64. set BIACH=32 to get 32 bit libraries.
+BIARCH = 64
+
+x86_64_libdir = $(BIARCH)
+native_libdir = $($(NATIVE_ARCH)_libdir)
+
+# lib or lib64 depending
+arch_lib_dir = lib$($(BASIC_ARCH)_libdir)
+
+# OS to configure for. configure --host will be set to $(ARCH)-$(OS)
+# Allow per-platform overrides
+
+OS = $(strip $($(PLATFORM)_os))
+ifeq ($(OS),)
+ OS = mu-linux
+endif
+
+spu_target = spu
+native_target =
+
+is_native = $(if $(ARCH:native=),,true)
+not_native = $(if $(ARCH:native=),true,)
+
+ARCH_TARGET_tmp = $(call ifdef_fn,$(ARCH)_target,$(ARCH)-$(OS))
+TARGET = $(call ifdef_fn,$(PLATFORM)_target,$(ARCH_TARGET_tmp))
+TARGET_PREFIX = $(if $(not_native),$(TARGET)-,)
+
+# CPU microarchitecture detection.
+# Either set <platform>_march in build-data/platforms/<platform>.mk,
+# or detect and use the build-host instruction set
+
+MARCH = $(strip $($(PLATFORM)_march))
+ifeq ($(MARCH),)
+ ifneq ($(wildcard $(TOOL_INSTALL_DIR)/bin/$(TARGET)-gcc),)
+ TARGET_GCC = $(TOOL_INSTALL_DIR)/bin/$(TARGET)-gcc
+ else ifneq ($(wildcard $(MU_BUILD_ROOT_DIR)/tools/bin/$(TARGET)-gcc),)
+ TARGET_GCC = $(MU_BUILD_ROOT_DIR)/tools/bin/$(TARGET)-gcc
+ endif
+ ifneq ($(TARGET_GCC),)
+ MARCH = $(shell $(TARGET_GCC) -Q --help=target -march=native | grep march | sed -e 's/.*march=[[:space:]]*//')
+ else
+ MARCH = native
+ endif
+else
+ ifeq ($(MARCH),nehalem)
+ override MARCH = corei7
+ else ifeq ($(MARCH),westmere)
+ override MARCH = corei7
+ else ifeq ($(MARCH),sandybridge)
+ override MARCH = corei7-avx
+ else ifeq ($(MARCH),ivybridge)
+ override MARCH = core-avx-i
+ else ifeq ($(MARCH),haswell)
+ override MARCH = core-avx2
+ endif
+endif
+export MARCH
+
+MTUNE = $(strip $($(PLATFORM)_mtune))
+ifeq ($(MTUNE),)
+ MTUNE = generic
+endif
+
+######################################################################
+# Generic build stuff
+######################################################################
+
+# The package we are currently working on
+PACKAGE = $*
+
+# Build/install tags. This lets you have different CFLAGS/CPPFLAGS/LDFLAGS
+# for e.g. debug versus optimized compiles. Each tag has its own set of build/install
+# areas.
+TAG =
+TAG_PREFIX = $(if $(TAG),$(TAG)-)
+
+# yes you need the space
+tag_var_with_added_space_fn = $(if $($(TAG)_TAG_$(1)),$($(TAG)_TAG_$(1)) )
+
+# TAG=debug for debugging
+debug_TAG_CFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
+ -fstack-protector-all -fPIC
+debug_TAG_LDFLAGS = -g -O0 -DCLIB_DEBUG -DFORTIFY_SOURCE=2 -march=$(MARCH) \
+ -fstack-protector-all -fPIC
+
+BUILD_PREFIX_package = build-$(TAG_PREFIX)
+BUILD_PREFIX_tool = build-tool-$(TAG_PREFIX)
+INSTALL_PREFIX = install-$(TAG_PREFIX)
+IMAGES_PREFIX = images-$(TAG_PREFIX)
+
+# Whether we are building a tool or not
+tool_or_package_fn = $(if $(is_build_tool),tool,package)
+
+# Directory where packages are built & installed
+BUILD_DIR = $(MU_BUILD_ROOT_DIR)/$(BUILD_PREFIX_$(call tool_or_package_fn))$(ARCH)
+
+## BURT
+# we will deprecate INSTALL_DIR shortly for DFLT_INSTALL_DIR
+INSTALL_DIR = $(MU_BUILD_ROOT_DIR)/$(INSTALL_PREFIX)$(ARCH)
+# DFLT_INSTALL_DIR used in platforms.mk for $(PLATFORM)_DESTDIR_BASE
+DFLT_INSTALL_DIR := $(MU_BUILD_ROOT_DIR)/$(INSTALL_PREFIX)$(ARCH)
+## BURT
+
+PLATFORM_IMAGE_DIR = $(MU_BUILD_ROOT_DIR)/$(IMAGES_PREFIX)$(PLATFORM)
+
+# $(call VAR,DEFAULT)
+override_var_with_default_fn = $(if $($(1)),$($(1)),$(2))
+
+# $(call if_directory_exists_fn,D1,D2) returns D1 if it exists else D2
+define if_directory_exists_fn
+$(shell if test -d $(1); then echo $(1); else echo $(2); fi)
+endef
+
+# $(call if_file_exists_fn,F1,F2) returns F1 if it exists else F2
+define if_file_exists_fn
+$(shell if test -f $(1); then echo $(1); else echo $(2); fi)
+endef
+
+# Default VAR, package specified override of default PACKAGE_VAR
+package_var_fn = $(call override_var_with_default_fn,$(1)_$(2),$(1))
+
+package_build_dir_fn = $(call package_var_fn,$(1),build_dir)
+
+package_install_dir_fn = \
+ $(if $(is_build_tool),$(TOOL_INSTALL_DIR),$(INSTALL_DIR)/$(call package_build_dir_fn,$(1)))
+
+PACKAGE_BUILD_DIR = \
+ $(BUILD_DIR)/$(call package_build_dir_fn,$(PACKAGE))
+PACKAGE_INSTALL_DIR = \
+ $(call package_install_dir_fn,$(PACKAGE))
+
+# Tools (gcc, binutils, glibc...) are installed here
+TOOL_INSTALL_DIR = $(MU_BUILD_ROOT_DIR)/tools
+
+# Target specific tools go here e.g. mu-build/tools/ppc-mu-linux
+TARGET_TOOL_INSTALL_DIR = $(TOOL_INSTALL_DIR)/$(TARGET)
+
+# Set BUILD_DEBUG to vx or x enable shell command tracing.
+BUILD_DEBUG =
+
+# Message from build system itself (as opposed to make or shell commands)
+build_msg_fn = echo "@@@@ $(1) @@@@"
+
+# Allow CCACHE_DIR to be overridden, e.g. in .../build-root/build-config.mk
+ifeq ($(CCACHE_DIR),)
+ CCACHE_DIR=$(MU_BUILD_ROOT_DIR)/.ccache
+endif
+
+# Always prefer our own tools to those installed on system.
+# Note: ccache-bin must be before tool bin.
+BUILD_ENV = \
+ export CCACHE_DIR=$(CCACHE_DIR) ; \
+ export PATH=$(TOOL_INSTALL_DIR)/ccache-bin:$(TOOL_INSTALL_DIR)/bin:$${PATH} ; \
+ export PATH="`echo $${PATH} | sed -e s/[.]://`" ; \
+ $(if $(not_native),export CONFIG_SITE=$(MU_BUILD_ROOT_DIR)/config.site ;,) \
+ export LD_LIBRARY_PATH=$(TOOL_INSTALL_DIR)/lib64:$(TOOL_INSTALL_DIR)/lib ; \
+ set -eu$(BUILD_DEBUG) ; \
+ set -o pipefail
+
+######################################################################
+# Package build generic definitions
+######################################################################
+
+package_dir_fn = \
+ $(call find_build_data_dir_for_package_fn,$(1))/packages
+
+package_mk_fn = $(call package_dir_fn,$(1))/$(1).mk
+
+### BURT
+
+#next version
+#pkgPhaseDependMacro = $(foreach x,configure build install, \
+ $(eval $(1)_$(x)_depend := $($(1)_depend:%=%-$(x))))
+#version equivalent to original code
+pkgPhaseDependMacro = $(eval $(1)_configure_depend := $($(1)_depend:%=%-install))
+
+### BURT
+
+# Pick up built-root/pre-package-include.mk for all source directories
+$(foreach d,$(SOURCE_PATH_BUILD_ROOT_DIRS), \
+ $(eval -include $(d)/pre-package-include.mk))
+
+$(foreach d,$(addsuffix /packages,$(FIND_SOURCE_PATH)), \
+ $(eval -include $(d)/*.mk) \
+ $(eval ALL_PACKAGES += $(patsubst $(d)/%.mk,%,$(wildcard $(d)/*.mk))) \
+)
+
+# Pick up built-root/post-package-include.mk for all source directories
+$(foreach d,$(SOURCE_PATH_BUILD_ROOT_DIRS), \
+ $(eval -include $(d)/post-package-include.mk))
+
+# Linux specific native build tools
+NATIVE_TOOLS_LINUX = \
+ e2fsimage \
+ e2fsprogs \
+ fakeroot \
+ jffs2 \
+ mkimage \
+ zlib \
+ xz \
+ squashfs
+
+IS_LINUX = $(if $(findstring no,$($(PLATFORM)_uses_linux)),no,yes)
+
+NATIVE_TOOLS_$(IS_LINUX) += $(NATIVE_TOOLS_LINUX)
+
+# only build glibc for linux installs
+CROSS_TOOLS_$(IS_LINUX) += glibc gcc
+
+# must be first for bootstrapping
+NATIVE_TOOLS = findutils make
+
+# basic tools needed for build system
+NATIVE_TOOLS += git automake autoconf libtool texinfo bison flex tar
+
+# needed to compile gcc
+NATIVE_TOOLS += mpfr gmp mpc
+
+# Tool to sign binaries
+NATIVE_TOOLS += sign
+
+# ccache
+NATIVE_TOOLS += ccache
+
+# Tools needed on native host to build for platform
+NATIVE_TOOLS += $(call ifdef_fn,$(PLATFORM)_native_tools,)
+
+# Tools for cross-compiling from native -> ARCH
+CROSS_TOOLS = binutils gcc-bootstrap gdb
+
+# Tools needed on native host to build for platform
+CROSS_TOOLS += $(call ifdef_fn,$(PLATFORM)_cross_tools,)
+
+NATIVE_TOOLS += $(NATIVE_TOOLS_yes)
+CROSS_TOOLS += $(CROSS_TOOLS_yes)
+
+timestamp_name_fn = .mu_build_$(1)_timestamp
+CONFIGURE_TIMESTAMP = $(call timestamp_name_fn,configure)
+BUILD_TIMESTAMP = $(call timestamp_name_fn,build)
+INSTALL_TIMESTAMP = $(call timestamp_name_fn,install)
+
+TIMESTAMP_DIR = $(PACKAGE_BUILD_DIR)
+
+find_newer_files_fn = \
+ "`for i in $(2) ; do \
+ [[ -f $$i && $$i -nt $(1) ]] && echo "$$i" && exit 0; \
+ done ; \
+ exit 0;`"
+
+find_filter = -not -name '*~'
+find_filter += -and -not -path '*/.git*'
+find_filter += -and -not -path '*/.svn*'
+find_filter += -and -not -path '*/.CVS*'
+find_filter += -and -not -path '*/manual/*'
+find_filter += -and -not -path '*/autom4te.cache/*'
+find_filter += -and -not -path '*/doc/all-cfg.texi'
+find_filter += -and -not -path '*/.mu_build_*'
+
+find_newer_filtered_fn = \
+ (! -f $(1) \
+ || -n $(call find_newer_files_fn,$(1),$(3)) \
+ || -n "`find -H $(2) \
+ -type f \
+ -and -newer $(1) \
+ -and \( $(4) \) \
+ -print -quit`")
+
+find_newer_fn = \
+ $(call find_newer_filtered_fn,$(1),$(2),$(3),$(find_filter))
+
+######################################################################
+# Package dependencies
+######################################################################
+
+# This must come before %-configure, %-build, %-install pattern rules
+# or else dependencies will not work.
+
+package_dependencies_fn = \
+ $(patsubst %-install, %, \
+ $(filter %-install,$($(1)_configure_depend)))
+
+PACKAGE_DEPENDENCIES = $(call package_dependencies_fn,$(PACKAGE))
+
+# package specific configure, build, install dependencies
+add_package_dependency_fn = \
+ $(if $($(1)_$(2)_depend), \
+ $(eval $(1)-$(2) : $($(1)_$(2)_depend)))
+
+$(foreach p,$(ALL_PACKAGES), \
+ $(call add_package_dependency_fn,$(p),configure) \
+ $(call add_package_dependency_fn,$(p),build) \
+ $(call add_package_dependency_fn,$(p),install))
+
+TARGETS_RESPECTING_DEPENDENCIES = image_install wipe diff push-all pull-all find-source
+
+# carry over packages dependencies to image install, wipe, pull-all, push-all
+$(foreach p,$(ALL_PACKAGES), \
+ $(if $($(p)_configure_depend), \
+ $(foreach s,$(TARGETS_RESPECTING_DEPENDENCIES), \
+ $(eval $(p)-$(s): \
+ $(addsuffix -$(s), $(call package_dependencies_fn,$(p)))))))
+
+# recursively resolve dependencies
+resolve_dependencies2_fn = $(strip \
+ $(eval __added = $(filter-out $(4), \
+ $(call uniq_fn, \
+ $(foreach l,$(3), \
+ $(call ifdef3_fn,$(l)$(1),,$(call $(2),$($(l)$(1)))) \
+ )))) \
+ $(eval __known = $(call uniq_fn,$(4) $(3) $(__added))) \
+ $(if $(__added), \
+ $(call resolve_dependencies2_fn,$(1),$(2),$(__added),$(__known)), \
+ $(__known)) \
+)
+
+resolve_dependencies_null_fn = $(1)
+
+resolve_dependencies_fn = $(call resolve_dependencies2_fn,$(1),resolve_dependencies_null_fn,$(2))
+
+######################################################################
+# Package configure
+######################################################################
+
+# x86_64 can be either 32/64. set BIACH=32 to get 32 bit libraries.
+BIARCH = 64
+
+x86_64_libdir = $(BIARCH)
+native_libdir = $($(NATIVE_ARCH)_libdir)
+
+# lib or lib64 depending
+arch_lib_dir = lib$($(BASIC_ARCH)_libdir)
+
+# find dynamic linker as absolute path
+TOOL_INSTALL_LIB_DIR=$(TOOL_INSTALL_DIR)/$(TARGET)/$(arch_lib_dir)
+DYNAMIC_LINKER=${shell cd $(TOOL_INSTALL_LIB_DIR); echo ld*.so.*}
+
+# Pad dynamic linker & rpath so elftool will never have to change ELF section sizes.
+# Yes, this is a kludge.
+lots_of_slashes_to_pad_names = "/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////"
+
+# When PLATFORM != native we *always* use our own versions of GLIBC and dynamic linker
+# Allow per-platform overrides
+CROSS_LDFLAGS = $(strip $($(PLATFORM)_cross_ldflags))
+ifeq ($(CROSS_LDFLAGS),)
+ CROSS_LDFLAGS = \
+ -Wl,--dynamic-linker=$(lots_of_slashes_to_pad_names)$(TOOL_INSTALL_LIB_DIR)/$(DYNAMIC_LINKER) \
+ -Wl,-rpath -Wl,$(lots_of_slashes_to_pad_names)$(TOOL_INSTALL_LIB_DIR)
+endif
+
+cross_ldflags = $(if $(is_native)$(is_build_tool),,$(CROSS_LDFLAGS) )
+
+# $(call installed_libs_fn,PACKAGE)
+# Return install library directory for given package.
+# Some packages (e.g. openssl) don't install under lib64; instead they use lib
+define installed_lib_fn
+$(call if_directory_exists_fn,
+ $(call package_install_dir_fn,$(1))/$(arch_lib_dir),
+ $(call package_install_dir_fn,$(1))/lib)
+endef
+
+# Set -L and rpath to point to dependent libraries previously built by us.
+installed_libs_fn = \
+ $(foreach i,$(1), \
+ -L$(call installed_lib_fn,$(i)) \
+ -Wl,-rpath -Wl,$(call installed_lib_fn,$(i)))
+
+# As above for include files
+installed_include_fn = $(call package_install_dir_fn,$(1))/include
+
+installed_includes_fn = $(foreach i,$(1),-I$(call installed_include_fn,$(i)))
+
+# By default package CPPFLAGS (to set include path -I) and LDFLAGS (to set link path -L)
+# point at dependent install directories.
+DEFAULT_CPPFLAGS = $(call installed_includes_fn, $(PACKAGE_DEPENDENCIES))
+DEFAULT_LDFLAGS = $(call installed_libs_fn, $(PACKAGE_DEPENDENCIES))
+
+configure_var_fn = \
+ $(call tag_var_with_added_space_fn,$(1))$(call override_var_with_default_fn,$(PACKAGE)_$(1),$(DEFAULT_$(1)))
+configure_ldflags_fn = \
+ $(cross_ldflags)$(call configure_var_fn,LDFLAGS)
+
+# Allow packages to override CPPFLAGS, CFLAGS, and LDFLAGS
+CONFIGURE_ENV = \
+ $(if $(call configure_var_fn,CPPFLAGS), \
+ CPPFLAGS="$(CPPFLAGS) $(call configure_var_fn,CPPFLAGS)") \
+ $(if $(call configure_var_fn,CFLAGS), \
+ CFLAGS="$(CFLAGS) $(call configure_var_fn,CFLAGS)") \
+ $(if $(call configure_var_fn,CCASFLAGS), \
+ CCASFLAGS="$(CCASFLAGS) $(call configure_var_fn,CCASFLAGS)") \
+ $(if $(call configure_ldflags_fn), \
+ LDFLAGS="$(LDFLAGS) $(call configure_ldflags_fn)") \
+ $(if $($(PACKAGE)_configure_env),$($(PACKAGE)_configure_env))
+
+### BURT
+# only partially used now (used in a few .mk files)
+ifeq ($(is_build_tool),yes)
+prefix = $(PACKAGE_INSTALL_DIR)
+libdir = $(PACKAGE_INSTALL_DIR)/$(arch_lib_dir)
+libexecdir = $(PACKAGE_INSTALL_DIR)/usr/libexec
+DESTDIR = /
+else
+# Eventually simplify this with no per package DESTDIR or prefix
+ppdMacro = $(if $(PER_PACKAGE_DESTDIR),$(call package_build_dir_fn,$(1)))
+pppMacro = $(if $(PER_PACKAGE_PREFIX),$(call package_build_dir_fn,$(1)))
+prefixMacro = $($(PLATFORM)_PREFIX_BASE)/$(pppMacro)
+prefix = $(call prefixMacro,$(PACKAGE))
+libdir = $($(PLATFORM)_LIBDIR)
+libexecdir = $($(PLATFORM)_LIBEXECDIR)
+destdirMacro = $($(PLATFORM)_DESTDIR_BASE)$(ppdMacro)
+DESTDIR = $(call destdirMacro,$(PACKAGE))
+endif
+### BURT
+### dbarach
+image_extra_dependencies = $($(PLATFORM)_image_extra_dependencies)
+### dbarach
+
+configure_package_gnu = \
+ s=$(call find_source_fn,$(PACKAGE_SOURCE)) ; \
+ if [ ! -f $$s/configure ] ; then \
+ autoreconf -i -f $$s ; \
+ fi ; \
+ cd $(PACKAGE_BUILD_DIR) ; \
+ env $(CONFIGURE_ENV) \
+ $$s/configure \
+ $(if $($(PACKAGE)_configure_host_and_target), \
+ $($(PACKAGE)_configure_host_and_target), \
+ $(if $(not_native),--host=$(TARGET),)) \
+ $(if $($(PACKAGE)_configure_prefix), \
+ $($(PACKAGE)_configure_prefix), \
+ --libdir=$(PACKAGE_INSTALL_DIR)/$(arch_lib_dir) \
+ --prefix=$(PACKAGE_INSTALL_DIR)) \
+ $($(PACKAGE)_configure_args) \
+ $($(PACKAGE)_configure_args_$(PLATFORM))
+
+configure_package = \
+ $(call build_msg_fn,Configuring $(PACKAGE) in $(PACKAGE_BUILD_DIR)) ; \
+ mkdir -p $(PACKAGE_BUILD_DIR) ; \
+ $(if $($(PACKAGE)_configure), \
+ $($(PACKAGE)_configure), \
+ $(configure_package_gnu))
+
+# Tools (e.g. gcc, binutils, gdb) required a platform to build for
+check_platform = \
+ is_tool="$(is_build_tool)" ; \
+ is_cross_package="$(findstring $(PACKAGE),$(CROSS_TOOLS))" ; \
+ is_arch_native="$(if $(subst native,,$(ARCH)),,yes)" ; \
+ if [ "$${is_tool}" == "yes" \
+ -a "$${is_cross_package}" != "" \
+ -a "$${is_arch_native}" != "" ]; then \
+ $(call build_msg_fn,You must specify PLATFORM for building tools) ; \
+ exit 1 ; \
+ fi ; \
+ : check that platform gcc can be found ; \
+ target_gcc=gcc ; \
+ if [ "$${is_arch_native}" != "yes" ] ; then \
+ target_gcc=$(TARGET)-gcc ; \
+ fi ; \
+ if [ "$${is_tool}" != "yes" \
+ -a "$${is_arch_native}" != "yes" \
+ -a ! -x "`which 2> /dev/null $${target_gcc}`" ] ; then \
+ $(call build_msg_fn, \
+ No cross-compiler found for platform $(PLATFORM) target $(TARGET); \
+ try make PLATFORM=$(PLATFORM) install-tools) ; \
+ exit 1 ; \
+ fi
+
+configure_check_timestamp = \
+ @$(BUILD_ENV) ; \
+ $(check_platform) ; \
+ mkdir -p $(PACKAGE_BUILD_DIR) ; \
+ mkdir -p $(PACKAGE_INSTALL_DIR) ; \
+ conf="$(TIMESTAMP_DIR)/$(CONFIGURE_TIMESTAMP)" ; \
+ dirs="$(call package_mk_fn,$(PACKAGE)) \
+ $(wildcard $(call find_source_fn,$(PACKAGE_SOURCE))/configure) \
+ $(MU_BUILD_ROOT_DIR)/config.site" ; \
+ if [[ $(call find_newer_fn, $${conf}, $${dirs}, $?) ]]; then \
+ $(configure_package) ; \
+ touch $${conf} ; \
+ else \
+ $(call build_msg_fn,Configuring $(PACKAGE): nothing to do) ; \
+ fi
+
+.PHONY: %-configure
+%-configure: %-find-source
+ $(configure_check_timestamp)
+
+######################################################################
+# Package build
+######################################################################
+
+linux_n_cpus = `grep '^processor' /proc/cpuinfo | wc -l`
+
+MAKE_PARALLEL_JOBS = \
+ -j $(shell \
+ if [ -f /proc/cpuinfo ] ; then \
+ expr 2 '*' $(linux_n_cpus) ; \
+ else \
+ echo 1 ; \
+ fi)
+
+MAKE_PARALLEL_FLAGS = $(if $($(PACKAGE)_make_parallel_fails),,$(MAKE_PARALLEL_JOBS))
+
+# Make command shorthand for packages & tools.
+PACKAGE_MAKE = \
+ $(MAKE) \
+ -C $(PACKAGE_BUILD_DIR) \
+ $($(PACKAGE)_make_args) \
+ $(MAKE_PARALLEL_FLAGS)
+
+build_package = \
+ $(call build_msg_fn,Building $* in $(PACKAGE_BUILD_DIR)) ; \
+ mkdir -p $(PACKAGE_BUILD_DIR) ; \
+ cd $(PACKAGE_BUILD_DIR) ; \
+ $(if $($(PACKAGE)_build), \
+ $($(PACKAGE)_build), \
+ $(PACKAGE_MAKE))
+
+build_check_timestamp = \
+ @$(BUILD_ENV) ; \
+ comp="$(TIMESTAMP_DIR)/$(BUILD_TIMESTAMP)" ; \
+ conf="$(TIMESTAMP_DIR)/$(CONFIGURE_TIMESTAMP)" ; \
+ dirs="$(call find_source_fn,$(PACKAGE_SOURCE)) \
+ $($(PACKAGE)_build_timestamp_depends) \
+ $(if $(is_build_tool),,$(addprefix $(INSTALL_DIR)/,$(PACKAGE_DEPENDENCIES)))" ; \
+ if [[ $${conf} -nt $${comp} \
+ || $(call find_newer_fn, $${comp}, $${dirs}, $?) ]]; then \
+ $(build_package) ; \
+ touch $${comp} ; \
+ else \
+ $(call build_msg_fn,Building $(PACKAGE): nothing to do) ; \
+ fi
+
+.PHONY: %-build
+%-build: %-configure
+ $(build_check_timestamp)
+
+.PHONY: %-rebuild
+%-rebuild: %-wipe %-build
+ @ :
+
+######################################################################
+# Package install
+######################################################################
+
+install_package = \
+ : by default, for non-tools, remove any previously installed bits ; \
+ $(if $(is_build_tool)$($(PACKAGE)_keep_instdir), \
+ true, \
+ rm -rf $(PACKAGE_INSTALL_DIR)); \
+ mkdir -p $(PACKAGE_INSTALL_DIR) ; \
+ $(if $($(PACKAGE)_pre_install),$($(PACKAGE)_pre_install),true); \
+ $(if $($(PACKAGE)_install), \
+ $($(PACKAGE)_install), \
+ $(PACKAGE_MAKE) \
+ $($(PACKAGE)_install_args) \
+ install) ; \
+ $(if $($(PACKAGE)_post_install),$($(PACKAGE)_post_install),true)
+
+install_check_timestamp = \
+ @$(BUILD_ENV) ; \
+ inst=$(TIMESTAMP_DIR)/$(INSTALL_TIMESTAMP) ; \
+ dirs="$(PACKAGE_BUILD_DIR) \
+ $($(PACKAGE)_install_dependencies)" ; \
+ if [[ $(call find_newer_fn, $${inst}, $${dirs}, $?) ]]; then \
+ $(call build_msg_fn,Installing $(PACKAGE)) ; \
+ $(install_package) ; \
+ touch $${inst} ; \
+ else \
+ $(call build_msg_fn,Installing $(PACKAGE): nothing to do) ; \
+ fi
+
+.PHONY: %-install
+%-install: %-build
+ $(install_check_timestamp)
+
+######################################################################
+# Source code managment
+######################################################################
+
+GIT = git
+
+# Maps package name to source directory root.
+# Multiple packages may use a single source tree.
+# For example, gcc-bootstrap package shares gcc source.
+PACKAGE_SOURCE = $(if $($(PACKAGE)_source),$($(PACKAGE)_source),$(PACKAGE))
+
+# Use git to download source if directory is not found
+find_source_for_package = \
+ @$(BUILD_ENV) ; \
+ $(call build_msg_fn,Arch for platform '$(PLATFORM)' is $(ARCH)) ; \
+ $(call build_msg_fn,Finding source for $(PACKAGE)) ; \
+ s="$(call find_source_fn,$(PACKAGE_SOURCE))" ; \
+ [[ -z "$${s}" ]] \
+ && $(call build_msg_fn,Package $(PACKAGE) not found with path $(SOURCE_PATH)) \
+ && exit 1; \
+ mk="$(call find_build_data_dir_for_package_fn,$(PACKAGE_SOURCE))/packages/$(PACKAGE).mk"; \
+ $(call build_msg_fn,Makefile fragment found in $${mk}) ; \
+ if [ ! -d "$${s}" ] ; then \
+ d=`dirname $${mk}` ; \
+ i=`cd $${d}/.. && ($(GIT) config remote.origin.url || \
+ awk '/URL/ { print $$2; }' .git/remotes/origin)`; \
+ g=`dirname $${i}` ; \
+ $(call build_msg_fn,Fetching source: $(GIT) clone $${g}/$(PACKAGE_SOURCE) $$s) ; \
+ if ! $(GIT) clone $${g}/$(PACKAGE_SOURCE) $$s; then \
+ $(call build_msg_fn,No source for $(PACKAGE) in $${g}); \
+ exit 1; \
+ fi ; \
+ $(call build_msg_fn,Fix file dates in $${g}/$(PACKAGE_SOURCE)) ; \
+ (cd $${s} ; $(MU_BUILD_ROOT_DIR)/autowank --touch) ; \
+ fi ; \
+ s=`cd $${s} && pwd` ; \
+ $(call build_msg_fn,Source found in $${s})
+
+.PHONY: %-find-source
+%-find-source:
+ $(find_source_for_package)
+
+.PHONY: %-push %-pull %-push-all %-pull-all
+%-push %-pull %-push-all %-pull-all:
+ @$(BUILD_ENV) ; \
+ push_or_pull=$(patsubst %-all,%,$(subst $(PACKAGE)-,,$@)) ; \
+ $(call build_msg_fn,Git $${push_or_pull} source for $(PACKAGE)) ; \
+ s=$(call find_source_fn,$(PACKAGE_SOURCE)) ; \
+ if [ "x$$s" = "x" ]; then \
+ $(call build_msg_fn,No source for $(PACKAGE)) ; \
+ exit 1; \
+ fi ; \
+ cd $$s && $(GIT) $${push_or_pull}
+
+# Pull all packages for platform
+.PHONY: pull-all
+pull-all:
+ @$(BUILD_ENV) ; \
+ $(call build_msg_fn,Git pull build system) ; \
+ for d in $(MU_BUILD_ROOT_DIR) \
+ $(SOURCE_PATH_BUILD_ROOT_DIRS) \
+ $(SOURCE_PATH_BUILD_DATA_DIRS); do \
+ $(call build_msg_fn,Git pull $${d}) ; \
+ pushd $${d} >& /dev/null && $(GIT) pull && popd >& /dev/null ; \
+ done ; \
+ $(call build_msg_fn,Git pull build tools) ; \
+ $(call tool_make_target_fn,pull-all) ; \
+ $(call build_msg_fn,Git pull packages for platform $(PLATFORM)) ; \
+ make PLATFORM=$(PLATFORM) $(patsubst %,%-pull-all,$(ROOT_PACKAGES))
+
+.PHONY: %-diff
+%-diff:
+ @$(BUILD_ENV) ; \
+ d=$(call find_source_fn,$(PACKAGE_SOURCE)) ; \
+ $(call build_msg_fn,Git diff $(PACKAGE)) ; \
+ if [ -d $${d}/.git ] ; then \
+ cd $${d} && $(GIT) --no-pager diff 2>/dev/null; \
+ else \
+ $(call build_msg_fn, $(PACKAGE) not a git directory) ; \
+ fi
+
+
+
+# generate diffs for everything in source path
+.PHONY: diff-all
+diff-all:
+ @$(BUILD_ENV) ; \
+ $(call build_msg_fn,Generate diffs) ; \
+ for r in $(ABSOLUTE_SOURCE_PATH); do \
+ for d in $${r}/* ; do \
+ if [ -d $${d} ] ; then \
+ $(call build_msg_fn,Git diff $${d}) ; \
+ if [ -d $${d}/.git ] ; then \
+ cd $${d} && $(GIT) --no-pager diff 2>/dev/null; \
+ else \
+ $(call build_msg_fn, $${d} not a git directory) ; \
+ fi ; \
+ fi ; \
+ done ; \
+ done
+
+######################################################################
+# System images
+######################################################################
+
+IMAGE_DIR = $(MU_BUILD_ROOT_DIR)/image-$(PLATFORM)
+
+# Reports shared libraries in given directory
+find_shared_libs_fn = \
+ find $(1) \
+ -maxdepth 1 \
+ -regex '.*/lib[a-z0-9_]+\+?\+?.so' \
+ -o -regex '.*/lib[a-z0-9_]+-[0-9.]+\+?\+?.so' \
+ -o -regex '.*/lib[a-z0-9_]+\+?\+?.so.[0-9.]+'
+
+# By default pick up files from binary directories and /etc.
+# Also include shared libraries.
+DEFAULT_IMAGE_INCLUDE = \
+ for d in bin sbin libexec \
+ usr/bin usr/sbin usr/libexec \
+ etc; do \
+ [[ -d $$d ]] && echo $$d; \
+ done ; \
+ [[ -d $(arch_lib_dir) ]] \
+ && $(call find_shared_libs_fn,$(arch_lib_dir))
+
+# Define any shell functions needed by install scripts
+image_install_functions = \
+ $(foreach p,$(ALL_PACKAGES), \
+ $(if $($(p)_image_install_functions), \
+ $($(p)_image_install_functions)))
+
+# Should always be over-written by temp dir in %-root-image rule
+IMAGE_INSTALL_DIR = $(error you need to set IMAGE_INSTALL_DIR)
+
+image_install_fn = \
+ @$(BUILD_ENV) ; \
+ $(call build_msg_fn,Image-install $(1) for platform $(PLATFORM)) ; \
+ inst_dir=$(IMAGE_INSTALL_DIR) ; \
+ mkdir -p $${inst_dir} ; \
+ cd $(2) ; \
+ : select files to include in image ; \
+ image_include_files=" \
+ `$(call ifdef_fn,$(1)_image_include,$(DEFAULT_IMAGE_INCLUDE)) ; \
+ echo "" ; \
+ exit 0 ; `"; \
+ : select files regexps to exclude from image ; \
+ image_exclude_files="" ; \
+ if [ ! -z "$($(1)_image_exclude)" ] ; then \
+ image_exclude_files="${image_exclude_files} \
+ $(patsubst %,--exclude=%,$($(1)_image_exclude))" ; \
+ fi ; \
+ [[ -z "$${image_include_files}" || $${image_include_files} == " " ]] \
+ || tar cf - $${image_include_files} $${image_exclude_files} \
+ | tar xf - -C $${inst_dir} ; \
+ : copy files from copyimg directories on source path if present ; \
+ for build_data_dir in $(SOURCE_PATH_BUILD_DATA_DIRS) ; do \
+ d="$${build_data_dir}/packages/$(1).copyimg" ; \
+ if [ -d "$${d}" ] ; then \
+ env $($(PLATFORM)_copyimg_env) \
+ $(MU_BUILD_ROOT_DIR)/copyimg $${d} $${inst_dir} ; \
+ fi ; \
+ done ; \
+ : run package dependent install script ; \
+ $(if $($(1)_image_install), \
+ $(image_install_functions) \
+ cd $${inst_dir} ; \
+ $($(1)_image_install))
+
+.PHONY: %-image_install
+%-image_install: %-install
+ $(call image_install_fn,$(PACKAGE),$(PACKAGE_INSTALL_DIR))
+
+basic_system_image_include = \
+ $(call ifdef_fn,$(PLATFORM)_basic_system_image_include, \
+ echo bin/ldd ; \
+ echo $(arch_lib_dir)/ld*.so* ; \
+ $(call find_shared_libs_fn, $(arch_lib_dir)))
+
+basic_system_image_install = \
+ mkdir -p bin lib mnt proc root sbin sys tmp etc ; \
+ mkdir -p usr usr/{bin,sbin} usr/lib ; \
+ mkdir -p var var/{lib,lock,log,run,tmp} ; \
+ mkdir -p var/lock/subsys var/lib/urandom
+
+.PHONY: basic_system-image_install
+basic_system-image_install: # linuxrc-install
+ $(if $(not_native), \
+ $(call image_install_fn,basic_system,$(TARGET_TOOL_INSTALL_DIR)),)
+
+ROOT_PACKAGES = $(if $($(PLATFORM)_root_packages),$($(PLATFORM)_root_packages),$(default_root_packages))
+
+.PHONY: install-packages
+install-packages: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
+ @$(BUILD_ENV) ; \
+ set -eu$(BUILD_DEBUG) ; \
+ d=$(MU_BUILD_ROOT_DIR)/packages-$(PLATFORM) ; \
+ rm -rf $${d} ; \
+ mkdir -p $${d}; \
+ $(MAKE) -C $(MU_BUILD_ROOT_DIR) IMAGE_INSTALL_DIR=$${d} \
+ $(patsubst %,%-image_install, \
+ basic_system \
+ $(ROOT_PACKAGES)) || exit 1; \
+ $(call build_msg_fn, Relocating ELF executables to run in $${d}) ; \
+ find $${d} -type f \
+ -exec elftool quiet in '{}' out '{}' \
+ set-interpreter \
+ $${d}/$(arch_lib_dir)/$(DYNAMIC_LINKER) \
+ set-rpath $${d}/$(arch_lib_dir):$${d}/lib ';' ; \
+ : strip symbols from files ; \
+ if [ $${strip_symbols:-no} = 'yes' ] ; then \
+ $(call build_msg_fn, Stripping symbols from files) ; \
+ find $${d} -type f \
+ -exec \
+ $(TARGET_PREFIX)strip \
+ --strip-unneeded '{}' ';' \
+ >& /dev/null ; \
+ else \
+ $(call build_msg_fn, NOT stripping symbols) ; \
+ fi
+
+# readonly root squashfs image
+# Note: $(call build_msg_fn) does not seem to work inside of fakeroot so we use echo
+.PHONY: ro-image
+$(PLATFORM_IMAGE_DIR)/ro.img ro-image: $(patsubst %,%-find-source,$(ROOT_PACKAGES))
+ @$(BUILD_ENV) ; \
+ d=$(PLATFORM_IMAGE_DIR) ; \
+ mkdir -p $$d; \
+ ro_image=$$d/ro.img ; \
+ rm -f $${ro_image} ; \
+ tmp_dir="`mktemp -d $$d/ro-image-XXXXXX`" ; \
+ chmod 0755 $${tmp_dir} ; \
+ cd $${tmp_dir} ; \
+ trap "rm -rf $${tmp_dir}" err ; \
+ fakeroot /bin/bash -c "{ \
+ set -eu$(BUILD_DEBUG) ; \
+ $(MAKE) -C $(MU_BUILD_ROOT_DIR) IMAGE_INSTALL_DIR=$${tmp_dir} \
+ $(patsubst %,%-image_install, \
+ basic_system \
+ $(ROOT_PACKAGES)) ; \
+ : make dev directory ; \
+ $(linuxrc_makedev) ; \
+ echo @@@@ Relocating ELF executables to run in / @@@@ ; \
+ find $${d} -type f \
+ -exec elftool quiet in '{}' out '{}' \
+ set-interpreter \
+ /$(arch_lib_dir)/$(DYNAMIC_LINKER) \
+ set-rpath /$(arch_lib_dir):/lib ';' ; \
+ : strip symbols from files ; \
+ if [ '$${strip_symbols:-yes}' = 'yes' ] ; then \
+ echo @@@@ Stripping symbols from files @@@@ ; \
+ find $${tmp_dir} -type f \
+ -exec \
+ $(TARGET_PREFIX)strip \
+ --strip-unneeded '{}' ';' \
+ >& /dev/null ; \
+ else \
+ echo @@@@ NOT stripping symbols @@@@ ; \
+ fi ; \
+ if [ $${sign_executables:-yes} = 'yes' \
+ -a -n "$($(PLATFORM)_public_key)" ] ; then \
+ echo @@@@ Signing executables @@@@ ; \
+ find $${tmp_dir} -type f \
+ | xargs sign $($(PLATFORM)_public_key) \
+ $($(PLATFORM)_private_key_passphrase) ; \
+ fi ; \
+ : make read-only file system ; \
+ mksquashfs \
+ $${tmp_dir} $${ro_image} \
+ -no-exports -no-progress -no-recovery ; \
+ }" ; \
+ : cleanup tmp directory ; \
+ rm -rf $${tmp_dir}
+
+MKFS_JFFS2_BYTE_ORDER_x86_64 = -l
+MKFS_JFFS2_BYTE_ORDER_i686 = -l
+MKFS_JFFS2_BYTE_ORDER_ppc = -b
+MKFS_JFFS2_BYTE_ORDER_mips = -b
+MKFS_JFFS2_BYTE_ORDER_native = $(MKFS_JFFS2_BYTE_ORDER_$(NATIVE_ARCH))
+
+MKFS_JFFS2_SECTOR_SIZE_IN_KBYTES = \
+ $(call ifdef_fn,$(PLATFORM)_jffs2_sector_size_in_kbytes,256)
+
+mkfs_fn_jffs2 = mkfs.jffs2 \
+ --eraseblock=$(MKFS_JFFS2_SECTOR_SIZE_IN_KBYTES)KiB \
+ --root=$(1) --output=$(2) \
+ $(MKFS_JFFS2_BYTE_ORDER_$(BASIC_ARCH))
+
+# As things stand the actual initrd size parameter
+# is set in .../open-repo/build-data/packages/linuxrc.mk.
+EXT2_RW_IMAGE_SIZE=notused
+
+mkfs_fn_ext2 = \
+ e2fsimage -d $(1) -f $(2) -s $(EXT2_RW_IMAGE_SIZE)
+
+RW_IMAGE_TYPE=jffs2
+
+make_rw_image_fn = \
+ $(call mkfs_fn_$(RW_IMAGE_TYPE),$(1),$(2))
+
+rw_image_embed_ro_image_fn = \
+ mkdir -p proc initrd images ro rw union ; \
+ cp $(PLATFORM_IMAGE_DIR)/$(1) images/$(1) ; \
+ md5sum images/$(1) > images/$(1).md5 ; \
+ echo Built by $(LOGNAME) at `date` > images/$(1).stamp ; \
+ mkdir -p changes/$(1)
+
+# make sure RW_IMAGE_TYPE is a type we know how to build
+.PHONY: rw-image-check-type
+rw-image-check-type:
+ @$(BUILD_ENV) ; \
+ if [ -z "$(make_rw_image_fn)" ] ; then \
+ $(call build_msg_fn,Unknown read/write fs image type; \
+ try RW_IMAGE_TYPE=ext2 or RW_IMAGE_TYPE=jffs2) ; \
+ exit 1; \
+ fi
+
+# read write image
+.PHONY: rw-image
+rw-image: rw-image-check-type ro-image
+ @$(BUILD_ENV) ; \
+ d=$(PLATFORM_IMAGE_DIR) ; \
+ mkdir -p $$d ; \
+ rw_image="$$d/rw.$(RW_IMAGE_TYPE)" ; \
+ ro_image="ro.img" ; \
+ rm -f $$rw_image ; \
+ tmp_dir="`mktemp -d $$d/rw-image-XXXXXX`" ; \
+ chmod 0755 $${tmp_dir} ; \
+ cd $${tmp_dir} ; \
+ trap "rm -rf $${tmp_dir}" err ; \
+ fakeroot /bin/bash -c "{ \
+ set -eu$(BUILD_DEBUG) ; \
+ $(linuxrc_makedev) ; \
+ $(call rw_image_embed_ro_image_fn,$${ro_image}) ; \
+ $(call make_rw_image_fn,$${tmp_dir},$${rw_image}) ; \
+ }" ; \
+ : cleanup tmp directory ; \
+ rm -rf $${tmp_dir}
+
+images: linuxrc-install linux-install $(image_extra_dependencies) rw-image
+ @$(BUILD_ENV) ; \
+ d=$(PLATFORM_IMAGE_DIR) ; \
+ cd $(BUILD_DIR)/linux-$(PLATFORM) ; \
+ i="" ; \
+ [[ -z $$i && -f bzImage ]] && i=bzImage ; \
+ [[ -z $$i && -f zImage ]] && i=zImage ; \
+ [[ -z $$i && -f linux ]] && i=linux ; \
+ [[ -z $$i && -f vmlinux ]] && i=vmlinux ; \
+ [[ -z $$i ]] \
+ && $(call build_msg_fn,no linux image to install \
+ in $(BUILD_DIR)/linux-$(PLATFORM)) \
+ && exit 1 ; \
+ cp $$i $$d
+
+######################################################################
+# Tool chain build/install
+######################################################################
+
+.PHONY: ccache-install
+ccache-install:
+ $(MAKE) -C $(MU_BUILD_ROOT_DIR) ccache-build
+ mkdir -p $(TOOL_INSTALL_DIR)/ccache-bin
+ ln -sf $(MU_BUILD_ROOT_DIR)/build-tool-native/ccache/ccache \
+ $(TOOL_INSTALL_DIR)/ccache-bin/$(TARGET_PREFIX)gcc
+
+TOOL_MAKE = $(MAKE) is_build_tool=yes
+
+tool_make_target_fn = \
+ $(if $(strip $(NATIVE_TOOLS)), \
+ $(TOOL_MAKE) $(patsubst %,%-$(1),$(NATIVE_TOOLS)) ARCH=native || exit 1 ;) \
+ $(TOOL_MAKE) $(patsubst %,%-$(1),$(CROSS_TOOLS))
+
+.PHONY: install-tools
+install-tools:
+ $(call tool_make_target_fn,install)
+
+.PHONY: bootstrap-tools
+bootstrap-tools:
+ $(TOOL_MAKE) make-install findutils-install git-install \
+ automake-install autoconf-install libtool-install fakeroot-install
+
+
+######################################################################
+# Clean
+######################################################################
+
+package_clean_script = \
+ @$(call build_msg_fn, Cleaning $* in $(PACKAGE_INSTALL_DIR)) ; \
+ $(BUILD_ENV) ; \
+ $(if $(is_build_tool),,rm -rf $(PACKAGE_INSTALL_DIR) ;) \
+ rm -rf $(TIMESTAMP_DIR)/$(call timestamp_name_fn,*) ; \
+ $(if $($(PACKAGE)_clean), \
+ $($(PACKAGE)_clean), \
+ $(PACKAGE_MAKE) clean)
+
+.PHONY: %-clean
+%-clean:
+ $(package_clean_script)
+
+# Wipe e.g. remove build and install directories for packages.
+package_wipe_script = \
+ @message=$(if $(is_build_tool),"Wiping build $(PACKAGE)","Wiping build/install $(PACKAGE)") ; \
+ $(call build_msg_fn,$$message) ; \
+ $(BUILD_ENV) ; \
+ rm -rf $(if $(is_build_tool),$(PACKAGE_BUILD_DIR),$(PACKAGE_INSTALL_DIR) $(PACKAGE_BUILD_DIR))
+
+.PHONY: %-wipe
+%-wipe:
+ $(package_wipe_script)
+
+# Wipe entire build/install area for TAG and PLATFORM
+.PHONY: wipe-all
+wipe-all:
+ @$(call build_msg_fn, Wiping $(BUILD_DIR) $(INSTALL_DIR)) ; \
+ $(BUILD_ENV) ; \
+ rm -rf $(BUILD_DIR) $(INSTALL_DIR)
+
+# Clean everything
+distclean:
+ rm -rf $(MU_BUILD_ROOT_DIR)/$(BUILD_PREFIX_package)*/
+ rm -rf $(MU_BUILD_ROOT_DIR)/$(BUILD_PREFIX_tool)*
+ rm -rf $(MU_BUILD_ROOT_DIR)/$(INSTALL_PREFIX)*
+ rm -rf $(MU_BUILD_ROOT_DIR)/$(IMAGES_PREFIX)*
+ rm -rf $(TOOL_INSTALL_DIR)
+ rm -rf $(MU_BUILD_ROOT_DIR)/*.deb
+ rm -rf $(MU_BUILD_ROOT_DIR)/*.rpm
+ rm -rf $(MU_BUILD_ROOT_DIR)/*.changes
+ rm -rf $(MU_BUILD_ROOT_DIR)/python
+ if [ -e /usr/bin/dh ];then (cd $(MU_BUILD_ROOT_DIR)/deb/;debian/rules clean); fi
+ rm -f $(MU_BUILD_ROOT_DIR)/deb/debian/*.install
+ rm -f $(MU_BUILD_ROOT_DIR)/deb/debian/*.dkms
+ rm -f $(MU_BUILD_ROOT_DIR)/deb/debian/changelog
diff --git a/vpp/build-root/autowank b/vpp/build-root/autowank
new file mode 100755
index 0000000..21a440d
--- /dev/null
+++ b/vpp/build-root/autowank
@@ -0,0 +1,307 @@
+#!/bin/bash
+
+# Copyright (c) 2015 Cisco and/or its affiliates.
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# This aptly-named script verifies and fixes time ordering
+# problems with Makefile.{am,in} aclocal.m4 configure* files.
+
+set -eu
+#set -vx
+
+touch=""
+commit=""
+comma_v=""
+aclocal=""
+optimize=""
+
+# The old autowank scheme used "touch <foo> ; sleep 1"
+# to ensure differentiable, ordered timestamps. Worked, but
+# took N seconds given N files to fix. We have an example
+# which wastes multiple minutes given the old scheme.
+#
+# This version generates a sequence of timestamps
+# starting an hour ago. That gives us
+# lots to play with, in case some obnoxious program feels the need
+# to complain about timestamps in the future.
+
+# If we're in UTC+N land, generate UTC+(N+1)
+# If we're in UTC-N land, generate UTC-(N-1)
+
+my_tz=`date +%z`
+sign=`echo $my_tz | sed -n -e 's/^\(.\{1\}\).*$/\1/p'`
+t=`echo $my_tz | sed -n -e 's/^\(.\{1\}\)//p'`
+tz_hour=`echo $t | sed -n -e 's/^\(.\{2\}\).*$/\1/p'`
+tz_hour=`echo $tz_hour | sed 's/^0//'`
+
+if [ $sign = "-" ] ; then
+ sign="+"
+ let tz_hour=$tz_hour+1
+ if [[ $tz_hour -ge "24" ]] ; then
+ tz_hour=0
+ fi
+else
+ sign="-"
+ let tz_hour=$tz_hour-1 || true
+ if [[ $tz_hour -lt "0" ]] ; then
+ tz_hour=23
+ fi
+fi
+
+# Timestamp, an hour ago:
+ts_begin=`TZ=UTC${sign}${tz_hour} date +%Y%m%d%H%M.%S`
+
+# break into constituent parts
+year=`echo $ts_begin | sed -n -e 's/^\(.\{4\}\).*$/\1/p'`
+t=`echo $ts_begin | sed -n -e 's/^\(.\{4\}\)//p'`
+month=`echo $t | sed -n -e 's/^\(.\{2\}\).*$/\1/p'`
+t=`echo $t | sed -n -e 's/^\(.\{2\}\)//p'`
+day=`echo $t | sed -n -e 's/^\(.\{2\}\).*$/\1/p'`
+t=`echo $t | sed -n -e 's/^\(.\{2\}\)//p'`
+hour=`echo $t | sed -n -e 's/^\(.\{2\}\).*$/\1/p'`
+t=`echo $t | sed -n -e 's/^\(.\{2\}\)//p'`
+min=`echo $t | sed -n -e 's/^\(.\{2\}\).*$/\1/p'`
+t=`echo $t | sed -n -e 's/^\(.\{2\}\)//p'`
+sec=`echo $t | sed -n -e 's/\.//p'`
+
+# How many days in the current month?
+# Good until someone changes the calendar rules
+days_in_current_month() {
+ if [[ $month -eq 9 || $month -eq 4 \
+ || $month -eq 6 || $month -eq 11 ]] ; then
+ return 30;
+ fi
+ if [[ $month -eq 2 ]] ; then
+ let t=($year/400)*400
+ if [[ $t -eq $year ]] ; then
+ return 29;
+ fi
+ let t=($year/100)*100
+ if [[ $t -eq $year ]] ; then
+ return 28;
+ fi
+ let t=($year/4)*4
+ if [[ $t -eq $year ]] ; then
+ return 29;
+ fi
+ return 28;
+ fi
+ return 31;
+}
+
+# The next timestamp to issue via touch
+# A real hemorrhoid because bash isnt easily convinced
+# that 08 is a decimal number
+next_ts() {
+ sec=`echo $sec | sed 's/^0//'`
+ let sec=$sec+1
+ if [[ "$sec" -lt "60" ]] ; then
+ if [[ "$sec" -lt "10" ]] ; then
+ sec=0$sec
+ fi
+ return 0;
+ fi
+ sec="00"
+ min=`echo $min | sed 's/^0//'`
+ let min=$min+1
+ if [[ "$min" -lt "60" ]] ; then
+ if [[ "$min" -lt "10" ]] ; then
+ min=0$min
+ fi
+ return 0;
+ fi
+ min="00"
+ hour=`echo $hour | sed 's/^0//'`
+ let hour=$hour+1
+ if [[ "$hour" -lt "24" ]] ; then
+ if [[ "$hour" -lt "10" ]] ; then
+ hour=0$hour
+ fi
+ return 0;
+ fi
+ hour="00"
+ days_in_current_month
+ days_in_month=$?
+ if [[ "$day" -lt "$days_in_month" ]] ; then
+ day=`echo $day | sed 's/^0//'`
+ let day=$day+1
+ if [[ "$day" -lt "10" ]] ; then
+ day=0$day
+ fi
+ return 0;
+ fi
+ day="01"
+ month=`echo $month | sed 's/^0//'`
+ let month=$month+1
+ if [[ "$month" -lt "13" ]] ; then
+ if [[ "$month" -lt "10" ]] ; then
+ month=0$month
+ fi
+ return 0;
+ fi
+ month="01"
+ let year=$year+1
+ return 0;
+}
+
+while [ $# != 0 ] ; do
+ case "$1" in
+ (--commav) comma_v=",v" ;;
+ (--touch) touch=yes ;;
+ (--aclocal) aclocal=yes ;;
+ (--nooptimize) optimize="" ;;
+ (--commit=*) commit="$1" ;;
+ (*) echo "$0: usage [--touch|--commit|]" > /dev/stderr
+ exit 17 ;;
+ esac
+ shift
+done
+
+if [ "${aclocal}" != "" ] ; then
+ if [ -f aclocal.m4 ] ; then
+ echo touching aclocal.m4
+ sleep 1
+ touch aclocal.m4
+ else
+ echo aclocal.m4 not found
+ fi
+fi
+
+if [ "${comma_v}" != "" -a "${commit}" != "" ] ; then
+ echo "No, you may NOT molest ,v files directly. Go away." > /dev/stderr
+ exit 1
+fi
+
+function touchme ()
+{
+ local victim="${1}"
+ shift
+ local touchmebaby=""
+ local sein="is"
+ local newer="no"
+ local older="no"
+
+ if [ ! -r "$victim" ] ; then
+ return
+ fi
+
+ while [ $# != 0 ] ; do
+ if [ "${1}" -nt "${victim}" ] ; then
+ newer="yes"
+ fi
+ if [ "${1}" -ot "${victim}" ] ; then
+ older="yes"
+ fi
+ if [ "${newer}" = "no" -a "${older}" = "no" ] ; then
+ newer="yes"
+ fi
+
+ if [ "${newer}" = "yes" ] ; then
+ if [ "${touchmebaby}" = "" ] ; then
+ touchmebaby="${1}"
+ else
+ sein="are"
+ touchmebaby="${touchmebaby} ${1}"
+ fi
+ fi
+ shift
+ done
+ if [ -n "${touchmebaby}" ] ; then
+ echo "*** ${touchmebaby} ${sein} newer than ${victim} "
+ if [ -n "${touch}" ] ; then
+ #
+ # This is the old version, in case something backfires...
+ if [ "${optimize}" != "yes" ] ; then
+ echo "Fixing " ;touch -c "$victim" ; sleep 1
+ else
+ echo "Fixing "
+ # echo touch -c -t $year$month$day$hour$min.$sec "$victim"
+ touch -c -t $year$month$day$hour$min.$sec "$victim"
+ next_ts
+ fi
+ fi
+ fi
+}
+
+makefileins="`/usr/bin/find . -name Attic -prune -o -name Makefile.in${comma_v}`"
+
+# aclocal.m4 depends on ***/Makefile.am, configure.ac, acinclude.m4, *.m4 crap
+touchme aclocal.m4${comma_v} \
+ `/usr/bin/find . -name Attic -prune -o -name Makefile.am${comma_v}` \
+ "configure.in${comma_v}" "configure.ac${comma_v}" \
+ "acinclude.m4${comma_v}"
+
+# Makefile.in must be newer than Makefile.am
+for f in $makefileins ; do
+ d="`dirname ${f}`"
+ touchme "${d}/Makefile.in${comma_v}" "${d}/Makefile.am${comma_v}"
+done
+
+# Makefile.in depends on aclocal.m4
+for f in $makefileins ; do
+ d="`dirname $f`"
+ touchme "${d}/Makefile.in${comma_v}" "aclocal.m4${comma_v}"
+done
+
+# config.in must be newer than aclocal.m4 and configure.ac
+if [ -f "config.in${comma_v}" ] ; then
+ touchme "config.in${comma_v}" "aclocal.m4${comma_v}" \
+ "configure.ac${comma_v}" \
+ "configure.in${comma_v}"
+fi
+
+# config.h.in (or More Thoroughly Modern configh.in)
+# must be newer than aclocal.m4 and (obsolete) acconfig.h
+for c_h_in in config.h.in configh.in ; do
+ if [ -f "${c_h_in}${comma_v}" ]; then
+ touchme "${c_h_in}${comma_v}" "aclocal.m4${comma_v}" "acconfig.h${comma_v}"
+ #>>>> WTF? Why? This is nonsensical
+ ## ***/Makefile.in must be newer than config.h.in
+ #for f in $makefileins ; do
+ # touchme "$f" "${c_h_in}${comma_v}"
+ #done
+ fi
+done
+
+# configure must be newer than everything
+# touchme configure $makefileins -- why would this be needed?
+touchme "configure${comma_v}" "aclocal.m4${comma_v}" "acconfig.h${comma_v}" \
+ "config.in${comma_v}" "config.h.in${comma_v}" \
+ "configh.in${comma_v}"
+
+if [ -n "${commit}" ] ; then
+ commit="${commit:9}" # strip off "--commit="
+ # First ***/Makefile.am,
+ # configure.in, configure.ac,
+ # ***/*.m4
+ # acconfig.h
+ cvs commit -m "${commit}" \
+ `for f in ${makefileins} ; do \
+ [ -f "$${f%.in}.am" ] && echo "$${f%.in}.am" ; \
+ done` \
+ `[ -f configure.in ] && echo configure.in` \
+ `[ -f configure.ac ] && echo configure.ac` \
+ `[ -f acconfig.h ] && echo acconfig.h` \
+ `/usr/bin/find . -name '*.m4' -mindepth 2`
+
+ # Next aclocal.m4
+ [ -f "aclocal.m4" ] && cvs commit -m "${commit}" aclocal.m4
+
+ # Next config.in, config.h.in, configh.in
+ [ -f "config.in" ] && cvs commit -m "${commit}" config.in
+ [ -f "config.h.in" ] && cvs commit -m "${commit}" config.h.in
+ [ -f "configh.in" ] && cvs commit -m "${commit}" configh.in
+
+ # Last ***/Makefile.in, configure
+ cvs commit -m "${commit}" ${makefileins} configure
+fi
diff --git a/vpp/build-root/bootstrap.sh b/vpp/build-root/bootstrap.sh
new file mode 100755
index 0000000..f83734f
--- /dev/null
+++ b/vpp/build-root/bootstrap.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+
+build_root=`pwd`
+cd ../
+wsroot=`pwd`
+
+# PATH
+if [[ ! $CCACHE_DIR ]];then
+ CCACHE_DIR="$build_root/.ccache"
+fi
+ADD_TO_PATH="$build_root/tools/ccache-bin:$build_root/tools/bin"
+
+# Construct build-config.mk
+cd $build_root
+echo SOURCE_PATH = $wsroot > build-config.mk
+echo
+echo Saving PATH settings in `pwd`/path_setup
+echo Source this file later, as needed
+cat >path_setup <<EOF
+#!/bin/bash
+
+export PATH=$ADD_TO_PATH:$PATH
+export CCACHE_DIR=$CCACHE_DIR
+EOF
+
+# regenerate tools/ccache-bin
+rm -rf tools/ccache-bin
+mkdir -p tools/ccache-bin
+
+if [ ! -f /usr/bin/ccache ] ; then
+ echo Please install ccache AYEC and re-run this script
+fi
+
+cd tools/ccache-bin
+for c in gcc g++
+ do
+ if [ -f /usr/bin/ccache ] ; then
+ ln -s /usr/bin/ccache $c
+ else
+ ln -s /usr/bin/gcc
+ fi
+done
+
+cd $wsroot
+
+cd $build_root
+echo Compile native tools
+for tool in vppapigen
+do
+ make V=0 is_build_tool=yes $tool-install
+done
+
diff --git a/vpp/build-root/build-config.mk.README b/vpp/build-root/build-config.mk.README
new file mode 100644
index 0000000..8b8c87d
--- /dev/null
+++ b/vpp/build-root/build-config.mk.README
@@ -0,0 +1,3 @@
+# To specify directories to find sources, build/packages/*.mk
+# and build/platforms.mk
+# SOURCE_PATH = PATH1 PATH2 ...
diff --git a/vpp/build-root/config.site b/vpp/build-root/config.site
new file mode 100644
index 0000000..9f60708
--- /dev/null
+++ b/vpp/build-root/config.site
@@ -0,0 +1,105 @@
+######################################################################
+# glibc
+######################################################################
+
+# glibc needs this for cross compiling
+libc_cv_forced_unwind=yes
+libc_cv_c_cleanup=yes
+libc_cv_ssp=no
+# fixes gentoo build; not sure why?
+libc_cv_uname_release=""
+libc_cv_uname_version=""
+ac_cv_header_cpuid_h=yes
+######################################################################
+# bash
+######################################################################
+
+# Bash configure.in uses this to work around an autoconf 2.53 bug
+ac_cv_func_setvbuf_reversed=no
+ac_cv_rl_version=5.1
+bash_cv_termcap_lib=libncurses
+
+# These mostly come from debian bash-2.05b changes
+# They are needed to make a functioning bash. Without these
+# settings gdbserver exiting would cause the invoking bash to
+# exit also.
+bash_cv_have_mbstate_t=yes
+bash_cv_dup2_broken=no
+bash_cv_pgrp_pipe=no
+bash_cv_sys_siglist=yes
+bash_cv_under_sys_siglist=yes
+bash_cv_opendir_not_robust=no
+bash_cv_printf_declared=yes
+bash_cv_ulimit_maxfds=yes
+bash_cv_getenv_redef=yes
+bash_cv_getcwd_calls_popen=no
+bash_cv_func_strcoll_broken=no
+bash_cv_must_reinstall_sighandlers=no
+bash_cv_type_quad_t=yes
+bash_cv_func_sigsetjmp=present
+bash_cv_job_control_missing=present
+bash_cv_sys_named_pipes=present
+bash_cv_type_rlimit=long
+bash_cv_printf_a_format=yes
+bash_cv_unusable_rtsigs=no
+
+######################################################################
+# Apache
+######################################################################
+ac_cv_func_setpgrp_void=yes
+apr_cv_process_shared_works=yes
+apr_cv_tcp_nodelay_with_cork=yes
+ap_void_ptr_lt_long=no
+
+case ${host_cpu} in
+x86_64 | alpha)
+ ac_cv_sizeof_ssize_t=8
+ ac_cv_sizeof_size_t=8
+ ac_cv_sizeof_pid_t=4
+ ;;
+*)
+ ac_cv_sizeof_ssize_t=4
+ ac_cv_sizeof_size_t=4
+ ac_cv_sizeof_pid_t=4
+ ;;
+esac
+
+######################################################################
+# gdb
+######################################################################
+gdb_cv_func_ptrace_args=int,int,long,long
+
+######################################################################
+# dpkg
+######################################################################
+dpkg_cv_va_copy=yes
+
+######################################################################
+# coreutils
+######################################################################
+ac_cv_search_clock_gettime=no
+gl_cv_fs_space=yes
+
+######################################################################
+# valgrind
+######################################################################
+ac_cv_file__proc_self_fd=yes
+ac_cv_file__proc_self_exe=yes
+ac_cv_file__proc_self_maps=yes
+
+######################################################################
+# tcpdump
+######################################################################
+ac_cv_linux_vers=2
+ac_cv_func_pcap_findalldevs=no
+
+######################################################################
+# flex
+######################################################################
+ac_cv_func_malloc_0_nonnull=yes
+ac_cv_func_realloc_0_nonnull=yes
+
+######################################################################
+# tar
+######################################################################
+tar_gl_cv_func_mknod_works=yes
diff --git a/vpp/build-root/copyimg b/vpp/build-root/copyimg
new file mode 100755
index 0000000..e5e3fc2
--- /dev/null
+++ b/vpp/build-root/copyimg
@@ -0,0 +1,83 @@
+#!/bin/sh
+
+if [ $# -lt 2 ]; then
+ cat - <<EOF
+$0 FROM-DIR TO-DIR ENVIRONMENT
+
+Copies files from one directory to another with possible
+transformations.
+
+Files named FILE.spp will be transformed via the spp preprocessor
+subject to environment definitions. Source FILE.copyimgspp results in
+destination file FILE in the corresponding destination directory.
+
+Files named FILE.copyimgsh are run as shell scripts in (i.e. via chdir)
+the corresponding destination directory (and not copied).
+
+First regular files are copied. Then transformations are preformed.
+Finally, shell scripts are run.
+EOF
+ exit 1;
+fi
+
+FROM_DIR=$1
+TO_DIR=$2
+
+FILTER=" -and -not -name '*~'";
+FILTER="${FILTER} -and -not -name '.*~'";
+FILTER="$FILTER -and -not -path '*/.git*'";
+FILTER="$FILTER -and -not -path '*/.svn*'";
+FILTER="$FILTER -and -not -path '*/.CVS*'";
+
+FROM_FILES=`(cd $FROM_DIR; eval "find . -not -type d $FILTER")`;
+ FROM_DIRS=`(cd $FROM_DIR; eval "find . -type d $FILTER")`;
+
+COPY_FILES=
+SPP_FILES=
+SH_FILES=
+for f in $FROM_FILES; do
+ case $f in
+ *.copyimgspp) SPP_FILES="$SPP_FILES $f" ;;
+ *.copyimgsh) SH_FILES="$SH_FILES $f" ;;
+ *) COPY_FILES="$COPY_FILES $f";;
+ esac
+done
+
+# Make destination directories.
+mkdir -p $TO_DIR;
+if [ "$FROM_DIRS" != "" ]; then
+ for d in $FROM_DIRS; do
+ mkdir -p $TO_DIR/$d;
+ done
+fi
+
+# Copy files
+if [ "$COPY_FILES" != "" ]; then
+ tar -cf - -C $FROM_DIR $COPY_FILES | tar --preserve-permissions -xf - -C $TO_DIR;
+fi
+
+# Use spp to transform any spp files
+if [ "$SPP_FILES" != "" ]; then
+ for f in $SPP_FILES; do
+ d=`dirname $f`;
+ b=`basename $f .copyimgspp`;
+ mkdir -p $TO_DIR/$d;
+ t=$TO_DIR/$d/$b;
+ spp -o $TO_DIR/$d/$b $FROM_DIR/$f || exit 1;
+ done;
+fi
+
+# Now that all files have been copied/created we run any shell scripts
+ABS_FROM_DIR=`(cd $FROM_DIR; pwd)`;
+if [ "$SH_FILES" != "" ]; then
+ # Allow directory to define some functions
+ if [ -f $FROM_DIR/copyimgsh-functions.sh ]; then
+ . $FROM_DIR/copyimgsh-functions.sh ;
+ fi ;
+ for f in $SH_FILES; do
+ d=`dirname $f`;
+ b=`basename $f`;
+ mkdir -p $TO_DIR/$d;
+ (cd $TO_DIR/$d; . $ABS_FROM_DIR/$d/$b) || exit 1;
+ done;
+fi;
diff --git a/vpp/build-root/deb/debian/.gitignore b/vpp/build-root/deb/debian/.gitignore
new file mode 100644
index 0000000..75d8fbb
--- /dev/null
+++ b/vpp/build-root/deb/debian/.gitignore
@@ -0,0 +1,14 @@
+changelog
+files
+*debhelper*
+*.substvars
+*.install
+vpp-dpdk-dkms*
+vpp/
+vpp-dev/
+vpp-lib/
+vpp-dpdk-dev/
+vpp-dpdk-dkms/
+vpp-dbg/
+vppctl/
+vpp-python-api/
diff --git a/vpp/build-root/deb/debian/README.vpp b/vpp/build-root/deb/debian/README.vpp
new file mode 100755
index 0000000..b343c78
--- /dev/null
+++ b/vpp/build-root/deb/debian/README.vpp
@@ -0,0 +1,56 @@
+Building DEB packages
+=====================
+
+REQUIREMENTS:
+ You will need a working Internet connection to execute the build, because
+ the build procedure for the included "dpdk" project attempts to contact the
+ Internet host "dpdk.org".
+
+There are three main parts to the process:
+ a) Stage the source tree so that dpkg-source will recognize its organization
+ and create a valid DSC source package for you;
+ b) Ensure that the tools required for building DEB packages are installed;
+ and
+ c) Launch the build.
+
+1) Create, or have on hand, a local clone of the git repository, with no
+untracked files or local modifications pending, up-to-date with the branch or
+commit reference from which you wish to construct the source release.
+
+The branch and repository origins will differ based on local conditions.
+
+Example:
+$ git clone -b master ssh://git@example.com:7999/~username/open-vpp
+
+("-b master" can be omitted since master is the default branch)
+
+2) Rename the checkout with a version number embedded in its name as is
+conventional for code releases. Again, your version number may vary.
+
+Example:
+$ mv open-vpp open-vpp-0.0.0
+
+3) Ensure that the dpkg-buildpackage program is installed.
+
+E.g.,
+
+# apt-get install dpkg-dev
+
+4) From the PARENT directory of the debian/ directory, run:
+
+$ cd open-vpp-0.0.0
+$ dpkg-buildpackage -I .git -us -uc
+
+(The -us and -uc flags omit GPG signatures from the .dsc and .changes files,
+respectively. You can add them later, or if you are preparing a signed release
+and have the signing key on hand, leave off the flags.)
+
+5) Get rid of the source directory; you now either have a source package with
+which you can re-create it at any time, or there were problems with the build,
+and you should go back to your git checkout to fix them.
+
+$ rm -r open-vpp-0.0.0
+
+END
+
+vim:set ai et sw=4 ts=4 tw=80:
diff --git a/vpp/build-root/deb/debian/compat b/vpp/build-root/deb/debian/compat
new file mode 100755
index 0000000..ec63514
--- /dev/null
+++ b/vpp/build-root/deb/debian/compat
@@ -0,0 +1 @@
+9
diff --git a/vpp/build-root/deb/debian/control b/vpp/build-root/deb/debian/control
new file mode 100644
index 0000000..643774e
--- /dev/null
+++ b/vpp/build-root/deb/debian/control
@@ -0,0 +1,68 @@
+Source: vpp
+Section: net
+Priority: extra
+Maintainer: Cisco OpenVPP Packaging Team <bogus.address@cisco.com>
+Build-Depends: debhelper (>= 9), dkms, dh-systemd, chrpath
+Standards-Version: 3.9.4
+
+Package: vpp
+Architecture: any
+Depends: vpp-lib (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}, ${python:Depends}
+Description: Vector Packet Processing--executables
+ This package provides VPP executables: vpp, vpp_api_test, vpp_json_test
+ vpp - the vector packet engine
+ vpp_api_test - vector packet engine API test tool
+ vpp_json_test - vector packet engine JSON test tool
+
+Package: vpp-dbg
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Vector Packet Processing--debug symbols
+
+Package: vpp-dev
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Vector Packet Processing--development support
+ This package contains development support files for the VPP libraries
+ .
+
+Package: vpp-dpdk-dev
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Vector Packet Processing--development support
+ This package contains dpdk header files which match the dpdk version
+ compiled into the vpp executable
+ .
+
+Package: vpp-lib
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: Vector Packet Processing--runtime libraries
+ This package contains the VPP shared libraries, including:
+ .
+ vppinfra - foundation library supporting vectors, hashes, bitmaps, pools, and string formatting.
+ dpdk - DPDK library
+ svm - vm library
+ vlib - vector processing library
+ vlib-api - binary API library
+ vnet - network stack library
+
+Package: vpp-plugins
+Architecture: any
+Depends: vpp (= ${source:Version}), ${shlibs:Depends}, ${misc:Depends}
+Description: Vector Packet Processing--runtime plugins
+ This package contains VPP plugins
+ .
+
+Package: vpp-dpdk-dkms
+Architecture: any
+Depends: ${shlibs:Depends}, ${misc:Depends}
+Description: DPDK 2.1 igb_uio_driver
+ This package contains Linux kernel modules distributed with DPDK.
+
+Package: vpp-python-api
+Architecture: any
+Depends: ${python:Depends}, ${misc:Depends}, vpp (= ${source:Version})
+Description: VPP Python API bindings
+ This package contains VPP python api bindings
+ .
diff --git a/vpp/build-root/deb/debian/copyright b/vpp/build-root/deb/debian/copyright
new file mode 100644
index 0000000..f9775c1
--- /dev/null
+++ b/vpp/build-root/deb/debian/copyright
@@ -0,0 +1,9 @@
+Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
+Upstream-Name: optional.
+Upstream-Contact: optional.
+Source: optional.
+Disclaimer: optional.
+Comment: optional.
+License: Apache-2.0
+Copyright: 2015 Cisco and/or its affiliates and others.
+
diff --git a/vpp/build-root/deb/debian/rules b/vpp/build-root/deb/debian/rules
new file mode 100755
index 0000000..186fa84
--- /dev/null
+++ b/vpp/build-root/deb/debian/rules
@@ -0,0 +1,31 @@
+#!/usr/bin/make -f
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+DH_VERBOSE = 1
+
+# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
+
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
+
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+# main packaging script based on dh7 syntax
+%:
+ dh $@ --with dkms --with systemd,python2
+
+override_dh_install:
+ dh_install --exclude .git
+ ../scripts/remove-rpath .
+
+override_dh_strip:
+ dh_strip --dbg-package=vpp-dbg
+
+override_dh_dkms:
+ dh_dkms -pvpp-dpdk-dkms
diff --git a/vpp/build-root/deb/debian/source/format b/vpp/build-root/deb/debian/source/format
new file mode 100755
index 0000000..89ae9db
--- /dev/null
+++ b/vpp/build-root/deb/debian/source/format
@@ -0,0 +1 @@
+3.0 (native)
diff --git a/vpp/build-root/deb/debian/vpp-bin.README.Debian b/vpp/build-root/deb/debian/vpp-bin.README.Debian
new file mode 100644
index 0000000..1922896
--- /dev/null
+++ b/vpp/build-root/deb/debian/vpp-bin.README.Debian
@@ -0,0 +1,53 @@
+To run vpp with the debug shell:
+
+sudo vpp unix interactive
+
+which will result in a prompt that looks like:
+
+DBGvpd#
+
+To give it a spin, we can create a tap interface and try a simple ping
+(with trace).
+
+To create the tap:
+
+DBGvpd# tap connect foobar
+Created tap-0 for Linux tap 'foobar'
+DBGvpd# show int
+
+To assign it an ip address (and 'up' the interface):
+
+DBGvpd# set int ip address tap-0 192.168.1.1/24
+DBGvpd# set int state tap-0 up
+
+To turn on packet tracing for the tap interface:
+DBGvpd# trace add tapcli-rx 10
+
+Now, to set up and try the other end from the unix prompt:
+vagrant@vagrant-ubuntu-trusty-64:~$ sudo ip addr add 192.168.1.2/24 dev foobar
+vagrant@vagrant-ubuntu-trusty-64:~$ ping -c 3 192.168.1.1
+
+To look at the trace, back in the vpp CLI:
+DBGvpd# show trace
+
+And to stop tracing:
+
+DBGvpd# clear trace
+
+Other fun things to look at:
+
+The vlib packet processing graph:
+DBGvpd# show vlib graph
+
+which will produce output like:
+
+ Name Next Previous
+ip4-icmp-input error-punt [0] ip4-local
+ ip4-icmp-echo-request [1]
+ vpe-icmp4-oam [2]
+
+To read this, the first column (Name) is the name of the node.
+The second column (Next) is the name of the children of that node.
+The third column (Previous) is the name of the parents of this node.
+
+END
diff --git a/vpp/build-root/deb/debian/vpp-python-api.postinst b/vpp/build-root/deb/debian/vpp-python-api.postinst
new file mode 100644
index 0000000..ca1c856
--- /dev/null
+++ b/vpp/build-root/deb/debian/vpp-python-api.postinst
@@ -0,0 +1,5 @@
+#!/bin/sh -e
+
+# after installing python-api files
+python2_sitedir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
+easy_install --install-dir=$python2_sitedir -z $python2_sitedir/vpp_papi/vpp_papi-*.egg
diff --git a/vpp/build-root/deb/debian/vpp-python-api.prerm b/vpp/build-root/deb/debian/vpp-python-api.prerm
new file mode 100644
index 0000000..e6d92df
--- /dev/null
+++ b/vpp/build-root/deb/debian/vpp-python-api.prerm
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+# before removing python-api files
+python2_sitedir=$(python -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")
+easy_install --install-dir=$python2_sitedir -mxNq vpp_papi
+
+# the egg has been copied during install
+rm $python2_sitedir/vpp_papi-*.egg
diff --git a/vpp/build-root/deb/debian/vpp.postinst b/vpp/build-root/deb/debian/vpp.postinst
new file mode 100644
index 0000000..78fcac2
--- /dev/null
+++ b/vpp/build-root/deb/debian/vpp.postinst
@@ -0,0 +1,8 @@
+#!/bin/sh -e
+
+# try to set the required values now. This may or may not work.
+sysctl --system
+
+#DEBHELPER#
+
+exit 0
diff --git a/vpp/build-root/deb/debian/vpp.postrm b/vpp/build-root/deb/debian/vpp.postrm
new file mode 100644
index 0000000..ac16a45
--- /dev/null
+++ b/vpp/build-root/deb/debian/vpp.postrm
@@ -0,0 +1,21 @@
+#!/bin/sh -e
+
+removed=
+
+# Unbind user-mode PCI drivers
+pci_dirs=`find /sys/bus/pci/drivers -type d -name igb_uio -o -name uio_pci_generic -o -name vfio-pci`
+for d in $pci_dirs; do
+ for f in ${d}/*; do
+ [ -e "${f}/config" ] || continue
+ echo 1 > ${f}/remove
+ basename `dirname ${f}` | xargs echo -n "Removing driver"; echo " for PCI ID" `basename ${f}`
+ removed=y
+ done
+done
+if [ -n "${removed}" ]; then
+ echo "There are changes in PCI drivers, rescaning"
+ echo 1 > /sys/bus/pci/rescan
+else
+ echo "There weren't PCI devices binded"
+fi
+
diff --git a/vpp/build-root/deb/debian/vpp.preinst b/vpp/build-root/deb/debian/vpp.preinst
new file mode 100644
index 0000000..d33cacf
--- /dev/null
+++ b/vpp/build-root/deb/debian/vpp.preinst
@@ -0,0 +1,4 @@
+#!/bin/sh -e
+
+# Add the vpp group
+groupadd -f -r vpp
diff --git a/vpp/build-root/deb/debian/vpp.service b/vpp/build-root/deb/debian/vpp.service
new file mode 100644
index 0000000..4054985
--- /dev/null
+++ b/vpp/build-root/deb/debian/vpp.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=vector packet processing engine
+After=network.target
+
+[Service]
+Type=simple
+ExecStartPre=-/bin/rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api
+ExecStartPre=-/sbin/modprobe igb_uio
+ExecStart=/usr/bin/vpp -c /etc/vpp/startup.conf
+ExecStopPost=/bin/rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api
+Restart=always
+
+[Install]
+WantedBy=multi-user.target
diff --git a/vpp/build-root/deb/debian/vpp.upstart b/vpp/build-root/deb/debian/vpp.upstart
new file mode 100644
index 0000000..f590878
--- /dev/null
+++ b/vpp/build-root/deb/debian/vpp.upstart
@@ -0,0 +1,21 @@
+description "vector packet processing engine"
+author "Cisco Systems, Inc <listname@cisco.com>"
+
+manual
+
+respawn
+
+pre-start script
+ rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api || true
+ # should be there via dkms, but if not, start anyway
+ modprobe igb_uio || true
+end script
+
+
+script
+ exec vpp -c /etc/vpp/startup.conf
+end script
+
+post-stop script
+ rm -f /dev/shm/db /dev/shm/global_vm /dev/shm/vpe-api || true
+end script
diff --git a/vpp/build-root/emacs-lisp/README b/vpp/build-root/emacs-lisp/README
new file mode 100644
index 0000000..483e1c3
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/README
@@ -0,0 +1,86 @@
+How to construct a complete plugin using the emacs skeletons
+
+0. Install open-vpp, including the development package.
+
+1. Load emacs skeletons
+
+ M-x find-file all-skel.el
+ M-x eval-buffer
+
+2. Pick a single-word, lower-case name for your plugin. For example: macswap.
+Hereafter, we'll refer to the selected name as <plugin-name>.
+
+3. Generate the entire plugin:
+
+ M-x make-plugin
+ Plugin-name: <plugin-name>
+
+Or, generate each file individually:
+
+3. Create the required directories, e.g. under .../vpp
+
+ $ mkdir -p <plugin-name>-plugin/<plugin-name>
+
+4. Create <plugin-name>-plugin/{configure.ac,Makefile.am}
+
+ M-x find-file <plugin-name>-plugin/configure.ac
+ M-x plugin-configure-skel
+
+ M-x find-file <plugin-name>-plugin/Makefile.am
+ M-x skel-plugin-makefile
+
+5. Create the api skeleton
+ M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.api
+ M-x skel-plugin-api
+
+6. Create the api message enumeration header file
+ M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_msg_enum.h
+ M-x skel-plugin-msg-enum
+
+7. Create the "all-api" header file
+ M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_all_api_h.h
+ M-x skel-plugin-all-apih
+
+8. Create the main data structure definition header file
+ M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.h
+ M-x skel-plugin-h
+
+9. Create the plugin main C file
+ M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.c
+ M-x skel-plugin-main
+
+10. Create the vpp-api-test plugin main C file
+ M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_test.c
+ M-x skel-plugin-test
+
+11. Create the data plane packet processing node
+ M-x find-file <plugin-name>-plugin/<plugin-name>/node.c
+ M-x skel-plugin-node
+
+12. Process autotools input files
+
+ $ cd <plugin-name>-plugin
+ $ autoreconf -i -f
+
+13. Build the plugin skeleton
+
+ $ mkdir build
+ $ cd build
+ $ ../configure --with-plugin-toolkit
+ $ make
+ $ sudo make install
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/vpp/build-root/emacs-lisp/all-skel.el b/vpp/build-root/emacs-lisp/all-skel.el
new file mode 100644
index 0000000..2bf15b2
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/all-skel.el
@@ -0,0 +1,41 @@
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+;; plugin all-in-1 program
+
+(load-file "./plugin.el")
+
+;; list of clib / vlib / vnet / vpp skeleton files
+
+(load-file "./cli-cmd-skel.el")
+(load-file "./config-skel.el")
+(load-file "./dual-loop-skel.el")
+(load-file "./periodic-skel.el")
+(load-file "./pipe-skel.el")
+(load-file "./plugin-all-apih-skel.el")
+(load-file "./plugin-api-skel.el")
+(load-file "./plugin-configure-skel.el")
+(load-file "./plugin-h-skel.el")
+(load-file "./plugin-main-skel.el")
+(load-file "./plugin-makefile-skel.el")
+(load-file "./plugin-msg-enum-skel.el")
+(load-file "./plugin-node-skel.el")
+(load-file "./plugin-test-skel.el")
+(load-file "./tunnel-c-skel.el")
+(load-file "./tunnel-decap-skel.el")
+(load-file "./tunnel-encap-skel.el")
+(load-file "./tunnel-h-skel.el")
+(load-file "./elog-4-int-skel.el")
+(load-file "./elog-4-int-track-skel.el")
+(load-file "./elog-enum-skel.el")
+(load-file "./elog-one-datum-skel.el")
diff --git a/vpp/build-root/emacs-lisp/cli-cmd-skel.el b/vpp/build-root/emacs-lisp/cli-cmd-skel.el
new file mode 100644
index 0000000..cf8658c
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/cli-cmd-skel.el
@@ -0,0 +1,32 @@
+;;; cli-cmd-skel.el - cli command skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-cli-cmd
+"Insert a CLI command "
+nil
+'(setq cmd-name (skeleton-read "Command Name: "))
+'(setq path (skeleton-read "Path: "))
+
+"
+static clib_error_t *
+" cmd-name "_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
+ if (unformat (input, \"whatever %d\", &whatever))
+ ;
+ else
+ return clib_error_return (0, \"unknown input `%U'\",
+ format_unformat_error, input);
+ }
+ return 0;
+}
+
+VLIB_CLI_COMMAND (" cmd-name "_command, static) = {
+ .path = \"" path "\",
+ .short_help = \"" path "\",
+ .function = " cmd-name "_command_fn,
+};
+")
diff --git a/vpp/build-root/emacs-lisp/config-skel.el b/vpp/build-root/emacs-lisp/config-skel.el
new file mode 100644
index 0000000..dc2ec38
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/config-skel.el
@@ -0,0 +1,28 @@
+;;; config-skel.el - config function command skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-config
+"Insert a vlib config skeleton "
+nil
+'(setq cfg-name (skeleton-read "Config Class Name: "))
+
+"
+static clib_error_t *
+" cfg-name "_config (vlib_main_t * vm, unformat_input_t * input)
+{
+ u32 whatever;
+
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
+ if (unformat (input, \"whatever %d\", &whatever))
+ ;
+ else
+ return clib_error_return (0, \"unknown input `%U'\",
+ format_unformat_error, input);
+ }
+
+ return 0;
+}
+
+VLIB_CONFIG_FUNCTION (" cfg-name "_config, \"" cfg-name "\");
+")
diff --git a/vpp/build-root/emacs-lisp/dual-loop-skel.el b/vpp/build-root/emacs-lisp/dual-loop-skel.el
new file mode 100644
index 0000000..b23d65a
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/dual-loop-skel.el
@@ -0,0 +1,302 @@
+;;; dual-loop-skel.el - Eliotic dual-loop node skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-dual-loop
+"Insert a skeleton dual-loop graph node"
+nil
+'(setq node-name (skeleton-read "Node Name: "))
+'(setq uc-node-name (upcase node-name))
+"
+#include <vlib/vlib.h>
+#include <vnet/vnet.h>
+#include <vnet/pg/pg.h>
+
+#include <vnet/ip/ip.h>
+#include <vnet/ethernet/ethernet.h>
+
+#include <vppinfra/hash.h>
+#include <vppinfra/error.h>
+#include <vppinfra/elog.h>
+
+typedef struct {
+ /* convenience */
+ vlib_main_t * vlib_main;
+ vnet_main_t * vnet_main;
+ ethernet_main_t * ethernet_main;
+} " node-name "_main_t;
+
+" node-name "_main_t " node-name "_main;
+
+vlib_node_registration_t " node-name "_node;
+
+typedef struct {
+ u32 next_index;
+ u32 sw_if_index;
+} " node-name "_trace_t;
+
+/* packet trace format function */
+static u8 * format_" node-name "_trace (u8 * s, va_list * args)
+{
+ CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
+ CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
+ " node-name "_trace_t * t = va_arg (*args, " node-name "_trace_t *);
+
+ s = format (s, \"" uc-node-name ": sw_if_index %d, next index %d\",
+ t->sw_if_index, t->next_index);
+ return s;
+}
+
+vlib_node_registration_t " node-name "_node;
+
+#define foreach_" node-name "_error \\
+_(SWAPPED, \"Mac swap packets processed\")
+
+typedef enum {
+#define _(sym,str) " uc-node-name "_ERROR_##sym,
+ foreach_" node-name "_error
+#undef _
+ " uc-node-name "_N_ERROR,
+} " node-name "_error_t;
+
+static char * " node-name "_error_strings[] = {
+#define _(sym,string) string,
+ foreach_" node-name "_error
+#undef _
+};
+
+typedef enum {
+ " uc-node-name "_NEXT_INTERFACE_OUTPUT,
+ " uc-node-name "_N_NEXT,
+} " node-name "_next_t;
+
+#define foreach_mac_address_offset \\
+_(0) \\
+_(1) \\
+_(2) \\
+_(3) \\
+_(4) \\
+_(5)
+
+static uword
+" node-name "_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
+{
+ u32 n_left_from, * from, * to_next;
+ " node-name "_next_t next_index;
+ u32 pkts_swapped = 0;
+
+ from = vlib_frame_vector_args (frame);
+ n_left_from = frame->n_vectors;
+ next_index = node->cached_next_index;
+
+ while (n_left_from > 0)
+ {
+ u32 n_left_to_next;
+
+ vlib_get_next_frame (vm, node, next_index,
+ to_next, n_left_to_next);
+
+ while (n_left_from >= 4 && n_left_to_next >= 2)
+ {
+ u32 next0 = " uc-node-name "_NEXT_INTERFACE_OUTPUT;
+ u32 next1 = " uc-node-name "_NEXT_INTERFACE_OUTPUT;
+ u32 sw_if_index0, sw_if_index1;
+ u8 tmp0[6], tmp1[6];
+ ethernet_header_t *en0, *en1;
+ u32 bi0, bi1;
+ vlib_buffer_t * b0, * b1;
+
+ /* Prefetch next iteration. */
+ {
+ vlib_buffer_t * p2, * p3;
+
+ p2 = vlib_get_buffer (vm, from[2]);
+ p3 = vlib_get_buffer (vm, from[3]);
+
+ vlib_prefetch_buffer_header (p2, LOAD);
+ vlib_prefetch_buffer_header (p3, LOAD);
+
+ CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
+ CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+ }
+
+ /* speculatively enqueue b0 and b1 to the current next frame */
+ to_next[0] = bi0 = from[0];
+ to_next[1] = bi1 = from[1];
+ from += 2;
+ to_next += 2;
+ n_left_from -= 2;
+ n_left_to_next -= 2;
+
+ b0 = vlib_get_buffer (vm, bi0);
+ b1 = vlib_get_buffer (vm, bi1);
+
+ /* $$$$$ Dual loop: process 2 x packets here $$$$$ */
+ ASSERT (b0->current_data == 0);
+ ASSERT (b1->current_data == 0);
+
+ en0 = vlib_buffer_get_current (b0);
+ en1 = vlib_buffer_get_current (b1);
+
+ /* This is not the fastest way to swap src + dst mac addresses */
+#define _(a) tmp0[a] = en0->src_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en0->src_address[a] = en0->dst_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en0->dst_address[a] = tmp0[a];
+ foreach_mac_address_offset;
+#undef _
+
+#define _(a) tmp1[a] = en1->src_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en1->src_address[a] = en1->dst_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en1->dst_address[a] = tmp1[a];
+ foreach_mac_address_offset;
+#undef _
+
+ sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_RX];
+ sw_if_index1 = vnet_buffer(b1)->sw_if_index[VLIB_RX];
+
+ /* Send pkt back out the RX interface */
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = sw_if_index0;
+ vnet_buffer(b1)->sw_if_index[VLIB_TX] = sw_if_index1;
+
+ pkts_swapped += 2;
+ /* $$$$$ End of processing 2 x packets $$$$$ */
+
+ if (PREDICT_FALSE((node->flags & VLIB_NODE_FLAG_TRACE)))
+ {
+ if (b0->flags & VLIB_BUFFER_IS_TRACED)
+ {
+ " node-name "_trace_t *t =
+ vlib_add_trace (vm, node, b0, sizeof (*t));
+ t->sw_if_index = sw_if_index0;
+ t->next_index = next0;
+ }
+ if (b1->flags & VLIB_BUFFER_IS_TRACED)
+ {
+ " node-name "_trace_t *t =
+ vlib_add_trace (vm, node, b1, sizeof (*t));
+ t->sw_if_index = sw_if_index1;
+ t->next_index = next1;
+ }
+ }
+
+ /* verify speculative enqueues, maybe switch current next frame */
+ vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
+ to_next, n_left_to_next,
+ bi0, bi1, next0, next1);
+ }
+
+ while (n_left_from > 0 && n_left_to_next > 0)
+ {
+ u32 bi0;
+ vlib_buffer_t * b0;
+ u32 next0 = " uc-node-name "_NEXT_INTERFACE_OUTPUT;
+ u32 sw_if_index0;
+ u8 tmp0[6];
+ ethernet_header_t *en0;
+
+ /* speculatively enqueue b0 to the current next frame */
+ bi0 = from[0];
+ to_next[0] = bi0;
+ from += 1;
+ to_next += 1;
+ n_left_from -= 1;
+ n_left_to_next -= 1;
+
+ b0 = vlib_get_buffer (vm, bi0);
+
+ /* $$$$$ Single loop: process 1 packet here $$$$$ */
+
+ /*
+ * Direct from the driver, we should be at offset 0
+ * aka at &b0->data[0]
+ */
+ ASSERT (b0->current_data == 0);
+
+ en0 = vlib_buffer_get_current (b0);
+
+ /* This is not the fastest way to swap src + dst mac addresses */
+#define _(a) tmp0[a] = en0->src_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en0->src_address[a] = en0->dst_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en0->dst_address[a] = tmp0[a];
+ foreach_mac_address_offset;
+#undef _
+
+ sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_RX];
+
+ /* Send pkt back out the RX interface */
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = sw_if_index0;
+
+ if (PREDICT_FALSE((node->flags & VLIB_NODE_FLAG_TRACE)
+ && (b0->flags & VLIB_BUFFER_IS_TRACED)))
+ {
+ " node-name "_trace_t *t =
+ vlib_add_trace (vm, node, b0, sizeof (*t));
+ t->sw_if_index = sw_if_index0;
+ t->next_index = next0;
+ }
+
+ pkts_swapped += 1;
+
+ /* $$$$$ Done processing 1 packet here $$$$$ */
+
+ /* verify speculative enqueue, maybe switch current next frame */
+ vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
+ to_next, n_left_to_next,
+ bi0, next0);
+ }
+
+ vlib_put_next_frame (vm, node, next_index, n_left_to_next);
+ }
+
+ vlib_node_increment_counter (vm, " node-name "_node.index,
+ " uc-node-name "_ERROR_SWAPPED, pkts_swapped);
+ return frame->n_vectors;
+}
+
+VLIB_REGISTER_NODE (" node-name "_node) = {
+ .function = " node-name "_node_fn,
+ .name = \"" node-name "\",
+ .vector_size = sizeof (u32),
+ .format_trace = format_" node-name "_trace,
+ .type = VLIB_NODE_TYPE_INTERNAL,
+
+ .n_errors = ARRAY_LEN(" node-name "_error_strings),
+ .error_strings = " node-name "_error_strings,
+
+ .n_next_nodes = " uc-node-name "_N_NEXT,
+
+ /* edit / add dispositions here */
+ .next_nodes = {
+ [" uc-node-name "_NEXT_INTERFACE_OUTPUT] = \"interface-output\",
+ },
+};
+
+clib_error_t *" node-name "_init (vlib_main_t *vm)
+{
+ " node-name "_main_t *msm = &" node-name "_main;
+
+ /* $$$$$ Initialize " node-name "_main_t structure here. $$$$$ */
+ msm->vlib_main = vm;
+ msm->vnet_main = vnet_get_main();
+ msm->ethernet_main = ethernet_get_main(vm);
+
+ return 0;
+}
+
+VLIB_INIT_FUNCTION(" node-name "_init);
+")
+
diff --git a/vpp/build-root/emacs-lisp/elog-4-int-skel.el b/vpp/build-root/emacs-lisp/elog-4-int-skel.el
new file mode 100644
index 0000000..fda412a
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/elog-4-int-skel.el
@@ -0,0 +1,31 @@
+;;; elog-4-int-skel.el - 4 integer elog skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-elog-4-int
+"Insert a skeleton 4-integer event definition"
+nil
+'(setq function-name (skeleton-read "Function: "))
+'(setq label (skeleton-read "Label: "))
+
+"
+
+/* $$$ May or may not be needed */
+#include <vlib/vlib.h>
+#include <vppinfra/elog.h>
+
+static inline void " function-name " (u32 *data)
+{
+ ELOG_TYPE_DECLARE(e) =
+ {
+ .format = \"" label ": first %d second %d third %d fourth %d\",
+ .format_args = \"i4i4i4i4\",
+ };
+ struct { u32 data[4];} * ed;
+ ed = ELOG_DATA (&vlib_global_main.elog_main, e);
+ ed->data[0] = data[0];
+ ed->data[1] = data[1];
+ ed->data[2] = data[2];
+ ed->data[3] = data[3];
+}
+")
diff --git a/vpp/build-root/emacs-lisp/elog-4-int-track-skel.el b/vpp/build-root/emacs-lisp/elog-4-int-track-skel.el
new file mode 100644
index 0000000..506cc3a
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/elog-4-int-track-skel.el
@@ -0,0 +1,34 @@
+;;; elog-4-int-skel.el - 4 integer elog skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-elog-4-int-track
+"Insert a skeleton 4-integer-with-track event definition"
+nil
+'(setq function-name (skeleton-read "Function: "))
+'(setq track-label (skeleton-read "Track Label: "))
+'(setq label (skeleton-read "Label: "))
+
+"
+
+/* $$$ May or may not be needed */
+#include <vlib/vlib.h>
+#include <vppinfra/elog.h>
+
+static inline void " function-name " (u32 *data)
+{
+ ELOG_TYPE_DECLARE(e) =
+ {
+ .format = \"" label ": first %d second %d third %d fourth %d\",
+ .format_args = \"i4i4i4i4\",
+ };
+ struct { u32 data[4];} * ed;
+ ELOG_TRACK(" track-label ");
+ ed = ELOG_TRACK_DATA (&vlib_global_main.elog_main, e, " track-label ");
+ ed->data[0] = data[0];
+ ed->data[1] = data[1];
+ ed->data[2] = data[2];
+ ed->data[3] = data[3];
+}
+
+")
diff --git a/vpp/build-root/emacs-lisp/elog-enum-skel.el b/vpp/build-root/emacs-lisp/elog-enum-skel.el
new file mode 100644
index 0000000..836ce86
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/elog-enum-skel.el
@@ -0,0 +1,35 @@
+;;; elog-enum-skel.el - enum elog skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-elog-enum
+"Insert a skeleton enum event definition"
+nil
+'(setq function-name (skeleton-read "Function: "))
+'(setq label (skeleton-read "Label: "))
+
+"
+
+/* $$$ May or may not be needed */
+#include <vlib/vlib.h>
+#include <vppinfra/elog.h>
+
+static inline void " function-name " (u8 which)
+{
+ ELOG_TYPE_DECLARE (e) =
+ {
+ .format = \"" label ": %s\",
+ .format_args = \"t1\",
+ .n_enum_strings = 2,
+ .enum_strings =
+ {
+ \"string 1\",
+ \"string 2\",
+ },
+ };
+ struct { u8 which;} * ed;
+ ed = ELOG_DATA (&vlib_global_main.elog_main, e);
+ ed->which = which;
+}
+
+")
diff --git a/vpp/build-root/emacs-lisp/elog-one-datum-skel.el b/vpp/build-root/emacs-lisp/elog-one-datum-skel.el
new file mode 100644
index 0000000..11f8389
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/elog-one-datum-skel.el
@@ -0,0 +1,28 @@
+;;; elog-one-datum-skel.el - single u32 datum elog skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-elog-one-datum
+"Insert a skeleton single datum event definition"
+nil
+'(setq function-name (skeleton-read "Function: "))
+'(setq label (skeleton-read "Label: "))
+
+"
+
+/* $$$ May or may not be needed */
+#include <vlib/vlib.h>
+#include <vppinfra/elog.h>
+
+static inline void " function-name " (u32 data)
+{
+ ELOG_TYPE_DECLARE (e) =
+ {
+ .format = \"" label ": %d\",
+ .format_args = \"i4\",
+ };
+
+ elog (&vlib_global_main.elog_main, &e, data);
+}
+
+")
diff --git a/vpp/build-root/emacs-lisp/fix-coding-style.el b/vpp/build-root/emacs-lisp/fix-coding-style.el
new file mode 100755
index 0000000..0bb6348
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/fix-coding-style.el
@@ -0,0 +1,162 @@
+#!/usr/bin/emacs --script
+
+;; Insert style boilerplate if it's not already there
+;;
+;; Breaking the string in half keeps emacs
+;; from trying to interpret the local variable
+;; settings e.g. when it reads the lisp source code
+
+(defun insert-style-boilerplate () (interactive)
+ (save-excursion
+ (goto-char (point-min))
+ (if (eq nil (search-forward "coding-style-patch-verification"
+ (point-max) t))
+ (let ((junk 0)) (goto-char (point-max))
+ (insert "
+/*
+ * fd.io coding-style-patch-verification: ON
+ *
+ * Local Var" "iables:
+ * eval: (c-set-style \"gnu\")
+ * End:
+ */")))))
+
+;; (cons xxx <list>) means insert xxx at the head of <list>
+;; Build a sorted list of *INDENT-OFF* lines, by searching
+;; backwards. The initial (setq indent-offset-list nil)
+;; results in (cdr <last-cell>) nil, which makes it a proper list
+
+(defun find-indent-offs () (interactive)
+ (save-excursion
+ (if (boundp 'indent-offset-list)
+ (makunbound 'indent-offset-list))
+ (setq indent-offset-list nil)
+ (goto-char (point-max))
+ (while (search-backward "*INDENT-OFF*" (point-min) t)
+ (move-beginning-of-line nil)
+ (setq indent-offset-list (cons (point) indent-offset-list))
+ (previous-line))))
+
+;; Insert indent-off ... indent-on brackets around
+;; a certain xxx_foreach macro, etc. which "indent"
+;; completely screws up. Doesn't handle nesting, of which there
+;; are few examples (fortunately).
+
+(defun fix-initializer (what) (interactive)
+ (find-indent-offs)
+ (save-excursion
+ (goto-char (point-min))
+ (while (search-forward-regexp what (point-max) t)
+ (move-beginning-of-line nil)
+ (previous-line)
+ (let ((index 0)(pointval 0))
+ (while (and (< pointval (point))(elt indent-offset-list index))
+ (setq pointval (elt indent-offset-list index))
+ (setq index (1+ index)))
+ (if (not (eq pointval (point)))
+ (let ((junk 0))
+ (next-line)
+ (open-line 1)
+ (c-indent-line-or-region)
+ (insert "/* *INDENT-OFF* */")
+ (search-forward "{")
+ (backward-char)
+ (forward-sexp)
+ (move-end-of-line nil)
+ (newline 1)
+ (c-indent-line-or-region)
+ (insert "/* *INDENT-ON* */")
+ (find-indent-offs))
+ (search-forward "*INDENT-ON*"))))))
+
+(defun fix-pool-foreach () (interactive)
+ (fix-initializer "pool_foreach *("))
+
+(defun fix-pool-foreach-index () (interactive)
+ (fix-initializer "pool_foreach_index *("))
+
+(defun fix-hash-foreach () (interactive)
+ (fix-initializer "hash_foreach *("))
+
+(defun fix-hash-foreach-pair () (interactive)
+ (fix-initializer "hash_foreach_pair *("))
+
+(defun fix-hash-foreach-mem () (interactive)
+ (fix-initializer "hash_foreach_mem *("))
+
+(defun fix-clib-fifo-foreach () (interactive)
+ (fix-initializer "clib_fifo_foreach *("))
+
+(defun fix-clib-bitmap-foreach () (interactive)
+ (fix-initializer "clib_bitmap_foreach *("))
+
+(defun fix-foreach-ip-interface-address () (interactive)
+ (fix-initializer "foreach_ip_interface_address *("))
+
+(defun fix-vlib-register-thread () (interactive)
+ (fix-initializer "VLIB_REGISTER_THREAD *("))
+
+(defun fix-vlib-cli-command () (interactive)
+ (fix-initializer "VLIB_CLI_COMMAND *("))
+
+(defun fix-vlib-register-node () (interactive)
+ (fix-initializer "VLIB_REGISTER_NODE *("))
+
+(defun fix-reply-macro2 () (interactive)
+ (fix-initializer "REPLY_MACRO2 *("))
+
+(defun fix-vnet-device-class () (interactive)
+ (fix-initializer "VNET_DEVICE_CLASS *("))
+
+(defun fix-vnet-hw-interface-class () (interactive)
+ (fix-initializer "VNET_HW_INTERFACE_CLASS *("))
+
+(defun fix-clib-packed () (interactive)
+ (fix-initializer "CLIB_PACKED *("))
+(defun fix-vl-api-packed () (interactive)
+ (fix-initializer "VL_API_PACKED *("))
+
+;; Driver routine which runs the set of functions
+;; defined above, as well as the bottom boilerplate function
+
+(defun fd-io-styleify () (interactive)
+ (fix-pool-foreach)
+ (fix-pool-foreach-index)
+ (fix-hash-foreach)
+ (fix-hash-foreach-pair)
+ (fix-hash-foreach-mem)
+ (fix-foreach-ip-interface-address)
+ (fix-clib-fifo-foreach)
+ (fix-clib-bitmap-foreach)
+ (fix-vlib-register-thread)
+ (fix-vlib-cli-command)
+ (fix-vlib-register-node)
+ (fix-reply-macro2)
+ (fix-vnet-device-class)
+ (fix-vnet-hw-interface-class)
+ (fix-clib-packed)
+ (fix-vl-api-packed)
+ (insert-style-boilerplate)
+ (if (boundp 'indent-offset-list)
+ (makunbound 'indent-offset-list)))
+
+;; When run as a script, this sexp
+;; walks the list of files supplied on the command line.
+;;
+;; (elt argv index) returns nil if you M-x eval-buffer
+;; or M-x load-file the file, so we won't accidentally
+;; evaluate (save-buffers-kill-emacs)...
+
+(let ((file-index 0))
+ (if (elt argv file-index)
+ (while (elt argv file-index)
+ (find-file (elt argv file-index))
+ (fd-io-styleify)
+ (message "Done %s..." (elt argv file-index))
+ (setq file-index (1+ file-index))))
+ (if (> file-index 0)
+ (let ((junk 0))
+ (message "Save and quit...")
+ (save-buffers-kill-emacs t))))
+
+
diff --git a/vpp/build-root/emacs-lisp/make-plugin.sh b/vpp/build-root/emacs-lisp/make-plugin.sh
new file mode 100755
index 0000000..4985974
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/make-plugin.sh
@@ -0,0 +1,4 @@
+#!/usr/bin/emacs --script
+(load-file "./all-skel.el")
+(make-plugin)
+(save-some-buffers t)
diff --git a/vpp/build-root/emacs-lisp/periodic-skel.el b/vpp/build-root/emacs-lisp/periodic-skel.el
new file mode 100644
index 0000000..a8f3ef6
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/periodic-skel.el
@@ -0,0 +1,86 @@
+;;; pipe-skel.el - pipelined graph node skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-periodic
+"Insert a skeleton periodic process node"
+nil
+'(setq node-name (skeleton-read "Name: "))
+'(setq uc-node-name (upcase node-name))
+'(setq poll-period (skeleton-read "Poll period (f64 seconds, e.g. 10.0): "))
+
+"
+#define " uc-node-name "_POLL_PERIOD " poll-period "
+
+static uword
+" node-name "_process (vlib_main_t * vm,
+ vlib_node_runtime_t * rt,
+ vlib_frame_t * f)
+{
+ f64 poll_time_remaining;
+ uword event_type, * event_data = 0;
+
+ poll_time_remaining = " uc-node-name "_POLL_PERIOD;
+ while (1) {
+ int i;
+
+ /*
+ * Sleep until next periodic call due, or until we receive event(s)
+ */
+ poll_time_remaining =
+ vlib_process_wait_for_event_or_clock (vm, poll_time_remaining);
+
+ event_type = vlib_process_get_events (vm, &event_data);
+ switch (event_type) {
+ case ~0: /* no events => timeout */
+ break;
+
+ /*
+ * $$$$ FIXME: add cases / handlers for each event type
+ */
+ case EVENT1:
+ for (i = 0; i < vec_len (event_data); i++)
+ handle_event1 (mm, event_data[i]);
+ break;
+
+ case EVENT2:
+ for (i = 0; i < vec_len (event_data); i++)
+ handle_event2 (vm, event_data[i]);
+ break;
+
+ /* ... and so forth for each event type */
+
+ default:
+ /* This should never happen... */
+ clib_warning (\"BUG: unhandled event type %d\", event_type);
+ break;
+ }
+ if (event_data)
+ _vec_len (event_data) = 0;
+
+ /* Timer expired, call periodic function */
+ if (vlib_process_suspend_time_is_zero (poll_time_remaining)) {
+ " node-name "_periodic (vm);
+ poll_time_remaining = " uc-node-name "_POLL_PERIOD;
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * " node-name " periodic node declaration
+ */
+static VLIB_REGISTER_NODE (" node-name "_node) = {
+ .function = " node-name "_process,
+ .type = VLIB_NODE_TYPE_PROCESS,
+ .name = \"" node-name "-process\",
+};
+
+/*
+ * To signal an event:
+ *
+ * vlib_process_signal_event (vm, " node-name "_node.index, EVENTn, datum);
+ *
+ */
+")
diff --git a/vpp/build-root/emacs-lisp/pipe-skel.el b/vpp/build-root/emacs-lisp/pipe-skel.el
new file mode 100644
index 0000000..911e0d0
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/pipe-skel.el
@@ -0,0 +1,132 @@
+;;; pipe-skel.el - pipelined graph node skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-pipeline-node
+"Insert a skeleton pipelined graph node"
+nil
+'(setq node-name (skeleton-read "Node Name: "))
+'(setq uc-node-name (upcase node-name))
+'(setq nstages (skeleton-read "Number of pipeline stages: "))
+"
+#include <vlib/vlib.h>
+#include <vppinfra/error.h>
+
+/*
+ * Dump these counters via the \"show error\" CLI command
+ * FIXME: Add packet counter / error strings as desired
+ */
+
+#define foreach_" node-name "_error \\
+_(ERROR1, \"sample counter/ error string\")
+
+static char * " node-name "_error_strings[] = {
+#define _(sym,string) string,
+ foreach_" node-name "_error
+#undef _
+};
+
+/*
+ * packet error / counter enumeration
+ *
+ * To count and drop a vlib_buffer_t *b:
+ *
+ * Set b->error = node->errors[" uc-node-name "_ERROR_xxx];
+ * last_stage returns a disposition index bound to \"error-drop\"
+ *
+ * To manually increment the specific counter " uc-node-name "_ERROR1
+ *
+ * vlib_node_t *n = vlib_get_node (vm, " node-name ".index);
+ * u32 node_counter_base_index = n->error_heap_index;
+ * vlib_error_main_t * em = &vm->error_main;
+ * em->counters[node_counter_base_index + " uc-node-name "_ERROR1] += 1;
+ *
+ */
+
+typedef enum {
+#define _(sym,str) " uc-node-name "_ERROR_##sym,
+ foreach_" node-name "_error
+#undef _
+ " uc-node-name "_N_ERROR,
+} " node-name "_error_t;
+
+/*
+ * enumeration of per-packet dispositions
+ * FIXME: add dispositions as desired
+ */
+
+typedef enum { \n"
+" " uc-node-name "_NEXT_NORMAL,\n"
+" " uc-node-name "_N_NEXT,
+} " node-name "_next_t;
+
+#define NSTAGES " nstages "
+
+/*
+ * Use the generic buffer metadata + first line of packet data prefetch
+ * stage function from <api/pipeline.h>. This is usually a Good Idea.
+ */
+#define stage0 generic_stage0
+
+/*
+ * FIXME: add stage functions. Here is the function prototype:
+ *
+ * static inline void stageN (vlib_main_t * vm,
+ * vlib_node_runtime_t * node,
+ * u32 buffer_index)
+ */
+
+/*
+ * FIXME: the last pipeline stage returns the desired pkt next node index,
+ * from the " node-name "_next_t enum above
+ */
+static inline u32 last_stage (vlib_main_t *vm, vlib_node_runtime_t *node,
+ u32 bi)
+{
+ vlib_buffer_t *b = vlib_get_buffer (vm, bi);
+
+ b->error = node->errors[EXAMPLE_ERROR_ERROR1];
+
+ return " uc-node-name "_NEXT_NORMAL;
+}
+
+#include <api/pipeline.h>
+
+static uword " node-name "_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
+{
+ return dispatch_pipeline (vm, node, frame);
+}
+
+static VLIB_REGISTER_NODE (example_node) = {
+ .function = " node-name "_node_fn,
+ .name = \"" node-name "-node\",
+ .vector_size = sizeof (u32),
+ .type = VLIB_NODE_TYPE_INTERNAL,
+
+ .n_errors = ARRAY_LEN(" node-name "_error_strings),
+ .error_strings = " node-name "_error_strings,
+
+ .n_next_nodes = " uc-node-name "_N_NEXT,
+
+ /* edit / add dispositions here */
+ .next_nodes = {
+ [" uc-node-name "_NEXT_NORMAL] = \"error-drop\",
+ },
+};
+
+/*
+ * packet generator definition to push superframes of data into the
+ * new graph node. Cut and paste into <file>, then
+ * \"exec <file>\", \"pa enable test\" at the QVNET prompt...
+ *
+packet-generator new {
+ name test
+ limit 100
+ node " node-name "-node
+ size 374-374
+ data { hex 0x02b46b96000100096978676265000500bf436973636f20494f5320536f6674776172652c2043333735304520536f66747761726520284333373530452d554e4956455253414c2d4d292c2056657273696f6e2031322e32283335295345352c2052454c4541534520534f4654574152452028666331290a436f707972696768742028632920313938362d3230303720627920436973636f2053797374656d732c20496e632e0a436f6d70696c6564205468752031392d4a756c2d30372031363a3137206279206e616368656e00060018636973636f2057532d4333373530452d3234544400020011000000010101cc0004000000000003001b54656e4769676162697445746865726e6574312f302f3100040008000000280008002400000c011200000000ffffffff010221ff000000000000001e7a50f000ff000000090004000a00060001000b0005010012000500001300050000160011000000010101cc000400000000001a00100000000100000000ffffffff }
+}
+ */
+")
diff --git a/vpp/build-root/emacs-lisp/plugin-all-apih-skel.el b/vpp/build-root/emacs-lisp/plugin-all-apih-skel.el
new file mode 100644
index 0000000..0f073f9
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-all-apih-skel.el
@@ -0,0 +1,43 @@
+;;; plugin-all-apih-skel.el - vpp engine plug-in "all-apih.c" skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-all-apih
+"Insert a plug-in 'all_api_h.h' skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+/*
+ * " plugin-name "_all_api_h.h - skeleton vpp engine plug-in api #include file
+ *
+ * Copyright (c) <current-year> <your-organization>
+ * Licensed under the Apache License, Version 2.0 (the \"License\");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an \"AS IS\" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+/* Include the generated file, see BUILT_SOURCES in Makefile.am */
+#include <" plugin-name "/" plugin-name ".api.h>
+")
diff --git a/vpp/build-root/emacs-lisp/plugin-api-skel.el b/vpp/build-root/emacs-lisp/plugin-api-skel.el
new file mode 100644
index 0000000..74519e7
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-api-skel.el
@@ -0,0 +1,48 @@
+;;; plugin-api-skel.el - vpp engine plug-in "all-apih.c" skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-api
+"Insert a plug-in '<name>.api' skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+/* Define a simple enable-disable binary API to control the feature */
+
+define " plugin-name "_enable_disable {
+ /* Client identifier, set from api_main.my_client_index */
+ u32 client_index;
+
+ /* Arbitrary context, so client can match reply to request */
+ u32 context;
+
+ /* Enable / disable the feature */
+ u8 enable_disable;
+
+ /* Interface handle */
+ u32 sw_if_index;
+};
+
+define " plugin-name "_enable_disable_reply {
+ /* From the request */
+ u32 context;
+
+ /* Return value, zero means all OK */
+ i32 retval;
+};
+")
diff --git a/vpp/build-root/emacs-lisp/plugin-configure-skel.el b/vpp/build-root/emacs-lisp/plugin-configure-skel.el
new file mode 100644
index 0000000..ebf0bf6
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-configure-skel.el
@@ -0,0 +1,33 @@
+;;; plugin-configure-skel.el - vpp engine plug-in "main.c" skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-configure
+"Insert a plug-in 'configure.ac' skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+AC_INIT(" plugin-name "_plugin, 1.0)
+AM_INIT_AUTOMAKE
+AM_SILENT_RULES([yes])
+
+AC_PROG_LIBTOOL
+AC_PROG_CC
+
+AC_OUTPUT([Makefile])
+")
diff --git a/vpp/build-root/emacs-lisp/plugin-h-skel.el b/vpp/build-root/emacs-lisp/plugin-h-skel.el
new file mode 100644
index 0000000..8bf9b6f
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-h-skel.el
@@ -0,0 +1,66 @@
+;;; plugin-h-skel.el - vpp engine plug-in "main.c" skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-h
+"Insert a plug-in 'main.c' skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+/*
+ * " plugin-name ".h - skeleton vpp engine plug-in header file
+ *
+ * Copyright (c) <current-year> <your-organization>
+ * Licensed under the Apache License, Version 2.0 (the \"License\");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an \"AS IS\" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef __included_" plugin-name "_h__
+#define __included_" plugin-name "_h__
+
+#include <vnet/vnet.h>
+#include <vnet/ip/ip.h>
+#include <vnet/ethernet/ethernet.h>
+
+#include <vppinfra/hash.h>
+#include <vppinfra/error.h>
+
+typedef struct {
+ /* API message ID base */
+ u16 msg_id_base;
+
+ /* convenience */
+ vlib_main_t * vlib_main;
+ vnet_main_t * vnet_main;
+ ethernet_main_t * ethernet_main;
+} " plugin-name "_main_t;
+
+" plugin-name "_main_t " plugin-name "_main;
+
+vlib_node_registration_t " plugin-name "_node;
+
+#endif /* __included_" plugin-name "_h__ */
+")
diff --git a/vpp/build-root/emacs-lisp/plugin-main-skel.el b/vpp/build-root/emacs-lisp/plugin-main-skel.el
new file mode 100644
index 0000000..4724069
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-main-skel.el
@@ -0,0 +1,275 @@
+;;; plugin-main-skel.el - vpp engine plug-in "main.c" skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-main
+"Insert a plug-in 'main.c' skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+/*
+ * " plugin-name ".c - skeleton vpp engine plug-in
+ *
+ * Copyright (c) <current-year> <your-organization>
+ * Licensed under the Apache License, Version 2.0 (the \"License\");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an \"AS IS\" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <vnet/vnet.h>
+#include <vnet/plugin/plugin.h>
+#include <" plugin-name "/" plugin-name ".h>
+
+#include <vlibapi/api.h>
+#include <vlibmemory/api.h>
+#include <vlibsocket/api.h>
+
+/* define message IDs */
+#include <" plugin-name "/" plugin-name "_msg_enum.h>
+
+/* define message structures */
+#define vl_typedefs
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_typedefs
+
+/* define generated endian-swappers */
+#define vl_endianfun
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_endianfun
+
+/* instantiate all the print functions we know about */
+#define vl_print(handle, ...) vlib_cli_output (handle, __VA_ARGS__)
+#define vl_printfun
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_printfun
+
+/* Get the API version number */
+#define vl_api_version(n,v) static u32 api_version=(v);
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_api_version
+
+/*
+ * A handy macro to set up a message reply.
+ * Assumes that the following variables are available:
+ * mp - pointer to request message
+ * rmp - pointer to reply message type
+ * rv - return value
+ */
+
+#define REPLY_MACRO(t) \\
+do { \\
+ unix_shared_memory_queue_t * q = \\
+ vl_api_client_index_to_input_queue (mp->client_index); \\
+ if (!q) \\
+ return; \\
+ \\
+ rmp = vl_msg_api_alloc (sizeof (*rmp)); \\
+ rmp->_vl_msg_id = ntohs((t)+sm->msg_id_base); \\
+ rmp->context = mp->context; \\
+ rmp->retval = ntohl(rv); \\
+ \\
+ vl_msg_api_send_shmem (q, (u8 *)&rmp); \\
+} while(0);
+
+
+/* List of message types that this plugin understands */
+
+#define foreach_" plugin-name "_plugin_api_msg \\
+_(" PLUGIN-NAME "_ENABLE_DISABLE, " plugin-name "_enable_disable)
+
+/*
+ * This routine exists to convince the vlib plugin framework that
+ * we haven't accidentally copied a random .dll into the plugin directory.
+ *
+ * Also collects global variable pointers passed from the vpp engine
+ */
+
+clib_error_t *
+vlib_plugin_register (vlib_main_t * vm, vnet_plugin_handoff_t * h,
+ int from_early_init)
+{
+ " plugin-name "_main_t * sm = &" plugin-name "_main;
+ clib_error_t * error = 0;
+
+ sm->vlib_main = vm;
+ sm->vnet_main = h->vnet_main;
+ sm->ethernet_main = h->ethernet_main;
+
+ return error;
+}
+
+/* Action function shared between message handler and debug CLI */
+
+int " plugin-name "_enable_disable (" plugin-name "_main_t * sm, u32 sw_if_index,
+ int enable_disable)
+{
+ vnet_sw_interface_t * sw;
+ int rv = 0;
+
+ /* Utterly wrong? */
+ if (pool_is_free_index (sm->vnet_main->interface_main.sw_interfaces,
+ sw_if_index))
+ return VNET_API_ERROR_INVALID_SW_IF_INDEX;
+
+ /* Not a physical port? */
+ sw = vnet_get_sw_interface (sm->vnet_main, sw_if_index);
+ if (sw->type != VNET_SW_INTERFACE_TYPE_HARDWARE)
+ return VNET_API_ERROR_INVALID_SW_IF_INDEX;
+
+ vnet_feature_enable_disable (\"device-input\", \"" plugin-name "\",
+ sw_if_index, enable_disable, 0, 0);
+
+ return rv;
+}
+
+static clib_error_t *
+" plugin-name "_enable_disable_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ " plugin-name "_main_t * sm = &" plugin-name "_main;
+ u32 sw_if_index = ~0;
+ int enable_disable = 1;
+
+ int rv;
+
+ while (unformat_check_input (input) != UNFORMAT_END_OF_INPUT) {
+ if (unformat (input, \"disable\"))
+ enable_disable = 0;
+ else if (unformat (input, \"%U\", unformat_vnet_sw_interface,
+ sm->vnet_main, &sw_if_index))
+ ;
+ else
+ break;
+ }
+
+ if (sw_if_index == ~0)
+ return clib_error_return (0, \"Please specify an interface...\");
+
+ rv = " plugin-name "_enable_disable (sm, sw_if_index, enable_disable);
+
+ switch(rv) {
+ case 0:
+ break;
+
+ case VNET_API_ERROR_INVALID_SW_IF_INDEX:
+ return clib_error_return
+ (0, \"Invalid interface, only works on physical ports\");
+ break;
+
+ case VNET_API_ERROR_UNIMPLEMENTED:
+ return clib_error_return (0, \"Device driver doesn't support redirection\");
+ break;
+
+ default:
+ return clib_error_return (0, \"" plugin-name "_enable_disable returned %d\",
+ rv);
+ }
+ return 0;
+}
+
+VLIB_CLI_COMMAND (" plugin-name "_enable_disable_command, static) = {
+ .path = \"" plugin-name " enable-disable\",
+ .short_help =
+ \"" plugin-name " enable-disable <interface-name> [disable]\",
+ .function = " plugin-name "_enable_disable_command_fn,
+};
+
+/* API message handler */
+static void vl_api_" plugin-name "_enable_disable_t_handler
+(vl_api_" plugin-name "_enable_disable_t * mp)
+{
+ vl_api_" plugin-name "_enable_disable_reply_t * rmp;
+ " plugin-name "_main_t * sm = &" plugin-name "_main;
+ int rv;
+
+ rv = " plugin-name "_enable_disable (sm, ntohl(mp->sw_if_index),
+ (int) (mp->enable_disable));
+
+ REPLY_MACRO(VL_API_" PLUGIN-NAME "_ENABLE_DISABLE_REPLY);
+}
+
+/* Set up the API message handling tables */
+static clib_error_t *
+" plugin-name "_plugin_api_hookup (vlib_main_t *vm)
+{
+ " plugin-name "_main_t * sm = &" plugin-name "_main;
+#define _(N,n) \\
+ vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \\
+ #n, \\
+ vl_api_##n##_t_handler, \\
+ vl_noop_handler, \\
+ vl_api_##n##_t_endian, \\
+ vl_api_##n##_t_print, \\
+ sizeof(vl_api_##n##_t), 1);
+ foreach_" plugin-name "_plugin_api_msg;
+#undef _
+
+ return 0;
+}
+
+#define vl_msg_name_crc_list
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_msg_name_crc_list
+
+static void
+setup_message_id_table (" plugin-name "_main_t * sm, api_main_t * am)
+{
+#define _(id,n,crc) \
+ vl_msg_api_add_msg_name_crc (am, #n "_" #crc, id + sm->msg_id_base);
+ foreach_vl_msg_name_crc_" plugin-name" ;
+#undef _
+}
+
+static clib_error_t * " plugin-name "_init (vlib_main_t * vm)
+{
+ " plugin-name "_main_t * sm = &" plugin-name "_main;
+ clib_error_t * error = 0;
+ u8 * name;
+
+ name = format (0, \"" plugin-name "_%08x%c\", api_version, 0);
+
+ /* Ask for a correctly-sized block of API message decode slots */
+ sm->msg_id_base = vl_msg_api_get_msg_ids
+ ((char *) name, VL_MSG_FIRST_AVAILABLE);
+
+ error = " plugin-name "_plugin_api_hookup (vm);
+
+ vec_free(name);
+
+ return error;
+}
+
+VLIB_INIT_FUNCTION (" plugin-name "_init);
+
+VNET_FEATURE_INIT (" plugin-name ", static) =
+{
+ .arc_name = \"device-input\",
+ .node_name = \"" plugin-name "\",
+ .runs_before = VNET_FEATURES (\"ethernet-input\"),
+};
+")
+
diff --git a/vpp/build-root/emacs-lisp/plugin-makefile-skel.el b/vpp/build-root/emacs-lisp/plugin-makefile-skel.el
new file mode 100644
index 0000000..7cb6cbf
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-makefile-skel.el
@@ -0,0 +1,75 @@
+;;; plugin-makefile-skel.el - vpp engine plug-in "main.c" skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-makefile
+"Insert a plug-in 'Makefile.am' skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+# Copyright (c) <current-year> <your-organization>
+# Licensed under the Apache License, Version 2.0 (the \"License\");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at:
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an \"AS IS\" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+AUTOMAKE_OPTIONS = foreign subdir-objects
+
+AM_CFLAGS = -Wall
+AM_LDFLAGS = -module -shared -avoid-version
+
+vppapitestpluginsdir = ${libdir}/vpp_api_test_plugins
+vpppluginsdir = ${libdir}/vpp_plugins
+
+vppplugins_LTLIBRARIES = " plugin-name "_plugin.la
+vppapitestplugins_LTLIBRARIES = " plugin-name "_test_plugin.la
+
+" plugin-name "_plugin_la_SOURCES = " plugin-name "/" plugin-name ".c \\
+ " plugin-name "/node.c \\
+ " plugin-name "/" plugin-name "_plugin.api.h
+" plugin-name "_plugin_la_LDFLAGS = -module
+
+BUILT_SOURCES = " plugin-name "/" plugin-name ".api.h
+
+SUFFIXES = .api.h .api
+
+%.api.h: %.api
+ mkdir -p `dirname $@` ; \\
+ $(CC) $(CPPFLAGS) -E -P -C -x c $^ \\
+ | vppapigen --input - --output $@ --show-name $@
+
+noinst_HEADERS = \\
+ " plugin-name "/" plugin-name "_all_api_h.h \\
+ " plugin-name "/" plugin-name "_msg_enum.h \\
+ " plugin-name "/" plugin-name ".api.h
+
+" plugin-name "_test_plugin_la_SOURCES = \\
+ " plugin-name "/" plugin-name "_test.c " plugin-name "/" plugin-name "_plugin.api.h
+
+# Remove *.la files
+install-data-hook:
+ @(cd $(vpppluginsdir) && $(RM) $(vppplugins_LTLIBRARIES))
+ @(cd $(vppapitestpluginsdir) && $(RM) $(vppapitestplugins_LTLIBRARIES))
+")
diff --git a/vpp/build-root/emacs-lisp/plugin-msg-enum-skel.el b/vpp/build-root/emacs-lisp/plugin-msg-enum-skel.el
new file mode 100644
index 0000000..c44af05
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-msg-enum-skel.el
@@ -0,0 +1,55 @@
+;;; plugin-msg-enum-skel.el - vpp engine plug-in message enum skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-msg-enum
+"Insert a plug-in message enumeration skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+/*
+ * " plugin-name "_msg_enum.h - skeleton vpp engine plug-in message enumeration
+ *
+ * Copyright (c) <current-year> <your-organization>
+ * Licensed under the Apache License, Version 2.0 (the \"License\");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an \"AS IS\" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#ifndef included_" plugin-name "_msg_enum_h
+#define included_" plugin-name "_msg_enum_h
+
+#include <vppinfra/byte_order.h>
+
+#define vl_msg_id(n,h) n,
+typedef enum {
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+ /* We'll want to know how many messages IDs we need... */
+ VL_MSG_FIRST_AVAILABLE,
+} vl_msg_id_t;
+#undef vl_msg_id
+
+#endif /* included_" plugin-name "_msg_enum_h */
+")
diff --git a/vpp/build-root/emacs-lisp/plugin-node-skel.el b/vpp/build-root/emacs-lisp/plugin-node-skel.el
new file mode 100644
index 0000000..ee745c3
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-node-skel.el
@@ -0,0 +1,320 @@
+;;; plugin-node-skel.el - vpp engine plug-in "node.c" skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-node
+"Insert a plug-in 'node.c' skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+/*
+ * node.c - skeleton vpp engine plug-in dual-loop node skeleton
+ *
+ * Copyright (c) <current-year> <your-organization>
+ * Licensed under the Apache License, Version 2.0 (the \"License\");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an \"AS IS\" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <vlib/vlib.h>
+#include <vnet/vnet.h>
+#include <vnet/pg/pg.h>
+#include <vppinfra/error.h>
+#include <" plugin-name "/" plugin-name ".h>
+
+typedef struct {
+ u32 next_index;
+ u32 sw_if_index;
+ u8 new_src_mac[6];
+ u8 new_dst_mac[6];
+} " plugin-name "_trace_t;
+
+static u8 *
+format_mac_address (u8 * s, va_list * args)
+{
+ u8 *a = va_arg (*args, u8 *);
+ return format (s, \"%02x:%02x:%02x:%02x:%02x:%02x\",
+ a[0], a[1], a[2], a[3], a[4], a[5]);
+}
+
+/* packet trace format function */
+static u8 * format_" plugin-name "_trace (u8 * s, va_list * args)
+{
+ CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
+ CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
+ " plugin-name "_trace_t * t = va_arg (*args, " plugin-name "_trace_t *);
+
+ s = format (s, \"" PLUGIN-NAME ": sw_if_index %d, next index %d\\n\",
+ t->sw_if_index, t->next_index);
+ s = format (s, \" new src %U -> new dst %U\",
+ format_mac_address, t->new_src_mac,
+ format_mac_address, t->new_dst_mac);
+ return s;
+}
+
+vlib_node_registration_t " plugin-name "_node;
+
+#define foreach_" plugin-name "_error \\
+_(SWAPPED, \"Mac swap packets processed\")
+
+typedef enum {
+#define _(sym,str) " PLUGIN-NAME "_ERROR_##sym,
+ foreach_" plugin-name "_error
+#undef _
+ " PLUGIN-NAME "_N_ERROR,
+} " plugin-name "_error_t;
+
+static char * " plugin-name "_error_strings[] = {
+#define _(sym,string) string,
+ foreach_" plugin-name "_error
+#undef _
+};
+
+typedef enum {
+ " PLUGIN-NAME "_NEXT_INTERFACE_OUTPUT,
+ " PLUGIN-NAME "_N_NEXT,
+} " plugin-name "_next_t;
+
+#define foreach_mac_address_offset \\
+_(0) \\
+_(1) \\
+_(2) \\
+_(3) \\
+_(4) \\
+_(5)
+
+static uword
+" plugin-name "_node_fn (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
+{
+ u32 n_left_from, * from, * to_next;
+ " plugin-name "_next_t next_index;
+ u32 pkts_swapped = 0;
+
+ from = vlib_frame_vector_args (frame);
+ n_left_from = frame->n_vectors;
+ next_index = node->cached_next_index;
+
+ while (n_left_from > 0)
+ {
+ u32 n_left_to_next;
+
+ vlib_get_next_frame (vm, node, next_index,
+ to_next, n_left_to_next);
+
+ while (n_left_from >= 4 && n_left_to_next >= 2)
+ {
+ u32 next0 = " PLUGIN-NAME "_NEXT_INTERFACE_OUTPUT;
+ u32 next1 = " PLUGIN-NAME "_NEXT_INTERFACE_OUTPUT;
+ u32 sw_if_index0, sw_if_index1;
+ u8 tmp0[6], tmp1[6];
+ ethernet_header_t *en0, *en1;
+ u32 bi0, bi1;
+ vlib_buffer_t * b0, * b1;
+
+ /* Prefetch next iteration. */
+ {
+ vlib_buffer_t * p2, * p3;
+
+ p2 = vlib_get_buffer (vm, from[2]);
+ p3 = vlib_get_buffer (vm, from[3]);
+
+ vlib_prefetch_buffer_header (p2, LOAD);
+ vlib_prefetch_buffer_header (p3, LOAD);
+
+ CLIB_PREFETCH (p2->data, CLIB_CACHE_LINE_BYTES, STORE);
+ CLIB_PREFETCH (p3->data, CLIB_CACHE_LINE_BYTES, STORE);
+ }
+
+ /* speculatively enqueue b0 and b1 to the current next frame */
+ to_next[0] = bi0 = from[0];
+ to_next[1] = bi1 = from[1];
+ from += 2;
+ to_next += 2;
+ n_left_from -= 2;
+ n_left_to_next -= 2;
+
+ b0 = vlib_get_buffer (vm, bi0);
+ b1 = vlib_get_buffer (vm, bi1);
+
+ ASSERT (b0->current_data == 0);
+ ASSERT (b1->current_data == 0);
+
+ en0 = vlib_buffer_get_current (b0);
+ en1 = vlib_buffer_get_current (b1);
+
+ /* This is not the fastest way to swap src + dst mac addresses */
+#define _(a) tmp0[a] = en0->src_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en0->src_address[a] = en0->dst_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en0->dst_address[a] = tmp0[a];
+ foreach_mac_address_offset;
+#undef _
+
+#define _(a) tmp1[a] = en1->src_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en1->src_address[a] = en1->dst_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en1->dst_address[a] = tmp1[a];
+ foreach_mac_address_offset;
+#undef _
+
+
+
+ sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_RX];
+ sw_if_index1 = vnet_buffer(b1)->sw_if_index[VLIB_RX];
+
+ /* Send pkt back out the RX interface */
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = sw_if_index0;
+ vnet_buffer(b1)->sw_if_index[VLIB_TX] = sw_if_index1;
+
+ pkts_swapped += 2;
+
+ if (PREDICT_FALSE((node->flags & VLIB_NODE_FLAG_TRACE)))
+ {
+ if (b0->flags & VLIB_BUFFER_IS_TRACED)
+ {
+ " plugin-name "_trace_t *t =
+ vlib_add_trace (vm, node, b0, sizeof (*t));
+ t->sw_if_index = sw_if_index0;
+ t->next_index = next0;
+ clib_memcpy (t->new_src_mac, en0->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy (t->new_dst_mac, en0->dst_address,
+ sizeof (t->new_dst_mac));
+ }
+ if (b1->flags & VLIB_BUFFER_IS_TRACED)
+ {
+ " plugin-name "_trace_t *t =
+ vlib_add_trace (vm, node, b1, sizeof (*t));
+ t->sw_if_index = sw_if_index1;
+ t->next_index = next1;
+ clib_memcpy (t->new_src_mac, en1->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy (t->new_dst_mac, en1->dst_address,
+ sizeof (t->new_dst_mac));
+ }
+ }
+
+ /* verify speculative enqueues, maybe switch current next frame */
+ vlib_validate_buffer_enqueue_x2 (vm, node, next_index,
+ to_next, n_left_to_next,
+ bi0, bi1, next0, next1);
+ }
+
+ while (n_left_from > 0 && n_left_to_next > 0)
+ {
+ u32 bi0;
+ vlib_buffer_t * b0;
+ u32 next0 = " PLUGIN-NAME "_NEXT_INTERFACE_OUTPUT;
+ u32 sw_if_index0;
+ u8 tmp0[6];
+ ethernet_header_t *en0;
+
+ /* speculatively enqueue b0 to the current next frame */
+ bi0 = from[0];
+ to_next[0] = bi0;
+ from += 1;
+ to_next += 1;
+ n_left_from -= 1;
+ n_left_to_next -= 1;
+
+ b0 = vlib_get_buffer (vm, bi0);
+ /*
+ * Direct from the driver, we should be at offset 0
+ * aka at &b0->data[0]
+ */
+ ASSERT (b0->current_data == 0);
+
+ en0 = vlib_buffer_get_current (b0);
+
+ /* This is not the fastest way to swap src + dst mac addresses */
+#define _(a) tmp0[a] = en0->src_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en0->src_address[a] = en0->dst_address[a];
+ foreach_mac_address_offset;
+#undef _
+#define _(a) en0->dst_address[a] = tmp0[a];
+ foreach_mac_address_offset;
+#undef _
+
+ sw_if_index0 = vnet_buffer(b0)->sw_if_index[VLIB_RX];
+
+ /* Send pkt back out the RX interface */
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = sw_if_index0;
+
+ if (PREDICT_FALSE((node->flags & VLIB_NODE_FLAG_TRACE)
+ && (b0->flags & VLIB_BUFFER_IS_TRACED))) {
+ " plugin-name "_trace_t *t =
+ vlib_add_trace (vm, node, b0, sizeof (*t));
+ t->sw_if_index = sw_if_index0;
+ t->next_index = next0;
+ clib_memcpy (t->new_src_mac, en0->src_address,
+ sizeof (t->new_src_mac));
+ clib_memcpy (t->new_dst_mac, en0->dst_address,
+ sizeof (t->new_dst_mac));
+ }
+
+ pkts_swapped += 1;
+
+ /* verify speculative enqueue, maybe switch current next frame */
+ vlib_validate_buffer_enqueue_x1 (vm, node, next_index,
+ to_next, n_left_to_next,
+ bi0, next0);
+ }
+
+ vlib_put_next_frame (vm, node, next_index, n_left_to_next);
+ }
+
+ vlib_node_increment_counter (vm, " plugin-name "_node.index,
+ " PLUGIN-NAME "_ERROR_SWAPPED, pkts_swapped);
+ return frame->n_vectors;
+}
+
+VLIB_REGISTER_NODE (" plugin-name "_node) = {
+ .function = " plugin-name "_node_fn,
+ .name = \"" plugin-name "\",
+ .vector_size = sizeof (u32),
+ .format_trace = format_" plugin-name "_trace,
+ .type = VLIB_NODE_TYPE_INTERNAL,
+
+ .n_errors = ARRAY_LEN(" plugin-name "_error_strings),
+ .error_strings = " plugin-name "_error_strings,
+
+ .n_next_nodes = " PLUGIN-NAME "_N_NEXT,
+
+ /* edit / add dispositions here */
+ .next_nodes = {
+ [" PLUGIN-NAME "_NEXT_INTERFACE_OUTPUT] = \"interface-output\",
+ },
+};
+")
diff --git a/vpp/build-root/emacs-lisp/plugin-test-skel.el b/vpp/build-root/emacs-lisp/plugin-test-skel.el
new file mode 100644
index 0000000..5231a23
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin-test-skel.el
@@ -0,0 +1,235 @@
+;;; plugin-test-skel.el - vpp-api-test plug-in skeleton
+;;;
+;;; Copyright (c) 2016 Cisco and/or its affiliates.
+;;; Licensed under the Apache License, Version 2.0 (the "License");
+;;; you may not use this file except in compliance with the License.
+;;; You may obtain a copy of the License at:
+;;;
+;;; http://www.apache.org/licenses/LICENSE-2.0
+;;;
+;;; Unless required by applicable law or agreed to in writing, software
+;;; distributed under the License is distributed on an "AS IS" BASIS,
+;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+;;; See the License for the specific language governing permissions and
+;;; limitations under the License.
+
+(require 'skeleton)
+
+(define-skeleton skel-plugin-test
+"Insert a plug-in vpp-api-test skeleton "
+nil
+'(if (not (boundp 'plugin-name))
+ (setq plugin-name (read-string "Plugin name: ")))
+'(setq PLUGIN-NAME (upcase plugin-name))
+"
+/*
+ * " plugin-name ".c - skeleton vpp-api-test plug-in
+ *
+ * Copyright (c) <current-year> <your-organization>
+ * Licensed under the Apache License, Version 2.0 (the \"License\");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an \"AS IS\" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <vat/vat.h>
+#include <vlibapi/api.h>
+#include <vlibmemory/api.h>
+#include <vlibsocket/api.h>
+#include <vppinfra/error.h>
+
+uword unformat_sw_if_index (unformat_input_t * input, va_list * args);
+
+/* Declare message IDs */
+#include <" plugin-name "/" plugin-name "_msg_enum.h>
+
+/* define message structures */
+#define vl_typedefs
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_typedefs
+
+/* declare message handlers for each api */
+
+#define vl_endianfun /* define message structures */
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_endianfun
+
+/* instantiate all the print functions we know about */
+#define vl_print(handle, ...)
+#define vl_printfun
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_printfun
+
+/* Get the API version number. */
+#define vl_api_version(n,v) static u32 api_version=(v);
+#include <" plugin-name "/" plugin-name "_all_api_h.h>
+#undef vl_api_version
+
+
+typedef struct {
+ /* API message ID base */
+ u16 msg_id_base;
+ vat_main_t *vat_main;
+} " plugin-name "_test_main_t;
+
+" plugin-name "_test_main_t " plugin-name "_test_main;
+
+#define foreach_standard_reply_retval_handler \\
+_(" plugin-name "_enable_disable_reply)
+
+#define _(n) \\
+ static void vl_api_##n##_t_handler \\
+ (vl_api_##n##_t * mp) \\
+ { \\
+ vat_main_t * vam = " plugin-name "_test_main.vat_main; \\
+ i32 retval = ntohl(mp->retval); \\
+ if (vam->async_mode) { \\
+ vam->async_errors += (retval < 0); \\
+ } else { \\
+ vam->retval = retval; \\
+ vam->result_ready = 1; \\
+ } \\
+ }
+foreach_standard_reply_retval_handler;
+#undef _
+
+/*
+ * Table of message reply handlers, must include boilerplate handlers
+ * we just generated
+ */
+#define foreach_vpe_api_reply_msg \\
+_(" PLUGIN-NAME "_ENABLE_DISABLE_REPLY, " plugin-name "_enable_disable_reply)
+
+
+/* M: construct, but don't yet send a message */
+
+#define M(T,t) \\
+do { \\
+ vam->result_ready = 0; \\
+ mp = vl_msg_api_alloc(sizeof(*mp)); \\
+ memset (mp, 0, sizeof (*mp)); \\
+ mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \\
+ mp->client_index = vam->my_client_index; \\
+} while(0);
+
+#define M2(T,t,n) \\
+do { \\
+ vam->result_ready = 0; \\
+ mp = vl_msg_api_alloc(sizeof(*mp)+(n)); \\
+ memset (mp, 0, sizeof (*mp)); \\
+ mp->_vl_msg_id = ntohs (VL_API_##T + sm->msg_id_base); \\
+ mp->client_index = vam->my_client_index; \\
+} while(0);
+
+/* S: send a message */
+#define S (vl_msg_api_send_shmem (vam->vl_input_queue, (u8 *)&mp))
+
+/* W: wait for results, with timeout */
+#define W \\
+do { \\
+ timeout = vat_time_now (vam) + 1.0; \\
+ \\
+ while (vat_time_now (vam) < timeout) { \\
+ if (vam->result_ready == 1) { \\
+ return (vam->retval); \\
+ } \\
+ } \\
+ return -99; \\
+} while(0);
+
+static int api_" plugin-name "_enable_disable (vat_main_t * vam)
+{
+ " plugin-name "_test_main_t * sm = &" plugin-name "_test_main;
+ unformat_input_t * i = vam->input;
+ f64 timeout;
+ int enable_disable = 1;
+ u32 sw_if_index = ~0;
+ vl_api_" plugin-name "_enable_disable_t * mp;
+
+ /* Parse args required to build the message */
+ while (unformat_check_input (i) != UNFORMAT_END_OF_INPUT) {
+ if (unformat (i, \"%U\", unformat_sw_if_index, vam, &sw_if_index))
+ ;
+ else if (unformat (i, \"sw_if_index %d\", &sw_if_index))
+ ;
+ else if (unformat (i, \"disable\"))
+ enable_disable = 0;
+ else
+ break;
+ }
+
+ if (sw_if_index == ~0) {
+ errmsg (\"missing interface name / explicit sw_if_index number \\n\");
+ return -99;
+ }
+
+ /* Construct the API message */
+ M(" PLUGIN-NAME "_ENABLE_DISABLE, " plugin-name "_enable_disable);
+ mp->sw_if_index = ntohl (sw_if_index);
+ mp->enable_disable = enable_disable;
+
+ /* send it... */
+ S;
+
+ /* Wait for a reply... */
+ W;
+}
+
+/*
+ * List of messages that the api test plugin sends,
+ * and that the data plane plugin processes
+ */
+#define foreach_vpe_api_msg \\
+_(" plugin-name "_enable_disable, \"<intfc> [disable]\")
+
+void vat_api_hookup (vat_main_t *vam)
+{
+ " plugin-name "_test_main_t * sm = &" plugin-name "_test_main;
+ /* Hook up handlers for replies from the data plane plug-in */
+#define _(N,n) \\
+ vl_msg_api_set_handlers((VL_API_##N + sm->msg_id_base), \\
+ #n, \\
+ vl_api_##n##_t_handler, \\
+ vl_noop_handler, \\
+ vl_api_##n##_t_endian, \\
+ vl_api_##n##_t_print, \\
+ sizeof(vl_api_##n##_t), 1);
+ foreach_vpe_api_reply_msg;
+#undef _
+
+ /* API messages we can send */
+#define _(n,h) hash_set_mem (vam->function_by_name, #n, api_##n);
+ foreach_vpe_api_msg;
+#undef _
+
+ /* Help strings */
+#define _(n,h) hash_set_mem (vam->help_by_name, #n, h);
+ foreach_vpe_api_msg;
+#undef _
+}
+
+clib_error_t * vat_plugin_register (vat_main_t *vam)
+{
+ " plugin-name "_test_main_t * sm = &" plugin-name "_test_main;
+ u8 * name;
+
+ sm->vat_main = vam;
+
+ /* Ask the vpp engine for the first assigned message-id */
+ name = format (0, \"" plugin-name "_%08x%c\", api_version, 0);
+ sm->msg_id_base = vl_client_get_first_plugin_msg_id ((char *) name);
+
+ if (sm->msg_id_base != (u16) ~0)
+ vat_api_hookup (vam);
+
+ vec_free(name);
+
+ return 0;
+}
+")
diff --git a/vpp/build-root/emacs-lisp/plugin.el b/vpp/build-root/emacs-lisp/plugin.el
new file mode 100644
index 0000000..006ae54
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/plugin.el
@@ -0,0 +1,35 @@
+(defun make-plugin ()
+ "Create a plugin"
+ (interactive)
+ (save-excursion
+ (let (cd-args cmd-args start-dir)
+ (setq start-dir default-directory)
+ (makunbound 'plugin-name)
+ (makunbound 'PLUGIN-NAME)
+ (setq plugin-name (read-string "Plugin name: "))
+ (setq PLUGIN-NAME (upcase plugin-name))
+ (setq cmd-args (concat "mkdir -p " plugin-name "-plugin/" plugin-name))
+ (shell-command cmd-args)
+ (setq cd-args (concat start-dir plugin-name "-plugin"))
+ (setq default-directory cd-args)
+ (find-file "Makefile.am")
+ (skel-plugin-makefile)
+ (find-file "configure.ac")
+ (skel-plugin-configure)
+ (setq default-directory (concat cd-args "/" plugin-name))
+ (find-file (concat plugin-name ".api"))
+ (skel-plugin-api)
+ (find-file (concat plugin-name "_all_api_h.h"))
+ (skel-plugin-all-apih)
+ (find-file (concat plugin-name ".h"))
+ (skel-plugin-h)
+ (find-file (concat plugin-name ".c"))
+ (skel-plugin-main)
+ (find-file (concat plugin-name "_msg_enum.h"))
+ (skel-plugin-msg-enum)
+ (find-file "node.c")
+ (skel-plugin-node)
+ (find-file (concat plugin-name "_test.c"))
+ (skel-plugin-test)
+ (cd start-dir))))
+
diff --git a/vpp/build-root/emacs-lisp/tunnel-c-skel.el b/vpp/build-root/emacs-lisp/tunnel-c-skel.el
new file mode 100644
index 0000000..aa260e5
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/tunnel-c-skel.el
@@ -0,0 +1,441 @@
+;;; tunnel-c-skel.el - tunnel encap cli / api
+
+(require 'skeleton)
+
+(define-skeleton skel-tunnel-c
+"Insert a tunnel cli/api implementation"
+nil
+'(setq encap_stack (skeleton-read "encap_stack (e.g ip4_udp_lisp): "))
+'(setq ENCAP_STACK (upcase encap_stack))
+'(setq encap-stack (replace-regexp-in-string "_" "-" encap_stack))
+"
+#include <vnet/" encap-stack "/" encap_stack" .h>
+
+" encap_stack "_main_t " encap_stack "_main;
+
+static u8 * format_decap_next (u8 * s, va_list * args)
+{
+ u32 next_index = va_arg (*args, u32);
+
+ switch (next_index)
+ {
+ case " ENCAP_STACK "_INPUT_NEXT_DROP:
+ return format (s, \"drop\");
+ case " ENCAP_STACK "_INPUT_NEXT_IP4_INPUT:
+ return format (s, \"ip4\");
+ case " ENCAP_STACK "_INPUT_NEXT_IP6_INPUT:
+ return format (s, \"ip6\");
+ case " ENCAP_STACK "_INPUT_NEXT_" ENCAP_STACK "_ENCAP:
+ return format (s, \"" encap-stack "\");
+ default:
+ return format (s, \"unknown %d\", next_index);
+ }
+ return s;
+}
+
+u8 * format_" encap_stack "_tunnel (u8 * s, va_list * args)
+{
+ " encap_stack "_tunnel_t * t = va_arg (*args, " encap_stack "_tunnel_t *);
+ " encap_stack "_main_t * ngm = &" encap_stack "_main;
+
+ s = format (s,
+ \"[%d] %U (src) %U (dst) fibs: encap %d, decap %d\",
+ t - ngm->tunnels,
+ format_ip4_address, &t->src,
+ format_ip4_address, &t->dst,
+ t->encap_fib_index,
+ t->decap_fib_index);
+
+ s = format (s, \" decap next %U\\n\", format_decap_next, t->decap_next_index);
+ /* FIXME: add protocol details */
+ return s;
+}
+
+static u8 * format_" encap_stack "_name (u8 * s, va_list * args)
+{
+ u32 dev_instance = va_arg (*args, u32);
+ return format (s, \"" encap_stack "_tunnel%d\", dev_instance);
+}
+
+static uword dummy_interface_tx (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * frame)
+{
+ clib_warning (\"you shouldn't be here, leaking buffers...\");
+ return frame->n_vectors;
+}
+
+VNET_DEVICE_CLASS (" encap_stack "_device_class,static) = {
+ .name = "" ENCAP_STACK "",
+ .format_device_name = format_" encap_stack "_name,
+ .format_tx_trace = format_" encap_stack "_encap_trace,
+ .tx_function = dummy_interface_tx,
+};
+
+static uword dummy_set_rewrite (vnet_main_t * vnm,
+ u32 sw_if_index,
+ u32 l3_type,
+ void * dst_address,
+ void * rewrite,
+ uword max_rewrite_bytes)
+{
+ return 0;
+}
+
+u8 * format_" encap_stack "_header_with_length (u8 * s, va_list * args)
+{
+ " encap_stack "_header_t * h = va_arg (*args, " encap_stack "_header_t *);
+ u32 max_header_bytes = va_arg (*args, u32);
+ u32 header_bytes;
+
+ header_bytes = sizeof (h[0]);
+ if (max_header_bytes != 0 && header_bytes > max_header_bytes)
+ return format (s, \"" encap-stack "header truncated\");
+
+ /* FIXME: pretty-print an " encap_stack " header */
+
+ return s;
+}
+
+VNET_HW_INTERFACE_CLASS (" encap_stack "_hw_class) = {
+ .name = \"" ENCAP_STACK "\",
+ .format_header = format_" encap_stack "_header_with_length,
+ .set_rewrite = dummy_set_rewrite,
+};
+
+#define foreach_copy_field \
+_(src.as_u32) \
+_(dst.as_u32) \
+_(encap_fib_index) \
+_(decap_fib_index) \
+_(decap_next_index) \
+_(FIXME_ADD_ALL_COPY_FIELDS )
+
+static int " encap_stack "_rewrite (" encap_stack "_tunnel_t * t)
+{
+ u8 *rw = 0;
+ ip4_header_t * ip0;
+ " encap_stack "_header_t * h0;
+ int len;
+
+ len = sizeof (*h0);
+
+ vec_validate_aligned (rw, len-1, CLIB_CACHE_LINE_BYTES);
+
+ h0 = (ip4_udp_" encap_stack "_header_t *) rw;
+
+ /* FIXME: build the actual header here... */
+
+ /* Fixed portion of the (outer) ip4 header */
+ ip0 = &h0->ip4;
+ ip0->ip_version_and_header_length = 0x45;
+ ip0->ttl = 254;
+ ip0->protocol = IP_PROTOCOL_UDP;
+
+ /* we'll fix up the ip4 header length and checksum after-the-fact */
+ ip0->src_address.as_u32 = t->src.as_u32;
+ ip0->dst_address.as_u32 = t->dst.as_u32;
+ ip0->checksum = ip4_header_checksum (ip0);
+
+ /* UDP header, randomize src port on something, maybe? */
+ h0->udp.src_port = clib_host_to_net_u16 (4341);
+ h0->udp.dst_port = clib_host_to_net_u16 (UDP_DST_PORT_" encap_stack ");
+
+ /* $$$ build a <mumble> tunnel header here */
+
+ t->rewrite = rw;
+ return (0);
+}
+
+int vnet_" encap_stack "_add_del_tunnel
+(vnet_" encap_stack "_add_del_tunnel_args_t *a, u32 * hw_if_indexp)
+{
+ " encap_stack "_main_t * ngm = &" encap_stack "_main;
+ " encap_stack "_tunnel_t *t = 0;
+ vnet_main_t * vnm = ngm->vnet_main;
+ vnet_hw_interface_t * hi;
+ uword * p;
+ u32 hw_if_index = ~0;
+ int rv;
+ " encap_stack "_tunnel_key_t key, *key_copy;
+ hash_pair_t *hp;
+
+ key.FIXME = clib_host_to_net_XXX(FIXME);
+
+ p = hash_get_mem (ngm->" encap_stack "_tunnel_by_key, &key);
+
+ if (a->is_add)
+ {
+ /* adding a tunnel: tunnel must not already exist */
+ if (p)
+ return VNET_API_ERROR_INVALID_VALUE;
+
+ pool_get_aligned (ngm->tunnels, t, CLIB_CACHE_LINE_BYTES);
+ memset (t, 0, sizeof (*t));
+
+ /* copy from arg structure */
+#define _(x) t->x = a->x;
+ foreach_copy_field;
+#undef _
+
+ rv = " encap_stack "_rewrite (t);
+
+ if (rv)
+ {
+ pool_put (ngm->tunnels, t);
+ return rv;
+ }
+
+ /* $$$$ use a simple hash if you can ... */
+ key_copy = clib_mem_alloc (sizeof (*key_copy));
+ clib_memcpy (key_copy, &key, sizeof (*key_copy));
+
+ hash_set_mem (ngm->" encap_stack "_tunnel_by_key, key_copy,
+ t - ngm->tunnels);
+
+ /*
+ * interface freelist / recycle shtik
+ * This simple implementation rapidly reuses freed tunnel interfaces.
+ * Consider whether to refcount, etc. etc.
+ */
+ if (vec_len (ngm->free_" encap_stack "_tunnel_hw_if_indices) > 0)
+ {
+ hw_if_index = ngm->free_" encap_stack "_tunnel_hw_if_indices
+ [vec_len (ngm->free_" encap_stack "_tunnel_hw_if_indices)-1];
+ _vec_len (ngm->free_" encap_stack "_tunnel_hw_if_indices) -= 1;
+
+ hi = vnet_get_hw_interface (vnm, hw_if_index);
+ hi->dev_instance = t - ngm->tunnels;
+ hi->hw_instance = hi->dev_instance;
+ }
+ else
+ {
+ hw_if_index = vnet_register_interface
+ (vnm, " encap_stack "_device_class.index, t - ngm->tunnels,
+ " encap_stack "_hw_class.index, t - ngm->tunnels);
+ hi = vnet_get_hw_interface (vnm, hw_if_index);
+ hi->output_node_index = " encap_stack "_encap_node.index;
+ }
+
+ t->hw_if_index = hw_if_index;
+
+ vnet_sw_interface_set_flags (vnm, hi->sw_if_index,
+ VNET_SW_INTERFACE_FLAG_ADMIN_UP);
+ }
+ else
+ {
+ /* deleting a tunnel: tunnel must exist */
+ if (!p)
+ return VNET_API_ERROR_NO_SUCH_ENTRY;
+
+ t = pool_elt_at_index (ngm->tunnels, p[0]);
+
+ vnet_sw_interface_set_flags (vnm, t->hw_if_index, 0 /* down */);
+ vec_add1 (ngm->free_" encap_stack "_tunnel_hw_if_indices, t->hw_if_index);
+
+ hp = hash_get_pair (ngm->" encap_stack "_tunnel_by_key, &key);
+ key_copy = (void *)(hp->key);
+ hash_unset_mem (ngm->" encap_stack "_tunnel_by_key, &key);
+ clib_mem_free (key_copy);
+
+ vec_free (t->rewrite);
+ pool_put (ngm->tunnels, t);
+ }
+
+ if (hw_if_indexp)
+ *hw_if_indexp = hw_if_index;
+
+ return 0;
+}
+
+static u32 fib_index_from_fib_id (u32 fib_id)
+{
+ ip4_main_t * im = &ip4_main;
+ uword * p;
+
+ p = hash_get (im->fib_index_by_table_id, fib_id);
+ if (!p)
+ return ~0;
+
+ return p[0];
+}
+
+static uword unformat_decap_next (unformat_input_t * input, va_list * args)
+{
+ u32 * result = va_arg (*args, u32 *);
+ u32 tmp;
+
+ if (unformat (input, \"drop\"))
+ *result = " ENCAP_STACK "_INPUT_NEXT_DROP;
+ else if (unformat (input, \"ip4\"))
+ *result = " ENCAP_STACK "_INPUT_NEXT_IP4_INPUT;
+ else if (unformat (input, \"ip6\"))
+ *result = " ENCAP_STACK "_INPUT_NEXT_IP6_INPUT;
+ else if (unformat (input, \"ethernet\"))
+ *result = " ENCAP_STACK "_INPUT_NEXT_IP6_INPUT;
+ else if (unformat (input, \"" encap-stack "\"))
+ *result = " ENCAP_STACK "_INPUT_NEXT_" ENCAP_STACK "_ENCAP;
+ else if (unformat (input, \"%d\", &tmp))
+ *result = tmp;
+ else
+ return 0;
+ return 1;
+}
+
+static clib_error_t *
+" encap_stack "_add_del_tunnel_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ unformat_input_t _line_input, * line_input = &_line_input;
+ ip4_address_t src, dst;
+ u8 is_add = 1;
+ u8 src_set = 0;
+ u8 dst_set = 0;
+ u32 encap_fib_index = 0;
+ u32 decap_fib_index = 0;
+ u8 next_protocol = " ENCAP_STACK "_NEXT_PROTOCOL_IP4;
+ u32 decap_next_index = " ENCAP_STACK "_INPUT_NEXT_IP4_INPUT;
+ u8 flags = " ENCAP_STACK "_FLAGS_P;
+ u8 ver_res = 0;
+ u8 res = 0;
+ u32 iid = 0;
+ u8 iid_set = 0;
+ u32 tmp;
+ int rv;
+ vnet_" encap_stack "_add_del_tunnel_args_t _a, * a = &_a;
+
+ /* Get a line of input. */
+ if (! unformat_user (input, unformat_line_input, line_input))
+ return 0;
+
+ while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT) {
+ if (unformat (line_input, \"del\"))
+ is_add = 0;
+ else if (unformat (line_input, \"src %U\",
+ unformat_ip4_address, &src))
+ src_set = 1;
+ else if (unformat (line_input, \"dst %U\",
+ unformat_ip4_address, &dst))
+ dst_set = 1;
+ else if (unformat (line_input, \"encap-vrf-id %d\", &tmp))
+ {
+ encap_fib_index = fib_index_from_fib_id (tmp);
+ if (encap_fib_index == ~0)
+ return clib_error_return (0, \"nonexistent encap fib id %d\", tmp);
+ }
+ else if (unformat (line_input, \"decap-vrf-id %d\", &tmp))
+ {
+ decap_fib_index = fib_index_from_fib_id (tmp);
+ if (decap_fib_index == ~0)
+ return clib_error_return (0, \"nonexistent decap fib id %d\", tmp);
+ }
+ else if (unformat (line_input, \"decap-next %U\", unformat_decap_next,
+ &decap_next_index))
+ ;
+ else if (unformat(line_input, \"next-ip4\"))
+ next_protocol = 1;
+ else if (unformat(line_input, \"next-ip6\"))
+ next_protocol = 2;
+ else if (unformat(line_input, \"next-ethernet\"))
+ next_protocol = 3;
+ else if (unformat(line_input, \"next-nsh\"))
+ next_protocol = 4;
+ /*
+ * $$$ allow the user to specify anything they want
+ * in the " ENCAP_STACK " header
+ */
+ else
+ return clib_error_return (0, \"parse error: '%U'\",
+ format_unformat_error, line_input);
+ }
+
+ unformat_free (line_input);
+
+ if (src_set == 0)
+ return clib_error_return (0, \"tunnel src address not specified\");
+
+ if (dst_set == 0)
+ return clib_error_return (0, \"tunnel dst address not specified\");
+
+ memset (a, 0, sizeof (*a));
+
+ a->is_add = is_add;
+
+#define _(x) a->x = x;
+ foreach_copy_field;
+#undef _
+
+ rv = vnet_" encap_stack "_add_del_tunnel (a, 0 /* hw_if_indexp */);
+
+ switch(rv)
+ {
+ case 0:
+ break;
+ case VNET_API_ERROR_INVALID_VALUE:
+ return clib_error_return (0, \"tunnel already exists...\");
+
+ case VNET_API_ERROR_NO_SUCH_ENTRY:
+ return clib_error_return (0, \"tunnel does not exist...\");
+
+ default:
+ return clib_error_return
+ (0, \"vnet_" encap_stack "_add_del_tunnel returned %d\", rv);
+ }
+
+ return 0;
+}
+
+VLIB_CLI_COMMAND (create_" encap_stack "_tunnel_command, static) = {
+ .path = \"lisp gpe tunnel\",
+ .short_help =
+ \"<mumble> tunnel src <ip4-addr> dst <ip4-addr>\\n\"
+ \" [encap-fib-id <nn>] [decap-fib-id <nn>]\\n\"
+ \" [decap-next [ip4|ip6|ethernet|nsh-encap|<nn>]][del]\\n\",
+ .function = " encap_stack "_add_del_tunnel_command_fn,
+};
+
+static clib_error_t *
+show_" encap_stack "_tunnel_command_fn (vlib_main_t * vm,
+ unformat_input_t * input,
+ vlib_cli_command_t * cmd)
+{
+ " encap_stack "_main_t * ngm = &" encap_stack "_main;
+ " encap_stack "_tunnel_t * t;
+
+ if (pool_elts (ngm->tunnels) == 0)
+ vlib_cli_output (vm, \"No lisp-gpe tunnels configured...\");
+
+ pool_foreach (t, ngm->tunnels,
+ ({
+ vlib_cli_output (vm, \"%U\", format_" encap_stack "_tunnel);
+ }));
+
+ return 0;
+}
+
+VLIB_CLI_COMMAND (show_" encap_stack "_tunnel_command, static) = {
+ .path = \"show lisp gpe tunnel\",
+ .function = show_" encap_stack "_tunnel_command_fn,
+};
+
+clib_error_t *" encap_stack "_init (vlib_main_t *vm)
+{
+ " encap_stack "_main_t *ngm = &" encap_stack "_main;
+
+ ngm->vnet_main = vnet_get_main();
+ ngm->vlib_main = vm;
+
+ ngm->" encap_stack "_tunnel_by_key
+ = hash_create_mem (0, sizeof(" encap_stack "_tunnel_key_t), sizeof (uword));
+
+ /* YMMV, register with the local netstack */
+ udp_register_dst_port (vm, UDP_DST_PORT_" encap_stack ",
+ " encap_stack "_input_node.index, 1 /* is_ip4 */);
+ return 0;
+}
+
+VLIB_INIT_FUNCTION(" encap_stack "_init);
+
+")
+
diff --git a/vpp/build-root/emacs-lisp/tunnel-decap-skel.el b/vpp/build-root/emacs-lisp/tunnel-decap-skel.el
new file mode 100644
index 0000000..380273b
--- /dev/null
+++ b/vpp/build-root/emacs-lisp/tunnel-decap-skel.el
@@ -0,0 +1,299 @@
+;;; tunnel-decap-skel.el - tunnel decapsulation skeleton
+
+(require 'skeleton)
+
+(define-skeleton skel-tunnel-decap
+"Insert a tunnel decap implementation"
+nil
+'(setq encap_stack (skeleton-read "encap_stack (e.g ip4_udp_lisp): "))
+'(setq ENCAP_STACK (upcase encap_stack))
+'(setq encap-stack (replace-regexp-in-string "_" "-" encap_stack))
+'(setq ENCAP-STACK (upcase encap-stack))
+"
+#include <vlib/vlib.h>
+#include <vnet/pg/pg.h>
+#include <vnet/" encap-stack "/" encap_stack ".h>
+
+typedef struct {
+ u32 next_index;
+ u32 tunnel_index;
+ u32 error;
+ " encap_stack "_header_t h;
+} " encap_stack "_rx_trace_t;
+
+static u8 * format_" encap_stack "_rx_trace (u8 * s, va_list * args)
+{
+ CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
+ CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
+ " encap_stack "_rx_trace_t * t = va_arg (*args, " encap_stack "_rx_trace_t *);
+
+ if (t->tunnel_index != ~0)
+ {
+ s = format (s, \"" ENCAP-STACK ": tunnel %d next %d error %d\",
+ t->tunnel_index, t->next_index, t->error);
+ }
+ else
+ {
+ s = format (s, \"" ENCAP-STACK ": no tunnel next %d error %d\\n\",
+ t->next_index, t->error);
+ }
+ s = format (s, \"\\n %U\", format_" encap_stack "_header_with_length, &t->h,
+ (u32) sizeof (t->h) /* max size */);
+ return s;
+}
+
+static uword
+" encap_stack "_input (vlib_main_t * vm,
+ vlib_node_runtime_t * node,
+ vlib_frame_t * from_frame)
+{
+ u32 n_left_from, next_index, * from, * to_next;
+ " encap_stack "_main_t * ngm = &" encap_stack "_main;
+ u32 last_tunnel_index = ~0;
+ " encap_stack "_tunnel_key_t last_key;
+ u32 pkts_decapsulated = 0;
+
+ memset (&last_key, 0xff, sizeof (last_key));
+
+ from = vlib_frame_vector_args (from_frame);
+ n_left_from = from_frame->n_vectors;
+
+ next_index = node->cached_next_index;
+
+ while (n_left_from > 0)
+ {
+ u32 n_left_to_next;
+
+ vlib_get_next_frame (vm, node, next_index,
+ to_next, n_left_to_next);
+
+#if 0 /* $$$ dual loop when the single loop works */
+ while (n_left_from >= 4 && n_left_to_next >= 2)
+ {
+ u32 bi0, bi1;
+ vlib_buffer_t * b0, * b1;
+ nsh_unicast_header_t * h0, * h1;
+ u32 label0, label1;
+ u32 next0, next1;
+ uword * p0, * p1;
+
+ /* Prefetch next iteration. */
+ {
+ vlib_buffer_t * p2, * p3;
+
+ p2 = vlib_get_buffer (vm, from[2]);
+ p3 = vlib_get_buffer (vm, from[3]);
+
+ vlib_prefetch_buffer_header (p2, LOAD);
+ vlib_prefetch_buffer_header (p3, LOAD);
+
+ CLIB_PREFETCH (p2->data, 2*CLIB_CACHE_LINE_BYTES, LOAD);
+ CLIB_PREFETCH (p3->data, 2*CLIB_CACHE_LINE_BYTES, LOAD);
+ }
+
+ bi0 = from[0];
+ bi1 = from[1];
+ to_next[0] = bi0;
+ to_next[1] = bi1;
+ from += 2;
+ to_next += 2;
+ n_left_to_next -= 2;
+ n_left_from -= 2;
+
+ b0 = vlib_get_buffer (vm, bi0);
+ b1 = vlib_get_buffer (vm, bi1);
+
+ h0 = vlib_buffer_get_current (b0);
+ h1 = vlib_buffer_get_current (b1);
+
+ next0 = next1 = " ENCAP_STACK "_INPUT_NEXT_IP4_INPUT;
+
+ label0 = clib_net_to_host_u32 (h0->label_exp_s_ttl);
+ label1 = clib_net_to_host_u32 (h1->label_exp_s_ttl);
+
+ /*
+ * Translate label contents into a fib index.
+ * This is a decent sanity check, and guarantees
+ * a sane FIB for the downstream lookup
+ */
+ label0 = vnet_nsh_uc_get_label (label0);
+ label1 = vnet_nsh_uc_get_label (label1);
+
+ /* If 2xlabels match, and match the 1-wide cache, use it */
+ if (label0 == label1 && rt->last_label == label0)
+ {
+ vnet_buffer(b0)->sw_if_index[VLIB_TX] = rt->last_fib_index;
+ vnet_buffer(b1)->sw_if_index[VLIB_TX] = rt->last_fib_index;
+ }
+ else
+ {
+ p0 = hash_get (rt->mm->fib_index_by_nsh_label, label0);
+ if (PREDICT_FALSE (p0