FD.io VPP  v21.01.1
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 
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  */
38 
39 #define REPLY_MSG_ID_BASE crypto_sw_scheduler_base_msg_id
40 
42 
43 static void
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 
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  */
crypto sw scheduler: Enable or disable workers
vlib_main_t * vm
Definition: in2out_ed.c:1580
int crypto_sw_scheduler_set_worker_crypto(u32 worker_idx, u8 enabled)
Definition: main.c:23
unsigned char u8
Definition: types.h:56
static u32 crypto_sw_scheduler_base_msg_id
Base message ID fot the plugin.
Definition: api.c:37
static void vl_api_crypto_sw_scheduler_set_worker_t_handler(vl_api_crypto_sw_scheduler_set_worker_t *mp)
Definition: api.c:45
unsigned int u32
Definition: types.h:88
#define REPLY_MACRO(t)
clib_error_t * crypto_sw_scheduler_api_init(vlib_main_t *vm)
Definition: api.c:63
static void setup_message_id_table(api_main_t *am)
Definition: api.c:802