/*
 * 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 = "1.0.0";

typeonly manual_print manual_endian define one_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 - locator records
*/
manual_endian manual_print define one_add_del_locator_set
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 locator_set_name[64];
  u32 locator_num;
  vl_api_one_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;
  u8 is_add;
  u8 locator_set_name[64];
  u32 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_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 one_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 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;
  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 one_add_del_map_resolver
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 is_ipv6;
  u8 ip_address[16];
};

/** \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_en - enable protocol if non-zero, else disable
*/
autoreply define one_enable_disable
{
  u32 client_index;
  u32 context;
  u8 is_en;
};

/** \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;
  u8 is_add;
  u8 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;
  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 PETR
*/
autoreply define one_use_petr
{
  u32 client_index;
  u32 context;
  u8 is_ip4;
  u8 address[16];
  u8 is_add;
};

/** \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 status - 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;
  u8 status;
  u8 is_ip4;
  u8 address[16];
};

/** \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_enabled - state of RLOC probing
*/
define show_one_rloc_probe_state_reply
{
  u32 context;
  i32 retval;
  u8 is_enabled;
};

/** \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;
  u8 is_enabled;
};

/** \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;
  u8 is_enabled;
};

/** \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;
  u8 is_enabled;
};

/** \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;
  u8 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;
  u8 mode;
};

typeonly manual_endian manual_print define one_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
      3 : NSH : both information (service path ID and service index) are
        encoded in 'eid' field in a following way:

        |4 B |1 B |
        -----------
        |SPI | SI |
    @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;
  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_one_remote_locator_t rlocs[rloc_num];
};

/** \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 mac - MAC address
    @param ip4 - IPv4 address
*/
autoreply define one_add_del_l2_arp_entry
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 mac[6];
  u32 bd;
  u32 ip4;
};

/** \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;
};

typeonly manual_print manual_endian define one_l2_arp_entry
{
  u8 mac[6];
  u32 ip4;
};

/** \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];
};

autoreply define one_add_del_ndp_entry
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 mac[6];
  u32 bd;
  u8 ip6[16];
};

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

typeonly manual_print manual_endian define one_ndp_entry
{
  u8 mac[6];
  u8 ip6[16];
};

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 eid_type -
      0 : ipv4
      1 : ipv6
      2 : mac
    @param reid - remote EID
    @param leid - local EID
*/
autoreply define one_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 one_add_del_map_request_itr_rlocs
{
  u32 client_index;
  u32 context;
  u8 is_add;
  u8 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
*/
autoreply define one_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 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;
  u8 ls_name[64];
  u8 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;
  u32 sw_if_index;
  u8 is_ipv6;
  u8 ip_address[16];
  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;
  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 one_locator_set_dump
{
  u32 client_index;
  u32 context;
  u8 filter;
};

/** \brief Dump ONE 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 one_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
        3 : NSH : both information (service path ID and service index) are
          encoded in 'eid' field in a following way:

          |4 B |1 B |
          -----------
          |SPI | SI |
    @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;
  u8 eid_set;
  u8 prefix_length;
  u32 vni;
  u8 eid_type;
  u8 eid[16];
  u8 filter;
};

/** \brief ONE 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 one_adjacency
{
  u8 eid_type;
  u8 reid[16];
  u8 leid[16];
  u8 reid_prefix_len;
  u8 leid_prefix_len;
};

/** \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;
  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 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;
  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 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;
  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 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;
  u8 feature_status;
  u8 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;
  u8 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;
  u8 is_set;
  u8 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;
  u8 status;
  u8 locator_set_name[64];
};

define one_stats_dump
{
  u32 client_index;
  u32 context;
};

define one_stats_details
{
  u32 context;
  u32 vni;
  u8 eid_type;
  u8 deid[16];
  u8 seid[16];
  u8 deid_pref_len;
  u8 seid_pref_len;
  u8 is_ip4;
  u8 rloc[16];
  u8 lloc[16];

  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;
  u8 is_en;
};

define show_one_stats_enable_disable
{
  u32 client_index;
  u32 context;
};

define show_one_stats_enable_disable_reply
{
  u32 context;
  i32 retval;
  u8 is_en;
};

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;
  u8 is_en;
};

define one_show_xtr_mode
{
  u32 client_index;
  u32 context;
};

define one_show_xtr_mode_reply
{
  u32 context;
  i32 retval;
  u8 is_en;
};

autoreply define one_enable_disable_petr_mode
{
  u32 client_index;
  u32 context;
  u8 is_en;
};

define one_show_petr_mode
{
  u32 client_index;
  u32 context;
};

define one_show_petr_mode_reply
{
  u32 context;
  i32 retval;
  u8 is_en;
};

autoreply define one_enable_disable_pitr_mode
{
  u32 client_index;
  u32 context;
  u8 is_en;
};

define one_show_pitr_mode
{
  u32 client_index;
  u32 context;
};

define one_show_pitr_mode_reply
{
  u32 context;
  i32 retval;
  u8 is_en;
};

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