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

import "vnet/ip/ip_types.api";

/** \brief Add MAP domains
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param ip6_prefix - Rule IPv6 prefix
    @param ip4_prefix - Rule IPv4 prefix
    @param ip6_src - MAP domain IPv6 BR address / Tunnel source
    @param ea_bits_len - Embedded Address bits length
    @param psid_offset - Port Set Identifier (PSID) offset
    @param psid_length - PSID length
    @param mtu - MTU
    @param tag - A user field stored with the MAP
*/
define map_add_domain
{
  u32 client_index;
  u32 context;
  vl_api_ip6_prefix_t ip6_prefix;
  vl_api_ip4_prefix_t ip4_prefix;
  vl_api_ip6_prefix_t ip6_src;
  u8 ea_bits_len;
  u8 psid_offset;
  u8 psid_length;
  u16 mtu;
  string tag[64];
};

/** \brief Reply for MAP domain add
    @param context - returned sender context, to match reply w/ request
    @param index - MAP domain index
    @param retval - return code
*/
define map_add_domain_reply
{
  u32 context;
  u32 index;
  i32 retval;
};

/** \brief Delete MAP domain
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param index - MAP Domain index
*/
autoreply define map_del_domain
{
  u32 client_index;
  u32 context;
  u32 index;
};


/** \brief Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param index - MAP Domain index
    @param is_add - If 1 add rule, if 0 delete rule
    @param ip6_dst - MAP CE IPv6 address
    @param psid - Rule PSID
*/
autoreply define map_add_del_rule
{
  u32 client_index;
  u32 context;
  u32 index;
  bool is_add;
  vl_api_ip6_address_t ip6_dst;
  u16 psid;
};


/** \brief Get list of map domains
    @param client_index - opaque cookie to identify the sender
*/
define map_domain_dump
{
  u32 client_index;
  u32 context;
};

/** \brief Details about a single MAP domain
    @param context - returned sender context, to match reply w/ request
    @param domain_index - MAP domain index
    @param ip6_prefix - Rule IPv6 prefix
    @param ip4_prefix - Rule IPv4 prefix
    @param ip6_src - MAP domain IPv6 BR address / Tunnel source
    @param ea_bits_len - Embedded Address bits length
    @param psid_offset - Port Set Identifier (PSID) offset
    @param psid_length - PSID length
    @param flags -
    @param mtu - MTU
    @param tag - The user field stored with the MAP at creation time
*/
define map_domain_details
{
  u32 context;
  u32 domain_index;
  vl_api_ip6_prefix_t ip6_prefix;
  vl_api_ip4_prefix_t ip4_prefix;
  vl_api_ip6_prefix_t ip6_src;
  u8 ea_bits_len;
  u8 psid_offset;
  u8 psid_length;
  u8 flags;
  u16 mtu;
  string tag[64];
};

define map_rule_dump
{
  u32 client_index;
  u32 context;
  u32 domain_index;
};

define map_rule_details
{
  u32 context;
  vl_api_ip6_address_t ip6_dst;
  u16 psid;
};

/** \brief Enable or disable a MAP interface
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param sw_if_index - 
    @param is_enable - 0=disable, 1=enable interface
    @param is_translation -  0=encapsulation, 1=translation
*/
autoreply define map_if_enable_disable
{
  u32 client_index;
  u32 context;
  u32 sw_if_index;
  bool is_enable;
  bool is_translation; /* 0 - encapsulation, 1 - translation */
};

/** \brief Request for a single block of summary stats
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define map_summary_stats
{
  u32 client_index;
  u32 context;
};

/** \brief Reply for map_summary_stats request
    @param context - sender context, to match reply w/ request
    @param retval - return code for request
    @param total_bindings -
    @param total_pkts -
    @param total_ip4_fragments -
    @param total_security_check -
*/
define map_summary_stats_reply
{
  u32 context;
  i32 retval;
  u64 total_bindings;
  u64 total_pkts[2];
  u64 total_bytes[2];
  u64 total_ip4_fragments;
  u64 total_security_check[2];
};


/** \brief Set MAP fragmentation parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param inner - 1=frag inner packet, 0=frag tunnel packets
    @param ignore_df - 1=IP4 fragment despite DF bit, 0=honor DF
*/
autoreply define map_param_set_fragmentation
{
  u32 client_index;
  u32 context;
  bool inner;
  bool ignore_df;
};


