FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
api.c
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2020 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
#include <stddef.h>
17
18
#include <
vnet/vnet.h
>
19
#include <
vnet/plugin/plugin.h
>
20
21
#include <
vnet/ip/ip_types_api.h
>
22
#include <vpp/app/version.h>
23
24
#include <
vlibapi/api.h
>
25
#include <
vlibmemory/api.h
>
26
27
#include <
crypto_sw_scheduler/crypto_sw_scheduler.h
>
28
29
/* define message IDs */
30
#include <
vnet/format_fns.h
>
31
#include <crypto_sw_scheduler/crypto_sw_scheduler.api_enum.h>
32
#include <crypto_sw_scheduler/crypto_sw_scheduler.api_types.h>
33
34
/**
35
* Base message ID fot the plugin
36
*/
37
static
u32
crypto_sw_scheduler_base_msg_id
;
38
39
#define REPLY_MSG_ID_BASE crypto_sw_scheduler_base_msg_id
40
41
#include <
vlibapi/api_helper_macros.h
>
42
43
static
void
44
vl_api_crypto_sw_scheduler_set_worker_t_handler
45
(
vl_api_crypto_sw_scheduler_set_worker_t
* mp)
46
{
47
vl_api_crypto_sw_scheduler_set_worker_reply_t *rmp;
48
u32
worker_index;
49
u8
crypto_enable;
50
int
rv
;
51
52
worker_index = ntohl (mp->
worker_index
);
53
crypto_enable = mp->
crypto_enable
;
54
55
rv
=
crypto_sw_scheduler_set_worker_crypto
(worker_index, crypto_enable);
56
57
REPLY_MACRO
(VL_API_CRYPTO_SW_SCHEDULER_SET_WORKER_REPLY);
58
}
59
60
#include <crypto_sw_scheduler/crypto_sw_scheduler.api.c>
61
62
clib_error_t
*
63
crypto_sw_scheduler_api_init
(
vlib_main_t
*
vm
)
64
{
65
/* Ask for a correctly-sized block of API message decode slots */
66
crypto_sw_scheduler_base_msg_id
=
setup_message_id_table
();
67
68
return
0;
69
}
70
71
/*
72
* fd.io coding-style-patch-verification: ON
73
*
74
* Local Variables:
75
* eval: (c-set-style "gnu")
76
* End:
77
*/
api.h
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition:
nat44_ei.c:3047
api.h
vl_api_crypto_sw_scheduler_set_worker_t::worker_index
u32 worker_index
Definition:
crypto_sw_scheduler.api:35
REPLY_MACRO
#define REPLY_MACRO(t)
Definition:
api_helper_macros.h:30
setup_message_id_table
static void setup_message_id_table(api_main_t *am)
Definition:
api.c:799
vl_api_crypto_sw_scheduler_set_worker_t::crypto_enable
bool crypto_enable
Definition:
crypto_sw_scheduler.api:36
plugin.h
vl_api_crypto_sw_scheduler_set_worker_t_handler
static void vl_api_crypto_sw_scheduler_set_worker_t_handler(vl_api_crypto_sw_scheduler_set_worker_t *mp)
Definition:
api.c:45
crypto_sw_scheduler_base_msg_id
static u32 crypto_sw_scheduler_base_msg_id
Base message ID fot the plugin.
Definition:
api.c:37
format_fns.h
u32
unsigned int u32
Definition:
types.h:88
api_helper_macros.h
vlib_main_t
Definition:
main.h:102
u8
unsigned char u8
Definition:
types.h:56
clib_error_t
Definition:
clib_error.h:21
crypto_sw_scheduler_api_init
clib_error_t * crypto_sw_scheduler_api_init(vlib_main_t *vm)
Definition:
api.c:63
rv
int __clib_unused rv
Definition:
application.c:491
crypto_sw_scheduler_set_worker_crypto
int crypto_sw_scheduler_set_worker_crypto(u32 worker_idx, u8 enabled)
Definition:
main.c:23
vnet.h
crypto_sw_scheduler.h
vl_api_crypto_sw_scheduler_set_worker_t
crypto sw scheduler: Enable or disable workers
Definition:
crypto_sw_scheduler.api:31
ip_types_api.h
src
plugins
crypto_sw_scheduler
api.c
Generated on Sat Jan 8 2022 10:03:30 for FD.io VPP by
1.8.17