b9f5d097bb73e8452c96529ec4531c86fe9be22c
[strongswan.git] / src / libcharon / plugins / tnc_pdp / tnc_pdp_connections.h
1 /*
2 * Copyright (C) 2012 Andreas Steffen
3 * HSR Hochschule fuer Technik Rapperswil
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 tnc_pdp_connections tnc_pdp_connections
18 * @{ @ingroup tnc_pdp
19 */
20
21 #ifndef TNC_PDP_CONNECTIONS_H_
22 #define TNC_PDP_CONNECTIONS_H_
23
24 typedef struct tnc_pdp_connections_t tnc_pdp_connections_t;
25
26 #include <library.h>
27 #include <sa/ike_sa.h>
28 #include <sa/authenticators/eap/eap_method.h>
29
30 /**
31 * Public interface of a tnc_pdp_connections object
32 */
33 struct tnc_pdp_connections_t {
34
35 /**
36 * Register a new TNC PEP RADIUS Connection
37 *
38 * @param nas_id NAS identifier of Policy Enforcement Point
39 * @param user_name User name of TNC Client
40 * @param peer Peer identity
41 * @param method EAP method state for this TNC PEP Connection
42 */
43 void (*add)(tnc_pdp_connections_t *this, chunk_t nas_id, chunk_t user_name,
44 identification_t *peer, eap_method_t *method);
45
46 /**
47 * Remove a TNC PEP RADIUS Connection
48 *
49 * @param nas_id NAS identifier of Policy Enforcement Point
50 * @param user_name User name of TNC Client
51 */
52 void (*remove)(tnc_pdp_connections_t *this, chunk_t nas_id,
53 chunk_t user_name);
54
55 /**
56 * Get the EAP method and IKE_SA of a registered TNC PEP RADIUS Connection
57 *
58 * @param nas_id NAS identifier of Policy Enforcement Point
59 * @param user_name User name of TNC Client
60 * @param ike_sa IKE_SA used for bus communication only
61 * @return EAP method for this connection or NULL if not found
62 */
63 eap_method_t* (*get_state)(tnc_pdp_connections_t *this, chunk_t nas_id,
64 chunk_t user_name, ike_sa_t **ike_sa);
65
66 /**
67 * Destroys a tnc_pdp_connections_t object.
68 */
69 void (*destroy)(tnc_pdp_connections_t *this);
70 };
71
72 /**
73 * Create a tnc_pdp_connections_t instance
74 */
75 tnc_pdp_connections_t* tnc_pdp_connections_create(void);
76
77 #endif /** TNC_PDP_CONNECTIONS_PLUGIN_H_ @}*/