blob: 1f09a3fa4e4f774c3301d46f8bc19343249cdc97 [file] [log] [blame]
Dave Barachb852bfa2016-01-04 15:27:42 -05001How to construct a complete plugin using the emacs skeletons
2
30. Install open-vpp, including the development package.
4
51. Load emacs skeletons
6
7 M-x find-file all-skel.el
8 M-x eval-buffer
9
102. Pick a single-word, lower-case name for your plugin. For example: macswap.
11Hereafter, we'll refer to the selected name as <plugin-name>.
12
133. Generate the entire plugin:
14
15 M-x make-plugin
16 Plugin-name: <plugin-name>
17
18Or, generate each file individually:
19
203. Create the required directories, e.g. under .../vpp
21
22 $ mkdir -p <plugin-name>-plugin/<plugin-name>
23
244. 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
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070030 M-x skel-plugin-makefile
Dave Barachb852bfa2016-01-04 15:27:42 -050031
325. Create the api skeleton
33 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.api
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070034 M-x skel-plugin-api
Dave Barachb852bfa2016-01-04 15:27:42 -050035
366. Create the api message enumeration header file
37 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_msg_enum.h
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070038 M-x skel-plugin-msg-enum
Dave Barachb852bfa2016-01-04 15:27:42 -050039
407. Create the "all-api" header file
41 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_all_api_h.h
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070042 M-x skel-plugin-all-apih
Dave Barachb852bfa2016-01-04 15:27:42 -050043
448. Create the main data structure definition header file
45 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.h
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070046 M-x skel-plugin-h
Dave Barachb852bfa2016-01-04 15:27:42 -050047
489. Create the plugin main C file
49 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.c
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070050 M-x skel-plugin-main
Dave Barachb852bfa2016-01-04 15:27:42 -050051
5210. Create the vpp-api-test plugin main C file
53 M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>_test.c
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070054 M-x skel-plugin-test
Dave Barachb852bfa2016-01-04 15:27:42 -050055
5611. Create the data plane packet processing node
57 M-x find-file <plugin-name>-plugin/<plugin-name>/node.c
Keith Burns (alagalah)ca46d8c2016-03-18 07:22:15 -070058 M-x skel-plugin-node
Dave Barachb852bfa2016-01-04 15:27:42 -050059
6012. Process autotools input files
61
62 $ cd <plugin-name>-plugin
63 $ autoreconf -i -f
64
6513. Build the plugin skeleton
66
67 $ mkdir build
68 $ cd build
Damjan Marion724f64c2017-01-11 11:11:00 +010069 $ ../configure
Dave Barachb852bfa2016-01-04 15:27:42 -050070 $ make
71 $ sudo make install
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86