VPP-1506: dump local punts and registered punt sockets
[vpp.git] / src / vpp / api / plugin.h
1 /*
2  * plugin.h: plugin handling
3  *
4  * Copyright (c) 2015 Cisco and/or its affiliates.
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at:
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #ifndef __included_plugin_h__
19 #define __included_plugin_h__
20
21 #include <sys/types.h>
22 #include <sys/stat.h>
23 #include <unistd.h>
24
25 typedef struct
26 {
27   u8 *name;
28   struct stat file_info;
29   void *handle;
30 } plugin_info_t;
31
32 typedef struct
33 {
34   /* loaded plugin info */
35   plugin_info_t *plugin_info;
36   uword *plugin_by_name_hash;
37
38   /* paths and name filters */
39   u8 *plugin_path;
40   u8 *plugin_name_filter;
41   u8 *vat_plugin_path;
42   u8 *vat_plugin_name_filter;
43
44   /* plugin configs and hash by name */
45   plugin_config_t *configs;
46   uword *config_index_by_name;
47
48   /* usual */
49   vlib_main_t *vlib_main;
50 } plugin_main_t;
51
52 extern plugin_main_t vat_plugin_main;
53
54 int vat_plugin_init (vat_main_t * vam);
55 int vat_load_new_plugins (plugin_main_t * pm);
56
57 #endif
58
59 /*
60  * fd.io coding-style-patch-verification: ON
61  *
62  * Local Variables:
63  * eval: (c-set-style "gnu")
64  * End:
65  */