4 * @brief Interface of eap_payload_t.
9 * Copyright (C) 2005 Jan Hutter, Martin Willi
10 * Hochschule fuer Technik Rapperswil
12 * This program is free software; you can redistribute it and/or modify it
13 * under the terms of the GNU General Public License as published by the
14 * Free Software Foundation; either version 2 of the License, or (at your
15 * option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
17 * This program is distributed in the hope that it will be useful, but
18 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
19 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
23 #ifndef EAP_PAYLOAD_H_
24 #define EAP_PAYLOAD_H_
27 #include <encoding/payloads/payload.h>
30 * Length of a EAP payload without the EAP Message in bytes.
34 #define EAP_PAYLOAD_HEADER_LENGTH 4
37 typedef struct eap_payload_t eap_payload_t
;
40 * @brief Class representing an IKEv2 EAP payload.
42 * The EAP payload format is described in RFC section 3.16.
45 * - eap_payload_create()
47 * @todo Implement functionality for this payload
51 struct eap_payload_t
{
53 * The payload_t interface.
55 payload_t payload_interface
;
58 * @brief Set the EAP Message.
60 * Data are getting cloned.
62 * @param this calling eap_payload_t object
63 * @param message EAP message as chunk_t
65 void (*set_message
) (eap_payload_t
*this, chunk_t message
);
68 * @brief Get the EAP message.
70 * Returned data are a copy of the internal one.
72 * @param this calling eap_payload_t object
73 * @return EAP message as chunk_t
75 chunk_t (*get_message_clone
) (eap_payload_t
*this);
78 * @brief Get the EAP message.
80 * Returned data are NOT copied.
82 * @param this calling eap_payload_t object
83 * @return EAP message as chunk_t
85 chunk_t (*get_message
) (eap_payload_t
*this);
88 * @brief Destroys an eap_payload_t object.
90 * @param this eap_payload_t object to destroy
92 void (*destroy
) (eap_payload_t
*this);
96 * @brief Creates an empty eap_payload_t object.
98 * @return eap_payload_t object
102 eap_payload_t
*eap_payload_create(void);
105 #endif /* EAP_PAYLOAD_H_ */