X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=src%2Fplugins%2Fnat%2Fnat44_api.c;h=37c3dbadfc0be28f5fe9d9d563aa437ea678dd15;hb=411-gf6eb348a6;hp=2028b3510df297e507627ad3fd585639dd1add46;hpb=b227aa699faabd79d6f3e8c43c0a912086b0c95e;p=vpp.git diff --git a/src/plugins/nat/nat44_api.c b/src/plugins/nat/nat44_api.c index 2028b3510df..37c3dbadfc0 100644 --- a/src/plugins/nat/nat44_api.c +++ b/src/plugins/nat/nat44_api.c @@ -18,9 +18,6 @@ * @brief NAT44 plugin API implementation */ -#define vl_api_nat44_lb_static_mapping_details_t_endian vl_noop_handler -#define vl_api_nat44_add_del_lb_static_mapping_t_endian vl_noop_handler - #include #include @@ -129,6 +126,15 @@ vl_api_nat44_show_running_config_t_handler (vl_api_nat44_show_running_config_t rmp->user_buckets = htonl (sm->user_buckets); rmp->translation_buckets = htonl (sm->translation_buckets); + rmp->timeouts.udp = htonl (sm->timeouts.udp); + rmp->timeouts.tcp_established = htonl (sm->timeouts.tcp.established); + rmp->timeouts.tcp_transitory = htonl (sm->timeouts.tcp.transitory); + rmp->timeouts.icmp = htonl (sm->timeouts.icmp); + + rmp->forwarding_enabled = sm->forwarding_enabled == 1; + // consider how to split functionality between subplugins + rmp->ipfix_logging_enabled = nat_ipfix_logging_enabled (); + if (rc->endpoint_dependent) rmp->flags |= NAT44_IS_ENDPOINT_DEPENDENT; else @@ -300,10 +306,10 @@ vl_api_nat_set_timeouts_t_handler (vl_api_nat_set_timeouts_t * mp) vl_api_nat_set_timeouts_reply_t *rmp; int rv = 0; - 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); + sm->timeouts.udp = ntohl (mp->udp); + sm->timeouts.tcp.established = ntohl (mp->tcp_established); + sm->timeouts.tcp.transitory = ntohl (mp->tcp_transitory); + sm->timeouts.icmp = ntohl (mp->icmp); REPLY_MACRO (VL_API_NAT_SET_TIMEOUTS_REPLY); } @@ -318,10 +324,10 @@ vl_api_nat_get_timeouts_t_handler (vl_api_nat_get_timeouts_t * mp) /* *INDENT-OFF* */ REPLY_MACRO2 (VL_API_NAT_GET_TIMEOUTS_REPLY, ({ - rmp->udp = htonl (sm->udp_timeout); - rmp->tcp_established = htonl (sm->tcp_established_timeout); - rmp->tcp_transitory = htonl (sm->tcp_transitory_timeout); - rmp->icmp = htonl (sm->icmp_timeout); + rmp->udp = htonl (sm->timeouts.udp); + rmp->tcp_established = htonl (sm->timeouts.tcp.established); + rmp->tcp_transitory = htonl (sm->timeouts.tcp.transitory); + rmp->icmp = htonl (sm->timeouts.icmp); })) /* *INDENT-ON* */ } @@ -335,6 +341,12 @@ static void int rv = 0; u16 port_start, port_end; + if (sm->endpoint_dependent) + { + rv = VNET_API_ERROR_UNSUPPORTED; + goto send_reply; + } + switch (mp->alg) { case NAT_ADDR_AND_PORT_ALLOC_ALG_DEFAULT: