]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove entry_point_set()
authorAlan T. DeKok <aland@freeradius.org>
Fri, 19 Mar 2021 13:33:54 +0000 (09:33 -0400)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Wed, 31 Mar 2021 15:04:25 +0000 (16:04 +0100)
and instead just call the virtual server function

src/lib/io/application.h
src/lib/io/worker.c
src/lib/server/virtual_servers.c
src/listen/arp/proto_arp.c
src/listen/detail/proto_detail.c
src/listen/dhcpv4/proto_dhcpv4.c
src/listen/dhcpv6/proto_dhcpv6.c
src/listen/radius/proto_radius.c
src/listen/tacacs/proto_tacacs.c
src/listen/vmps/proto_vmps.c

index 32b05a8d0e0414d9cb15f428e3999fbd89136dd7..6cffaf498415a685c6f8788ed940ac67649f6cdc 100644 (file)
@@ -69,13 +69,6 @@ typedef int (*fr_app_instantiate_t)(void *instance, CONF_SECTION *cs);
  */
 typedef int (*fr_app_open_t)(void *instance, fr_schedule_t *sc, CONF_SECTION *cs);
 
-/** Set the next state executed by the request to be one of the application subtype's entry points
- *
- * @param[in] instance of the #fr_app_t.
- * @param[in] request  To set the next state function for.
- */
-typedef void (*fr_app_entry_point_set_t)(void const *instance, request_t *request);
-
 /** Set the priority of a packet
  *
  * @param[in] instance of the #fr_app_t.
@@ -125,11 +118,6 @@ typedef struct {
                                                        ///< Here for convenience, so that encode operations common
                                                        ///< to all #fr_app_io_t can be performed by the #fr_app_t.
 
-       fr_app_entry_point_set_t        entry_point_set;//!< Callback to Set the entry point into the state machine
-                                                       ///< provided by the fr_app_worker_t.
-                                                       ///< We need a function this as the #fr_app_worker_t might
-                                                       ///< change based on the packet we received.
-
        fr_app_priority_get_t           priority;       //!< Assign a priority to the packet.
 } fr_app_t;
 
index 0e4238dd7cc92eefab85646f62a1f9682cfb9099..281012cf5e89d8c2637e3f54500f24b3927d2b1b 100644 (file)
@@ -757,11 +757,9 @@ nak:
        }
 
        /*
-        *      Call the main protocol handler to set the right async
-        *      process function.
+        *      Set the entry point for this virtual server.
         */
-       listen->app->entry_point_set(listen->app_instance, request);
-
+       virtual_server_entry_point_set(request);
        if (!request->async->process) {
                RERROR("Protocol failed to set 'process' function");
                worker_nak(worker, cd, now);
index 638aef8eb68daad70b5189b6a60946458a07fa9b..39420eff1139f1a0f204a8ee9721c92294c1c868 100644 (file)
@@ -1495,7 +1495,8 @@ void fr_request_async_bootstrap(request_t *request, fr_event_list_t *el)
 
        request->async->listen = NULL;
        request->async->packet_ctx = NULL;
-       listener[0]->app->entry_point_set(listener[0]->proto_module->data, request);
+
+       virtual_server_entry_point_set(request);
 }
 
 static int fr_app_process_bootstrap(CONF_SECTION *server)
index 42aa78123f767175fafe2820eea8aa03fd06c74c..3f2f8b5f306a67b9c48b7ffa4b2b782cbb197437 100644 (file)
@@ -143,14 +143,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf
        return slen;
 }
 
