vl_api_nat_set_workers_reply_t *rmp;
int rv = 0;
uword *bitmap = 0;
- u64 mask = clib_net_to_host_u64 (mp->worker_mask);
+ u64 mask;
+
+ if (sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
+ mask = clib_net_to_host_u64 (mp->worker_mask);
if (sm->num_workers < 2)
{
snat_main_t *sm = &snat_main;
u32 *worker_index;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
int rv = 0;
u32 *tmp;
+ if (sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
if (sm->static_mapping_only)
{
rv = VNET_API_ERROR_FEATURE_DISABLED;
snat_main_t *sm = &snat_main;
snat_address_t *a;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
u32 sw_if_index = ntohl (mp->sw_if_index);
int rv = 0;
+ if (sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
VALIDATE_SW_IF_INDEX (mp);
rv = snat_interface_add_del_output_feature (sw_if_index, mp->is_inside,
is_del);
BAD_SW_IF_INDEX_LABEL;
-
+send_reply:
REPLY_MACRO (VL_API_NAT44_INTERFACE_ADD_DEL_OUTPUT_FEATURE_REPLY);
}
snat_main_t *sm = &snat_main;
snat_interface_t *i;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
snat_protocol_t proto;
u8 *tag = 0;
+ if (sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
memcpy (&local_addr.as_u8, mp->local_ip_address, 4);
memcpy (&external_addr.as_u8, mp->external_ip_address, 4);
if (mp->addr_only == 0)
vec_free (tag);
+send_reply:
REPLY_MACRO (VL_API_NAT44_ADD_DEL_STATIC_MAPPING_REPLY);
}
snat_static_map_resolve_t *rp;
int j;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
snat_protocol_t proto = ~0;
u8 *tag = 0;
+ if (sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
if (mp->addr_only == 0)
{
port = clib_net_to_host_u16 (mp->port);
vec_free (tag);
+send_reply:
REPLY_MACRO (VL_API_NAT44_ADD_DEL_IDENTITY_MAPPING_REPLY);
}
snat_static_map_resolve_t *rp;
int j;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
u32 sw_if_index = ntohl (mp->sw_if_index);
int rv = 0;
+ if (sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
VALIDATE_SW_IF_INDEX (mp);
rv = snat_add_interface_address (sm, sw_if_index, is_del, mp->twice_nat);
BAD_SW_IF_INDEX_LABEL;
-
+send_reply:
REPLY_MACRO (VL_API_NAT44_ADD_DEL_INTERFACE_ADDR_REPLY);
}
snat_main_t *sm = &snat_main;
u32 *i;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
snat_main_per_thread_data_t *tsm;
snat_user_t *u;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
dlist_elt_t *head, *elt;
ip4_header_t ip;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
snat_protocol_t proto;
u8 *tag = 0;
+ if (sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
locals = unformat_nat44_lb_addr_port (mp->locals, mp->local_num);
clib_memcpy (&e_addr, mp->external_addr, 4);
proto = ip_proto_to_snat_proto (mp->protocol);
vec_free (locals);
vec_free (tag);
+send_reply:
REPLY_MACRO (VL_API_NAT44_ADD_DEL_LB_STATIC_MAPPING_REPLY);
}
snat_main_t *sm = &snat_main;
snat_static_mapping_t *m;
+ if (sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
int rv = 0;
snat_protocol_t proto;
+ if (sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
memcpy (&addr.as_u8, mp->address, 4);
port = clib_net_to_host_u16 (mp->port);
vrf_id = clib_net_to_host_u32 (mp->vrf_id);
rv = nat44_del_session (sm, &addr, port, proto, vrf_id, mp->is_in);
+send_reply:
REPLY_MACRO (VL_API_NAT44_DEL_SESSION_REPLY);
}
int rv = 0;
ip4_address_t in_addr, out_addr;
+ if (!sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
if (!mp->is_nat44)
{
rv = VNET_API_ERROR_UNIMPLEMENTED;
snat_det_map_t *dm;
ip4_address_t in_addr, out_addr;
+ if (!sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ REPLY_MACRO (VL_API_NAT_DET_FORWARD_REPLY);
+ return;
+ }
+
if (!mp->is_nat44)
{
out_addr.as_u32 = 0;
ip4_address_t out_addr, in_addr;
snat_det_map_t *dm;
+ if (!sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ REPLY_MACRO (VL_API_NAT_DET_REVERSE_REPLY);
+ return;
+ }
+
in_addr.as_u32 = 0;
clib_memcpy (&out_addr, mp->out_addr, 4);
dm = snat_det_map_by_out (sm, &out_addr);
snat_main_t *sm = &snat_main;
snat_det_map_t *m;
+ if (!sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;
vl_api_nat_det_set_timeouts_reply_t *rmp;
int rv = 0;
+ if (!sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
sm->udp_timeout = ntohl (mp->udp);
sm->tcp_established_timeout = ntohl (mp->tcp_established);
sm->tcp_transitory_timeout = ntohl (mp->tcp_transitory);
sm->icmp_timeout = ntohl (mp->icmp);
+send_reply:
REPLY_MACRO (VL_API_NAT_DET_SET_TIMEOUTS_REPLY);
}
vl_api_nat_det_get_timeouts_reply_t *rmp;
int rv = 0;
+ if (!sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ REPLY_MACRO (VL_API_NAT_DET_GET_TIMEOUTS_REPLY);
+ return;
+ }
+
/* *INDENT-OFF* */
REPLY_MACRO2 (VL_API_NAT_DET_GET_TIMEOUTS_REPLY,
({
snat_det_session_t *ses;
int rv = 0;
+ if (!sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
clib_memcpy (&out_addr, mp->out_addr, 4);
clib_memcpy (&ext_addr, mp->ext_addr, 4);
snat_det_session_t *ses;
int rv = 0;
+ if (!sm->deterministic)
+ {
+ rv = VNET_API_ERROR_UNSUPPORTED;
+ goto send_reply;
+ }
+
if (!mp->is_nat44)
{
rv = VNET_API_ERROR_UNIMPLEMENTED;
snat_det_session_t *s, empty_ses;
u16 i;
+ if (!sm->deterministic)
+ return;
+
reg = vl_api_client_index_to_registration (mp->client_index);
if (!reg)
return;