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

typeonly manual_print manual_endian define local_locator
{
  u32 sw_if_index;
  u8 priority;
  u8 weight;
};

/** \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 - LISP locator records
*/
manual_endian manual_print define lisp_add_del_locator_set
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 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 lisp_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 lisp locator
    @param weight - weight of the lisp locator
*/
autoreply define lisp_add_del_locator
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 locator_set_name[64];
  u32 sw_if_index;
  u8 priority;
  u8 weight;
};

/** \brief add or delete lisp 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_type:
      0 : ipv4
      1 : ipv6
      2 : mac
    @param eid - EID can be ip4, ip6 or mac
    @param prefix_len - prefix len
    @param locator_set_name - name of locator_set to add/del eid-table
    @param vni - virtual network instance
    @param key_id
      HMAC_NO_KEY           0
      HMAC_SHA_1_96         1
      HMAC_SHA_256_128      2
    @param key - secret key
*/
autoreply define lisp_add_del_local_eid
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 eid_type;
  u8 eid[16];
  u8 prefix_len;
  u8 locator_set_name[64];
  u32 vni;
  u16 key_id;
  u8 key[64];
};

/** \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 lisp_add_del_map_server
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 is_ipv6;
  u8 ip_address[16];
};

/** \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 lisp_add_del_map_resolver
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 is_ipv6;
  u8 ip_address[16];
};

/** \brief enable or disable LISP feature
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_en - enable protocol if non-zero, else disable
*/
autoreply define lisp_enable_disable
{
  u32 client_index;
  u32 context;
  u8 is_en;
};

/** \brief configure or disable LISP 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 lisp_pitr_set_locator_set
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 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 pitr
*/
autoreply define lisp_use_petr
{
  u32 client_index;
  u32 context;
  u8 is_ip4;
  u8 address[16];
  u8 is_add;
};

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

/** \brief LISP PETR status, enable or disable
    @param context - sender context, to match reply w/ request
    @param status - LISP 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_lisp_use_petr_reply
{
  u32 context;
  i32 retval;
  u8 status;
  u8 is_ip4;
  u8 address[16];
};

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

/** \brief Reply for show_lisp_rloc_probe_state
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
    @param is_enabled - state of RLOC probing
*/
define show_lisp_rloc_probe_state_reply
{
  u32 context;
  i32 retval;
  u8 is_enabled;
};

/** \brief enable/disable LISP 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 lisp_rloc_probe_enable_disable
{
  u32 client_index;
  u32 context;
  u8 is_enabled;
};

/** \brief enable/disable LISP 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 lisp_map_register_enable_disable
{
  u32 client_index;
  u32 context;
  u8 is_enabled;
};

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

/** \brief Reply for show_lisp_map_register_state
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/
define show_lisp_map_register_state_reply
{
  u32 context;
  i32 retval;
  u8 is_enabled;
};

/** \brief set LISP 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 lisp_map_request_mode
{
  u32 client_index;
  u32 context;
  u8 mode;
};

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

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

typeonly manual_endian manual_print define remote_locator
{
  u8 is_ip4;
  u8 priority;
  u8 weight;
  u8 addr[16];
};

/** \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 eid_type -
      0 : ipv4
      1 : ipv6
      2 : mac
    @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 lisp_add_del_remote_mapping
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 is_src_dst;
  u8 del_all;
  u32 vni;
  u8 action;
  u8 eid_type;
  u8 eid[16];
  u8 eid_len;
  u8 seid[16];
  u8 seid_len;
  u32 rloc_num;
  vl_api_remote_locator_t rlocs[rloc_num];
};

/** \brief add or delete LISP 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 eid_type -
      0 : ipv4
      1 : ipv6
      2 : mac
    @param reid - remote EID
    @param leid - local EID
*/
autoreply define lisp_add_del_adjacency
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u32 vni;
  u8 eid_type;
  u8 reid[16];
  u8 leid[16];
  u8 reid_len;
  u8 leid_len;
};

/** \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 lisp_add_del_map_request_itr_rlocs
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 locator_set_name[64];
};

/** \brief Reply for lisp_add_del_map_request_itr_rlocs
    @param context - returned sender context, to match reply w/ request
    @param retval - return code
*/

/** \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
*/
autoreply define lisp_eid_table_add_del_map
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u32 vni;
  u32 dp_table;
  u8 is_l2;
};

