Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 1 | ;;; plugin-h-skel.el - vpp engine plug-in "main.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-h |
Dave Barach | b852bfa | 2016-01-04 15:27:42 -0500 | [diff] [blame] | 19 | "Insert a plug-in 'main.c' 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 | /* |
| 26 | * " plugin-name ".h - skeleton vpp engine plug-in header file |
| 27 | * |
| 28 | * Copyright (c) <current-year> <your-organization> |
| 29 | * Licensed under the Apache License, Version 2.0 (the \"License\"); |
| 30 | * you may not use this file except in compliance with the License. |
| 31 | * You may obtain a copy of the License at: |
| 32 | * |
| 33 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 34 | * |
| 35 | * Unless required by applicable law or agreed to in writing, software |
| 36 | * distributed under the License is distributed on an \"AS IS\" BASIS, |
| 37 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 38 | * See the License for the specific language governing permissions and |
| 39 | * limitations under the License. |
| 40 | */ |
| 41 | #ifndef __included_" plugin-name "_h__ |
| 42 | #define __included_" plugin-name "_h__ |
| 43 | |
| 44 | #include <vnet/vnet.h> |
| 45 | #include <vnet/ip/ip.h> |
| 46 | #include <vnet/ethernet/ethernet.h> |
| 47 | |
| 48 | #include <vppinfra/hash.h> |
| 49 | #include <vppinfra/error.h> |
| 50 | |
| 51 | typedef struct { |
| 52 | /* API message ID base */ |
| 53 | u16 msg_id_base; |
| 54 | |
| 55 | /* convenience */ |
| 56 | vlib_main_t * vlib_main; |
| 57 | vnet_main_t * vnet_main; |
| 58 | ethernet_main_t * ethernet_main; |
| 59 | } " plugin-name "_main_t; |
| 60 | |
| 61 | " plugin-name "_main_t " plugin-name "_main; |
| 62 | |
| 63 | vlib_node_registration_t " plugin-name "_node; |
| 64 | |
| 65 | #endif /* __included_" plugin-name "_h__ */ |
| 66 | ") |