task-manager-v1: Clear retransmit alert on request retransmit
[strongswan.git] / src / libcharon / sa / xauth / xauth_manager.h
1 /*
2 * Copyright (C) 2011 Martin Willi
3 * Copyright (C) 2011 revosec AG
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
9 *
10 * This program is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
12 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13 * for more details.
14 */
15
16 /**
17 * @defgroup xauth_manager xauth_manager
18 * @{ @ingroup xauth
19 */
20
21 #ifndef XAUTH_MANAGER_H_
22 #define XAUTH_MANAGER_H_
23
24 #include <sa/xauth/xauth_method.h>
25
26 typedef struct xauth_manager_t xauth_manager_t;
27
28 /**
29 * The XAuth manager manages all XAuth implementations and creates instances.
30 *
31 * A plugin registers it's implemented XAuth method at the manager by
32 * providing type and a constructor function. The manager then instantiates
33 * xauth_method_t instances through the provided constructor to handle
34 * XAuth authentication.
35 */
36 struct xauth_manager_t {
37
38 /**
39 * Register a XAuth method implementation.
40 *
41 * @param name backend name to register
42 * @param role XAUTH_SERVER or XAUTH_PEER
43 * @param constructor constructor function, returns an xauth_method_t
44 */
45 void (*add_method)(xauth_manager_t *this, char *name,
46 xauth_role_t role, xauth_constructor_t constructor);
47
48 /**
49 * Unregister a XAuth method implementation using it's constructor.
50 *
51 * @param constructor constructor function, as added in add_method
52 */
53 void (*remove_method)(xauth_manager_t *this, xauth_constructor_t constructor);
54
55 /**
56 * Create a new XAuth method instance.
57 *
58 * The name may contain an option string, separated by a colon. This option
59 * string gets passed to the XAuth constructor to specify the behavior
60 * of the XAuth method.
61 *
62 * @param name backend name, with optional config string
63 * @param role XAUTH_SERVER or XAUTH_PEER
64 * @param server identity of the server
65 * @param peer identity of the peer (client)
66 * @return XAUTH method instance, NULL if no constructor found
67 */
68 xauth_method_t* (*create_instance)(xauth_manager_t *this,
69 char *name, xauth_role_t role,
70 identification_t *server, identification_t *peer);
71
72 /**
73 * Destroy a eap_manager instance.
74 */
75 void (*destroy)(xauth_manager_t *this);
76 };
77
78 /**
79 * Create a eap_manager instance.
80 */
81 xauth_manager_t *xauth_manager_create();
82
83 #endif /** XAUTH_MANAGER_H_ @}*/