EAP peer method: EAP-FAST PAC file processing.
More...
#include "eap_common/eap_fast_common.h"
Go to the source code of this file.
Data Structures |
| struct | eap_fast_pac |
Functions |
| void | eap_fast_free_pac (struct eap_fast_pac *pac) |
| | Free PAC data.
|
| struct eap_fast_pac * | eap_fast_get_pac (struct eap_fast_pac *pac_root, const u8 *a_id, size_t a_id_len, u16 pac_type) |
| | Get a PAC entry based on A-ID.
|
| int | eap_fast_add_pac (struct eap_fast_pac **pac_root, struct eap_fast_pac **pac_current, struct eap_fast_pac *entry) |
| | Add a copy of a PAC entry to a list.
|
| int | eap_fast_load_pac (struct eap_sm *sm, struct eap_fast_pac **pac_root, const char *pac_file) |
| | Load PAC entries (text format)
|
| int | eap_fast_save_pac (struct eap_sm *sm, struct eap_fast_pac *pac_root, const char *pac_file) |
| | Save PAC entries (text format)
|
| size_t | eap_fast_pac_list_truncate (struct eap_fast_pac *pac_root, size_t max_len) |
| | Truncate a PAC list to the given length.
|
| int | eap_fast_load_pac_bin (struct eap_sm *sm, struct eap_fast_pac **pac_root, const char *pac_file) |
| | Load PAC entries (binary format)
|
| int | eap_fast_save_pac_bin (struct eap_sm *sm, struct eap_fast_pac *pac_root, const char *pac_file) |
| | Save PAC entries (binary format)
|
Detailed Description
EAP peer method: EAP-FAST PAC file processing.
- Copyright
- Copyright (c) 2004-2007, Jouni Malinen <j@w1.fi>
This software may be distributed under the terms of the BSD license. See README for more details.
Function Documentation
Add a copy of a PAC entry to a list.
- Parameters:
-
| pac_root | Pointer to PAC list root pointer |
| pac_current | Pointer to the current PAC pointer |
| entry | New entry to clone and add to the list |
- Returns:
- 0 on success, -1 on failure
This function makes a clone of the given PAC entry and adds this copied entry to the list (pac_root). If an old entry for the same A-ID is found, it will be removed from the PAC list and in this case, pac_current entry is set to NULL if it was the removed entry.
Free PAC data.
- Parameters:
-
| pac | Pointer to the PAC entry |
Note that the PAC entry must not be in a list since this function does not remove the list links.
| struct eap_fast_pac* eap_fast_get_pac |
( |
struct eap_fast_pac * |
pac_root, |
|
|
const u8 * |
a_id, |
|
|
size_t |
a_id_len, |
|
|
u16 |
pac_type |
|
) |
| [read] |
Get a PAC entry based on A-ID.
- Parameters:
-
| pac_root | Pointer to root of the PAC list |
| a_id | A-ID to search for |
| a_id_len | Length of A-ID |
| pac_type | PAC-Type to search for |
- Returns:
- Pointer to the PAC entry, or NULL if A-ID not found
| int eap_fast_load_pac |
( |
struct eap_sm * |
sm, |
|
|
struct eap_fast_pac ** |
pac_root, |
|
|
const char * |
pac_file |
|
) |
| |
Load PAC entries (text format)
- Parameters:
-
| sm | Pointer to EAP state machine allocated with eap_peer_sm_init() |
| pac_root | Pointer to root of the PAC list (to be filled) |
| pac_file | Name of the PAC file/blob to load |
- Returns:
- 0 on success, -1 on failure
| int eap_fast_load_pac_bin |
( |
struct eap_sm * |
sm, |
|
|
struct eap_fast_pac ** |
pac_root, |
|
|
const char * |
pac_file |
|
) |
| |
Load PAC entries (binary format)
- Parameters:
-
| sm | Pointer to EAP state machine allocated with eap_peer_sm_init() |
| pac_root | Pointer to root of the PAC list (to be filled) |
| pac_file | Name of the PAC file/blob to load |
- Returns:
- 0 on success, -1 on failure
| size_t eap_fast_pac_list_truncate |
( |
struct eap_fast_pac * |
pac_root, |
|
|
size_t |
max_len |
|
) |
| |
Truncate a PAC list to the given length.
- Parameters:
-
| pac_root | Root of the PAC list |
| max_len | Maximum length of the list (>= 1) |
- Returns:
- Number of PAC entries removed
| int eap_fast_save_pac |
( |
struct eap_sm * |
sm, |
|
|
struct eap_fast_pac * |
pac_root, |
|
|
const char * |
pac_file |
|
) |
| |
Save PAC entries (text format)
- Parameters:
-
| sm | Pointer to EAP state machine allocated with eap_peer_sm_init() |
| pac_root | Root of the PAC list |
| pac_file | Name of the PAC file/blob |
- Returns:
- 0 on success, -1 on failure
| int eap_fast_save_pac_bin |
( |
struct eap_sm * |
sm, |
|
|
struct eap_fast_pac * |
pac_root, |
|
|
const char * |
pac_file |
|
) |
| |
Save PAC entries (binary format)
- Parameters:
-
| sm | Pointer to EAP state machine allocated with eap_peer_sm_init() |
| pac_root | Root of the PAC list |
| pac_file | Name of the PAC file/blob |
- Returns:
- 0 on success, -1 on failure