/** \brief Set MAP ICMP parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param icmp4_err_relay_src - IPv4 ICMP err relay src address
*/
autoreply define map_param_set_icmp
{
  u32 client_index;
  u32 context;
  vl_api_ip4_address_t ip4_err_relay_src;
};


/** \brief Set MAP ICMP6 parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param enable_unreachable - 1 = send ICMP unreachable err msgs
*/
autoreply define map_param_set_icmp6
{
  u32 client_index;
  u32 context;
  bool enable_unreachable;
};


/** \brief Add/delete MAP pre-resolve IP addresses parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_add - 1 = Add non-zero IP addresses, 0 = delete
    @param ip4_nh_address - direct IP4 next-hop address
    @param ip6_nh_address - direct IP6 next-hop address
*/
autoreply define map_param_add_del_pre_resolve
{
  u32 client_index;
  u32 context;
  bool is_add;
  vl_api_ip4_address_t ip4_nh_address;
  vl_api_ip6_address_t ip6_nh_address;
};


/** \brief Set MAP reassembly parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param is_ip6 - 1 = params apply to IPv6, 0 = params apply to IPv4
    @param lifetime_ms - reassembly valid lifetime, or ~0
    @param pool_size - max number of reassemblies, or ~0
    @param buffers -  max number of reassembly buffers, or ~0 
    @param ht_ratio - hash-table size factor, or ~0
*/
autoreply define map_param_set_reassembly
{
  u32 client_index;
  u32 context;
  bool is_ip6;
  u16 lifetime_ms;
  u16 pool_size;
  u32 buffers;
  f64 ht_ratio;
};


/** \brief Set MAP security-check parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param enable - 1=enable security check on first inbound packet
    @param fragments - 1=enable check on (subsequent) fragments too
*/
autoreply define map_param_set_security_check
{
  u32 client_index;
  u32 context;
  bool enable;
  bool fragments;
};


/** \brief Set MAP traffic class parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @param copy - 1 = copy packet class/TOS field, 0 = use tc_class instead
    @param tc_class - class field value when copy == 0
*/
autoreply define map_param_set_traffic_class
{
  u32 client_index;
  u32 context;
  bool copy;
  u8 tc_class;
};


/** \brief Set MAP TCP parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
    @parma tcp_mss - TCP MSS clamping value
*/
autoreply define map_param_set_tcp
{
  u32 client_index;
  u32 context;
  u16 tcp_mss;
};


/** \brief Request for a single block of MAP parameters
    @param client_index - opaque cookie to identify the sender
    @param context - sender context, to match reply w/ request
*/
define map_param_get
{
  u32 client_index;
  u32 context;
};


/** \brief Reply for map_param_get request
    @param context - sender context, to match reply w/ request
    @param retval - return code for request
    @param inner - 1=frag inner packet, 0=frag tunnel packets, ~0=untouched
    @param ignore_df - 1=IP4 fragm despite DF bit, 0=honor DF, ~0=untouched
    @param icmp_ip4_err_relay_src - IPv4 ICMP err relay src address
    @param icmp6_enable_unreachable - 1 = send ICMP unreachable err msgs
    @param ip4_nh_address - direct IP4 next-hop address
    @param ip6_nh_address - direct IP6 next-hop address
    @param ip6_lifetime_ms - max number of reassemblies, or ~0
    @param ip6_pool_size - max number of reassemblies, or ~0
    @param ip6_buffers -  max number of reassembly buffers, or ~0 
    @param ip6_ht_ratio - hash-table size factor, or ~0
    @param sec_check_enable - 1=enable security check on first inbound packet
    @param sec_check_fragments - 1=enable check on (subsequent) fragments too
    @param tc_copy - 1 = copy packet class/TOS field, 0 = use class instead
    @param tc_class - class field value when copy == 0
*/
define map_param_get_reply
{
  u32 context;
  i32 retval;
  u8 frag_inner;
  u8 frag_ignore_df;
  vl_api_ip4_address_t icmp_ip4_err_relay_src;
  bool icmp6_enable_unreachable;
  vl_api_ip4_address_t ip4_nh_address;
  vl_api_ip6_address_t ip6_nh_address;
  u16 ip4_lifetime_ms;
  u16 ip4_pool_size;
  u32 ip4_buffers;
  f64 ip4_ht_ratio;
  u16 ip6_lifetime_ms;
  u16 ip6_pool_size;
  u32 ip6_buffers;
  f64 ip6_ht_ratio;
  bool sec_check_enable;
  bool sec_check_fragments;
  bool tc_copy;
  u8 tc_class;
};
