From: Alan T. DeKok Date: Wed, 1 Mar 2023 22:00:56 +0000 (-0500) Subject: remove unused function X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5b4446d894cc1c787f28c9f8994ec08099d7cad6;p=thirdparty%2Ffreeradius-server.git remove unused function --- diff --git a/src/lib/server/client.c b/src/lib/server/client.c index 6cbb8da0af2..51736db3b19 100644 --- a/src/lib/server/client.c +++ b/src/lib/server/client.c @@ -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 diff --git a/src/lib/server/client.h b/src/lib/server/client.h index cfef4c89bde..16429641a8a 100644 --- a/src/lib/server/client.h +++ b/src/lib/server/client.h @@ -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);