4 * @brief Interface of ke_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
27 #include <encoding/payloads/payload.h>
28 #include <encoding/payloads/transform_substructure.h>
29 #include <utils/linked_list.h>
31 * KE payload length in bytes without any key exchange data.
35 #define KE_PAYLOAD_HEADER_LENGTH 8
38 typedef struct ke_payload_t ke_payload_t
;
41 * @brief Class representing an IKEv2-KE Payload.
43 * The KE Payload format is described in RFC section 3.4.
46 * - ke_payload_create()
52 * The payload_t interface.
54 payload_t payload_interface
;
57 * @brief Returns the currently set key exchange data of this KE payload.
59 * @warning Returned data are not copied.
61 * @param this calling ke_payload_t object
62 * @return chunk_t pointing to the value
64 chunk_t (*get_key_exchange_data
) (ke_payload_t
*this);
67 * @brief Sets the key exchange data of this KE payload.
69 * @warning Value is getting copied.
71 * @param this calling ke_payload_t object
72 * @param key_exchange_data chunk_t pointing to the value to set
74 void (*set_key_exchange_data
) (ke_payload_t
*this, chunk_t key_exchange_data
);
77 * @brief Gets the Diffie-Hellman Group Number of this KE payload.
79 * @param this calling ke_payload_t object
80 * @return DH Group Number of this payload
82 diffie_hellman_group_t (*get_dh_group_number
) (ke_payload_t
*this);
85 * @brief Sets the Diffie-Hellman Group Number of this KE payload.
87 * @param this calling ke_payload_t object
88 * @param dh_group_number DH Group to set
90 void (*set_dh_group_number
) (ke_payload_t
*this, diffie_hellman_group_t dh_group_number
);
93 * @brief Destroys an ke_payload_t object.
95 * @param this ke_payload_t object to destroy
97 void (*destroy
) (ke_payload_t
*this);
101 * @brief Creates an empty ke_payload_t object
103 * @return ke_payload_t object
107 ke_payload_t
*ke_payload_create(void);
110 #endif /*KE_PAYLOAD_H_*/