/*
 * Copyright (c) 2020 Cisco and/or its affiliates.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at:
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

option version = "1.0.1";

enum crypto_dispatch_mode:u8
{
  CRYPTO_ASYNC_DISPATCH_POLLING = 0,
  CRYPTO_ASYNC_DISPATCH_INTERRUPT = 1,
};

enum crypto_op_class_type:u8
{
  CRYPTO_API_OP_SIMPLE = 0,
  CRYPTO_API_OP_CHAINED,
  CRYPTO_API_OP_BOTH,
};

 /** \brief crypto: use polling or interrupt dispatch
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param mode - dispatch mode
*/

autoreply define crypto_set_async_dispatch
{
  u32 client_index;
  u32 context;
  vl_api_crypto_dispatch_mode_t mode;
};

 /** \brief crypto: set crypto handler
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param alg_name - Name of the algorithm to add
    @param engine - Name of the engine to add
    @param oct - Operation class type (simple, chained, both)
    @param is_async - Asynchronous or not
*/

autoreply define crypto_set_handler
{
  u32 client_index;
  u32 context;
  string alg_name[32];
  string engine[16];
  vl_api_crypto_op_class_type_t oct;
  u8 is_async;
};

 /*
 * Local Variables:
 * eval: (c-set-style "gnu")
 * End:
 */
