[asterisk-commits] kharwell: branch 11 r406802 - in /branches/11: ./ cdr/ cel/ include/asterisk/

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


Author: kharwell
Date: Tue Jan 28 17:10:47 2014
New Revision: 406802

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=406802
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)
........

Merged revisions 406801 from http://svn.asterisk.org/svn/asterisk/branches/1.8

Modified:
    branches/11/   (props changed)
    branches/11/cdr/cdr_radius.c
    branches/11/cel/cel_radius.c
    branches/11/configure
    branches/11/configure.ac
    branches/11/include/asterisk/autoconfig.h.in

Propchange: branches/11/
------------------------------------------------------------------------------
Binary property 'branch-1.8-merged' - no diff available.

Modified: branches/11/cdr/cdr_radius.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/cdr/cdr_radius.c?view=diff&rev=406802&r1=406801&r2=406802
==============================================================================
--- branches/11/cdr/cdr_radius.c (original)
+++ branches/11/cdr/cdr_radius.c Tue Jan 28 17:10:47 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/11/cel/cel_radius.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/cel/cel_radius.c?view=diff&rev=406802&r1=406801&r2=406802
==============================================================================
--- branches/11/cel/cel_radius.c (original)
+++ branches/11/cel/cel_radius.c Tue Jan 28 17:10:47 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/11/configure.ac
URL: http://svnview.digium.com/svn/asterisk/branches/11/configure.ac?view=diff&rev=406802&r1=406801&r2=406802
==============================================================================
--- branches/11/configure.ac (original)
+++ branches/11/configure.ac Tue Jan 28 17:10:47 2014
@@ -2114,7 +2114,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
 
 AST_EXT_LIB_CHECK([COROSYNC], [cpg], [cpg_join], [corosync/cpg.h], [-lcfg])
 AST_EXT_LIB_CHECK([COROSYNC_CFG_STATE_TRACK], [cfg], [corosync_cfg_state_track], [corosync/cfg.h], [-lcfg])

Modified: branches/11/include/asterisk/autoconfig.h.in
URL: http://svnview.digium.com/svn/asterisk/branches/11/include/asterisk/autoconfig.h.in?view=diff&rev=406802&r1=406801&r2=406802
==============================================================================
--- branches/11/include/asterisk/autoconfig.h.in (original)
+++ branches/11/include/asterisk/autoconfig.h.in Tue Jan 28 17:10:47 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