fr_listen_t *listen; //!< associated listener
int sockfd; //!< cached for laziness
- fr_event_list_t *el;
+ fr_event_list_t *el; //!< event list
+ fr_network_t *nr; //!< network side of things
struct sockaddr_storage remote_sockaddr; //!< cached for laziness
socklen_t remote_salen;
* @param[in] el the event list
* @param[in] nr context from the network side
*/
-static void mod_event_list_set(fr_listen_t *li, fr_event_list_t *el, UNUSED void *nr)
+static void mod_event_list_set(fr_listen_t *li, fr_event_list_t *el, void *nr)
{
proto_bfd_udp_t const *inst = talloc_get_type_abort_const(li->app_io_instance, proto_bfd_udp_t);
proto_bfd_udp_thread_t *thread = talloc_get_type_abort(li->thread_instance, proto_bfd_udp_thread_t);
peer = fr_rb_iter_next_inorder(&iter)) {
if (peer->inst != inst) continue;
- bfd_session_start(peer, el, thread->sockfd);
+ peer->el = el;
+ peer->nr = (fr_network_t *) nr;
+ peer->sockfd = thread->sockfd;
+
+ bfd_session_start(peer);
}
}
return 0;
}
-void bfd_session_start(proto_bfd_peer_t *session, fr_event_list_t *el, int sockfd)
+void bfd_session_start(proto_bfd_peer_t *session)
{
DEBUG("Starting BFD for %s", session->client.shortname);
- fr_assert(!session->el);
-
- session->el = el;
- session->sockfd = sockfd;
+ fr_assert(session->el);
bfd_start_control(session);
}
int bfd_session_init(proto_bfd_peer_t *session);
-void bfd_session_start(proto_bfd_peer_t *session, fr_event_list_t *el, int sockfd);
+void bfd_session_start(proto_bfd_peer_t *session);
int bfd_session_process(proto_bfd_peer_t *session, bfd_packet_t *bfd);