22 #include <map/map.api_enum.h> 23 #include <map/map.api_types.h> 31 #define REPLY_MSG_ID_BASE mm->msg_id_base 56 rmp->
index = ntohl(index);
65 vl_api_map_del_domain_reply_t *rmp;
77 vl_api_map_del_domain_reply_t *rmp;
107 map_domain_index = d - mm->domains;
108 de = vec_elt_at_index(mm->domain_extras, map_domain_index);
109 int tag_len = clib_min(ARRAY_LEN(rmp->tag), vec_len(de->tag) + 1);
112 rmp = vl_msg_api_alloc (sizeof (*rmp) + tag_len);
114 rmp->_vl_msg_id = htons(VL_API_MAP_DOMAIN_DETAILS + mm->msg_id_base);
115 rmp->context = mp->context;
116 rmp->domain_index = htonl(map_domain_index);
117 clib_memcpy(&rmp->ip6_prefix.address, &d->ip6_prefix, sizeof(rmp->ip6_prefix.address));
118 clib_memcpy(&rmp->ip4_prefix.address, &d->ip4_prefix, sizeof(rmp->ip4_prefix.address));
119 clib_memcpy(&rmp->ip6_src.address, &d->ip6_src, sizeof(rmp->ip6_src.address));
120 rmp->ip6_prefix.len = d->ip6_prefix_len;
121 rmp->ip4_prefix.len = d->ip4_prefix_len;
122 rmp->ip6_src.len = d->ip6_src_len;
123 rmp->ea_bits_len = d->ea_bits_len;
124 rmp->psid_offset = d->psid_offset;
125 rmp->psid_length = d->psid_length;
126 rmp->flags = d->flags;
127 rmp->mtu = htons(d->mtu);
128 memcpy(rmp->tag, de->tag, tag_len-1);
129 rmp->tag[tag_len-1] =
'\0';
131 vl_api_send_msg (reg, (u8 *) rmp);
169 rmp->_vl_msg_id = ntohs (VL_API_MAP_RULE_DETAILS + mm->
msg_id_base);
170 rmp->
psid = htons (i);
194 rmp->_vl_msg_id = htons (VL_API_MAP_SUMMARY_STATS_REPLY + mm->
msg_id_base);
205 clib_memset (total_bytes, 0,
sizeof (total_bytes));
215 total_pkts[which] += v.
packets;
216 total_bytes[which] += v.
bytes;
226 clib_host_to_net_u64 (total_bytes[MAP_DOMAIN_COUNTER_RX]);
230 clib_host_to_net_u64 (total_bytes[MAP_DOMAIN_COUNTER_TX]);
261 vl_api_map_param_set_fragmentation_reply_t *rmp;
266 REPLY_MACRO (VL_API_MAP_PARAM_SET_FRAGMENTATION_REPLY);
275 if (icmp_src_address == 0)
288 vl_api_map_param_set_icmp_reply_t *rmp;
311 vl_api_map_param_set_icmp6_reply_t *rmp;
325 vl_api_map_param_add_del_pre_resolve_reply_t *rmp;
331 REPLY_MACRO (VL_API_MAP_PARAM_ADD_DEL_PRE_RESOLVE_REPLY);
350 vl_api_map_param_set_security_check_reply_t *rmp;
355 REPLY_MACRO (VL_API_MAP_PARAM_SET_SECURITY_CHECK_REPLY);
375 vl_api_map_param_set_traffic_class_reply_t *rmp;
380 REPLY_MACRO (VL_API_MAP_PARAM_SET_TRAFFIC_CLASS_REPLY);
399 vl_api_map_param_set_tcp_reply_t *rmp;
419 rmp->_vl_msg_id = htons (VL_API_MAP_PARAM_GET_REPLY + mm->
msg_id_base);
455 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
457 is_enable = ! !is_enable;
472 if (is_translation ==
false)
477 is_enable ? 1 : 0, 0, 0);
479 is_enable ? 1 : 0, 0, 0);
489 is_enable ? 1 : 0, 0, 0);
491 is_enable ? 1 : 0, 0, 0);
505 vl_api_map_if_enable_disable_reply_t *rmp;
520 #include <map/map.api.c> static void vl_api_map_param_set_tcp_t_handler(vl_api_map_param_set_tcp_t *mp)
int map_add_del_psid(u32 map_domain_index, u16 psid, ip6_address_t *tep, bool is_add)
static void vl_api_map_if_enable_disable_t_handler(vl_api_map_if_enable_disable_t *mp)
static void vl_api_map_param_set_icmp_t_handler(vl_api_map_param_set_icmp_t *mp)
Set MAP traffic class parameters.
Add or Delete MAP rule from a domain (Only used for shared IPv4 per subscriber)
int map_delete_domain(u32 map_domain_index)
int ip4_sv_reass_enable_disable_with_refcnt(u32 sw_if_index, int is_enable)
static void vl_api_map_domain_dump_t_handler(vl_api_map_domain_dump_t *mp)
vnet_interface_main_t interface_main
vl_api_ip6_prefix_t ip6_src
#define REPLY_MACRO2(t, body)
clib_memset(h->entries, 0, sizeof(h->entries[0]) *entries)
Add/delete MAP pre-resolve IP addresses parameters.
u64 map_error_counter_get(u32 node_index, map_error_t map_error)
static void vl_api_send_msg(vl_api_registration_t *rp, u8 *elem)
static void vl_api_map_param_set_security_check_t_handler(vl_api_map_param_set_security_check_t *mp)
static void map_domain_counter_unlock(map_main_t *mm)
Combined counter to hold both packets and byte differences.
u64 total_security_check[2]
static uword * clib_bitmap_set(uword *ai, uword i, uword value)
Sets the ith bit of a bitmap to new_value Removes trailing zeros from the bitmap. ...
static void vl_api_map_param_set_traffic_class_t_handler(vl_api_map_param_set_traffic_class_t *mp)
vlib_node_registration_t ip4_map_node
(constructor) VLIB_REGISTER_NODE (ip4_map_node)
int map_param_set_traffic_class(bool copy, u8 tc)
int map_create_domain(ip4_address_t *ip4_prefix, u8 ip4_prefix_len, ip6_address_t *ip6_prefix, u8 ip6_prefix_len, ip6_address_t *ip6_src, u8 ip6_src_len, u8 ea_bits_len, u8 psid_offset, u8 psid_length, u32 *map_domain_index, u16 mtu, u8 flags, u8 *tag)
uword * bm_trans_enabled_by_sw_if
void map_pre_resolve(ip4_address_t *ip4, ip6_address_t *ip6, bool is_del)
void * vl_msg_api_alloc(int nbytes)
static void vl_api_map_param_set_icmp6_t_handler(vl_api_map_param_set_icmp6_t *mp)
static void vl_api_map_add_del_rule_t_handler(vl_api_map_add_del_rule_t *mp)
static void vl_api_map_summary_stats_t_handler(vl_api_map_summary_stats_t *mp)
vl_api_ip6_address_t ip6_dst
#define clib_memcpy(d, s, n)
int map_param_set_security_check(bool enable, bool fragments)
static void vl_api_map_add_domain_t_handler(vl_api_map_add_domain_t *mp)
vl_api_ip4_prefix_t ip4_prefix
#define pool_foreach(VAR, POOL, BODY)
Iterate through pool.
vl_api_interface_index_t sw_if_index
vlib_combined_counter_main_t * domain_counters
ip4_address_t icmp4_src_address
Reply for map_param_get request.
static void vl_api_map_del_domain_t_handler(vl_api_map_del_domain_t *mp)
Set MAP fragmentation parameters.
static void vl_api_map_param_add_del_pre_resolve_t_handler(vl_api_map_param_add_del_pre_resolve_t *mp)
int map_param_set_icmp6(u8 enable_unreachable)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
counter_t packets
packet counter
int map_if_enable_disable(bool is_enable, u32 sw_if_index, bool is_translation)
IPv6 shallow virtual reassembly.
clib_error_t * map_plugin_api_hookup(vlib_main_t *vm)
bool icmp6_enable_unreachable
IPv4 shallow virtual reassembly.
static void vl_api_map_rule_dump_t_handler(vl_api_map_rule_dump_t *mp)
u32 vlib_combined_counter_n_counters(const vlib_combined_counter_main_t *cm)
The number of counters (not the number of per-thread counters)
vl_api_ip4_address_t ip4_nh_address
static void vl_api_map_param_get_t_handler(vl_api_map_param_get_t *mp)
vl_api_ip4_address_t ip4_nh_address
Request for a single block of MAP parameters.
int map_param_set_tcp(u16 tcp_mss)
Details about a single MAP domain.
An API client registration, only in vpp/vlib.
#define BAD_SW_IF_INDEX_LABEL
static void vl_api_map_param_set_fragmentation_t_handler(vl_api_map_param_set_fragmentation_t *mp)
Enable or disable a MAP interface.
static void vlib_get_combined_counter(const vlib_combined_counter_main_t *cm, u32 index, vlib_counter_t *result)
Get the value of a combined counter, never called in the speed path Scrapes the entire set of per-thr...
vl_api_interface_index_t sw_if_index
vl_api_ip6_address_t ip6_nh_address
uword * bm_encap_enabled_by_sw_if
#define vec_free(V)
Free vector's memory (no header).
Set MAP ICMP6 parameters.
Reply for map_summary_stats request.
#define pool_is_free_index(P, I)
Use free bitmap to query whether given index is free.
static uword clib_bitmap_get(uword *ai, uword i)
Gets the ith bit value from a bitmap.
static vl_api_registration_t * vl_api_client_index_to_registration(u32 index)
vl_api_ip6_address_t ip6_dst
static void map_domain_counter_lock(map_main_t *mm)
int map_param_set_icmp(ip4_address_t *icmp_src_address)
vl_api_ip6_address_t ip6_nh_address
Request for a single block of summary stats.
Reply for MAP domain add.
int ip6_sv_reass_enable_disable_with_refcnt(u32 sw_if_index, int is_enable)
counter_t bytes
byte counter
Set MAP security-check parameters.
vl_api_ip4_address_t ip4_err_relay_src
vnet_sw_interface_t * sw_interfaces
A collection of combined counters.
vl_api_ip4_address_t icmp_ip4_err_relay_src
vl_api_ip6_prefix_t ip6_prefix
#define vec_foreach(var, vec)
Vector iterator.
static void setup_message_id_table(snat_main_t *sm, api_main_t *am)
int ip6_full_reass_enable_disable_with_refcnt(u32 sw_if_index, int is_enable)
int vnet_feature_enable_disable(const char *arc_name, const char *node_name, u32 sw_if_index, int enable_disable, void *feature_config, u32 n_feature_config_bytes)
#define VALIDATE_SW_IF_INDEX(mp)
int map_param_set_fragmentation(bool inner, bool ignore_df)
static uword pool_elts(void *v)
Number of active elements in a pool.