22 #include <map/map.api_enum.h> 23 #include <map/map.api_types.h> 31 #define REPLY_MSG_ID_BASE mm->msg_id_base 49 (ip6_address_t *) & mp->
ip6_src.address,
66 vl_api_map_del_domain_reply_t *rmp;
78 vl_api_map_del_domain_reply_t *rmp;
110 sizeof (rmp->
ip6_src.address));
118 rmp->
mtu = htons (d->
mtu);
119 memcpy (rmp->
tag, de->
tag, tag_len - 1);
120 rmp->
tag[tag_len - 1] =
'\0';
142 send_domain_details(i, reg, mp->context);
161 send_domain_details (cursor, rp, mp->context);
193 if (dst.as_u64[0] == 0 && dst.as_u64[1] == 0)
200 rmp->
psid = htons (i);
224 rmp->_vl_msg_id = htons (VL_API_MAP_SUMMARY_STATS_REPLY + mm->
msg_id_base);
235 clib_memset (total_bytes, 0,
sizeof (total_bytes));
245 total_pkts[which] += v.
packets;
246 total_bytes[which] += v.
bytes;
256 clib_host_to_net_u64 (total_bytes[MAP_DOMAIN_COUNTER_RX]);
260 clib_host_to_net_u64 (total_bytes[MAP_DOMAIN_COUNTER_TX]);
291 vl_api_map_param_set_fragmentation_reply_t *rmp;
296 REPLY_MACRO (VL_API_MAP_PARAM_SET_FRAGMENTATION_REPLY);
305 if (icmp_src_address == 0)
318 vl_api_map_param_set_icmp_reply_t *rmp;
341 vl_api_map_param_set_icmp6_reply_t *rmp;
355 vl_api_map_param_add_del_pre_resolve_reply_t *rmp;
361 REPLY_MACRO (VL_API_MAP_PARAM_ADD_DEL_PRE_RESOLVE_REPLY);
380 vl_api_map_param_set_security_check_reply_t *rmp;
385 REPLY_MACRO (VL_API_MAP_PARAM_SET_SECURITY_CHECK_REPLY);
405 vl_api_map_param_set_traffic_class_reply_t *rmp;
410 REPLY_MACRO (VL_API_MAP_PARAM_SET_TRAFFIC_CLASS_REPLY);
429 vl_api_map_param_set_tcp_reply_t *rmp;
449 rmp->_vl_msg_id = htons (VL_API_MAP_PARAM_GET_REPLY + mm->
msg_id_base);
485 return VNET_API_ERROR_INVALID_SW_IF_INDEX;
487 is_enable = ! !is_enable;
502 if (is_translation ==
false)
507 is_enable ? 1 : 0, 0, 0);
509 is_enable ? 1 : 0, 0, 0);
519 is_enable ? 1 : 0, 0, 0);
521 is_enable ? 1 : 0, 0, 0);
535 vl_api_map_if_enable_disable_reply_t *rmp;
550 #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)
vl_api_wireguard_peer_flags_t flags
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_END(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.
vl_api_ip6_prefix_t ip6_src
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
static void vl_api_map_domains_get_t_handler(vl_api_map_domains_get_t *mp)
vlib_combined_counter_main_t * domain_counters
ip4_address_t icmp4_src_address
#define vec_elt_at_index(v, i)
Get vector value at index i checking that i is in bounds.
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 REPLY_MACRO_DETAILS4(t, rp, context, body)
#define pool_elt_at_index(p, i)
Returns pointer to element at given index.
static void send_domain_details(u32 map_domain_index, vl_api_registration_t *rp, u32 context)
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
API main structure, used by both vpp and binary API clients.
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.
vl_api_ip6_prefix_t ip6_prefix
#define REPLY_AND_DETAILS_MACRO(t, p, body)
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
sll srl srl sll sra u16x4 i
Set MAP ICMP6 parameters.
Reply for map_summary_stats request.
u8 * is_autoendian
Message requires us to do endian conversion.
#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
#define vec_len(v)
Number of elements in vector (rvalue-only, NULL tolerant)
map_domain_extra_t * domain_extras
vl_api_ip4_prefix_t ip4_prefix
vnet_sw_interface_t * sw_interfaces
A collection of combined counters.
static api_main_t * vlibapi_get_main(void)
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)
#define pool_foreach_index(i, v, body)
Iterate pool by index.
vl_api_interface_index_t sw_if_index
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.