From: Andreas Steffen Date: Tue, 26 Apr 2016 15:13:20 +0000 (+0200) Subject: swanctl: list EAP type in --list-conns X-Git-Tag: 5.4.1dr2~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=afcd46619234b63af2857d7bab70102b689d50a8;p=thirdparty%2Fstrongswan.git swanctl: list EAP type in --list-conns --- diff --git a/src/swanctl/commands/list_conns.c b/src/swanctl/commands/list_conns.c index 22a5633d5b..b73a9f7e71 100644 --- a/src/swanctl/commands/list_conns.c +++ b/src/swanctl/commands/list_conns.c @@ -2,6 +2,9 @@ * Copyright (C) 2014 Martin Willi * Copyright (C) 2014 revosec AG * + * Copyright (C) 2016 Andreas Steffen + * HSR Hochschule fuer Technik Rapperswil + * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your @@ -119,15 +122,19 @@ CALLBACK(conn_sn, int, if (strpfx(name, "local") || strpfx(name, "remote")) { hashtable_t *auth; + char *class; auth = hashtable_create(hashtable_hash_str, hashtable_equals_str, 1); ret = vici_parse_cb(res, NULL, values, list, auth); if (ret == 0) { + class = auth->get(auth, "class") ?: "unspecified"; + if (strcaseeq(class, "EAP")) + { + class = auth->get(auth, "eap-type") ?: class; + } printf(" %s %s authentication:\n", - strpfx(name, "local") ? "local" : "remote", - auth->get(auth, "class") ?: "unspecified"); - if (auth->get(auth, "id")) + strpfx(name, "local") ? "local" : "remote", class); { printf(" id: %s\n", auth->get(auth, "id")); }