swanctl: list EAP type in --list-conns

This commit is contained in:
Andreas Steffen 2016-04-26 17:13:20 +02:00
parent b85422b90c
commit afcd466192
1 changed files with 10 additions and 3 deletions

View File

@ -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"));
}