session: add ip4-fib-id and ip6-fib-id to app ns CLI 15/41815/4
authorSteven Luong <[email protected]>
Fri, 8 Nov 2024 16:35:14 +0000 (08:35 -0800)
committerFlorin Coras <[email protected]>
Sun, 8 Dec 2024 23:39:24 +0000 (23:39 +0000)
commit2e67a3f37798bb7ae68e53554a163a4945a46e4b
tree8a7f5642528e5ee777ea0c994fe4f846155de4e6
parentfd896fc9faeae2a97adf4b53ca15c7e36365021c
session: add ip4-fib-id and ip6-fib-id to app ns CLI

Problem
The API app_namespace_add_del allows specifying ip4_fib_id and
ip6_fib_id. But the CLI does not. It only allows interface.
Interface binding may change after the application namespace
is created and there is no registration for the callback
when the interface binding changes.

Fix
Add ip4-fib-id and ip6-fib-id to app ns CLI. When both
interface and fib-id's are specified, interface takes
precedence. When interface is not specified, either ip4-fib-id
or ip6-fib-id or both ip4 and ip6 fib-id's may be specified.
If only ip4-fib-id is specified, ip6 is disable for this
particular app namespace. If only ip6-fib-id is specified,
ip4 is disable for this namespace.

When the interface binding changes to different vrf and the
application namespace was created via interface option, we
delete the application namespace and recreate the application
namespace with the new interface binding. Notice when the
application namespace is removed, all session rules and
sdl rules previously created for the deleted application
namespace will be deleted. However, if the fib table/session
table  was shared by another namespace, the other namespace
will still contain the session rules and sdl rules.

Type: improvement

Change-Id: I76eb30da1ed8a39d06694c1e66d0675bf03516bf
Signed-off-by: Steven Luong <[email protected]>
src/vnet/interface.h
src/vnet/session/application_namespace.c
src/vnet/session/session_lookup.c
test/asf/test_session.py