eap_i.h File Reference

hostapd / EAP Authenticator state machine internal structures (RFC 4137) More...

#include "eap.h"

Include dependency graph for eap_i.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define EAP_SERVER_METHOD_INTERFACE_VERSION   1

Functions

int eap_user_get (struct eap_sm *sm, const u8 *identity, size_t identity_len, int phase2)
 Fetch user information from the database.
void eap_sm_process_nak (struct eap_sm *sm, u8 *nak_list, size_t len)
 Process EAP-Response/Nak.
const u8 * eap_hdr_validate (int vendor, EapType eap_type, const u8 *msg, size_t msglen, size_t *plen)
 Validate EAP header.
eap_hdr * eap_msg_alloc (int vendor, EapType type, size_t *len, size_t payload_len, u8 code, u8 identifier, u8 **payload)
 Allocate a buffer for an EAP message.


Detailed Description

hostapd / EAP Authenticator state machine internal structures (RFC 4137)

Copyright
Copyright (c) 2004-2005, Jouni Malinen <[email protected]>
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation.

Alternatively, this software may be distributed under the terms of BSD license.

See README and COPYING for more details.

Definition in file eap_i.h.


Function Documentation

const u8* eap_hdr_validate int  vendor,
EapType  eap_type,
const u8 *  msg,
size_t  msglen,
size_t *  plen
 

Validate EAP header.

Parameters:
vendor Expected EAP Vendor-Id (0 = IETF)
eap_type Expected EAP type number
msg EAP frame (starting with EAP header)
msglen Length of msg
plen Pointer to variable to contain the returned payload length
Returns:
Pointer to EAP payload (after type field), or NULL on failure
This is a helper function for EAP method implementations. This is usually called in the beginning of struct eap_method::process() function to verify that the received EAP request packet has a valid header. This function is able to process both legacy and expanded EAP headers and in most cases, the caller can just use the returned payload pointer (into *plen) for processing the payload regardless of whether the packet used the expanded EAP header or not.

Definition at line 1048 of file eap.c.

Here is the call graph for this function:

struct eap_hdr* eap_msg_alloc int  vendor,
EapType  type,
size_t *  len,
size_t  payload_len,
u8  code,
u8  identifier,
u8 **  payload
 

Allocate a buffer for an EAP message.

Parameters:
vendor Vendor-Id (0 = IETF)
type EAP type
len Buffer for returning message length
payload_len Payload length in bytes (data after Type)
code Message Code (EAP_CODE_*)
identifier Identifier
payload Pointer to payload pointer that will be set to point to the beginning of the payload or NULL if payload pointer is not needed
Returns:
Pointer to the allocated message buffer or NULL on error
This function can be used to allocate a buffer for an EAP message and fill in the EAP header. This function is automatically using expanded EAP header if the selected Vendor-Id is not IETF. In other words, most EAP methods do not need to separately select which header type to use when using this function to allocate the message buffers.

Definition at line 1121 of file eap.c.

void eap_sm_process_nak struct eap_sm sm,
u8 *  nak_list,
size_t  len
 

Process EAP-Response/Nak.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
nak_list Nak list (allowed methods) from the supplicant
len Length of nak_list in bytes
This function is called when EAP-Response/Nak is received from the supplicant. This can happen for both phase 1 and phase 2 authentications.

Definition at line 714 of file eap.c.

Here is the call graph for this function:

int eap_user_get struct eap_sm sm,
const u8 *  identity,
size_t  identity_len,
int  phase2
 

Fetch user information from the database.

Parameters:
sm Pointer to EAP state machine allocated with eap_sm_init()
identity Identity (User-Name) of the user
identity_len Length of identity in bytes
phase2 0 = EAP phase1 user, 1 = EAP phase2 (tunneled) user
Returns:
0 on success, or -1 on failure
This function is used to fetch user information for EAP. The user will be selected based on the specified identity. sm->user and sm->user_eap_method_index are updated for the new user when a matching user is found. sm->user can be used to get user information (e.g., password).

Definition at line 91 of file eap.c.


Generated on Sun Dec 31 13:44:16 2006 for hostapd by  doxygen 1.4.2