/*
 * Copyright (c) 2015-2017 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 = "2.0.0";

import "vnet/interface_types.api";
import "vnet/lisp-cp/lisp_types.api";

/** \brief add or delete locator_set
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param locator_set_name - locator name
    @param locator_num - number of locators
    @param locators - locator records
*/
manual_endian manual_print define one_add_del_locator_set
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  string locator_set_name[64];
  u32 locator_num;
  vl_api_local_locator_t locators[locator_num];
};

/** \brief Reply for locator_set add/del
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param ls_index - locator set index
*/
define one_add_del_locator_set_reply
{
  u32 context;
  i32 retval;
  u32 ls_index;
};

/** \brief add or delete locator for locator set
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param locator_set_name - name of locator_set to add/del locator
    @param sw_if_index - index of the interface
    @param priority - priority of the locator
    @param weight - weight of the locator
*/
autoreply define one_add_del_locator
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  string locator_set_name[64];
  vl_api_interface_index_t sw_if_index;
  u8 priority;
  u8 weight;
};


/** \brief add or delete ONE eid-table
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param eid - endpoint identifier
    @param locator_set_name - name of locator_set to add/del eid-table
    @param vni - virtual network instance
    @param key - secret key
*/
autoreply define one_add_del_local_eid
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  vl_api_eid_t eid;
  string locator_set_name[64];
  u32 vni;
  vl_api_hmac_key_t key;
};

/** \brief Set TTL for map register messages
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param ttl - time to live
*/
autoreply define one_map_register_set_ttl
{
  u32 client_index;
  u32 context;
  u32 ttl;
};

/** \brief Get TTL for map register messages
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_one_map_register_ttl
{
  u32 client_index;
  u32 context;
};

/** \brief Contains current TTL for map register messages
    @param client_index - opaque cookie to identify the sender
    @param retval - return code
    @param ttl - time to live
*/
define show_one_map_register_ttl_reply
{
  u32 context;
  i32 retval;
  u32 ttl;
};

/** \brief Add/delete map server
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero; delete otherwise
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - map server IP address
*/
autoreply define one_add_del_map_server
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  vl_api_address_t ip_address;
};

/** \brief add or delete map-resolver
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - array of address bytes
*/
autoreply define one_add_del_map_resolver
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  vl_api_address_t ip_address;
};

/** \brief enable or disable ONE feature
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_enable - enable protocol if non-zero, else disable
*/
autoreply define one_enable_disable
{
  u32 client_index;
  u32 context;
  bool is_enable [default=true];
};

/** \brief configure or delete ONE NSH mapping
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param ls_name - locator set name
    @param is_add - add locator set if non-zero; delete otherwise
*/
autoreply define one_nsh_set_locator_set
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  string ls_name[64];
};

/** \brief configure or disable ONE PITR node
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param ls_name - locator set name
    @param is_add - add locator set if non-zero, else disable pitr
*/
autoreply define one_pitr_set_locator_set
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  string ls_name[64];
};

/** \brief configure or disable use of PETR
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_ip4 - Address is IPv4 if set and IPv6 otherwise
    @param address - PETR IP address
    @param is_add - add locator set if non-zero, else disable PETR
*/
autoreply define one_use_petr
{
  u32 client_index;
  u32 context;
  vl_api_address_t ip_address;
  bool is_add [default=true];
};

/** \brief Request for ONE PETR status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_one_use_petr
{
  u32 client_index;
  u32 context;
};

/** \brief ONE PETR status, enable or disable
    @param context - sender context, to match reply w/ request
    @param enable - ONE PETR enable if non-zero, else disable
    @param is_ip4 - Address is IPv4 if non-zero, else IPv6
    @param address - PETR IP address
*/
define show_one_use_petr_reply
{
  u32 context;
  i32 retval;
  bool status;
  vl_api_address_t ip_address;
};

/** \brief Get state of ONE RLOC probing
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_one_rloc_probe_state
{
  u32 client_index;
  u32 context;
};

/** \brief Reply for show_one_rloc_probe_state
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param is_enable - state of RLOC probing
*/
define show_one_rloc_probe_state_reply
{
  u32 context;
  i32 retval;
  bool is_enable;
};

/** \brief enable/disable ONE RLOC probing
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_enable - enable if non-zero; disable otherwise
*/
autoreply define one_rloc_probe_enable_disable
{
  u32 client_index;
  u32 context;
  bool is_enable [default=true];
};

/** \brief enable/disable ONE map-register
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_enable - enable if non-zero; disable otherwise
*/
autoreply define one_map_register_enable_disable
{
  u32 client_index;
  u32 context;
  bool is_enable [default=true];
};

