/** Called by the network thread to pass an event list for the module to use for timer events
*/
-typedef void (*fr_app_event_list_set_t)(void *instance, fr_event_list_t *el);
+typedef void (*fr_app_event_list_set_t)(void *instance, fr_event_list_t *el, void *nr);
/** Describes a new application (protocol)
*
app_io = s->listen->app_io;
- if (app_io->event_list_set) app_io->event_list_set(s->listen->app_io_instance, nr->el);
+ if (app_io->event_list_set) app_io->event_list_set(s->listen->app_io_instance, nr->el, nr);
rad_assert(app_io->fd);
s->fd = app_io->fd(s->listen->app_io_instance);
app_io = s->listen->app_io;
- if (app_io->event_list_set) app_io->event_list_set(s->listen->app_io_instance, nr->el);
+ if (app_io->event_list_set) app_io->event_list_set(s->listen->app_io_instance, nr->el, nr);
rad_assert(app_io->fd);
s->fd = app_io->fd(s->listen->app_io_instance);
return rcode;
}
+
+/** Signal the network to read from a listener
+ *
+ * @param nr the network
+ * @param worker the worker
+ */
+void fr_network_listen_read(fr_network_t *nr, fr_listen_t const *listen)
+{
+ fr_network_socket_t my_socket, *s;
+
+ (void) talloc_get_type_abort(nr, fr_network_t);
+ (void) talloc_get_type_abort(listen, fr_listen_t);
+
+ my_socket.listen = listen;
+ s = rbtree_finddata(nr->sockets, &my_socket);
+ if (!s) return;
+
+ /*
+ * Go read the socket.
+ */
+ fr_network_read(nr->el, s->fd, 0, s);
+}
int fr_network_socket_add(fr_network_t *nr, fr_listen_t const *io) CC_HINT(nonnull);
int fr_network_directory_add(fr_network_t *nr, fr_listen_t const *listen) CC_HINT(nonnull);
int fr_network_worker_add(fr_network_t *nr, fr_worker_t *worker) CC_HINT(nonnull);
+void fr_network_listen_read(fr_network_t *nr, fr_listen_t const *listen) CC_HINT(nonnull);
#ifdef __cplusplus
}
*
* @param[in] instance of the detail worker
* @param[in] el the event list
+ * @param[in] nr context from the network side
*/
-static void mod_event_list_set(void *instance, fr_event_list_t *el)
+static void mod_event_list_set(void *instance, fr_event_list_t *el, UNUSED void *nr)
{
proto_detail_file_t *inst = talloc_get_type_abort(instance, proto_detail_file_t);
#ifdef __linux__
*
* @param[in] instance of the detail worker
* @param[in] el the event list
+ * @param[in] nr context from the network side
*/
-static void mod_event_list_set(void *instance, fr_event_list_t *el)
+static void mod_event_list_set(void *instance, fr_event_list_t *el, void *nr)
{
proto_detail_work_t *inst = talloc_get_type_abort(instance, proto_detail_work_t);
*
* @param[in] instance of the RADIUS UDP I/O path.
* @param[in] el the event list
+ * @param[in] nr_ctx context from the network side
*/
-static void mod_event_list_set(void *instance, fr_event_list_t *el)
+static void mod_event_list_set(void *instance, fr_event_list_t *el, UNUSED void *nr_ctx)
{
proto_radius_udp_t *inst;