IKEv1 XAuth: Add XAuth defines for plugin types.
This commit is contained in:
@@ -70,7 +70,8 @@ utils/linked_list.c utils/linked_list.h \
|
|||||||
utils/hashtable.c utils/hashtable.h \
|
utils/hashtable.c utils/hashtable.h \
|
||||||
utils/enumerator.c utils/enumerator.h \
|
utils/enumerator.c utils/enumerator.h \
|
||||||
utils/optionsfrom.c utils/optionsfrom.h \
|
utils/optionsfrom.c utils/optionsfrom.h \
|
||||||
utils/backtrace.c utils/backtrace.h
|
utils/backtrace.c utils/backtrace.h \
|
||||||
|
xauth/xauth.h xauth/xauth.c
|
||||||
|
|
||||||
|
|
||||||
library.lo : $(top_builddir)/config.status
|
library.lo : $(top_builddir)/config.status
|
||||||
|
|||||||
@@ -0,0 +1,47 @@
|
|||||||
|
/*
|
||||||
|
* 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_RADIUS,
|
||||||
|
"XAUTH_RADIUS");
|
||||||
|
ENUM_END(xauth_method_type_names, XAUTH_RADIUS);
|
||||||
|
|
||||||
|
ENUM_BEGIN(xauth_method_type_short_names, XAUTH_RADIUS, XAUTH_RADIUS,
|
||||||
|
"RAD");
|
||||||
|
ENUM_END(xauth_method_type_short_names, XAUTH_RADIUS);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* 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},
|
||||||
|
};
|
||||||
|
|
||||||
|
for (i = 0; i < countof(types); i++)
|
||||||
|
{
|
||||||
|
if (strcaseeq(name, types[i].name))
|
||||||
|
{
|
||||||
|
return types[i].type;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
/*
|
||||||
|
* Copyright (C) 2010 Martin Willi
|
||||||
|
* Copyright (C) 2010 revosec AG
|
||||||
|
*
|
||||||
|
* 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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @defgroup xauth xauth
|
||||||
|
* @{ @ingroup libstrongswan
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifndef XAUTH_H_
|
||||||
|
#define XAUTH_H_
|
||||||
|
|
||||||
|
typedef enum xauth_type_t xauth_type_t;
|
||||||
|
|
||||||
|
#include <library.h>
|
||||||
|
|
||||||
|
/**
|
||||||
|
* XAuth types, defines the XAuth method implementation
|
||||||
|
*/
|
||||||
|
enum xauth_type_t {
|
||||||
|
XAUTH_RADIUS = 253,
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* enum names for xauth_type_t.
|
||||||
|
*/
|
||||||
|
extern enum_name_t *xauth_method_type_names;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* short string enum names for xauth_type_t.
|
||||||
|
*/
|
||||||
|
extern enum_name_t *xauth_method_type_short_names;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Lookup the XAuth method type from a string.
|
||||||
|
*
|
||||||
|
* @param name XAuth method name (such as "md5", "aka")
|
||||||
|
* @return method type, 0 if unknown
|
||||||
|
*/
|
||||||
|
xauth_type_t xauth_type_from_string(char *name);
|
||||||
|
|
||||||
|
#endif /** XAUTH_H_ @}*/
|
||||||
Reference in New Issue
Block a user