-static void mod_entry_point_set(UNUSED void const *instance, request_t *request)
-{
-       fr_assert(request->server_cs != NULL);
-
-       virtual_server_entry_point_set(request);
-}
-
-
 /** Open listen sockets/connect to external event source
  *
  * @param[in] instance Ctx data for this application.
@@ -323,5 +315,4 @@ fr_app_t proto_arp = {
        .open                   = mod_open,
        .decode                 = mod_decode,
        .encode                 = mod_encode,
-       .entry_point_set        = mod_entry_point_set,
 };
index 50a548ddc21fafafff96588df10492b65d91f85c..bceace3d30e1936dfdde1244ce0d14ef3b117d99 100644 (file)
@@ -345,13 +345,6 @@ static ssize_t mod_encode(UNUSED void const *instance, request_t *request, uint8
        return 1;
 }
 
-static void mod_entry_point_set(UNUSED void const *instance, request_t *request)
-{
-       fr_assert(request->server_cs != NULL);
-
-       virtual_server_entry_point_set(request);
-}
-
 /** Open listen sockets/connect to external event source
  *
  * @param[in] instance Ctx data for this application.
@@ -587,5 +580,4 @@ fr_app_t proto_detail = {
        .open                   = mod_open,
        .decode                 = mod_decode,
        .encode                 = mod_encode,
-       .entry_point_set        = mod_entry_point_set
 };
index 92baf28df85f31143a927a690ca3f59bbb47ebc9..cae5d5d5a417b1cef4529782e931826356be44ba 100644 (file)
@@ -336,14 +336,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf
        return data_len;
 }
 
-static void mod_entry_point_set(UNUSED void const *instance, request_t *request)
-{
-       fr_assert(request->server_cs != NULL);
-
-       virtual_server_entry_point_set(request);
-}
-
-
 static int mod_priority_set(void const *instance, uint8_t const *buffer, size_t buflen)
 {
        proto_dhcpv4_t const *inst = talloc_get_type_abort_const(instance, proto_dhcpv4_t);
@@ -524,6 +516,5 @@ fr_app_t proto_dhcpv4 = {
        .open                   = mod_open,
        .decode                 = mod_decode,
        .encode                 = mod_encode,
-       .entry_point_set        = mod_entry_point_set,
        .priority               = mod_priority_set
 };
index 4cbf103389db4d0b0e173223d78a23f308ca62dd..c6658d890058caeb5606b2f54a7675dbb4529c0c 100644 (file)
@@ -341,13 +341,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf
        return data_len;
 }
 
-static void mod_entry_point_set(UNUSED void const *instance, request_t *request)
-{
-       fr_assert(request->server_cs != NULL);
-
-       virtual_server_entry_point_set(request);
-}
-
 static int mod_priority_set(void const *instance, uint8_t const *buffer, UNUSED size_t buflen)
 {
        proto_dhcpv6_t const *inst = talloc_get_type_abort_const(instance, proto_dhcpv6_t);
@@ -521,6 +514,5 @@ fr_app_t proto_dhcpv6 = {
        .open                   = mod_open,
        .decode                 = mod_decode,
        .encode                 = mod_encode,
-       .entry_point_set        = mod_entry_point_set,
        .priority               = mod_priority_set
 };
index 8923a2757184da921c62cc7c30dc4746ec90ce68..0d1c5e6438d96124d67f989c6ada1464fe7e84e4 100644 (file)
@@ -412,14 +412,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf
        return data_len;
 }
 
-static void mod_entry_point_set(UNUSED void const *instance, request_t *request)
-{
-       fr_assert(request->server_cs != NULL);
-
-       virtual_server_entry_point_set(request);
-}
-
-
 static int mod_priority_set(void const *instance, uint8_t const *buffer, UNUSED size_t buflen)
 {
        proto_radius_t const *inst = talloc_get_type_abort_const(instance, proto_radius_t);
@@ -601,6 +593,5 @@ fr_app_t proto_radius = {
        .open                   = mod_open,
        .decode                 = mod_decode,
        .encode                 = mod_encode,
-       .entry_point_set        = mod_entry_point_set,
        .priority               = mod_priority_set
 };
index c38f0fe3f6deed65a872b7c3140e720fa0db9d71..ab1ebf145469974c91ccd52bad6d644a0cf382a8 100644 (file)
@@ -406,13 +406,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf
        return data_len;
 }
 
-static void mod_entry_point_set(UNUSED void const *instance, request_t *request)
-{
-       fr_assert(request->server_cs != NULL);
-
-       virtual_server_entry_point_set(request);
-}
-
 static int mod_priority_set(void const *instance, uint8_t const *buffer, UNUSED size_t buflen)
 {
        proto_tacacs_t const *inst = talloc_get_type_abort_const(instance, proto_tacacs_t);
@@ -582,6 +575,5 @@ fr_app_t proto_tacacs = {
        .open                   = mod_open,
        .decode                 = mod_decode,
        .encode                 = mod_encode,
-       .entry_point_set        = mod_entry_point_set,
        .priority               = mod_priority_set
 };
index 963a8519d22a53db0dc51796c19526b4b3f53b56..04077c11876c4c3bbfdc20caf2f76a5e7012b8b9 100644 (file)
@@ -318,13 +318,6 @@ static ssize_t mod_encode(void const *instance, request_t *request, uint8_t *buf
        return data_len;
 }
 
-static void mod_entry_point_set(UNUSED void const *instance, request_t *request)
-{
-       fr_assert(request->server_cs != NULL);
-
-       virtual_server_entry_point_set(request);
-}
-
 static int mod_priority_set(void const *instance, uint8_t const *buffer, UNUSED size_t buflen)
 {
        proto_vmps_t const *inst = talloc_get_type_abort_const(instance, proto_vmps_t);
@@ -490,6 +483,5 @@ fr_app_t proto_vmps = {
        .open                   = mod_open,
        .decode                 = mod_decode,
        .encode                 = mod_encode,
-       .entry_point_set        = mod_entry_point_set,
        .priority               = mod_priority_set
 };