#include <utils/linked_list.h>
/**
+ * IKEv1 Value for a proposal payload.
+ *
+ * @ingroup payloads
+ */
+#define PROPOSAL_TYPE_VALUE 2
+
+/**
* Length of the proposal substructure header
* (without spi).
*
* get_size to make sure the length and number values are ok.
*
* @param this calling proposal_substructure_t object
- * @param iterator the created iterator is stored at the pointed pointer
* @param[in] forward iterator direction (TRUE: front to end)
+ * @return created iterator_t object
*/
- void (*create_transform_substructure_iterator) (proposal_substructure_t *this,iterator_t **iterator, bool forward);
+ iterator_t * (*create_transform_substructure_iterator) (proposal_substructure_t *this, bool forward);
/**
* @brief Adds a transform_substructure_t object to this object.
u_int8_t (*get_proposal_number) (proposal_substructure_t *this);
/**
+ * @brief get the number of transforms in current proposal.
+ *
+ * @param this calling proposal_substructure_t object
+ * @return transform count in current proposal
+ */
+ size_t (*get_transform_count) (proposal_substructure_t *this);
+
+ /**
+ * @brief get size of the set spi in bytes.
+ *
+ * @param this calling proposal_substructure_t object
+ * @return size of the spi in bytes
+ */
+ size_t (*get_spi_size) (proposal_substructure_t *this);
+
+ /**
* @brief Sets the protocol id of current proposal.
*
* @param this calling proposal_substructure_t object
*/
status_t (*get_info_for_transform_type) (proposal_substructure_t *this,transform_type_t type, u_int16_t *transform_id, u_int16_t *key_length);
+ /**
+ * @brief Sets the next_payload field of this substructure
+ *
+ * If this is the last proposal, next payload field is set to 0,
+ * otherwise to 2
+ *
+ * @param this calling proposal_substructure_t object
+ * @param is_last When TRUE, next payload field is set to 0, otherwise to 2
+ */
+ void (*set_is_last_proposal) (proposal_substructure_t *this, bool is_last);
/**
* @brief Returns the currently set SPI of this proposal.
* @brief Clones an proposal_substructure_t object.
*
* @param this proposal_substructure_t object to clone
- * @param clone cloned object will be written there
+ * @return cloned object
*/
- void (*clone) (proposal_substructure_t *this,proposal_substructure_t **clone);
+ proposal_substructure_t* (*clone) (proposal_substructure_t *this);
/**
* @brief Destroys an proposal_substructure_t object.