/* Hey Emacs use -*- mode: C -*- */
/*
 * Copyright (c) 2016 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.0";

/** \brief Proof of Transit(POT): Set POT profile
    @param id - id of the profile 
    @param validator - True/False to indicate if this is verifier
    @param secret_key - Verification key
    @param secret_share - Share of the 1st polynomial
    @param prime - Prime number used for modulo operation
    @param max_bits - Max bits to be used for Random number generation
    @param lpc - Lagrange basis polynomial
    @param polynomial_public - pre-evaluated public polynomial 
    @param list_name - name of this profile list
*/
autoreply define pot_profile_add {
  u32 client_index;
  u32 context;
  u8 id;
  u8 validator;
  u64 secret_key;
  u64 secret_share;
  u64 prime;
  u8  max_bits;
  u64 lpc;
  u64 polynomial_public;
  string list_name[];
};

/** \brief Proof of Transit(POT): Activate POT profile in the list
    @param id - id of the profile 
    @param list_name - name of this profile list
*/
autoreply define pot_profile_activate {
  u32 client_index;
  u32 context;
  u8 id;
  string list_name[];
};

/** \brief Delete POT Profile 
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param list_name - name of profile list to delete
*/
autoreply define pot_profile_del {
  u32 client_index;
  u32 context;
  string list_name[];
};

/** \brief Show POT Profiles
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param id - id of the profile
*/
define pot_profile_show_config_dump {
  u32 client_index;
  u32 context;
  u8 id;
};

/** \brief Show POT profile reply
    @param id - id of the profile
    @param validator - True/False to indicate if this is verifier
    @param secret_key - Verification key
    @param secret_share - Share of the 1st polynomial
    @param prime - Prime number used for modulo operation
    @param max_bits - Max bits to be used for Random number generation
    @param lpc - Lagrange basis polynomial
    @param polynomial_public - pre-evaluated public polynomial
    @param list_name_len - length of the name of this profile list
    @param list_name - name of this profile list
*/
define pot_profile_show_config_details {
  u32 context;
  i32 retval;
  u8 id;
  u8 validator;
  u64 secret_key;
  u64 secret_share;
  u64 prime;
  u64 bit_mask;
  u64 lpc;
  u64 polynomial_public;
};
