diff options
author | Tobias Brunner <tobias@strongswan.org> | 2015-06-25 17:41:09 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2015-08-17 11:28:08 +0200 |
commit | d6f70ff68929e3b50a25fd2e11aa263beb5312e7 (patch) | |
tree | f993d8b783a21d74c5b6b71aab7e1391df2005c1 /src/libstrongswan/plugins/plugin_feature.c | |
parent | 39afe6e9d0336cd2212a287b51ff7c788d5a5a64 (diff) | |
download | strongswan-d6f70ff68929e3b50a25fd2e11aa263beb5312e7.tar.bz2 strongswan-d6f70ff68929e3b50a25fd2e11aa263beb5312e7.tar.xz |
plugin-feature: Add vendor specific EAP method registration macros
Vendor specific EAP methods may be registered with:
PLUGIN_CALLBACK(eap_method_register, <constructor>),
PLUGIN_PROVIDE(EAP_SERVER_VENDOR, <type>, <vendor>),
Same for client implementations via EAP_PEER_VENDOR.
References #969.
Diffstat (limited to 'src/libstrongswan/plugins/plugin_feature.c')
-rw-r--r-- | src/libstrongswan/plugins/plugin_feature.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/libstrongswan/plugins/plugin_feature.c b/src/libstrongswan/plugins/plugin_feature.c index e909f4adf..0ea5eeaf8 100644 --- a/src/libstrongswan/plugins/plugin_feature.c +++ b/src/libstrongswan/plugins/plugin_feature.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012-2013 Tobias Brunner + * Copyright (C) 2012-2015 Tobias Brunner * Hochschule fuer Technik Rapperswil * * Copyright (C) 2011 Martin Willi @@ -185,7 +185,8 @@ bool plugin_feature_matches(plugin_feature_t *a, plugin_feature_t *b) return a->arg.container == b->arg.container; case FEATURE_EAP_SERVER: case FEATURE_EAP_PEER: - return a->arg.eap == b->arg.eap; + return a->arg.eap.vendor == b->arg.eap.vendor && + a->arg.eap.type == b->arg.eap.type; case FEATURE_DATABASE: return a->arg.database == DB_ANY || a->arg.database == b->arg.database; @@ -368,8 +369,15 @@ char* plugin_feature_get_string(plugin_feature_t *feature) break; case FEATURE_EAP_SERVER: case FEATURE_EAP_PEER: - if (asprintf(&str, "%N:%N", plugin_feature_names, feature->type, - eap_type_short_names, feature->arg.eap) > 0) + if (feature->arg.eap.vendor && + asprintf(&str, "%N:%d-%d", plugin_feature_names, feature->type, + feature->arg.eap.type, feature->arg.eap.vendor) > 0) + { + return str; + } + else if (!feature->arg.eap.vendor && + asprintf(&str, "%N:%N", plugin_feature_names, feature->type, + eap_type_short_names, feature->arg.eap.type) > 0) { return str; } |