if (!app)
{
- clib_warning ("app not attached");
+ clib_warning ("app (%d) not attached", app_index);
return VNET_API_ERROR_APPLICATION_NOT_ATTACHED;
}
* Server is willing to have a direct fifo connection created
* instead of going through the state machine, etc.
*/
- if (server->flags & SESSION_OPTIONS_FLAGS_USE_FIFO)
+ if (server->flags & APP_OPTIONS_FLAGS_USE_FIFO)
return server->cb_fns.
redirect_connect_callback (server->api_client_index, mp);
}
a->session_cb_vft)))
return rv;
- a->app_event_queue_address = (u64) app->event_queue;
+ a->app_event_queue_address = pointer_to_uword (app->event_queue);
sm = segment_manager_get (app->first_segment_manager);
segment_manager_get_segment_info (sm->segment_indices[0],
&seg_name, &a->segment_size);
return 0;
}
-session_type_t
-session_type_from_proto_and_ip (session_api_proto_t proto, u8 is_ip4)
-{
- if (proto == SESSION_PROTO_TCP)
- {
- if (is_ip4)
- return SESSION_TYPE_IP4_TCP;
- else
- return SESSION_TYPE_IP6_TCP;
- }
- else
- {
- if (is_ip4)
- return SESSION_TYPE_IP4_UDP;
- else
- return SESSION_TYPE_IP6_UDP;
- }
-
- return SESSION_N_TYPES;
-}
-
int
vnet_bind_uri (vnet_bind_args_t * a)
{
if (!s || s->app_index != a->app_index)
return VNET_API_ERROR_INVALID_VALUE;
- stream_session_disconnect (s);
+ /* We're peeking into another's thread pool. Make sure */
+ ASSERT (s->session_index == index);
+
+ session_send_session_evt_to_thread (a->handle, FIFO_EVENT_DISCONNECT,
+ thread_index);
return 0;
}
return vnet_connect_i (a->app_index, a->api_context, sst, &a->tep, a->mp);
}
-int
-vnet_disconnect (vnet_disconnect_args_t * a)
-{
- stream_session_t *session;
- u32 session_index, thread_index;
-
- if (api_parse_session_handle (a->handle, &session_index, &thread_index))
- {
- clib_warning ("Invalid handle");
- return -1;
- }
-
- session = stream_session_get (session_index, thread_index);
- stream_session_disconnect (session);
-
- return 0;
-}
-
/*
* fd.io coding-style-patch-verification: ON
*