2016-12-06 12:50:08 +01:00
|
|
|
/*
|
|
|
|
|
* 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2018-12-20 11:47:30 -06:00
|
|
|
option version = "3.0.0";
|
2018-11-22 12:53:00 +01:00
|
|
|
|
|
|
|
|
import "vnet/ip/ip_types.api";
|
2016-12-06 12:50:08 +01:00
|
|
|
|
|
|
|
|
/** \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 Identifider (PSID) offset
|
|
|
|
|
@param psid_length - PSID length
|
|
|
|
|
@param mtu - MTU
|
|
|
|
|
*/
|
|
|
|
|
define map_add_domain
|
|
|
|
|
{
|
|
|
|
|
u32 client_index;
|
|
|
|
|
u32 context;
|
2018-11-22 12:53:00 +01:00
|
|
|
vl_api_ip6_prefix_t ip6_prefix;
|
|
|
|
|
vl_api_ip4_prefix_t ip4_prefix;
|
|
|
|
|
vl_api_ip6_prefix_t ip6_src;
|
2016-12-06 12:50:08 +01:00
|
|
|
u8 ea_bits_len;
|
|
|
|
|
u8 psid_offset;
|
|
|
|
|
u8 psid_length;
|
|
|
|
|
u16 mtu;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** \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
|
|
|
|
|
*/
|
2017-04-24 10:46:54 -04:00
|
|
|
autoreply define map_del_domain
|
2016-12-06 12:50:08 +01:00
|
|
|
{
|
|
|
|
|
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
|
|
|
|
|
*/
|
2017-04-24 10:46:54 -04:00
|
|
|
autoreply define map_add_del_rule
|
2016-12-06 12:50:08 +01:00
|
|
|
{
|
|
|
|
|
u32 client_index;
|
|
|
|
|
u32 context;
|
|
|
|
|
u32 index;
|
2018-11-28 11:34:38 +01:00
|
|
|
bool is_add;
|
2018-11-22 12:53:00 +01:00
|
|
|
vl_api_ip6_address_t ip6_dst;
|
2016-12-06 12:50:08 +01:00
|
|
|
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;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
define map_domain_details
|
|
|
|
|
{
|
|
|
|
|
u32 context;
|
|
|
|
|
u32 domain_index;
|
2018-11-22 12:53:00 +01:00
|
|
|
vl_api_ip6_prefix_t ip6_prefix;
|
|
|
|
|
vl_api_ip4_prefix_t ip4_prefix;
|
|
|
|
|
vl_api_ip6_prefix_t ip6_src;
|
2016-12-06 12:50:08 +01:00
|
|
|
u8 ea_bits_len;
|
|
|
|
|
u8 psid_offset;
|
|
|
|
|
u8 psid_length;
|
|
|
|
|
u8 flags;
|
|
|
|
|
u16 mtu;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
define map_rule_dump
|
|
|
|
|
{
|
|
|
|
|
u32 client_index;
|
|
|
|
|
u32 context;
|
|
|
|
|
u32 domain_index;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
define map_rule_details
|
|
|
|
|
{
|
|
|
|
|
u32 context;
|
2018-11-22 12:53:00 +01:00
|
|
|
vl_api_ip6_address_t ip6_dst;
|
2016-12-06 12:50:08 +01:00
|
|
|
u16 psid;
|
|
|
|
|
};
|
|
|
|
|
|
2018-12-17 13:43:52 -06:00
|
|
|
/** \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 */
|
|
|
|
|
};
|
|
|
|
|
|
2016-12-06 12:50:08 +01:00
|
|
|
/** \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];
|
|
|
|
|
};
|
2018-12-06 11:49:17 -06:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/** \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 class instead
|
|
|
|
|
@param class - class field value when copy == 0
|
|
|
|
|
*/
|
|
|
|
|
autoreply define map_param_set_traffic_class
|
|
|
|
|
{
|
|
|
|
|
u32 client_index;
|
|
|
|
|
u32 context;
|
|
|
|
|
bool copy;
|
|
|
|
|
u8 class;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2018-12-17 13:43:52 -06:00
|
|
|
/** \brief Set MAP TCP parammeters
|
|
|
|
|
@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;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2018-12-06 11:49:17 -06:00
|
|
|
/** \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 ip4_lifetime_ms - reassembly valid lifetime, or ~0
|
|
|
|
|
@param ip4_pool_size - max number of reassemblies, or ~0
|
|
|
|
|
@param ip4_buffers - max number of reassembly buffers, or ~0
|
|
|
|
|
@param ip4_ht_ratio - reassembly valid lifetime, or ~0
|
|
|
|
|
@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;
|
|
|
|
|
};
|