vxlan: vxlan/vxlan.api API cleanup
[vpp.git] / extras / emacs / plugin-api-skel.el
1 ;;; plugin-api-skel.el - vpp engine plug-in "all-apih.c" skeleton
2 ;;;
3 ;;; Copyright (c) 2016 Cisco and/or its affiliates.
4 ;;; Licensed under the Apache License, Version 2.0 (the "License");
5 ;;; you may not use this file except in compliance with the License.
6 ;;; You may obtain a copy of the License at:
7 ;;;
8 ;;;     http://www.apache.org/licenses/LICENSE-2.0
9 ;;;
10 ;;; Unless required by applicable law or agreed to in writing, software
11 ;;; distributed under the License is distributed on an "AS IS" BASIS,
12 ;;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 ;;; See the License for the specific language governing permissions and
14 ;;; limitations under the License.
15
16 (require 'skeleton)
17
18 (define-skeleton skel-plugin-api
19 "Insert a plug-in '<name>.api' skeleton "
20 nil
21 '(if (not (boundp 'plugin-name))
22      (setq plugin-name (read-string "Plugin name: ")))
23 '(setq PLUGIN-NAME (upcase plugin-name))
24 "/*
25  * " plugin-name ".api - binary API skeleton
26  *
27  * Copyright (c) <current-year> <your-organization>
28  * Licensed under the Apache License, Version 2.0 (the \"License\");
29  * you may not use this file except in compliance with the License.
30  * You may obtain a copy of the License at:
31  *
32  *     http://www.apache.org/licenses/LICENSE-2.0
33  *
34  * Unless required by applicable law or agreed to in writing, software
35  * distributed under the License is distributed on an \"AS IS\" BASIS,
36  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
37  * See the License for the specific language governing permissions and
38  * limitations under the License.
39  */
40
41 /**
42  * @file " plugin-name ".api
43  * @brief VPP control-plane API messages.
44  *
45  * This file defines VPP control-plane binary API messages which are generally
46  * called through a shared memory interface.
47  */
48
49 /* Version and type recitations */
50
51 option version = \"0.1.0\";
52 import \"vnet/interface_types.api\";
53
54
55 /** @brief API to enable / disable " plugin-name " on an interface
56     @param client_index - opaque cookie to identify the sender
57     @param context - sender context, to match reply w/ request
58     @param enable_disable - 1 to enable, 0 to disable the feature
59     @param sw_if_index - interface handle
60 */
61
62 autoreply define " plugin-name "_enable_disable {
63     /* Client identifier, set from api_main.my_client_index */
64     u32 client_index;
65
66     /* Arbitrary context, so client can match reply to request */
67     u32 context;
68
69     /* Enable / disable the feature */
70     bool enable_disable;
71
72     /* Interface handle */
73     vl_api_interface_index_t sw_if_index;
74 };
75 ")