From 5f4f2081c47a5d86c9c96b7de23a2b0147c737d8 Mon Sep 17 00:00:00 2001 From: Filip Varga Date: Wed, 30 Sep 2020 22:24:47 +0200 Subject: nat: nat44 enable/disable dynamic config This patch changes initialization and configuration of NAT plugin. Instead of allocating data structures at vpp plugin initialization phase allocation and configuration happens after calling enable API or CLI call. This reduces base VPP memory footprint and also enables dynamic reconfiguration of the NAT plugin. Type: improvement Change-Id: I42c069ee19a0311d043ac1f3f230d87bc8d2680f Signed-off-by: Filip Varga --- src/plugins/nat/nat_ha.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/plugins/nat/nat_ha.h') diff --git a/src/plugins/nat/nat_ha.h b/src/plugins/nat/nat_ha.h index ec627899a3f..92fc3373673 100644 --- a/src/plugins/nat/nat_ha.h +++ b/src/plugins/nat/nat_ha.h @@ -38,11 +38,16 @@ typedef void (*nat_ha_sref_cb_t) (ip4_address_t * out_addr, u16 out_port, u8 proto, u32 fib_index, u32 total_pkts, u64 total_bytes, u32 thread_index); +/** + * @brief Enable NAT HA, set callbacks + */ +void nat_ha_enable (nat_ha_sadd_cb_t sadd_cb, nat_ha_sdel_cb_t sdel_cb, + nat_ha_sref_cb_t sref_cb); + /** * @brief Initialize NAT HA */ -void nat_ha_init (vlib_main_t * vm, nat_ha_sadd_cb_t sadd_cb, - nat_ha_sdel_cb_t sdel_cb, nat_ha_sref_cb_t sref_cb); +void nat_ha_init (vlib_main_t * vm, u32 num_workers, u32 num_threads); /** * @brief Set HA listener (local settings) -- cgit 1.2.3-korg