2 * Copyright (c) 2022 Intel 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:
7 * http://www.apache.org/licenses/LICENSE-2.0
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.
16 #include <utils/debug.h>
17 #include <vlibapi/api.h>
18 #include <vlibmemory/api.h>
22 /* Include the (first) vlib-api API definition layer */
23 #include <vlibmemory/vl_memory_api_h.h>
24 /* Include the current layer (third) vpp API definition layer */
25 #include <vpp/api/vpe_types.api.h>
26 #include <vpp/api/vpe.api.h>
30 #include "kernel_vpp_plugin.h"
31 #include "kernel_vpp_shared.h"
32 #include "kernel_vpp_ipsec.h"
33 #include "kernel_vpp_net.h"
35 typedef struct private_kernel_vpp_plugin_t private_kernel_vpp_plugin_t;
38 * private data of kernel vpp plugin
40 struct private_kernel_vpp_plugin_t
43 * implements plugin interface
45 kernel_vpp_plugin_t public;
50 METHOD (plugin_t, get_name, char *, private_kernel_vpp_plugin_t *this)
55 METHOD (plugin_t, get_features, int, private_kernel_vpp_plugin_t *this,
56 plugin_feature_t *features[])
58 static plugin_feature_t f[] = {
59 PLUGIN_CALLBACK (kernel_ipsec_register, kernel_vpp_ipsec_create),
60 PLUGIN_PROVIDE (CUSTOM, "kernel-ipsec"),
61 PLUGIN_CALLBACK (kernel_net_register, kernel_vpp_net_create),
62 PLUGIN_PROVIDE (CUSTOM, "kernel-net"),
68 METHOD (plugin_t, destroy, void, private_kernel_vpp_plugin_t *this)
72 lib->set (lib, "kernel-vpp-vac", NULL);
73 this->vac->destroy (this->vac);
79 kernel_vpp_plugin_create ()
81 private_kernel_vpp_plugin_t *this;
86 .get_name = _get_name,
87 .get_features = _get_features,
93 this->vac = vac_create ("strongswan");
96 DBG1 (DBG_KNL, "vac_create failed");
100 lib->set (lib, "kernel-vpp-vac", this->vac);
102 return &this->public.plugin;