]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
rename "activate" to "connected"
authorAlan T. DeKok <aland@freeradius.org>
Wed, 16 Oct 2024 17:22:54 +0000 (13:22 -0400)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 16 Oct 2024 17:22:54 +0000 (13:22 -0400)
to match the connection / trunk API

src/bin/radclient-ng.c
src/lib/bio/base.h
src/lib/bio/fd.c
src/lib/bio/haproxy.c
src/lib/bio/packet.h
src/protocols/radius/client.c

index ed8b75df702a86c1979e1959a7c00885028bc7aa..ea610227f559c401bcf108c4ae85633862c429ac 100644 (file)
@@ -1287,7 +1287,7 @@ static void client_write(fr_event_list_t *el, int fd, UNUSED int flags, void *uc
        }
 }
 
-static void  client_bio_activate(fr_bio_packet_t *client)
+static void  client_bio_connected(fr_bio_packet_t *client)
 {
        fr_radius_client_bio_info_t const *info;
 
@@ -1769,7 +1769,7 @@ int main(int argc, char **argv)
         *      paused or resumed when the socket becomes writeable.
         */
        client_config.packet_cb_cfg = (fr_bio_packet_cb_funcs_t) {
-               .activate       = client_bio_activate,
+               .connected      = client_bio_connected,
                .failed         = client_bio_failed,
 
                .write_blocked  = client_bio_write_pause,
index a61a02bec9c2a1dd1d13add6f93999a0191adc0b..8d904ec8625c607e9d45ffb97ffc85c7930a697a 100644 (file)
@@ -79,12 +79,12 @@ typedef struct fr_bio_s fr_bio_t;
 typedef ssize_t        (*fr_bio_read_t)(fr_bio_t *bio, void *packet_ctx, void *buffer, size_t size);
 typedef ssize_t        (*fr_bio_write_t)(fr_bio_t *bio, void *packet_ctx, const void *buffer, size_t size);
 
-typedef int (*fr_bio_io_t)(fr_bio_t *bio); /* activate / shutdown callbacks */
+typedef int (*fr_bio_io_t)(fr_bio_t *bio); /* connected / shutdown callbacks */
 
-typedef void (*fr_bio_callback_t)(fr_bio_t *bio); /* activate / shutdown callbacks */
+typedef void (*fr_bio_callback_t)(fr_bio_t *bio); /* connected / shutdown callbacks */
 
 typedef struct {
-       fr_bio_callback_t       activate;               //!< called when the BIO is ready to be used
+       fr_bio_callback_t       connected;              //!< called when the BIO is ready to be used
        fr_bio_callback_t       shutdown;               //!< called when the BIO is being shut down
        fr_bio_callback_t       eof;                    //!< called when the BIO is at EOF
        fr_bio_callback_t       failed;                 //!< called when the BIO fails
index 165a42c58e3995915ce4765973c6b3e8c7b0f490..be39f87bce19ebc5ab85728478af1a0355436bd5 100644 (file)
@@ -650,7 +650,7 @@ static void fr_bio_fd_set_open(fr_bio_fd_t *my)
        /*
         *      Tell the caller that the socket is ready for application data.
         */
-       if (my->cb.activate) my->cb.activate(&my->bio);
+       if (my->cb.connected) my->cb.connected(&my->bio);
 }
 
 
index 10e1280ddcf91b770d17b69bab72dac864545590..13be88c2cd32aae609acf1c58b9fc75f23609caf 100644 (file)
@@ -159,7 +159,7 @@ static ssize_t fr_bio_haproxy_read_next(fr_bio_t *bio, UNUSED void *packet_ctx,
 
        /*
         *      Somehow (magically) we can satisfy the read from our buffer.  Do so.  Note that we do NOT run
-        *      the activation callback, as there is still data in our buffer
+        *      the connected callback, as there is still data in our buffer
         */
        if (size < used) {
                (void) fr_bio_buf_read(&my->buffer, buffer, size);
@@ -172,9 +172,9 @@ static ssize_t fr_bio_haproxy_read_next(fr_bio_t *bio, UNUSED void *packet_ctx,
        (void) fr_bio_buf_read(&my->buffer, buffer, used);
 
        /*
-        *      Call the users activation function, which might remove us from the proxy chain.
+        *      Call the users "socket is now usable" function, which might remove us from the proxy chain.
         */
-       if (my->cb.activate) my->cb.activate(bio);
+       if (my->cb.connected) my->cb.connected(bio);
 
        return used;
 }
index 86024c352d74e5f8fa35bf71a98eaf3f4558ec71..6f0745795dbc783a29cb054a3c44db189a70ecca 100644 (file)
@@ -68,7 +68,7 @@ typedef int (*fr_bio_packet_io_t)(fr_bio_packet_t *bio);
 typedef void (*fr_bio_packet_callback_t)(fr_bio_packet_t *bio);
 
 typedef struct {
-       fr_bio_packet_callback_t        activate;
+       fr_bio_packet_callback_t        connected;
        fr_bio_packet_callback_t        shutdown;
        fr_bio_packet_callback_t        eof;
        fr_bio_packet_callback_t        failed;
index 86c21c14734dac672746df2170c2c4413d3c39db..1a183eda34b14917637054af77ad02aeef85a63b 100644 (file)
@@ -147,7 +147,7 @@ fr_radius_client_fd_bio_t *fr_radius_client_fd_bio_alloc(TALLOC_CTX *ctx, size_t
        /*
         *      Inform all BIOs about the write pause / resume callbacks
         *
-        *      @todo - these callbacks are set AFTER the BIOs have been initialized, so the activate()
+        *      @todo - these callbacks are set AFTER the BIOs have been initialized, so the connected()
         *      callback is never set, and therefore is never run.  We should add all of the callbacks to the
         *      various bio "cfg" data structures.
         */
@@ -687,10 +687,10 @@ static void fr_radius_client_bio_eof(fr_bio_t *bio)
        if (my->common.cb.eof) my->common.cb.eof(&my->common);
 }
 
-/** Callback for when the FD is activated, i.e. connected.
+/** Callback for when the FD is connected, and the application can use it
  *
  */
-static void fr_radius_client_bio_activate(fr_bio_t *bio)
+static void fr_radius_client_bio_connected(fr_bio_t *bio)
 {
        fr_radius_client_fd_bio_t *my = bio->uctx;
 
@@ -704,9 +704,9 @@ static void fr_radius_client_bio_activate(fr_bio_t *bio)
        if (my->ev) talloc_const_free(&my->ev);
 
        /*
-        *      Tell the application that the connection has been activated.
+        *      Tell the application that the connection has been connected, and is now usable.
         */
-       my->common.cb.activate(&my->common);
+       my->common.cb.connected(&my->common);
 }
 
 /** We failed to connect in the given timeout, the connection is dead.
@@ -728,23 +728,23 @@ void fr_radius_client_bio_connect(NDEBUG_UNUSED fr_event_list_t *el, NDEBUG_UNUS
 {
        fr_radius_client_fd_bio_t *my = talloc_get_type_abort(uctx, fr_radius_client_fd_bio_t);
 
-       fr_assert(my->common.cb.activate);
+       fr_assert(my->common.cb.connected);
        fr_assert(!my->retry || (my->info.retry_info->el == el));
        fr_assert(my->info.fd_info->socket.fd == fd);
 
        /*
-        *      The socket is already connected, go activate it.  This happens when the FD bio opens an
-        *      unconnected socket.  It calls our activation routine before the application has a chance to
+        *      The socket is already connected, tell the application.  This happens when the FD bio opens an
+        *      unconnected socket.  It calls our connected routine before the application has a chance to
         *      call our connect routine.
         */
        if (my->info.connected) return;
 
        /*
-        *      We don't pass the callbacks to fr_bio_fd_alloc(), so it can't call our activate routine.
+        *      We don't pass the callbacks to fr_bio_fd_alloc(), so it can't call our connected routine.
         *      As a result, we have to check if the FD is open, and then call it ourselves.
         */
        if (my->info.fd_info->state == FR_BIO_FD_STATE_OPEN) {
-               fr_radius_client_bio_activate(my->fd);
+               fr_radius_client_bio_connected(my->fd);
                return;
        }
 
@@ -863,7 +863,7 @@ void fr_radius_client_bio_cb_set(fr_bio_packet_t *bio, fr_bio_packet_cb_funcs_t
        fr_assert((cb->write_blocked != NULL) == (cb->write_resume != NULL));
        fr_assert((cb->read_blocked != NULL) == (cb->read_resume != NULL));
 
-       bio_cb.activate = fr_radius_client_bio_activate;
+       bio_cb.connected = fr_radius_client_bio_connected;
        bio_cb.write_blocked = fr_radius_client_bio_write_blocked;
        bio_cb.write_resume = fr_radius_client_bio_write_resume;