]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
Split paircmp header out
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 9 Oct 2018 21:57:48 +0000 (14:57 -0700)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Tue, 9 Oct 2018 21:57:48 +0000 (14:57 -0700)
src/lib/server/base.h
src/lib/server/paircmp.c
src/lib/server/paircmp.h [new file with mode: 0644]

index febfccaca360d3f4a3957ad1cfcd5421775d0464..6b141f2e9ed4a1d1e2db3a85fa3765ea270ad766 100644 (file)
@@ -53,7 +53,7 @@ RCSIDH(radiusd_h, "$Id$")
 #include <freeradius-devel/server/client.h>
 #include <freeradius-devel/server/process.h>
 #include <freeradius-devel/server/dependency.h>
-
+#include <freeradius-devel/server/paircmp.h>
 /*
  *  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.
index 5f337eeaaeeb42e6c23cd59b9f83336236a899d7..5c2ee37e002384b66b9aa65115cde679ec050a15 100644 (file)
 
 RCSID("$Id$")
 
-#include <ctype.h>
-
+#include <freeradius-devel/server/paircmp.h>
 #include <freeradius-devel/server/rad_assert.h>
 #include <freeradius-devel/server/regex.h>
 #include <freeradius-devel/server/request.h>
 
+#include <ctype.h>
+
 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 (file)
index 0000000..3b6c436
--- /dev/null
@@ -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 <aland@ox.org>
+ */
+RCSIDH(paircmp_h, "$Id$")
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <freeradius-devel/server/request.h>
+#include <freeradius-devel/util/dict.h>
+#include <freeradius-devel/util/pair.h>
+
+/* 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