return pool_elt_at_index (app->listeners, app_listener_index);
}
+static app_listener_t *
+app_listener_get_if_valid (application_t * app, u32 app_listener_index)
+{
+ if (pool_is_free_index (app->listeners, app_listener_index))
+ return 0;
+ return pool_elt_at_index (app->listeners, app_listener_index);
+}
+
static void
app_listener_free (application_t * app, app_listener_t * app_listener)
{
app = application_get_if_valid (app_index);
if (!app)
return 0;
- return app_listener_get (app, app_listener_index);
+ return app_listener_get_if_valid (app, app_listener_index);
}
app_listener_t *
if (!(app = application_get_if_valid (a->app_index)))
return VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
- al = app_listener_get_w_handle (a->handle);
+ if (!(al = app_listener_get_w_handle (a->handle)))
+ return -1;
+
if (al->app_index != app->app_index)
{
clib_warning ("app doesn't own handle %llu!", a->handle);
return app->flags & APP_OPTIONS_FLAGS_USE_GLOBAL_SCOPE;
}
-u8
-application_use_mq_for_ctrl (application_t * app)
-{
- return app->flags & APP_OPTIONS_FLAGS_USE_MQ_FOR_CTRL_MSGS;
-}
-
static clib_error_t *
application_start_stop_proxy_fib_proto (application_t * app, u8 fib_proto,
u8 transport_proto, u8 is_start)