]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
remove unused function
authorAlan T. DeKok <aland@freeradius.org>
Wed, 1 Mar 2023 22:00:56 +0000 (17:00 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 1 Mar 2023 22:29:38 +0000 (17:29 -0500)
src/lib/server/client.c
src/lib/server/client.h

index 6cbb8da0af26bccbc95170d56140617e28a9b21f..51736db3b19fca7459551ce6e69de69807e5d025 100644 (file)
@@ -895,51 +895,6 @@ fr_client_t *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, CONF_SECTION *se
        return c;
 }
 
-/** Add a client from a result set (SQL)
- *
- * @todo This function should die. SQL should use client_afrom_cs.
- *
- * @param ctx Talloc context.
- * @param identifier Client IP Address / IPv4 subnet / IPv6 subnet / FQDN.
- * @param secret Client secret.
- * @param shortname Client friendly name.
- * @param type NAS-Type.
- * @param server Virtual-Server to associate clients with.
- * @param require_ma If true all packets from client must include a message-authenticator.
- * @return
- *     - New client.
- *     - NULL on error.
- */
-fr_client_t *client_afrom_query(TALLOC_CTX *ctx, char const *identifier, char const *secret,
-                             char const *shortname, char const *type, char const *server, bool require_ma)
-{
-       fr_client_t *c;
-       char buffer[128];
-
-       c = talloc_zero(ctx, fr_client_t);
-
-       if (fr_inet_pton(&c->ipaddr, identifier, -1, AF_UNSPEC, true, true) < 0) {
-               PERROR("Failed parsing client IP");
-               talloc_free(c);
-
-               return NULL;
-       }
-
-       fr_inet_ntoh(&c->ipaddr, buffer, sizeof(buffer));
-       c->longname = talloc_typed_strdup(c, buffer);
-
-       /*
-        *      Other values (secret, shortname, nas_type, virtual_server)
-        */
-       c->secret = talloc_typed_strdup(c, secret);
-       if (shortname) c->shortname = talloc_typed_strdup(c, shortname);
-       if (type) c->nas_type = talloc_typed_strdup(c, type);
-       if (server) c->server = talloc_typed_strdup(c, server);
-       c->message_authenticator = require_ma;
-
-       return c;
-}
-
 /** Create a new client, consuming all attributes in the control list of the request
  *
  * @param ctx the talloc context
index cfef4c89bdecd1596409a651e660ab33e2021b71..16429641a8ac4ddb8bab76d6f097530525898afe 100644 (file)
@@ -134,10 +134,6 @@ int                client_map_section(CONF_SECTION *out, CONF_SECTION const *map, client_value
 
 fr_client_t    *client_afrom_cs(TALLOC_CTX *ctx, CONF_SECTION *cs, CONF_SECTION *server_cs);
 
-fr_client_t    *client_afrom_query(TALLOC_CTX *ctx, char const *identifier, char const *secret, char const *shortname,
-                                   char const *type, char const *server, bool require_ma)
-               CC_HINT(nonnull(2, 3));
-
 fr_client_t    *client_find(fr_client_list_t const *clients, fr_ipaddr_t const *ipaddr, int proto);
 
 fr_client_t    *client_findbynumber(fr_client_list_t const *clients, int number);