Moved generic RADIUS protocol support to a dedicated libradius
[strongswan.git] / src / pluto / ike_alg.h
1 /* IKE modular algorithm handling interface
2 * Author: JuanJo Ciarlante <jjo-ipsec@mendoza.gov.ar>
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 */
14
15 #ifndef _IKE_ALG_H
16 #define _IKE_ALG_H
17
18 #include <freeswan.h>
19
20 #include "connections.h"
21
22 struct ike_alg {
23 u_int16_t algo_type;
24 u_int16_t algo_id;
25 const char *plugin_name;
26 struct ike_alg *algo_next;
27 };
28
29 struct encrypt_desc {
30 u_int16_t algo_type;
31 u_int16_t algo_id;
32 const char *plugin_name;
33 struct ike_alg *algo_next;
34
35 size_t enc_blocksize;
36 u_int keydeflen;
37 u_int keymaxlen;
38 u_int keyminlen;
39 };
40
41 struct hash_desc {
42 u_int16_t algo_type;
43 u_int16_t algo_id;
44 const char *plugin_name;
45 struct ike_alg *algo_next;
46
47 size_t hash_digest_size;
48 };
49
50 struct dh_desc {
51 u_int16_t algo_type;
52 u_int16_t algo_id;
53 const char *plugin_name;
54 struct ike_alg *algo_next;
55
56 size_t ke_size;
57 };
58
59 #define IKE_ALG_ENCRYPT 0
60 #define IKE_ALG_HASH 1
61 #define IKE_ALG_DH_GROUP 2
62 #define IKE_ALG_MAX IKE_ALG_DH_GROUP
63
64 extern int ike_alg_add(struct ike_alg *a, const char *plugin_name);
65 extern struct hash_desc *ike_alg_get_hasher(u_int alg);
66 extern struct encrypt_desc *ike_alg_get_crypter(u_int alg);
67 extern struct dh_desc *ike_alg_get_dh_group(u_int alg);
68 extern const struct dh_desc* ike_alg_pfsgroup(struct connection *c, lset_t policy);
69 extern struct db_context * ike_alg_db_new(struct connection *c, lset_t policy);
70 extern void ike_alg_list(void);
71 extern void ike_alg_show_connection(struct connection *c, const char *instance);
72 extern bool ike_alg_ok_final(u_int ealg, u_int key_len, u_int aalg, u_int group
73 , struct alg_info_ike *alg_info_ike);
74 extern int ike_alg_init(void);
75
76 #endif /* _IKE_ALG_H */