summaryrefslogtreecommitdiff
path: root/src/libcharon/plugins/eap_radius
diff options
context:
space:
mode:
authorYves-Alexis Perez <corsac@debian.org>2016-07-16 15:19:53 +0200
committerYves-Alexis Perez <corsac@debian.org>2016-07-16 15:19:53 +0200
commitbf372706c469764d59e9f29c39e3ecbebd72b8d2 (patch)
tree0f0e296e2d50e4a7faf99ae6fa428d2681e81ea1 /src/libcharon/plugins/eap_radius
parent518dd33c94e041db0444c7d1f33da363bb8e3faf (diff)
downloadvyos-strongswan-bf372706c469764d59e9f29c39e3ecbebd72b8d2.tar.gz
vyos-strongswan-bf372706c469764d59e9f29c39e3ecbebd72b8d2.zip
Imported Upstream version 5.5.0
Diffstat (limited to 'src/libcharon/plugins/eap_radius')
-rw-r--r--src/libcharon/plugins/eap_radius/Makefile.in27
-rw-r--r--src/libcharon/plugins/eap_radius/eap_radius.c32
-rw-r--r--src/libcharon/plugins/eap_radius/eap_radius_accounting.c28
-rw-r--r--src/libcharon/plugins/eap_radius/eap_radius_accounting.h2
-rw-r--r--src/libcharon/plugins/eap_radius/eap_radius_dae.c4
-rw-r--r--src/libcharon/plugins/eap_radius/eap_radius_forward.c6
-rw-r--r--src/libcharon/plugins/eap_radius/eap_radius_provider.c4
-rw-r--r--src/libcharon/plugins/eap_radius/eap_radius_provider.h4
8 files changed, 61 insertions, 46 deletions
diff --git a/src/libcharon/plugins/eap_radius/Makefile.in b/src/libcharon/plugins/eap_radius/Makefile.in
index 881a5b7e3..cdba38cde 100644
--- a/src/libcharon/plugins/eap_radius/Makefile.in
+++ b/src/libcharon/plugins/eap_radius/Makefile.in
@@ -1,7 +1,7 @@
-# Makefile.in generated by automake 1.14.1 from Makefile.am.
+# Makefile.in generated by automake 1.15 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+# Copyright (C) 1994-2014 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -15,7 +15,17 @@
@SET_MAKE@
VPATH = @srcdir@
-am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__is_gnu_make = { \
+ if test -z '$(MAKELEVEL)'; then \
+ false; \
+ elif test -n '$(MAKE_HOST)'; then \
+ true; \
+ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+ true; \
+ else \
+ false; \
+ fi; \
+}
am__make_running_with_option = \
case $${target_option-} in \
?) ;; \
@@ -79,8 +89,6 @@ POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = src/libcharon/plugins/eap_radius
-DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
- $(top_srcdir)/depcomp
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \
$(top_srcdir)/m4/config/ltoptions.m4 \
@@ -94,6 +102,7 @@ am__aclocal_m4_deps = $(top_srcdir)/m4/config/libtool.m4 \
$(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
mkinstalldirs = $(install_sh) -d
CONFIG_HEADER = $(top_builddir)/config.h
CONFIG_CLEAN_FILES =
@@ -205,12 +214,14 @@ am__define_uniq_tagged_files = \
done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/depcomp
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
ACLOCAL = @ACLOCAL@
ALLOCA = @ALLOCA@
AMTAR = @AMTAR@
AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
+ATOMICLIB = @ATOMICLIB@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
AUTOMAKE = @AUTOMAKE@
@@ -260,6 +271,7 @@ LIBTOOL = @LIBTOOL@
LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -294,6 +306,7 @@ PTHREADLIB = @PTHREADLIB@
PYTHON = @PYTHON@
PYTHONEGGINSTALLDIR = @PYTHONEGGINSTALLDIR@
PYTHON_EXEC_PREFIX = @PYTHON_EXEC_PREFIX@
+PYTHON_PACKAGE_VERSION = @PYTHON_PACKAGE_VERSION@
PYTHON_PLATFORM = @PYTHON_PLATFORM@
PYTHON_PREFIX = @PYTHON_PREFIX@
PYTHON_VERSION = @PYTHON_VERSION@
@@ -405,6 +418,7 @@ random_device = @random_device@
resolv_conf = @resolv_conf@
routing_table = @routing_table@
routing_table_prio = @routing_table_prio@
+runstatedir = @runstatedir@
s_plugins = @s_plugins@
sbindir = @sbindir@
scepclient_plugins = @scepclient_plugins@
@@ -470,7 +484,6 @@ $(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu src/libcharon/plugins/eap_radius/Makefile'; \
$(am__cd) $(top_srcdir) && \
$(AUTOMAKE) --gnu src/libcharon/plugins/eap_radius/Makefile
-.PRECIOUS: Makefile
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
@case '$?' in \
*config.status*) \
@@ -789,6 +802,8 @@ uninstall-am: uninstall-pluginLTLIBRARIES
mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
uninstall-am uninstall-pluginLTLIBRARIES
+.PRECIOUS: Makefile
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
diff --git a/src/libcharon/plugins/eap_radius/eap_radius.c b/src/libcharon/plugins/eap_radius/eap_radius.c
index 237f065fa..a2530e653 100644
--- a/src/libcharon/plugins/eap_radius/eap_radius.c
+++ b/src/libcharon/plugins/eap_radius/eap_radius.c
@@ -55,12 +55,12 @@ struct private_eap_radius_t {
/**
* EAP vendor, if any
*/
- u_int32_t vendor;
+ uint32_t vendor;
/**
* EAP message identifier
*/
- u_int8_t identifier;
+ uint8_t identifier;
/**
* RADIUS client instance
@@ -86,15 +86,15 @@ static void add_eap_identity(private_eap_radius_t *this,
{
struct {
/** EAP code (REQUEST/RESPONSE) */
- u_int8_t code;
+ uint8_t code;
/** unique message identifier */
- u_int8_t identifier;
+ uint8_t identifier;
/** length of whole message */
- u_int16_t length;
+ uint16_t length;
/** EAP type */
- u_int8_t type;
+ uint8_t type;
/** identity data */
- u_int8_t data[];
+ uint8_t data[];
} __attribute__((__packed__)) *hdr;
chunk_t id, prefix;
size_t len;
@@ -156,7 +156,7 @@ void eap_radius_build_attributes(radius_message_t *request)
ike_sa_t *ike_sa;
host_t *host;
char buf[40], *station_id_fmt;;
- u_int32_t value;
+ uint32_t value;
chunk_t chunk;
/* virtual NAS-Port-Type */
@@ -314,8 +314,8 @@ static void process_filter_id(radius_message_t *msg)
{
enumerator_t *enumerator;
int type;
- u_int8_t tunnel_tag;
- u_int32_t tunnel_type;
+ uint8_t tunnel_tag;
+ uint32_t tunnel_type;
chunk_t filter_id = chunk_empty, data;
bool is_esp_tunnel = FALSE;
@@ -395,7 +395,7 @@ static void process_timeout(radius_message_t *msg)
/**
* Add a Cisco Unity configuration attribute
*/
-static void add_unity_attribute(eap_radius_provider_t *provider, u_int32_t id,
+static void add_unity_attribute(eap_radius_provider_t *provider, uint32_t id,
int type, chunk_t data)
{
switch (type)
@@ -417,7 +417,7 @@ static void add_unity_attribute(eap_radius_provider_t *provider, u_int32_t id,
* Add a DNS/NBNS configuration attribute
*/
static void add_nameserver_attribute(eap_radius_provider_t *provider,
- u_int32_t id, int type, chunk_t data)
+ uint32_t id, int type, chunk_t data)
{
/* these are from different vendors, but there is currently no conflict */
switch (type)
@@ -444,7 +444,7 @@ static void add_nameserver_attribute(eap_radius_provider_t *provider,
* Add a UNITY_LOCAL_LAN or UNITY_SPLIT_INCLUDE attribute
*/
static void add_unity_split_attribute(eap_radius_provider_t *provider,
- u_int32_t id, configuration_attribute_type_t type,
+ uint32_t id, configuration_attribute_type_t type,
chunk_t data)
{
enumerator_t *enumerator;
@@ -701,7 +701,7 @@ METHOD(eap_method_t, process, status_t,
}
METHOD(eap_method_t, get_type, eap_type_t,
- private_eap_radius_t *this, u_int32_t *vendor)
+ private_eap_radius_t *this, uint32_t *vendor)
{
*vendor = this->vendor;
return this->type;
@@ -721,14 +721,14 @@ METHOD(eap_method_t, get_msk, status_t,
return FAILED;
}
-METHOD(eap_method_t, get_identifier, u_int8_t,
+METHOD(eap_method_t, get_identifier, uint8_t,
private_eap_radius_t *this)
{
return this->identifier;
}
METHOD(eap_method_t, set_identifier, void,
- private_eap_radius_t *this, u_int8_t identifier)
+ private_eap_radius_t *this, uint8_t identifier)
{
this->identifier = identifier;
}
diff --git a/src/libcharon/plugins/eap_radius/eap_radius_accounting.c b/src/libcharon/plugins/eap_radius/eap_radius_accounting.c
index 4b7260349..0c302af51 100644
--- a/src/libcharon/plugins/eap_radius/eap_radius_accounting.c
+++ b/src/libcharon/plugins/eap_radius/eap_radius_accounting.c
@@ -54,7 +54,7 @@ struct private_eap_radius_accounting_t {
/**
* Session ID prefix
*/
- u_int32_t prefix;
+ uint32_t prefix;
/**
* Format string we use for Called/Calling-Station-Id for a host
@@ -101,8 +101,8 @@ typedef enum {
*/
typedef struct {
struct {
- u_int64_t sent;
- u_int64_t received;
+ uint64_t sent;
+ uint64_t received;
} bytes, packets;
} usage_t;
@@ -133,7 +133,7 @@ static inline void sub_usage(usage_t *a, usage_t b)
*/
typedef struct {
/** unique CHILD_SA identifier */
- u_int32_t id;
+ uint32_t id;
/** usage stats for this SA */
usage_t usage;
} sa_entry_t;
@@ -172,7 +172,7 @@ typedef struct {
radius_acct_terminate_cause_t cause;
/* interim interval and timestamp of last update */
struct {
- u_int32_t interval;
+ uint32_t interval;
time_t last;
} interim;
/** did we send Accounting-Start */
@@ -237,7 +237,7 @@ static int sa_find(const void *a, const void *b)
/**
* Update or create usage counters of a cached SA
*/
-static void update_sa(entry_t *entry, u_int32_t id, usage_t usage)
+static void update_sa(entry_t *entry, uint32_t id, usage_t usage)
{
sa_entry_t *sa, lookup;
@@ -402,7 +402,7 @@ static void add_ike_sa_parameters(private_eap_radius_accounting_t *this,
host_t *vip, *host;
char buf[MAX_RADIUS_ATTRIBUTE_SIZE + 1];
chunk_t data;
- u_int32_t value;
+ uint32_t value;
/* virtual NAS-Port-Type */
value = htonl(5);
@@ -461,7 +461,7 @@ static void add_ike_sa_parameters(private_eap_radius_accounting_t *this,
* Get an existing or create a new entry from the locked session table
*/
static entry_t* get_or_create_entry(private_eap_radius_accounting_t *this,
- ike_sa_id_t *id, u_int32_t unique)
+ ike_sa_id_t *id, uint32_t unique)
{
entry_t *entry;
time_t now;
@@ -520,7 +520,7 @@ static job_requeue_t send_interim(interim_data_t *data)
enumerator_t *enumerator;
ike_sa_t *ike_sa;
entry_t *entry;
- u_int32_t value;
+ uint32_t value;
array_t *stats;
sa_entry_t *sa, *found;
@@ -681,7 +681,7 @@ static void send_start(private_eap_radius_accounting_t *this, ike_sa_t *ike_sa)
{
radius_message_t *message;
entry_t *entry;
- u_int32_t value;
+ uint32_t value;
if (this->acct_req_vip && !has_vip(ike_sa))
{
@@ -735,7 +735,7 @@ static void send_stop(private_eap_radius_accounting_t *this, ike_sa_t *ike_sa)
enumerator_t *enumerator;
entry_t *entry;
sa_entry_t *sa;
- u_int32_t value;
+ uint32_t value;
this->mutex->lock(this->mutex);
entry = this->sessions->remove(this->sessions, ike_sa->get_id(ike_sa));
@@ -931,7 +931,7 @@ METHOD(listener_t, child_rekey, bool,
METHOD(listener_t, children_migrate, bool,
private_eap_radius_accounting_t *this, ike_sa_t *ike_sa, ike_sa_id_t *new,
- u_int32_t unique)
+ uint32_t unique)
{
enumerator_t *enumerator;
sa_entry_t *sa, *sa_new, *cached;
@@ -1020,7 +1020,7 @@ eap_radius_accounting_t *eap_radius_accounting_create()
.destroy = _destroy,
},
/* use system time as Session ID prefix */
- .prefix = (u_int32_t)time(NULL),
+ .prefix = (uint32_t)time(NULL),
.sessions = hashtable_create((hashtable_hash_t)hash,
(hashtable_equals_t)equals, 32),
.mutex = mutex_create(MUTEX_TYPE_DEFAULT),
@@ -1050,7 +1050,7 @@ eap_radius_accounting_t *eap_radius_accounting_create()
/**
* See header
*/
-void eap_radius_accounting_start_interim(ike_sa_t *ike_sa, u_int32_t interval)
+void eap_radius_accounting_start_interim(ike_sa_t *ike_sa, uint32_t interval)
{
if (singleton)
{
diff --git a/src/libcharon/plugins/eap_radius/eap_radius_accounting.h b/src/libcharon/plugins/eap_radius/eap_radius_accounting.h
index 8d4f9a0e1..f7a19c9b5 100644
--- a/src/libcharon/plugins/eap_radius/eap_radius_accounting.h
+++ b/src/libcharon/plugins/eap_radius/eap_radius_accounting.h
@@ -52,6 +52,6 @@ eap_radius_accounting_t *eap_radius_accounting_create();
* @param ike_sa IKE_SA to send updates for
* @param interval interval for interim updates
*/
-void eap_radius_accounting_start_interim(ike_sa_t *ike_sa, u_int32_t interval);
+void eap_radius_accounting_start_interim(ike_sa_t *ike_sa, uint32_t interval);
#endif /** EAP_RADIUS_ACCOUNTING_H_ @}*/
diff --git a/src/libcharon/plugins/eap_radius/eap_radius_dae.c b/src/libcharon/plugins/eap_radius/eap_radius_dae.c
index a0bf99efd..fc9b39c3e 100644
--- a/src/libcharon/plugins/eap_radius/eap_radius_dae.c
+++ b/src/libcharon/plugins/eap_radius/eap_radius_dae.c
@@ -293,7 +293,7 @@ static void process_disconnect(private_eap_radius_dae_t *this,
* Apply a new lifetime to an IKE_SA
*/
static void apply_lifetime(private_eap_radius_dae_t *this, ike_sa_id_t *id,
- u_int32_t lifetime)
+ uint32_t lifetime)
{
ike_sa_t *ike_sa;
@@ -323,7 +323,7 @@ static void process_coa(private_eap_radius_dae_t *this,
ike_sa_id_t *id;
chunk_t data;
int type;
- u_int32_t lifetime = 0;
+ uint32_t lifetime = 0;
bool lifetime_seen = FALSE;
ids = get_matching_ike_sas(this, request, client);
diff --git a/src/libcharon/plugins/eap_radius/eap_radius_forward.c b/src/libcharon/plugins/eap_radius/eap_radius_forward.c
index 52ea84070..919e861be 100644
--- a/src/libcharon/plugins/eap_radius/eap_radius_forward.c
+++ b/src/libcharon/plugins/eap_radius/eap_radius_forward.c
@@ -63,9 +63,9 @@ struct private_eap_radius_forward_t {
*/
typedef struct {
/** vendor ID, 0 for standard attributes */
- u_int32_t vendor;
+ uint32_t vendor;
/** attribute type */
- u_int8_t type;
+ uint8_t type;
} attr_t;
/**
@@ -132,7 +132,7 @@ static bool is_attribute_selected(linked_list_t *selector,
radius_attribute_type_t type, chunk_t data)
{
enumerator_t *enumerator;
- u_int32_t vendor = 0;
+ uint32_t vendor = 0;
attr_t *sel;
bool found = FALSE;
diff --git a/src/libcharon/plugins/eap_radius/eap_radius_provider.c b/src/libcharon/plugins/eap_radius/eap_radius_provider.c
index 0f207fbe6..9a87ad38d 100644
--- a/src/libcharon/plugins/eap_radius/eap_radius_provider.c
+++ b/src/libcharon/plugins/eap_radius/eap_radius_provider.c
@@ -469,7 +469,7 @@ METHOD(attribute_provider_t, create_attribute_enumerator, enumerator_t*,
}
METHOD(eap_radius_provider_t, add_framed_ip, void,
- private_eap_radius_provider_t *this, u_int32_t id, host_t *ip)
+ private_eap_radius_provider_t *this, uint32_t id, host_t *ip)
{
this->listener.mutex->lock(this->listener.mutex);
add_addr(this, this->listener.unclaimed, id, ip);
@@ -477,7 +477,7 @@ METHOD(eap_radius_provider_t, add_framed_ip, void,
}
METHOD(eap_radius_provider_t, add_attribute, void,
- private_eap_radius_provider_t *this, u_int32_t id,
+ private_eap_radius_provider_t *this, uint32_t id,
configuration_attribute_type_t type, chunk_t data)
{
attr_t *attr;
diff --git a/src/libcharon/plugins/eap_radius/eap_radius_provider.h b/src/libcharon/plugins/eap_radius/eap_radius_provider.h
index 5a62f4a38..80971bddb 100644
--- a/src/libcharon/plugins/eap_radius/eap_radius_provider.h
+++ b/src/libcharon/plugins/eap_radius/eap_radius_provider.h
@@ -42,7 +42,7 @@ struct eap_radius_provider_t {
* @param id IKE_SA unique identifier
* @param ip IP address received from RADIUS server, gets owned
*/
- void (*add_framed_ip)(eap_radius_provider_t *this, u_int32_t id,
+ void (*add_framed_ip)(eap_radius_provider_t *this, uint32_t id,
host_t *ip);
/**
@@ -52,7 +52,7 @@ struct eap_radius_provider_t {
* @param type attribute type
* @param data attribute data
*/
- void (*add_attribute)(eap_radius_provider_t *this, u_int32_t id,
+ void (*add_attribute)(eap_radius_provider_t *this, uint32_t id,
configuration_attribute_type_t type, chunk_t data);
/**