blob: c69186287aa5a098ed42818d0faf55fafd853a74 [file] [log] [blame]
Ed Warnickecb9cada2015-12-08 15:45:58 -07001/*
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 Barach72d72232016-08-04 10:15:08 -040026typedef struct
27{
Ed Warnickecb9cada2015-12-08 15:45:58 -070028 u8 *name;
29 struct stat file_info;
30 void *handle;
31} plugin_info_t;
32
Dave Barach72d72232016-08-04 10:15:08 -040033typedef struct
34{
Ed Warnickecb9cada2015-12-08 15:45:58 -070035 /* loaded plugin info */
36 plugin_info_t *plugin_info;
37 uword *plugin_by_name_hash;
38
39 /* path and name filter */
40 u8 *plugin_path;
41 u8 *plugin_name_filter;
42
43 /* convenience */
Dave Barach72d72232016-08-04 10:15:08 -040044 vat_main_t *vat_main;
45
Ed Warnickecb9cada2015-12-08 15:45:58 -070046} plugin_main_t;
47
Dave Wallace71612d62017-10-24 01:32:41 -040048extern plugin_main_t vat_plugin_main;
Ed Warnickecb9cada2015-12-08 15:45:58 -070049
50int vat_plugin_init (vat_main_t * vam);
Dave Barach72d72232016-08-04 10:15:08 -040051int vat_load_new_plugins (plugin_main_t * pm);
Ed Warnickecb9cada2015-12-08 15:45:58 -070052
53#endif
Dave Barach72d72232016-08-04 10:15:08 -040054
55/*
56 * fd.io coding-style-patch-verification: ON
57 *
58 * Local Variables:
59 * eval: (c-set-style "gnu")
60 * End:
61 */