5f3adfe62e3ccfb6fcc7418521838e767fdd5e60
[strongswan.git] / src / charon / plugins / eap_sim_file / eap_sim_file_triplets.h
1 /*
2 * Copyright (C) 2008 Martin Willi
3 * 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 * $Id$
16 */
17
18 /**
19 * @defgroup eap_sim_file_triplets eap_sim_file_triplets
20 * @{ @ingroup eap_sim_file
21 */
22
23 #ifndef EAP_SIM_FILE_TRIPLETS_H_
24 #define EAP_SIM_FILE_TRIPLETS_H_
25
26 #include <utils/enumerator.h>
27 #include <utils/identification.h>
28
29 /**
30 * size of RAND value
31 */
32 #define RAND_LEN 16
33
34 /**
35 * size of SRES value
36 */
37 #define SRES_LEN 4
38
39 /**
40 * size of KC value
41 */
42 #define KC_LEN 8
43
44 typedef struct eap_sim_file_triplets_t eap_sim_file_triplets_t;
45
46 /**
47 * Reads triplets from a triplets.dat file.
48 *
49 * The file is in freeradius triplet file syntax:
50 * http://www.freeradius.org/radiusd/doc/rlm_sim_triplets
51 */
52 struct eap_sim_file_triplets_t {
53
54 /**
55 * Create an enumerator over the file's triplets.
56 *
57 * @return enumerator over (identity, rand, sres, kc)
58 */
59 enumerator_t* (*create_enumerator)(eap_sim_file_triplets_t *this);
60
61 /**
62 * Destroy a eap_sim_file_triplets_t.
63 */
64 void (*destroy)(eap_sim_file_triplets_t *this);
65 };
66
67 /**
68 * Create a eap_sim_file_triplets instance.
69 *
70 * @param file triplet file to read from
71 */
72 eap_sim_file_triplets_t *eap_sim_file_triplets_create(char *file);
73
74 #endif /* EAP_SIM_FILE_TRIPLETS_ @}*/