/** \brief Get state of ONE map-register
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_one_map_register_state
{
  u32 client_index;
  u32 context;
};

/** \brief Reply for show_one_map_register_state
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define show_one_map_register_state_reply
{
  u32 context;
  i32 retval;
  bool is_enable;
};

enum one_map_mode
{
	ONE_MAP_MODE_API_DST_ONLY = 0,
	ONE_MAP_MODE_API_SRC_DST = 1,
};

/** \brief set ONE map-request mode. Based on configuration VPP will send
      src/dest or just normal destination map requests.
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param mode - new map-request mode. Supported values are:
      0 - destination only
      1 - source/destination
*/
autoreply define one_map_request_mode
{
  u32 client_index;
  u32 context;
  vl_api_one_map_mode_t mode;
};

/** \brief Request for ONE map-request mode
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_one_map_request_mode
{
  u32 client_index;
  u32 context;
};

/** \brief Reply for show_one_map_request_mode
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param mode - map-request mode
*/
define show_one_map_request_mode_reply
{
  u32 context;
  i32 retval;
  vl_api_one_map_mode_t mode;
};

/** \brief add or delete remote static mapping
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param is_src_dst - flag indicating src/dst based routing policy
    @param del_all - if set, delete all remote mappings
    @param vni - virtual network instance
    @param action - negative map-reply action
    @param deid - dst EID
    @param seid - src EID, valid only if is_src_dst is enabled
    @param rloc_num - number of remote locators
    @param rlocs - remote locator records
*/
autoreply manual_print manual_endian define one_add_del_remote_mapping
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  bool is_src_dst;
  bool del_all;
  u32 vni;
  u8 action;
  vl_api_eid_t deid;
  vl_api_eid_t seid;
  u32 rloc_num;
  vl_api_remote_locator_t rlocs[rloc_num];
};

typedef one_l2_arp_entry
{
  vl_api_mac_address_t mac;
  vl_api_ip4_address_t ip4;
};

/** \brief Add/delete L2 ARP entries
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add if non-zero; delete otherwise
    @param bd - bridge domain
    @param entry - ARP entry
*/
autoreply define one_add_del_l2_arp_entry
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  u32 bd;
  vl_api_one_l2_arp_entry_t entry;
};

/** \brief Request for L2 ARP entries from specified bridge domain
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param bd - bridge domain
*/
define one_l2_arp_entries_get
{
  u32 client_index;
  u32 context;
  u32 bd;
};

/** \brief Reply with L2 ARP entries from specified bridge domain
    @param context - sender context, to match reply w/ request
    @param retval - error code
    @param count - number of elements in the list
    @param vl_api_one_arp_entry_t - list of entries
*/
manual_print manual_endian define one_l2_arp_entries_get_reply
{
  u32 context;
  i32 retval;
  u32 count;
  vl_api_one_l2_arp_entry_t entries[count];
};

typedef one_ndp_entry
{
  vl_api_mac_address_t mac;
  vl_api_ip6_address_t ip6;
};


autoreply define one_add_del_ndp_entry
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  u32 bd;
  vl_api_one_ndp_entry_t entry;
};

define one_ndp_entries_get
{
  u32 client_index;
  u32 context;
  u32 bd;
};

manual_print manual_endian define one_ndp_entries_get_reply
{
  u32 context;
  i32 retval;
  u32 count;
  vl_api_one_ndp_entry_t entries[count];
};

/** \brief Set ONE transport protocol
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param protocol - supported values:
      1: UDP based LISP (default)
      2: binary API
*/
autoreply define one_set_transport_protocol
{
  u32 client_index;
  u32 context;
  u8 protocol;
};

define one_get_transport_protocol
{
  u32 client_index;
  u32 context;
};

define one_get_transport_protocol_reply
{
  u32 context;
  i32 retval;
  u8 protocol;
};

/** \brief Request for list of bridge domains used by neighbor discovery
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define one_ndp_bd_get
{
  u32 client_index;
  u32 context;
};

/** \brief Reply with list of bridge domains used by neighbor discovery
    @param context - sender context, to match reply w/ request
    @param count - number of elements in the list
    @param bridge_domains - list of BDs
*/
manual_print manual_endian define one_ndp_bd_get_reply
{
  u32 context;
  i32 retval;
  u32 count;
  u32 bridge_domains[count];
};

/** \brief Request for list of bridge domains used by L2 ARP table
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define one_l2_arp_bd_get
{
  u32 client_index;
  u32 context;
};

/** \brief Reply with list of bridge domains used by L2 ARP table
    @param context - sender context, to match reply w/ request
    @param count - number of elements in the list
    @param bridge_domains - list of BDs
*/
manual_print manual_endian define one_l2_arp_bd_get_reply
{
  u32 context;
  i32 retval;
  u32 count;
  u32 bridge_domains[count];
};

/** \brief add or delete ONE adjacency adjacency
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param vni - virtual network instance
    @param reid - remote EID
    @param leid - local EID
*/
autoreply define one_add_del_adjacency
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u32 vni;
  vl_api_eid_t reid;
  vl_api_eid_t leid;
};

/** \brief add or delete map request itr rlocs
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add address if non-zero, else delete
    @param locator_set_name - locator set name
*/
autoreply define one_add_del_map_request_itr_rlocs
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  string locator_set_name[64];
};

/** \brief map/unmap vni/bd_index to vrf
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - add or delete mapping
    @param dp_table - virtual network id/bridge domain index
    @param vrf - vrf
    @param is_l2 - is l2
*/
autoreply define one_eid_table_add_del_map
{
  u32 client_index;
  u32 context;
  bool is_add [default=true];
  u32 vni;
  u32 dp_table;
  bool is_l2;
};

/** \brief Request for map one locator status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param locator_set_index - index of locator_set
    @param ls_name - locator set name
    @param is_index_set - flag indicating whether ls_name or ls_index is set
 */
define one_locator_dump
{
  u32 client_index;
  u32 context;
  u32 ls_index;
  string ls_name[64];
  bool is_index_set;
};

/** \brief ONE locator_set status
    @param local - if is set, then locator is local
    @param locator_set_name - name of the locator_set
    @param sw_if_index - sw_if_index of the locator
    @param priority - locator priority
    @param weight - locator weight
  */
define one_locator_details
{
  u32 context;
  u8 local;
  vl_api_interface_index_t sw_if_index;
  vl_api_address_t ip_address;
  u8 priority;
  u8 weight;
};

/** \brief ONE locator_set status
    @param context - sender context, to match reply w/ request
    @param ls_index - locator set index
    @param ls_name - name of the locator set
 */
define one_locator_set_details
{
  u32 context;
  u32 ls_index;
  string ls_name[64];
};

enum one_filter
{
	ONE_FILTER_API_ALL = 0,
	ONE_FILTER_API_LOCAL = 1,
	ONE_FILTER_API_REMOTE = 2,
};

/** \brief Request for locator_set summary status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param filter - filter type
      Supported values:
        0: all locator sets
        1: local locator sets
        2: remote locator sets
 */
define one_locator_set_dump
{
  u32 client_index;
  u32 context;
  vl_api_one_filter_t filter;
};

/** \brief Dump ONE eid-table
    @param context - sender context, to match reply w/ request
    @param locator_set_index - index of locator_set, if ~0 then the mapping
                                is negative
    @param action - negative map request action
    @param is_local - local if non-zero, else remote
    @param is_src_dst - EID is type of source/destination
    @param deid - dst EID
    @param seid - src EID
    @param vni - virtual network instance
    @param ttl - time to live
    @param authoritative - authoritative
    @param key - secret key
*/

// FIXME: action, authoritative

define one_eid_table_details
{
  u32 context;
  u32 locator_set_index;
  u8 action;
  bool is_local;
  bool is_src_dst;
  u32 vni;
  vl_api_eid_t deid;
  vl_api_eid_t seid;
  u32 ttl;
  u8 authoritative;
  vl_api_hmac_key_t key;
};

/** \brief Request for eid table summary status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param eid_set - if non-zero request info about specific mapping
    @param vni - virtual network instance; valid only if eid_set != 0
    @param eid - endpoint identifier
    @param filter - filter type;
      Support values:
        0: all eid
        1: local eid
        2: remote eid
 */
define one_eid_table_dump
{
  u32 client_index;
  u32 context;
  bool eid_set;
  u32 vni;
  vl_api_eid_t eid;
  vl_api_one_filter_t filter;
};

/** \brief ONE adjacency
    @param reid - remote EID
    @param leid - local EID
  */
typedef one_adjacency
{
  vl_api_eid_t reid;
  vl_api_eid_t leid;
};

/** \brief ONE adjacency reply
    @param count - number of adjacencies
    @param adjacencies - array of adjacencies
  */
manual_endian manual_print define one_adjacencies_get_reply
{
  u32 context;
  i32 retval;
  u32 count;
  vl_api_one_adjacency_t adjacencies[count];
};

/** \brief Request for ONE adjacencies
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param vni - filter adjacencies by VNI
 */
define one_adjacencies_get
{
  u32 client_index;
  u32 context;
  u32 vni;
};

/** \brief Shows relationship between vni and vrf/bd
    @param dp_table - VRF index or bridge domain index
    @param vni - virtual network instance
  */
define one_eid_table_map_details
{
  u32 context;
  u32 vni;
  u32 dp_table;
};

/** \brief Request for one_eid_table_map_details
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_l2 - if set dump vni/bd mappings else vni/vrf
 */
