diff options
author | Filip Tehlar <ftehlar@cisco.com> | 2023-06-28 10:47:32 +0200 |
---|---|---|
committer | Florin Coras <florin.coras@gmail.com> | 2023-07-26 01:09:17 +0000 |
commit | 0028e6f31624246e831b5b1a13dc46ab1d864fa7 (patch) | |
tree | 5e20818e09e5eb269a785770b1166d7ead129eec /src/vnet/session/application_interface.c | |
parent | cc8249c5fde1b00b043066617d35325dd1606cd6 (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_interface.c')
-rw-r--r-- | src/vnet/session/application_interface.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/vnet/session/application_interface.c b/src/vnet/session/application_interface.c index 74f456a1eab..86f3dcdece6 100644 --- a/src/vnet/session/application_interface.c +++ b/src/vnet/session/application_interface.c @@ -73,8 +73,8 @@ unformat_vnet_uri (unformat_input_t * input, va_list * args) static u8 *cache_uri; static session_endpoint_cfg_t *cache_sep; -int -parse_uri (char *uri, session_endpoint_cfg_t * sep) +session_error_t +parse_uri (char *uri, session_endpoint_cfg_t *sep) { unformat_input_t _input, *input = &_input; @@ -92,7 +92,7 @@ parse_uri (char *uri, session_endpoint_cfg_t * sep) if (!unformat (input, "%U", unformat_vnet_uri, sep)) { unformat_free (input); - return VNET_API_ERROR_INVALID_VALUE; + return SESSION_E_INVALID; } unformat_free (input); @@ -120,36 +120,36 @@ vnet_bind_uri (vnet_listen_args_t * a) return vnet_listen (a); } -int -vnet_unbind_uri (vnet_unlisten_args_t * a) +session_error_t +vnet_unbind_uri (vnet_unlisten_args_t *a) { session_endpoint_cfg_t sep = SESSION_ENDPOINT_CFG_NULL; application_t *app; session_t *listener; u32 table_index; - int rv; + session_error_t rv; if ((rv = parse_uri (a->uri, &sep))) return rv; app = application_get (a->app_index); if (!app) - return VNET_API_ERROR_INVALID_VALUE; + return SESSION_E_INVALID; table_index = application_session_table (app, fib_ip_proto (!sep.is_ip4)); listener = session_lookup_listener (table_index, (session_endpoint_t *) & sep); if (!listener) - return VNET_API_ERROR_ADDRESS_NOT_IN_USE; + return SESSION_E_ADDR_NOT_IN_USE; a->handle = listen_session_get_handle (listener); return vnet_unlisten (a); } -int -vnet_connect_uri (vnet_connect_args_t * a) +session_error_t +vnet_connect_uri (vnet_connect_args_t *a) { session_endpoint_cfg_t sep = SESSION_ENDPOINT_CFG_NULL; - int rv; + session_error_t rv; if ((rv = parse_uri (a->uri, &sep))) return rv; |