merged EAP framework from branch into trunk
includes a lot of other modifications
This commit is contained in:
@@ -28,6 +28,7 @@ typedef struct eap_payload_t eap_payload_t;
|
||||
|
||||
#include <library.h>
|
||||
#include <encoding/payloads/payload.h>
|
||||
#include <sa/authenticators/eap/eap_method.h>
|
||||
|
||||
/**
|
||||
* Length of a EAP payload without the EAP Message in bytes.
|
||||
@@ -44,62 +45,105 @@ typedef struct eap_payload_t eap_payload_t;
|
||||
* @b Constructors:
|
||||
* - eap_payload_create()
|
||||
*
|
||||
* @todo Implement functionality for this payload
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
struct eap_payload_t {
|
||||
|
||||
/**
|
||||
* The payload_t interface.
|
||||
*/
|
||||
payload_t payload_interface;
|
||||
|
||||
/**
|
||||
* @brief Set the EAP Message.
|
||||
*
|
||||
* Data are getting cloned.
|
||||
* @brief Set the contained EAP data.
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @param message EAP message as chunk_t
|
||||
* 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_message) (eap_payload_t *this, chunk_t message);
|
||||
void (*set_data) (eap_payload_t *this, chunk_t data);
|
||||
|
||||
/**
|
||||
* @brief Get the EAP message.
|
||||
*
|
||||
* Returned data are a copy of the internal one.
|
||||
* @brief Get the contained EAP data.
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @return EAP message as chunk_t
|
||||
* 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_message_clone) (eap_payload_t *this);
|
||||
chunk_t (*get_data) (eap_payload_t *this);
|
||||
|
||||
/**
|
||||
* @brief Get the EAP message.
|
||||
*
|
||||
* Returned data are NOT copied.
|
||||
* @brief Get the EAP code.
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @return EAP message as chunk_t
|
||||
* @param this calling eap_payload_t object
|
||||
* @return EAP message as chunk_t
|
||||
*/
|
||||
chunk_t (*get_message) (eap_payload_t *this);
|
||||
eap_code_t (*get_code) (eap_payload_t *this);
|
||||
|
||||
/**
|
||||
* @brief 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.
|
||||
*
|
||||
* @param this calling eap_payload_t object
|
||||
* @return EAP method type
|
||||
*/
|
||||
eap_type_t (*get_type) (eap_payload_t *this);
|
||||
|
||||
/**
|
||||
* @brief Destroys an eap_payload_t object.
|
||||
*
|
||||
* @param this eap_payload_t object to destroy
|
||||
* @param this eap_payload_t object to destroy
|
||||
*/
|
||||
void (*destroy) (eap_payload_t *this);
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 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.
|
||||
*
|
||||
* @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.
|
||||
*
|
||||
* Could should be either EAP_SUCCESS/EAP_FAILURE, use
|
||||
* constructor above otherwise.
|
||||
*
|
||||
* @return eap_payload_t object
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_code(eap_code_t code);
|
||||
|
||||
/**
|
||||
* @brief Creates an eap_payload_t EAP_RESPONSE containing an EAP_NAK.
|
||||
*
|
||||
* @return eap_payload_t object
|
||||
*
|
||||
* @ingroup payloads
|
||||
*/
|
||||
eap_payload_t *eap_payload_create_nak();
|
||||
|
||||
#endif /* EAP_PAYLOAD_H_ */
|
||||
|
||||
Reference in New Issue
Block a user