*/
linked_list_t *ike_proposals;
+ /**
+ * List of CHILD proposals
+ */
+ linked_list_t *child_proposals;
+
/**
* Hostname to connect to
*/
{
child_cfg_t *child_cfg;
traffic_selector_t *ts;
+ proposal_t *proposal;
lifetime_cfg_t lifetime = {
.time = {
.life = 10800 /* 3h */,
NULL, FALSE, MODE_TUNNEL, /* updown, hostaccess */
ACTION_NONE, ACTION_NONE, ACTION_NONE, FALSE,
0, 0, NULL, NULL, 0);
- child_cfg->add_proposal(child_cfg, proposal_create_default(PROTO_ESP));
+ if (this->child_proposals->get_count(this->child_proposals))
+ {
+ while (this->child_proposals->remove_first(this->child_proposals,
+ (void**)&proposal) == SUCCESS)
+ {
+ child_cfg->add_proposal(child_cfg, proposal);
+ }
+ }
+ else
+ {
+ child_cfg->add_proposal(child_cfg, proposal_create_default(PROTO_ESP));
+ }
while (this->local_ts->remove_first(this->local_ts, (void**)&ts) == SUCCESS)
{
child_cfg->add_traffic_selector(child_cfg, TRUE, ts);
}
this->ike_proposals->insert_last(this->ike_proposals, proposal);
break;
+ case CMD_OPT_ESP_PROPOSAL:
+ proposal = proposal_create_from_string(PROTO_ESP, arg);
+ if (!proposal)
+ {
+ exit(1);
+ }
+ this->child_proposals->insert_last(this->child_proposals, proposal);
+ break;
+ case CMD_OPT_AH_PROPOSAL:
+ proposal = proposal_create_from_string(PROTO_AH, arg);
+ if (!proposal)
+ {
+ exit(1);
+ }
+ this->child_proposals->insert_last(this->child_proposals, proposal);
+ break;
case CMD_OPT_PROFILE:
set_profile(this, arg);
break;
{
this->ike_proposals->destroy_offset(this->ike_proposals,
offsetof(proposal_t, destroy));
+ this->child_proposals->destroy_offset(this->child_proposals,
+ offsetof(proposal_t, destroy));
this->local_ts->destroy_offset(this->local_ts,
offsetof(traffic_selector_t, destroy));
this->remote_ts->destroy_offset(this->remote_ts,
.local_ts = linked_list_create(),
.remote_ts = linked_list_create(),
.ike_proposals = linked_list_create(),
+ .child_proposals = linked_list_create(),
.profile = PROF_UNDEF,
);
"traffic selector to propose for remote side", {}},
{ CMD_OPT_IKE_PROPOSAL, "ike-proposal", required_argument, "proposal",
"a single IKE proposal to offer instead of the default", {}},
+ { CMD_OPT_ESP_PROPOSAL, "esp-proposal", required_argument, "proposal",
+ "a single ESP proposal to offer instead of the default", {}},
+ { CMD_OPT_AH_PROPOSAL, "ah-proposal", required_argument, "proposal",
+ "a single AH proposal to offer instead of the default", {}},
{ CMD_OPT_PROFILE, "profile", required_argument, "name",
"authentication profile to use, where name is one of:", {
" ikev2-pub, ikev2-eap, ikev2-pub-eap",