Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 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 | |
Keith Burns (alagalah) | ca46d8c | 2016-03-18 07:22:15 -0700 | [diff] [blame] | 18 | (define-skeleton skel-plugin-api |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 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)) |
Dave Barach | 913f4c9 | 2019-05-29 09:59:51 -0400 | [diff] [blame] | 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 | */ |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 40 | |
Dave Barach | 913f4c9 | 2019-05-29 09:59:51 -0400 | [diff] [blame] | 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 { |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 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 */ |
Dave Barach | 913f4c9 | 2019-05-29 09:59:51 -0400 | [diff] [blame] | 70 | bool enable_disable; |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 71 | |
| 72 | /* Interface handle */ |
Dave Barach | 913f4c9 | 2019-05-29 09:59:51 -0400 | [diff] [blame] | 73 | vl_api_interface_index_t sw_if_index; |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 74 | }; |
| 75 | ") |