Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (c) 2015 Cisco and/or its affiliates. |
| 3 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | * you may not use this file except in compliance with the License. |
| 5 | * You may obtain a copy of the License at: |
| 6 | * |
| 7 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | * |
| 9 | * Unless required by applicable law or agreed to in writing, software |
| 10 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | * See the License for the specific language governing permissions and |
| 13 | * limitations under the License. |
| 14 | */ |
| 15 | /* |
| 16 | * plugin.h: plugin handling |
| 17 | */ |
| 18 | |
| 19 | #ifndef __included_plugin_h__ |
| 20 | #define __included_plugin_h__ |
| 21 | |
| 22 | #include <sys/types.h> |
| 23 | #include <sys/stat.h> |
| 24 | #include <unistd.h> |
| 25 | |
Dave Barach | 72d7223 | 2016-08-04 10:15:08 -0400 | [diff] [blame] | 26 | typedef struct |
| 27 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 28 | u8 *name; |
Damjan Marion | 67d4c24 | 2018-04-04 22:43:54 +0200 | [diff] [blame] | 29 | u8 *filename; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 30 | struct stat file_info; |
| 31 | void *handle; |
| 32 | } plugin_info_t; |
| 33 | |
Dave Barach | 72d7223 | 2016-08-04 10:15:08 -0400 | [diff] [blame] | 34 | typedef struct |
| 35 | { |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 36 | /* loaded plugin info */ |
| 37 | plugin_info_t *plugin_info; |
| 38 | uword *plugin_by_name_hash; |
| 39 | |
| 40 | /* path and name filter */ |
| 41 | u8 *plugin_path; |
| 42 | u8 *plugin_name_filter; |
| 43 | |
| 44 | /* convenience */ |
Dave Barach | 72d7223 | 2016-08-04 10:15:08 -0400 | [diff] [blame] | 45 | vat_main_t *vat_main; |
| 46 | |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 47 | } plugin_main_t; |
| 48 | |
Dave Wallace | 71612d6 | 2017-10-24 01:32:41 -0400 | [diff] [blame] | 49 | extern plugin_main_t vat_plugin_main; |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 50 | |
| 51 | int vat_plugin_init (vat_main_t * vam); |
Dave Barach | 72d7223 | 2016-08-04 10:15:08 -0400 | [diff] [blame] | 52 | int vat_load_new_plugins (plugin_main_t * pm); |
Ed Warnicke | cb9cada | 2015-12-08 15:45:58 -0700 | [diff] [blame] | 53 | |
| 54 | #endif |
Dave Barach | 72d7223 | 2016-08-04 10:15:08 -0400 | [diff] [blame] | 55 | |
| 56 | /* |
| 57 | * fd.io coding-style-patch-verification: ON |
| 58 | * |
| 59 | * Local Variables: |
| 60 | * eval: (c-set-style "gnu") |
| 61 | * End: |
| 62 | */ |