automake build system
[mech_eap.orig] / src / eap_peer / eap_fast_pac.h
1 /*
2  * EAP peer method: EAP-FAST PAC file processing
3  * Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License version 2 as
7  * published by the Free Software Foundation.
8  *
9  * Alternatively, this software may be distributed under the terms of BSD
10  * license.
11  *
12  * See README and COPYING for more details.
13  */
14
15 #ifndef EAP_FAST_PAC_H
16 #define EAP_FAST_PAC_H
17
18 #include "eap_common/eap_fast_common.h"
19
20 struct eap_fast_pac {
21         struct eap_fast_pac *next;
22
23         u8 pac_key[EAP_FAST_PAC_KEY_LEN];
24         u8 *pac_opaque;
25         size_t pac_opaque_len;
26         u8 *pac_info;
27         size_t pac_info_len;
28         u8 *a_id;
29         size_t a_id_len;
30         u8 *i_id;
31         size_t i_id_len;
32         u8 *a_id_info;
33         size_t a_id_info_len;
34         u16 pac_type;
35 };
36
37
38 void eap_fast_free_pac(struct eap_fast_pac *pac);
39 struct eap_fast_pac * eap_fast_get_pac(struct eap_fast_pac *pac_root,
40                                        const u8 *a_id, size_t a_id_len,
41                                        u16 pac_type);
42 int eap_fast_add_pac(struct eap_fast_pac **pac_root,
43                      struct eap_fast_pac **pac_current,
44                      struct eap_fast_pac *entry);
45 int eap_fast_load_pac(struct eap_sm *sm, struct eap_fast_pac **pac_root,
46                       const char *pac_file);
47 int eap_fast_save_pac(struct eap_sm *sm, struct eap_fast_pac *pac_root,
48                       const char *pac_file);
49 size_t eap_fast_pac_list_truncate(struct eap_fast_pac *pac_root,
50                                   size_t max_len);
51 int eap_fast_load_pac_bin(struct eap_sm *sm, struct eap_fast_pac **pac_root,
52                           const char *pac_file);
53 int eap_fast_save_pac_bin(struct eap_sm *sm, struct eap_fast_pac *pac_root,
54                           const char *pac_file);
55
56 #endif /* EAP_FAST_PAC_H */