diff options
author | Martin Willi <martin@revosec.ch> | 2011-12-08 16:42:11 +0100 |
---|---|---|
committer | Martin Willi <martin@revosec.ch> | 2012-03-20 17:31:15 +0100 |
commit | 1fe6cdfac2631434464a2a550414f45b60558369 (patch) | |
tree | 2a75220c67aed067682c5364be5969a274b1294b /src/libstrongswan/xauth/xauth.c | |
parent | 4e73f85b818c3abf48f5c5ae3db98cc6be7dd34f (diff) | |
download | strongswan-1fe6cdfac2631434464a2a550414f45b60558369.tar.bz2 strongswan-1fe6cdfac2631434464a2a550414f45b60558369.tar.xz |
Use a string to identify xauth backends, no need for integer types
Diffstat (limited to 'src/libstrongswan/xauth/xauth.c')
-rw-r--r-- | src/libstrongswan/xauth/xauth.c | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/src/libstrongswan/xauth/xauth.c b/src/libstrongswan/xauth/xauth.c deleted file mode 100644 index b2caf374a..000000000 --- a/src/libstrongswan/xauth/xauth.c +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (C) 2006 Martin Willi - * 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 - * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY - * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - * for more details. - */ - -#include "xauth.h" - -ENUM_BEGIN(xauth_method_type_names, XAUTH_RADIUS, XAUTH_NULL, - "XAUTH_RADIUS", - "XAUTH_NULL"); -ENUM_END(xauth_method_type_names, XAUTH_NULL); - -ENUM_BEGIN(xauth_method_type_short_names, XAUTH_RADIUS, XAUTH_NULL, - "RAD", - "NULL"); -ENUM_END(xauth_method_type_short_names, XAUTH_NULL); - -/* - * See header - */ -xauth_type_t xauth_type_from_string(char *name) -{ - int i; - static struct { - char *name; - xauth_type_t type; - } types[] = { - {"radius", XAUTH_RADIUS}, - {"null", XAUTH_NULL}, - }; - - for (i = 0; i < countof(types); i++) - { - if (strcaseeq(name, types[i].name)) - { - return types[i].type; - } - } - return 0; -} |