diff options
author | Filip Varga <fivarga@cisco.com> | 2020-09-30 22:24:47 +0200 |
---|---|---|
committer | Ole Tr�an <otroan@employees.org> | 2020-10-23 12:09:07 +0000 |
commit | 5f4f2081c47a5d86c9c96b7de23a2b0147c737d8 (patch) | |
tree | fd80c764cc3deb527f54d289c12a03d85c563373 /src/plugins/nat/nat.api | |
parent | 498889ae5d36eca5e2c017400b70f71bc5cdaf4a (diff) |
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 <fivarga@cisco.com>
Diffstat (limited to 'src/plugins/nat/nat.api')
-rw-r--r-- | src/plugins/nat/nat.api | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/plugins/nat/nat.api b/src/plugins/nat/nat.api index 09c4d4a10b7..753cfdfc9be 100644 --- a/src/plugins/nat/nat.api +++ b/src/plugins/nat/nat.api @@ -30,6 +30,49 @@ import "plugins/nat/nat_types.api"; * Common NAT plugin APIs */ +enum nat44_config_flags : u8 +{ + NAT44_IS_ENDPOINT_INDEPENDENT = 0x00, + NAT44_IS_ENDPOINT_DEPENDENT = 0x01, + NAT44_IS_STATIC_MAPPING_ONLY = 0x02, + NAT44_IS_CONNECTION_TRACKING = 0x04, + NAT44_IS_OUT2IN_DPO = 0x08, +}; + +/** \brief Enable/disable NAT44 plugin + @param client_index - opaque cookie to identify the sender + @param context - sender context, to match reply w/ request + @param inside_vrf - inside vrf id + @param outside_vrf - outside vrf id + @param users - maximum number of users per thread + (NAT44_IS_ENDPOINT_INDEPENDENT) + @param user_memory - overwrite hash allocation parameter + (NAT44_IS_ENDPOINT_INDEPENDENT) + @param sessions - maximum number of sessions per thread + @param session_memory - overwrite hash allocation parameter + @param user_sessions - maximum number of sessions per user + (NAT44_IS_ENDPOINT_INDEPENDENT) + @param enable - true if enable, false if disable + @param flags - flag NAT44_IS_ENDPOINT_INDEPENDENT, + NAT44_IS_ENDPOINT_DEPENDENT, + NAT44_IS_STATIC_MAPPING_ONLY, + NAT44_IS_CONNECTION_TRACKING, + NAT44_IS_OUT2IN_DPO +*/ +autoreply define nat44_plugin_enable_disable { + u32 client_index; + u32 context; + u32 inside_vrf; + u32 outside_vrf; + u32 users; + u32 user_memory; + u32 sessions; + u32 session_memory; + u32 user_sessions; + bool enable; + vl_api_nat44_config_flags_t flags; +}; + /** \brief Control ping from client to api server request @param client_index - opaque cookie to identify the sender @param context - sender context, to match reply w/ request |