1 ;;; Copyright (c) 2016 Cisco and/or its affiliates.
2 ;;; Licensed under the Apache License, Version 2.0 (the "License");
3 ;;; you may not use this file except in compliance with the License.
4 ;;; You may obtain a copy of the License at:
6 ;;; http://www.apache.org/licenses/LICENSE-2.0
8 ;;; Unless required by applicable law or agreed to in writing, software
9 ;;; distributed under the License is distributed on an "AS IS" BASIS,
10 ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 ;;; See the License for the specific language governing permissions and
12 ;;; limitations under the License.
14 How to construct a complete plugin using the emacs skeletons
16 0. Install open-vpp, including the development package.
18 1. Load emacs skeletons
20 M-x find-file all-skel.el
23 2. Pick a single-word, lower-case name for your plugin. For example: macswap.
24 Hereafter, we'll refer to the selected name as <plugin-name>.
26 3. Generate the entire plugin:
29 Plugin-name: <plugin-name>
31 Or, generate each file individually:
33 3. Create the required directories, e.g. under .../vpp
35 $ mkdir -p <plugin-name>-plugin/<plugin-name>
37 4. Create <plugin-name>-plugin/{configure.ac,Makefile.am}
39 M-x find-file <plugin-name>-plugin/configure.ac
40 M-x plugin-configure-skel
42 M-x find-file <plugin-name>-plugin/Makefile.am
43 M-x skel-plugin-makefile
45 5. Create the api skeleton
46 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.api
49 6. Create the api message enumeration header file
50 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_msg_enum.h
51 M-x skel-plugin-msg-enum
53 7. Create the "all-api" header file
54 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_all_api_h.h
55 M-x skel-plugin-all-apih
57 8. Create the main data structure definition header file
58 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.h
61 9. Create the plugin main C file
62 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.c
65 10. Create the vpp-api-test plugin main C file
66 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_test.c
69 11. Create the data plane packet processing node
70 M-x find-file <plugin-name>-plugin/<plugin-name>/node.c
73 12. Process autotools input files
75 $ cd <plugin-name>-plugin
78 13. Build the plugin skeleton