created libradius shared by eap-radius and tnc-pdp plugins
This commit is contained in:
+1
-1
@@ -254,7 +254,7 @@ if test x$eap_tls = xtrue -o x$eap_ttls = xtrue -o x$eap_peap = xtrue; then
|
|||||||
tls=true;
|
tls=true;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if test x$eap_radius = xtrue -o x$radattr = xtrue; then
|
if test x$eap_radius = xtrue -o x$radattr = xtrue -o x$tnc_pdp = xtrue; then
|
||||||
radius=true;
|
radius=true;
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ noinst_LTLIBRARIES = libstrongswan-eap-radius.la
|
|||||||
else
|
else
|
||||||
libstrongswan_eap_radius_la_LIBADD = $(top_builddir)/src/libradius/libradius.la
|
libstrongswan_eap_radius_la_LIBADD = $(top_builddir)/src/libradius/libradius.la
|
||||||
plugin_LTLIBRARIES = libstrongswan-eap-radius.la
|
plugin_LTLIBRARIES = libstrongswan-eap-radius.la
|
||||||
|
libstrongswan_eap_radius_la_LIBADD = \
|
||||||
|
$(top_builddir)/src/libradius/libradius.la
|
||||||
endif
|
endif
|
||||||
|
|
||||||
libstrongswan_eap_radius_la_SOURCES = \
|
libstrongswan_eap_radius_la_SOURCES = \
|
||||||
|
|||||||
@@ -2,7 +2,8 @@
|
|||||||
INCLUDES = \
|
INCLUDES = \
|
||||||
-I$(top_srcdir)/src/libstrongswan \
|
-I$(top_srcdir)/src/libstrongswan \
|
||||||
-I$(top_srcdir)/src/libhydra \
|
-I$(top_srcdir)/src/libhydra \
|
||||||
-I$(top_srcdir)/src/libcharon
|
-I$(top_srcdir)/src/libcharon \
|
||||||
|
-I$(top_srcdir)/src/libradius
|
||||||
|
|
||||||
AM_CFLAGS = -rdynamic
|
AM_CFLAGS = -rdynamic
|
||||||
|
|
||||||
@@ -11,6 +12,7 @@ noinst_LTLIBRARIES = libstrongswan-tnc-pdp.la
|
|||||||
else
|
else
|
||||||
plugin_LTLIBRARIES = libstrongswan-tnc-pdp.la
|
plugin_LTLIBRARIES = libstrongswan-tnc-pdp.la
|
||||||
libstrongswan_tnc_pdp_la_LIBADD = \
|
libstrongswan_tnc_pdp_la_LIBADD = \
|
||||||
|
$(top_builddir)/src/libradius/libradius.la \
|
||||||
$(top_builddir)/src/libtls/libtls.la \
|
$(top_builddir)/src/libtls/libtls.la \
|
||||||
$(top_builddir)/src/libtnccs/libtnccs.la
|
$(top_builddir)/src/libtnccs/libtnccs.la
|
||||||
endif
|
endif
|
||||||
|
|||||||
@@ -18,6 +18,8 @@
|
|||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
|
#include <radius_message.h>
|
||||||
|
|
||||||
#include <daemon.h>
|
#include <daemon.h>
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
#include <threading/thread.h>
|
#include <threading/thread.h>
|
||||||
@@ -28,7 +30,7 @@ typedef struct private_tnc_pdp_t private_tnc_pdp_t;
|
|||||||
/**
|
/**
|
||||||
* Maximum size of a RADIUS IP packet
|
* Maximum size of a RADIUS IP packet
|
||||||
*/
|
*/
|
||||||
#define MAX_PACKET 2048
|
#define MAX_PACKET 4096
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* private data of tnc_pdp_t
|
* private data of tnc_pdp_t
|
||||||
@@ -128,6 +130,7 @@ static job_requeue_t receive(private_tnc_pdp_t *this)
|
|||||||
{
|
{
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
|
radius_message_t *request;
|
||||||
char buffer[MAX_PACKET];
|
char buffer[MAX_PACKET];
|
||||||
int max_fd = 0, selected = 0, bytes_read = 0;
|
int max_fd = 0, selected = 0, bytes_read = 0;
|
||||||
fd_set rfds;
|
fd_set rfds;
|
||||||
@@ -198,6 +201,16 @@ static job_requeue_t receive(private_tnc_pdp_t *this)
|
|||||||
source = host_create_from_sockaddr((sockaddr_t*)&src);
|
source = host_create_from_sockaddr((sockaddr_t*)&src);
|
||||||
DBG2(DBG_NET, "received RADIUS packet from %#H", source);
|
DBG2(DBG_NET, "received RADIUS packet from %#H", source);
|
||||||
DBG3(DBG_NET, "%b", buffer, bytes_read);
|
DBG3(DBG_NET, "%b", buffer, bytes_read);
|
||||||
|
request = radius_message_parse_response(chunk_create(buffer, bytes_read));
|
||||||
|
if (request)
|
||||||
|
{
|
||||||
|
DBG2(DBG_NET, "received valid RADIUS message");
|
||||||
|
request->destroy(request);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DBG1(DBG_NET, "received invalid RADIUS message, ignored");
|
||||||
|
}
|
||||||
source->destroy(source);
|
source->destroy(source);
|
||||||
}
|
}
|
||||||
return JOB_REQUEUE_FAIR;
|
return JOB_REQUEUE_FAIR;
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ libradius_la_SOURCES = \
|
|||||||
radius_socket.h radius_socket.c \
|
radius_socket.h radius_socket.c \
|
||||||
radius_client.h radius_client.c \
|
radius_client.h radius_client.c \
|
||||||
radius_config.h radius_config.c
|
radius_config.h radius_config.c
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user