define one_eid_table_map_dump
{
  u32 client_index;
  u32 context;
  bool is_l2;
};

/** \brief Dumps all VNIs used in mappings
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
  */
define one_eid_table_vni_dump
{
  u32 client_index;
  u32 context;
};

/** \brief reply to one_eid_table_vni_dump
    @param context - sender context, to match reply w/ request
    @param vni - virtual network instance
 */
define one_eid_table_vni_details
{
  u32 context;
  u32 vni;
};

/** \brief ONE map resolver status
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - array of address bytes
 */
define one_map_resolver_details
{
  u32 context;
  vl_api_address_t ip_address;
};

/** \brief Request for map resolver summary status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
 */
define one_map_resolver_dump
{
  u32 client_index;
  u32 context;
};

/** \brief ONE map server details
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - array of address bytes
 */
define one_map_server_details
{
  u32 context;
  vl_api_address_t ip_address;
};

/** \brief Request for map server summary status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
 */
define one_map_server_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Request for ONE status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_one_status
{
  u32 client_index;
  u32 context;
};

/** \brief ONE status
    @param context - sender context, to match reply w/ request
    @param feature_status - enabled if non-zero, else disabled
    @param gpe_status - enabled if non-zero, else disabled
*/
define show_one_status_reply
{
  u32 context;
  i32 retval;
  bool feature_status;
  bool gpe_status;
};

/** \brief Get ONE map request itr rlocs status
    @param context - sender context, to match reply w/ request
    @param locator_set_name - name of the locator_set
 */
define one_get_map_request_itr_rlocs
{
  u32 client_index;
  u32 context;
};

/** \brief Request for map request itr rlocs summary status
 */
define one_get_map_request_itr_rlocs_reply
{
  u32 context;
  i32 retval;
  string locator_set_name[64];
};

/** \brief Request for ONE NSH mapping
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_one_nsh_mapping
{
  u32 client_index;
  u32 context;
};

/** \brief Reply for ONE NSH mapping
    @param context - sender context, to match reply w/ request
    @param is_set - is ONE NSH mapping set
    @param locator_set_name - name of the locator_set if NSH mapping is set
*/
define show_one_nsh_mapping_reply
{
  u32 context;
  i32 retval;
  bool is_set;
  string locator_set_name[64];
};

/** \brief Request for ONE PITR status
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define show_one_pitr
{
  u32 client_index;
  u32 context;
};

/** \brief Status of ONE PITR, enable or disable
    @param context - sender context, to match reply w/ request
    @param status - ONE PITR enable if non-zero, else disable
    @param locator_set_name -  name of the locator_set
*/
define show_one_pitr_reply
{
  u32 context;
  i32 retval;
  bool status;
  string locator_set_name[64];
};

define one_stats_dump
{
  u32 client_index;
  u32 context;
};

define one_stats_details
{
  u32 context;
  u32 vni;
  vl_api_eid_t deid;
  vl_api_eid_t seid;
  vl_api_address_t rloc;
  vl_api_address_t lloc;

  u32 pkt_count;
  u32 bytes;
};

autoreply define one_stats_flush
{
  u32 client_index;
  u32 context;
};

autoreply define one_stats_enable_disable
{
  u32 client_index;
  u32 context;
  bool is_enable [default=true];
};

define show_one_stats_enable_disable
{
  u32 client_index;
  u32 context;
};

define show_one_stats_enable_disable_reply
{
  u32 context;
  i32 retval;
  bool is_enable;
};

autoreply define one_map_register_fallback_threshold
{
  u32 client_index;
  u32 context;
  u32 value;
};

define show_one_map_register_fallback_threshold
{
  u32 client_index;
  u32 context;
};

define show_one_map_register_fallback_threshold_reply
{
  u32 context;
  i32 retval;
  u32 value;
};

autoreply define one_enable_disable_xtr_mode
{
  u32 client_index;
  u32 context;
  bool is_enable [default=true];
};

define one_show_xtr_mode
{
  u32 client_index;
  u32 context;
};

define one_show_xtr_mode_reply
{
  u32 context;
  i32 retval;
  bool is_enable;
};

autoreply define one_enable_disable_petr_mode
{
  u32 client_index;
  u32 context;
  bool is_enable [default=true];
};

define one_show_petr_mode
{
  u32 client_index;
  u32 context;
};

define one_show_petr_mode_reply
{
  u32 context;
  i32 retval;
  bool is_enable;
};

autoreply define one_enable_disable_pitr_mode
{
  u32 client_index;
  u32 context;
  bool is_enable [default=true];
};

define one_show_pitr_mode
{
  u32 client_index;
  u32 context;
};

define one_show_pitr_mode_reply
{
  u32 context;
  i32 retval;
  bool is_enable;
};

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