summaryrefslogtreecommitdiffstats
path: root/src/vnet/session/application_namespace.c
diff options
context:
space:
mode:
authorFilip Tehlar <ftehlar@cisco.com>2023-06-28 10:47:32 +0200
committerFlorin Coras <florin.coras@gmail.com>2023-07-26 01:09:17 +0000
commit0028e6f31624246e831b5b1a13dc46ab1d864fa7 (patch)
tree5e20818e09e5eb269a785770b1166d7ead129eec /src/vnet/session/application_namespace.c
parentcc8249c5fde1b00b043066617d35325dd1606cd6 (diff)
session: use session error type instead of vnet error
Type: improvement Change-Id: Ie0bad9e03ac2e29da23af01ee7f63cb44489ad9c Signed-off-by: Filip Tehlar <ftehlar@cisco.com>
Diffstat (limited to 'src/vnet/session/application_namespace.c')
-rw-r--r--src/vnet/session/application_namespace.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/vnet/session/application_namespace.c b/src/vnet/session/application_namespace.c
index 13b540cd3b8..03e41fdb22d 100644
--- a/src/vnet/session/application_namespace.c
+++ b/src/vnet/session/application_namespace.c
@@ -81,21 +81,20 @@ app_namespace_alloc (const u8 *ns_id)
return app_ns;
}
-int
-vnet_app_namespace_add_del (vnet_app_namespace_add_del_args_t * a)
+session_error_t
+vnet_app_namespace_add_del (vnet_app_namespace_add_del_args_t *a)
{
app_namespace_t *app_ns;
session_table_t *st;
u32 ns_index;
- int rv;
+ session_error_t rv;
if (a->is_add)
{
if (a->sw_if_index != APP_NAMESPACE_INVALID_INDEX
&& !vnet_get_sw_interface_or_null (vnet_get_main (),
a->sw_if_index))
- return VNET_API_ERROR_INVALID_SW_IF_INDEX;
-
+ return SESSION_E_INVALID;
if (a->sw_if_index != APP_NAMESPACE_INVALID_INDEX)
{
@@ -108,7 +107,7 @@ vnet_app_namespace_add_del (vnet_app_namespace_add_del_args_t * a)
}
if (a->sw_if_index == APP_NAMESPACE_INVALID_INDEX
&& a->ip4_fib_id == APP_NAMESPACE_INVALID_INDEX)
- return VNET_API_ERROR_INVALID_VALUE;
+ return SESSION_E_INVALID;
app_ns = app_namespace_get_from_id (a->ns_id);
if (!app_ns)
@@ -148,11 +147,11 @@ vnet_app_namespace_add_del (vnet_app_namespace_add_del_args_t * a)
{
ns_index = app_namespace_index_from_id (a->ns_id);
if (ns_index == APP_NAMESPACE_INVALID_INDEX)
- return VNET_API_ERROR_INVALID_VALUE;
+ return SESSION_E_INVALID;
app_ns = app_namespace_get (ns_index);
if (!app_ns)
- return VNET_API_ERROR_INVALID_VALUE;
+ return SESSION_E_INVALID;
application_namespace_cleanup (app_ns);