diff options
author | 2019-06-24 11:52:49 +0000 | |
---|---|---|
committer | 2019-10-03 08:43:03 +0000 | |
commit | d46055e868b7e687f50866f8aa1cefc177836bc7 (patch) | |
tree | fe5d9a05db86996d210495c66caca2da94fbf37e /src/vnet/ip/ip_api.c | |
parent | 3f6e370ebd13d101ec6f54eef15e7373818801da (diff) |
ip: refactor reassembly
this is a preparation step for introducing other reassembly types
Type: refactor
Change-Id: I197e299dbd729b00eead31667913b8ceff915d63
Signed-off-by: Klement Sekera <ksekera@cisco.com>
(cherry picked from commit 896c896a3c4ed563a270281ff8b50fd253f4833f)
Diffstat (limited to 'src/vnet/ip/ip_api.c')
-rw-r--r-- | src/vnet/ip/ip_api.c | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/vnet/ip/ip_api.c b/src/vnet/ip/ip_api.c index 4055dead4ba..c6d1a3cee29 100644 --- a/src/vnet/ip/ip_api.c +++ b/src/vnet/ip/ip_api.c @@ -43,8 +43,8 @@ #include <vnet/fib/ip6_fib.h> #include <vnet/fib/fib_path_list.h> #include <vnet/ip/ip6_hop_by_hop.h> -#include <vnet/ip/ip4_reassembly.h> -#include <vnet/ip/ip6_reassembly.h> +#include <vnet/ip/reass/ip4_full_reass.h> +#include <vnet/ip/reass/ip6_full_reass.h> #include <vnet/ethernet/arp.h> #include <vnet/ip/ip_types_api.h> @@ -2737,17 +2737,21 @@ vl_api_ip_reassembly_set_t_handler (vl_api_ip_reassembly_set_t * mp) int rv = 0; if (mp->is_ip6) { - rv = ip6_reass_set (clib_net_to_host_u32 (mp->timeout_ms), - clib_net_to_host_u32 (mp->max_reassemblies), - clib_net_to_host_u32 (mp->max_reassembly_length), - clib_net_to_host_u32 (mp->expire_walk_interval_ms)); + rv = ip6_full_reass_set (clib_net_to_host_u32 (mp->timeout_ms), + clib_net_to_host_u32 (mp->max_reassemblies), + clib_net_to_host_u32 + (mp->max_reassembly_length), + clib_net_to_host_u32 + (mp->expire_walk_interval_ms)); } else { - rv = ip4_reass_set (clib_net_to_host_u32 (mp->timeout_ms), - clib_net_to_host_u32 (mp->max_reassemblies), - clib_net_to_host_u32 (mp->max_reassembly_length), - clib_net_to_host_u32 (mp->expire_walk_interval_ms)); + rv = ip4_full_reass_set (clib_net_to_host_u32 (mp->timeout_ms), + clib_net_to_host_u32 (mp->max_reassemblies), + clib_net_to_host_u32 + (mp->max_reassembly_length), + clib_net_to_host_u32 + (mp->expire_walk_interval_ms)); } REPLY_MACRO (VL_API_IP_REASSEMBLY_SET_REPLY); @@ -2770,15 +2774,16 @@ vl_api_ip_reassembly_get_t_handler (vl_api_ip_reassembly_get_t * mp) if (mp->is_ip6) { rmp->is_ip6 = 1; - ip6_reass_get (&rmp->timeout_ms, &rmp->max_reassemblies, - &rmp->expire_walk_interval_ms); + ip6_full_reass_get (&rmp->timeout_ms, &rmp->max_reassemblies, + &rmp->max_reassembly_length, + &rmp->expire_walk_interval_ms); } else { rmp->is_ip6 = 0; - ip4_reass_get (&rmp->timeout_ms, &rmp->max_reassemblies, - &rmp->max_reassembly_length, - &rmp->expire_walk_interval_ms); + ip4_full_reass_get (&rmp->timeout_ms, &rmp->max_reassemblies, + &rmp->max_reassembly_length, + &rmp->expire_walk_interval_ms); } rmp->timeout_ms = clib_host_to_net_u32 (rmp->timeout_ms); rmp->max_reassemblies = clib_host_to_net_u32 (rmp->max_reassemblies); @@ -2793,12 +2798,13 @@ void { vl_api_ip_reassembly_enable_disable_reply_t *rmp; int rv = 0; - rv = ip4_reass_enable_disable (clib_net_to_host_u32 (mp->sw_if_index), - mp->enable_ip4); + rv = ip4_full_reass_enable_disable (clib_net_to_host_u32 (mp->sw_if_index), + mp->enable_ip4); if (0 == rv) { - rv = ip6_reass_enable_disable (clib_net_to_host_u32 (mp->sw_if_index), - mp->enable_ip6); + rv = + ip6_full_reass_enable_disable (clib_net_to_host_u32 (mp->sw_if_index), + mp->enable_ip6); } REPLY_MACRO (VL_API_IP_REASSEMBLY_ENABLE_DISABLE_REPLY); |