swanctl: list EAP type in --list-conns
This commit is contained in:
@@ -2,6 +2,9 @@
|
|||||||
* Copyright (C) 2014 Martin Willi
|
* Copyright (C) 2014 Martin Willi
|
||||||
* Copyright (C) 2014 revosec AG
|
* 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
|
* 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
|
* 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
|
* 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"))
|
if (strpfx(name, "local") || strpfx(name, "remote"))
|
||||||
{
|
{
|
||||||
hashtable_t *auth;
|
hashtable_t *auth;
|
||||||
|
char *class;
|
||||||
|
|
||||||
auth = hashtable_create(hashtable_hash_str, hashtable_equals_str, 1);
|
auth = hashtable_create(hashtable_hash_str, hashtable_equals_str, 1);
|
||||||
ret = vici_parse_cb(res, NULL, values, list, auth);
|
ret = vici_parse_cb(res, NULL, values, list, auth);
|
||||||
if (ret == 0)
|
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",
|
printf(" %s %s authentication:\n",
|
||||||
strpfx(name, "local") ? "local" : "remote",
|
strpfx(name, "local") ? "local" : "remote", class);
|
||||||
auth->get(auth, "class") ?: "unspecified");
|
|
||||||
if (auth->get(auth, "id"))
|
|
||||||
{
|
{
|
||||||
printf(" id: %s\n", auth->get(auth, "id"));
|
printf(" id: %s\n", auth->get(auth, "id"));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user