[asterisk-commits] kharwell: branch 1.8 r406801 - in /branches/1.8: ./ cdr/ cel/ include/asterisk/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Tue Jan 28 17:02:45 CST 2014


Author: kharwell
Date: Tue Jan 28 17:02:38 2014
New Revision: 406801

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=406801
Log:
cdr_radius, cel_radius: build agains libfreeradius-client

Asterisk's RADIUS module currently build against libradiusclient-ng, but this
project has been superseeded by libfreeradius-client. The API is 99% compatible
except that the header name has changed, the library name has changed, and
the configuration file location has changed.

(closes issue ASTERISK-22980)
Reported by: Jeremy Lainé
Patches:
     freeradius-client.patch uploaded by sharky (license 6561)


Modified:
    branches/1.8/cdr/cdr_radius.c
    branches/1.8/cel/cel_radius.c
    branches/1.8/configure
    branches/1.8/configure.ac
    branches/1.8/include/asterisk/autoconfig.h.in

Modified: branches/1.8/cdr/cdr_radius.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/cdr/cdr_radius.c?view=diff&rev=406801&r1=406800&r2=406801
==============================================================================
--- branches/1.8/cdr/cdr_radius.c (original)
+++ branches/1.8/cdr/cdr_radius.c Tue Jan 28 17:02:38 2014
@@ -36,7 +36,11 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
 
+#ifdef FREERADIUS_CLIENT
+#include <freeradius-client.h>
+#else
 #include <radiusclient-ng.h>
+#endif
 
 #include "asterisk/channel.h"
 #include "asterisk/cdr.h"
@@ -82,7 +86,11 @@
 static const char name[] = "radius";
 static const char cdr_config[] = "cdr.conf";
 
+#ifdef FREERADIUS_CLIENT
+static char radiuscfg[PATH_MAX] = "/etc/radiusclient/radiusclient.conf";
+#else
 static char radiuscfg[PATH_MAX] = "/etc/radiusclient-ng/radiusclient.conf";
+#endif
 
 static struct ast_flags global_flags = { RADIUS_FLAG_USEGMTIME | RADIUS_FLAG_LOGUNIQUEID | RADIUS_FLAG_LOGUSERFIELD };
 

Modified: branches/1.8/cel/cel_radius.c
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/cel/cel_radius.c?view=diff&rev=406801&r1=406800&r2=406801
==============================================================================
--- branches/1.8/cel/cel_radius.c (original)
+++ branches/1.8/cel/cel_radius.c Tue Jan 28 17:02:38 2014
@@ -35,7 +35,11 @@
 
 ASTERISK_FILE_VERSION(__FILE__, "$Rev$")
 
+#ifdef FREERADIUS_CLIENT
+#include <freeradius-client.h>
+#else
 #include <radiusclient-ng.h>
+#endif
 
 #include "asterisk/channel.h"
 #include "asterisk/cel.h"
@@ -79,7 +83,11 @@
 
 static char *cel_config = "cel.conf";
 
+#ifdef FREERADIUS_CLIENT
+static char radiuscfg[PATH_MAX] = "/etc/radiusclient/radiusclient.conf";
+#else
 static char radiuscfg[PATH_MAX] = "/etc/radiusclient-ng/radiusclient.conf";
+#endif
 
 static struct ast_flags global_flags = { RADIUS_FLAG_USEGMTIME | RADIUS_FLAG_LOGUNIQUEID | RADIUS_FLAG_LOGUSERFIELD };
 

Modified: branches/1.8/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/configure.ac?view=diff&rev=406801&r1=406800&r2=406801
==============================================================================
--- branches/1.8/configure.ac (original)
+++ branches/1.8/configure.ac Tue Jan 28 17:02:38 2014
@@ -1995,7 +1995,14 @@
 # Some distributions (like SuSE) remove the 5.1 suffix.
 AST_EXT_LIB_CHECK([LUA], [lua], [luaL_openlib], [lua.h], [-lm])
 
-AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
+# Accept either RADIUS client library, their APIs are fully compatible,
+# just different header filenames and different SONAMEs
+AST_EXT_LIB_CHECK([RADIUS], [freeradius-client], [rc_read_config], [freeradius-client.h])
+if test "x${PBX_RADIUS}" = "x1"; then
+	AC_DEFINE(FREERADIUS_CLIENT, [], [Use the FreeRADIUS-client library])
+else
+	AST_EXT_LIB_CHECK([RADIUS], [radiusclient-ng], [rc_read_config], [radiusclient-ng.h])
+fi
 
 # This is a bit complex... in reality, Asterisk's AIS support is dependent on finding
 # *any* implementation of AIS, not just OpenAIS. However, the configure script needs

Modified: branches/1.8/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/1.8/include/asterisk/autoconfig.h.in?view=diff&rev=406801&r1=406800&r2=406801
==============================================================================
--- branches/1.8/include/asterisk/autoconfig.h.in (original)
+++ branches/1.8/include/asterisk/autoconfig.h.in Tue Jan 28 17:02:38 2014
@@ -28,6 +28,9 @@
 
 /* Define to 1 if using `alloca.c'. */
 #undef C_ALLOCA
+
+/* Use the FreeRADIUS-client library */
+#undef FREERADIUS_CLIENT
 
 /* Define to 1 if you have the `acos' function. */
 #undef HAVE_ACOS




More information about the asterisk-commits mailing list