1 How to construct a complete plugin using the emacs skeletons
3 0. Install open-vpp, including the development package.
5 1. Load emacs skeletons
7 M-x find-file all-skel.el
10 2. Pick a single-word, lower-case name for your plugin. For example: macswap.
11 Hereafter, we'll refer to the selected name as <plugin-name>.
13 3. Generate the entire plugin:
16 Plugin-name: <plugin-name>
18 Or, generate each file individually:
20 3. Create the required directories, e.g. under .../vpp
22 $ mkdir -p <plugin-name>-plugin/<plugin-name>
24 4. Create <plugin-name>-plugin/{configure.ac,Makefile.am}
26 M-x find-file <plugin-name>-plugin/configure.ac
27 M-x plugin-configure-skel
29 M-x find-file <plugin-name>-plugin/Makefile.am
30 M-x skel-plugin-makefile
32 5. Create the api skeleton
33 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.api
36 6. Create the api message enumeration header file
37 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_msg_enum.h
38 M-x skel-plugin-msg-enum
40 7. Create the "all-api" header file
41 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_all_api_h.h
42 M-x skel-plugin-all-apih
44 8. Create the main data structure definition header file
45 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.h
48 9. Create the plugin main C file
49 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.c
52 10. Create the vpp-api-test plugin main C file
53 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_test.c
56 11. Create the data plane packet processing node
57 M-x find-file <plugin-name>-plugin/<plugin-name>/node.c
60 12. Process autotools input files
62 $ cd <plugin-name>-plugin
65 13. Build the plugin skeleton