merged the modularization branch (credentials) back to trunk
This commit is contained in:
@@ -1,10 +1,3 @@
|
||||
/**
|
||||
* @file eap_payload.h
|
||||
*
|
||||
* @brief Interface of eap_payload_t.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2005-2006 Martin Willi
|
||||
* Copyright (C) 2005 Jan Hutter
|
||||
@@ -19,6 +12,13 @@
|
||||
* WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
|
||||
* or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
* for more details.
|
||||
*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup eap_payload eap_payload
|
||||
* @{ @ingroup payloads
|
||||
*/
|
||||
|
||||
#ifndef EAP_PAYLOAD_H_
|
||||
@@ -32,20 +32,13 @@ typedef struct eap_payload_t eap_payload_t;
|
||||
|
||||
/**
|
||||
* Length of a EAP payload without the EAP Message in bytes.
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
#define EAP_PAYLOAD_HEADER_LENGTH 4
|
||||
|
||||
/**
|
||||
* @brief Class representing an IKEv2 EAP payload.
|
||||
* Class representing an IKEv2 EAP payload.
|
||||
*
|
||||
* The EAP payload format is described in RFC section 3.16.
|
||||
*
|
||||
* @b Constructors:
|
||||
* - eap_payload_create()
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
struct eap_payload_t {
|
||||
|
||||
@@ -55,79 +48,68 @@ struct eap_payload_t {
|
||||
payload_t payload_interface;
|
||||
|
||||
/**
|
||||
* @brief Set the contained EAP data.
|
||||
* Set the contained EAP data.
|
||||
*
|
||||
* This contains the FULL EAP message starting with "code".
|
||||
* Chunk gets cloned.
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @param message EAP data
|
||||
*/
|
||||
void (*set_data) (eap_payload_t *this, chunk_t data);
|
||||
|
||||
/**
|
||||
* @brief Get the contained EAP data.
|
||||
* Get the contained EAP data.
|
||||
*
|
||||
* This contains the FULL EAP message starting with "code".
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @return EAP data (pointer to internal data)
|
||||
*/
|
||||
chunk_t (*get_data) (eap_payload_t *this);
|
||||
|
||||
/**
|
||||
* @brief Get the EAP code.
|
||||
* Get the EAP code.
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @return EAP message as chunk_t
|
||||
*/
|
||||
eap_code_t (*get_code) (eap_payload_t *this);
|
||||
|
||||
/**
|
||||
* @brief Get the EAP identifier.
|
||||
* Get the EAP identifier.
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @return unique identifier
|
||||
*/
|
||||
u_int8_t (*get_identifier) (eap_payload_t *this);
|
||||
|
||||
/**
|
||||
* @brief Get the EAP method type.
|
||||
* Get the EAP method type.
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @param vendor pointer receiving vendor identifier
|
||||
* @return EAP method type, vendor specific if vendor != 0
|
||||
*/
|
||||
eap_type_t (*get_type) (eap_payload_t *this, u_int32_t *vendor);
|
||||
|
||||
/**
|
||||
* @brief Destroys an eap_payload_t object.
|
||||
*
|
||||
* @param this eap_payload_t object to destroy
|
||||
* Destroys an eap_payload_t object.
|
||||
*/
|
||||
void (*destroy) (eap_payload_t *this);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief Creates an empty eap_payload_t object.
|
||||
* Creates an empty eap_payload_t object.
|
||||
*
|
||||
* @return eap_payload_t object
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
eap_payload_t *eap_payload_create(void);
|
||||
|
||||
/**
|
||||
* @brief Creates an eap_payload_t object with data.
|
||||
* Creates an eap_payload_t object with data.
|
||||
*
|
||||
* @return eap_payload_t object
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_data(chunk_t data);
|
||||
|
||||
/**
|
||||
* @brief Creates an eap_payload_t object with a code.
|
||||
* Creates an eap_payload_t object with a code.
|
||||
*
|
||||
* Could should be either EAP_SUCCESS/EAP_FAILURE, use
|
||||
* constructor above otherwise.
|
||||
@@ -135,19 +117,15 @@ eap_payload_t *eap_payload_create_data(chunk_t data);
|
||||
* @param code EAP status code
|
||||
* @param identifier EAP identifier to use in payload
|
||||
* @return eap_payload_t object
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_code(eap_code_t code, u_int8_t identifier);
|
||||
|
||||
/**
|
||||
* @brief Creates an eap_payload_t EAP_RESPONSE containing an EAP_NAK.
|
||||
* Creates an eap_payload_t EAP_RESPONSE containing an EAP_NAK.
|
||||
*
|
||||
* @param identifier EAP identifier to use in payload
|
||||
* @return eap_payload_t object
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_nak(u_int8_t identifier);
|
||||
|
||||
#endif /* EAP_PAYLOAD_H_ */
|
||||
#endif /* EAP_PAYLOAD_H_ @} */
|
||||
|
||||
Reference in New Issue
Block a user