9 This is the VPP sample plugin demonstrates how to create a new plugin
10 that integrates with VPP. The sample code implements a trivial macswap
11 algorithm that demonstrates plugin runtime integration with the VPP
12 graph hierarchy, api and cli.
14 For deeper dive information see the annotations in the sample code
15 itself. See `sample.c <@ref%20sample.c>`__
17 How to build and run the sample plugin.
18 ---------------------------------------
26 Define environmental variable ‘SAMPLE_PLUGIN=yes’ with a process scope
30 $ SAMPLE_PLUGIN=yes make build
32 or a session scope, and build VPP.
36 $ export SAMPLE_PLUGIN=yes
39 Now run VPP and make sure the plugin is loaded.
45 load_one_plugin:184: Loaded plugin: memif_plugin.so (Packet Memory Interface (experimetal))
46 load_one_plugin:184: Loaded plugin: sample_plugin.so (Sample of VPP Plugin)
47 load_one_plugin:184: Loaded plugin: nat_plugin.so (Network Address Translation)
51 How to create a new plugin
52 --------------------------
54 To create a new plugin based on the sample plugin, copy and rename the
55 sample plugin directory and automake config.
59 cp -r src/examples/sample-plugin/sample src/plugins/newplugin
60 cp src/examples/sample-plugin/sample.am src/plugins/newplugin.am
62 Add the following entry to the plugins section of ``src/configure.ac``.
66 PLUGIN_ENABLED(newplugin)
68 Add the following entry to the plugins section of
69 ``src/plugins/Makefile.am``
87 To enable the sample plugin
91 sample macswap <interface name>
93 To disable the sample plugin
97 sample macswap <interface name> disable