*/
proposal_substructure_t *proposal_substructure_create_for_ipcomp_v1(
u_int32_t lifetime, u_int64_t lifebytes, u_int16_t cpi,
- u_int8_t proposal_number)
+ ipsec_mode_t mode, bool udp, u_int8_t proposal_number)
{
private_proposal_substructure_t *this;
transform_substructure_t *transform;
transform = transform_substructure_create_type(TRANSFORM_SUBSTRUCTURE_V1,
1, IKEV1_IPCOMP_DEFLATE);
+ transform->add_transform_attribute(transform,
+ transform_attribute_create_value(TRANSFORM_ATTRIBUTE_V1,
+ TATTR_PH2_ENCAP_MODE, get_ikev1_mode(mode, udp)));
if (lifetime)
{
transform->add_transform_attribute(transform,
* Creates an IKEv1 proposal_substructure_t for IPComp with the given
* proposal_number (e.g. of a ESP proposal to bundle them).
*
- * @param lifetime lifetime in seconds
- * @param lifebytes lifebytes, in bytes
+ * @param lifetime lifetime in seconds
+ * @param lifebytes lifebytes, in bytes
* @param cpi the CPI to be used
+ * @param mode IPsec encapsulation mode, TRANSPORT or TUNNEL
+ * @param udp TRUE to use UDP encapsulation
* @param proposal_number the proposal number of the proposal to be linked
* @return IKEv1 proposal_substructure_t PROPOSAL_SUBSTRUCTURE_V1
*/
proposal_substructure_t *proposal_substructure_create_for_ipcomp_v1(
u_int32_t lifetime, u_int64_t lifebytes, u_int16_t cpi,
- u_int8_t proposal_number);
+ ipsec_mode_t mode, bool udp, u_int8_t proposal_number);
#endif /** PROPOSAL_SUBSTRUCTURE_H_ @}*/
u_int8_t proposal_number = substruct->get_proposal_number(substruct);
substruct = proposal_substructure_create_for_ipcomp_v1(lifetime,
- lifebytes, cpi, proposal_number);
+ lifebytes, cpi, mode, udp, proposal_number);
this->proposals->insert_last(this->proposals, substruct);
substruct->set_is_last_proposal(substruct, FALSE);
/* add the proposals again without IPComp */