From: Arran Cudbard-Bell Date: Tue, 9 Oct 2018 21:57:48 +0000 (-0700) Subject: Split paircmp header out X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e375d41538ea43b9f0f1a69bbbc25c1d75458b0e;p=thirdparty%2Ffreeradius-server.git Split paircmp header out --- diff --git a/src/lib/server/base.h b/src/lib/server/base.h index febfccaca36..6b141f2e9ed 100644 --- a/src/lib/server/base.h +++ b/src/lib/server/base.h @@ -53,7 +53,7 @@ RCSIDH(radiusd_h, "$Id$") #include #include #include - +#include /* * Let any external program building against the library know what * features the library was built with. @@ -85,9 +85,6 @@ extern "C" { #define DEAD_TIME 120 #define EXEC_TIMEOUT 10 -/* for paircmp_register */ -typedef int (*RAD_COMPARE_FUNC)(void *instance, REQUEST *,VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR **); - typedef enum request_fail { REQUEST_FAIL_UNKNOWN = 0, REQUEST_FAIL_NO_THREADS, //!< No threads to handle it. @@ -200,27 +197,6 @@ int trigger_exec(REQUEST *request, CONF_SECTION const *cs, char const *name, boo void trigger_exec_free(void); VALUE_PAIR *trigger_args_afrom_server(TALLOC_CTX *ctx, char const *server, uint16_t port); -/* paircmp.c */ -int paircmp_pairs(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp); - -int paircmp(REQUEST *request, VALUE_PAIR *req_list, VALUE_PAIR *check, VALUE_PAIR **rep_list); - -int paircmp_find(fr_dict_attr_t const *da); - -int paircmp_register_by_name(char const *name, fr_dict_attr_t const *from, - bool first_only, RAD_COMPARE_FUNC func, void *instance); - -int paircmp_register(fr_dict_attr_t const *attribute, fr_dict_attr_t const *from, - bool first_only, RAD_COMPARE_FUNC func, void *instance); - -void paircmp_unregister(fr_dict_attr_t const *attr, RAD_COMPARE_FUNC func); - -void paircmp_unregister_instance(void *instance); - -int paircmp_init(void); - -void paircmp_free(void); - /** Allocate a VALUE_PAIR in the request list * * @param[in] _attr allocated. diff --git a/src/lib/server/paircmp.c b/src/lib/server/paircmp.c index 5f337eeaaee..5c2ee37e002 100644 --- a/src/lib/server/paircmp.c +++ b/src/lib/server/paircmp.c @@ -29,12 +29,13 @@ RCSID("$Id$") -#include - +#include #include #include #include +#include + typedef struct paircmp_s paircmp_t; struct paircmp_s { fr_dict_attr_t const *da; diff --git a/src/lib/server/paircmp.h b/src/lib/server/paircmp.h new file mode 100644 index 00000000000..3b6c4368ae4 --- /dev/null +++ b/src/lib/server/paircmp.h @@ -0,0 +1,62 @@ +#pragma once +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +/** + * $Id$ + * + * @file lib/server/paircmp.h + * @brief Legacy paircomparison function + * + * @copyright 2000,2006 The FreeRADIUS server project + * @copyright 2000 Alan DeKok + */ +RCSIDH(paircmp_h, "$Id$") + +#ifdef __cplusplus +extern "C" { +#endif + +#include +#include +#include + +/* for paircmp_register */ +typedef int (*RAD_COMPARE_FUNC)(void *instance, REQUEST *,VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR *, VALUE_PAIR **); + +int paircmp_pairs(REQUEST *request, VALUE_PAIR *check, VALUE_PAIR *vp); + +int paircmp(REQUEST *request, VALUE_PAIR *req_list, VALUE_PAIR *check, VALUE_PAIR **rep_list); + +int paircmp_find(fr_dict_attr_t const *da); + +int paircmp_register_by_name(char const *name, fr_dict_attr_t const *from, + bool first_only, RAD_COMPARE_FUNC func, void *instance); + +int paircmp_register(fr_dict_attr_t const *attribute, fr_dict_attr_t const *from, + bool first_only, RAD_COMPARE_FUNC func, void *instance); + +void paircmp_unregister(fr_dict_attr_t const *attr, RAD_COMPARE_FUNC func); + +void paircmp_unregister_instance(void *instance); + +int paircmp_init(void); + +void paircmp_free(void); + +#ifdef __cplusplus +} +#endif