Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 1 | How to construct a complete plugin using the emacs skeletons |
| 2 | |
| 3 | 0. Install open-vpp, including the development package. |
| 4 | |
| 5 | 1. Load emacs skeletons |
| 6 | |
| 7 | M-x find-file all-skel.el |
| 8 | M-x eval-buffer |
| 9 | |
| 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>. |
| 12 | |
| 13 | 3. Generate the entire plugin: |
| 14 | |
| 15 | M-x make-plugin |
| 16 | Plugin-name: <plugin-name> |
| 17 | |
| 18 | Or, generate each file individually: |
| 19 | |
| 20 | 3. Create the required directories, e.g. under .../vpp |
| 21 | |
| 22 | $ mkdir -p <plugin-name>-plugin/<plugin-name> |
| 23 | |
| 24 | 4. Create <plugin-name>-plugin/{configure.ac,Makefile.am} |
| 25 | |
| 26 | M-x find-file <plugin-name>-plugin/configure.ac |
| 27 | M-x plugin-configure-skel |
| 28 | |
| 29 | M-x find-file <plugin-name>-plugin/Makefile.am |
| 30 | M-x plugin-makefile.skel |
| 31 | |
| 32 | 5. Create the api skeleton |
| 33 | M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.api |
| 34 | M-x plugin-api-skel |
| 35 | |
| 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 plugin-msg-enum-skel |
| 39 | |
| 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 plugin-all-apih-skel |
| 43 | |
| 44 | 8. Create the main data structure definition header file |
| 45 | M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.h |
| 46 | M-x plugin-h-skel |
| 47 | |
| 48 | 9. Create the plugin main C file |
| 49 | M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.c |
| 50 | M-x plugin-main-skel |
| 51 | |
| 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 |
| 54 | M-x plugin-test-skel |
| 55 | |
| 56 | 11. Create the data plane packet processing node |
| 57 | M-x find-file <plugin-name>-plugin/<plugin-name>/node.c |
| 58 | M-x plugin-node-skel |
| 59 | |
| 60 | 12. Process autotools input files |
| 61 | |
| 62 | $ cd <plugin-name>-plugin |
| 63 | $ autoreconf -i -f |
| 64 | |
| 65 | 13. Build the plugin skeleton |
| 66 | |
| 67 | $ mkdir build |
| 68 | $ cd build |
Dave Barach | 66cc181 | 2016-01-04 18:21:48 -0500 | [diff] [blame] | 69 | $ ../configure --with-plugin-toolkit |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 70 | $ make |
| 71 | $ sudo make install |
| 72 | |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | |
| 78 | |
| 79 | |
| 80 | |
| 81 | |
| 82 | |
| 83 | |
| 84 | |
| 85 | |
| 86 | |