nat: use correct data types for memory sizes
[vpp.git] / extras / emacs / README
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:
5 ;;;
6 ;;;     http://www.apache.org/licenses/LICENSE-2.0
7 ;;;
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.
13
14 How to construct a complete plugin using the emacs skeletons
15
16 0. Install open-vpp, including the development package.
17
18 1. Load emacs skeletons
19
20    M-x find-file all-skel.el
21    M-x eval-buffer
22
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>.
25
26 3. Generate the entire plugin:
27
28    M-x make-plugin
29    Plugin-name: <plugin-name>
30
31 Or, generate each file individually:
32
33 3. Create the required directories, e.g. under .../vpp
34
35    $ mkdir -p <plugin-name>-plugin/<plugin-name>
36
37 4. Create <plugin-name>-plugin/{configure.ac,Makefile.am}
38
39    M-x find-file <plugin-name>-plugin/configure.ac
40    M-x plugin-configure-skel
41    
42    M-x find-file <plugin-name>-plugin/Makefile.am
43    M-x skel-plugin-makefile
44
45 5. Create the api skeleton
46    M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.api
47    M-x skel-plugin-api
48
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
52
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
56
57 8. Create the main data structure definition header file
58    M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.h
59    M-x skel-plugin-h
60
61 9. Create the plugin main C file
62    M-x find-file <plugin-name>-plugin/<plugin-name>/<plugin-name>.c
63    M-x skel-plugin-main
64
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
67    M-x skel-plugin-test
68
69 11. Create the data plane packet processing node
70    M-x find-file <plugin-name>-plugin/<plugin-name>/node.c
71    M-x skel-plugin-node
72
73 12. Process autotools input files
74
75    $ cd <plugin-name>-plugin
76    $ autoreconf -i -f
77
78 13. Build the plugin skeleton
79
80    $ mkdir build
81    $ cd build
82    $ ../configure
83    $ make
84    $ sudo make install
85
86
87
88
89
90
91
92
93    
94
95
96
97
98
99