/** \brief Request for map lisp 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 lisp_locator_dump
{
  u32 client_index;
  u32 context;
  u32 ls_index;
  u8 ls_name[64];
  u8 is_index_set;
};

/** \brief LISP 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 lisp_locator_details
{
  u32 context;
  u8 local;
  u32 sw_if_index;
  u8 is_ipv6;
  u8 ip_address[16];
  u8 priority;
  u8 weight;
};

/** \brief LISP 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 lisp_locator_set_details
{
  u32 context;
  u32 ls_index;
  u8 ls_name[64];
};

/** \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 lisp_locator_set_dump
{
  u32 client_index;
  u32 context;
  u8 filter;
};

/** \brief Dump lisp eid-table
    @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, if ~0 then the mapping
                                is negative
    @param action - negative map request action
    @param is_local - local if non-zero, else remote
    @param eid_type:
      0 : ipv4
      1 : ipv6
      2 : mac
    @param is_src_dst - EID is type of source/destination
    @param eid - EID can be ip4, ip6 or mac
    @param eid_prefix_len - prefix length
    @param seid - source EID can be ip4, ip6 or mac
    @param seid_prefix_len - source prefix length
    @param vni - virtual network instance
    @param ttl - time to live
    @param authoritative - authoritative
    @param key_id
      HMAC_NO_KEY           0
      HMAC_SHA_1_96         1
      HMAC_SHA_256_128      2
    @param key - secret key
*/

define lisp_eid_table_details
{
  u32 context;
  u32 locator_set_index;
  u8 action;
  u8 is_local;
  u8 eid_type;
  u8 is_src_dst;
  u32 vni;
  u8 eid[16];
  u8 eid_prefix_len;
  u8 seid[16];
  u8 seid_prefix_len;
  u32 ttl;
  u8 authoritative;
  u16 key_id;
  u8 key[64];
};

/** \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 prefix_length - prefix length if EID is IP address;
      valid only if eid_set != 0
    @param eid_type - EID type; valid only if eid_set != 0
      Supported values:
        0: EID is IPv4
        1: EID is IPv6
        2: EID is ethernet address
    @param eid - endpoint identifier
    @param filter - filter type;
      Support values:
        0: all eid
        1: local eid
        2: remote eid
 */
define lisp_eid_table_dump
{
  u32 client_index;
  u32 context;
  u8 eid_set;
  u8 prefix_length;
  u32 vni;
  u8 eid_type;
  u8 eid[16];
  u8 filter;
};

/** \brief LISP adjacency
    @param eid_type -
      0 : ipv4
      1 : ipv6
      2 : mac
    @param reid - remote EID
    @param leid - local EID
    @param reid_prefix_len - remote EID IP prefix length
    @param leid_prefix_len - local EID IP prefix length
  */
typeonly manual_print manual_endian define lisp_adjacency
{
  u8 eid_type;
  u8 reid[16];
  u8 leid[16];
  u8 reid_prefix_len;
  u8 leid_prefix_len;
};

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

/** \brief Request for LISP 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 lisp_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 lisp_eid_table_map_details
{
  u32 context;
  u32 vni;
  u32 dp_table;
};

/** \brief Request for lisp_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 lisp_eid_table_map_dump
{
  u32 client_index;
  u32 context;
  u8 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 lisp_eid_table_vni_dump
{
  u32 client_index;
  u32 context;
};

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

/** \brief LISP map resolver status
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - array of address bytes
 */
define lisp_map_resolver_details
{
  u32 context;
  u8 is_ipv6;
  u8 ip_address[16];
};

/** \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 lisp_map_resolver_dump
{
  u32 client_index;
  u32 context;
};

/** \brief LISP map server details
    @param is_ipv6 - if non-zero the address is ipv6, else ipv4
    @param ip_address - array of address bytes
 */
define lisp_map_server_details
{
  u32 context;
  u8 is_ipv6;
  u8 ip_address[16];
};

/** \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 lisp_map_server_dump
{
  u32 client_index;
  u32 context;
};

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

/** \brief Status of lisp, enable or disable
    @param context - sender context, to match reply w/ request
    @param feature_status - lisp enable if non-zero, else disable
    @param gpe_status - lisp enable if non-zero, else disable
*/
define show_lisp_status_reply
{
  u32 context;
  i32 retval;
  u8 feature_status;
  u8 gpe_status;
};

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

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

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

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

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