traffic_selector_t *dst;
/** Optional security label of triggering packet */
sec_label_t *label;
+ /** Optional sequence number associated with the acquire triggering the SA */
+ uint32_t seq;
};
/**
break;
}
task = (task_t *)quick_mode_create(this->ike_sa, NULL,
- NULL, NULL);
+ NULL, NULL, 0);
this->passive_tasks->insert_last(this->passive_tasks, task);
break;
case INFORMATIONAL_V1:
if (args)
{
- task = quick_mode_create(this->ike_sa, cfg, args->src, args->dst);
+ task = quick_mode_create(this->ike_sa, cfg, args->src, args->dst,
+ args->seq);
task->use_reqid(task, args->reqid);
}
else
{
- task = quick_mode_create(this->ike_sa, cfg, NULL, NULL);
+ task = quick_mode_create(this->ike_sa, cfg, NULL, NULL, 0);
}
queue_task(this, &task->task);
}
child_sa->set_state(child_sa, CHILD_REKEYING);
cfg = child_sa->get_config(child_sa);
task = quick_mode_create(this->ike_sa, cfg->get_ref(cfg),
- get_first_ts(child_sa, TRUE), get_first_ts(child_sa, FALSE));
+ get_first_ts(child_sa, TRUE), get_first_ts(child_sa, FALSE), 0);
reqid = child_sa->get_reqid_ref(child_sa);
if (reqid)
{
* Described in header.
*/
quick_mode_t *quick_mode_create(ike_sa_t *ike_sa, child_cfg_t *config,
- traffic_selector_t *tsi, traffic_selector_t *tsr)
+ traffic_selector_t *tsi, traffic_selector_t *tsr,
+ uint32_t seq)
{
private_quick_mode_t *this;
.rekey = _rekey,
.abort = _abort_,
},
+ .child = {
+ .seq = seq,
+ },
.ike_sa = ike_sa,
.initiator = config != NULL,
.config = config,
* @param config child_cfg if task initiator, NULL if responder
* @param tsi source of triggering packet, or NULL
* @param tsr destination of triggering packet, or NULL
+ * @param seq optional sequence number of triggering acquire, or 0
* @return task to handle by the task_manager
*/
quick_mode_t *quick_mode_create(ike_sa_t *ike_sa, child_cfg_t *config,
- traffic_selector_t *tsi, traffic_selector_t *tsr);
+ traffic_selector_t *tsi, traffic_selector_t *tsr,
+ uint32_t seq);
#endif /** QUICK_MODE_H_ @}*/
task = (task_t*)ike_auth_lifetime_create(this->ike_sa, FALSE);
array_insert(this->passive_tasks, ARRAY_TAIL, task);
task = (task_t*)child_create_create(this->ike_sa, NULL, FALSE,
- NULL, NULL);
+ NULL, NULL, 0);
array_insert(this->passive_tasks, ARRAY_TAIL, task);
break;
}
else
{
task = (task_t*)child_create_create(this->ike_sa, NULL,
- FALSE, NULL, NULL);
+ FALSE, NULL, NULL, 0);
}
}
else
}
cfg = child_sa->get_config(child_sa);
child_create = child_create_create(new, cfg->get_ref(cfg),
- FALSE, NULL, NULL);
+ FALSE, NULL, NULL, 0);
reqid = child_sa->get_reqid_ref(child_sa);
if (reqid)
{
if (args)
{
- task = child_create_create(this->ike_sa, cfg, FALSE, args->src, args->dst);
+ task = child_create_create(this->ike_sa, cfg, FALSE, args->src,
+ args->dst, args->seq);
task->use_reqid(task, args->reqid);
task->use_label(task, args->label);
}
else
{
- task = child_create_create(this->ike_sa, cfg, FALSE, NULL, NULL);
+ task = child_create_create(this->ike_sa, cfg, FALSE, NULL, NULL, 0);
}
queue_task(this, &task->task);
}
task = child_create_create(this->ike_sa,
this->config->get_ref(this->config), FALSE,
- this->packet_tsi, this->packet_tsr);
+ this->packet_tsi, this->packet_tsr,
+ this->child.seq);
task->use_reqid(task, this->child.reqid);
task->use_marks(task, this->child.mark_in, this->child.mark_out);
task->use_if_ids(task, this->child.if_id_in, this->child.if_id_out);
* Described in header.
*/
child_create_t *child_create_create(ike_sa_t *ike_sa,
- child_cfg_t *config, bool rekey,
- traffic_selector_t *tsi, traffic_selector_t *tsr)
+ child_cfg_t *config, bool rekey,
+ traffic_selector_t *tsi,
+ traffic_selector_t *tsr, uint32_t seq)
{
private_child_create_t *this;
.destroy = _destroy,
},
},
+ .child = {
+ .seq = seq,
+ },
.ike_sa = ike_sa,
.config = config,
.packet_tsi = tsi ? tsi->clone(tsi) : NULL,
* @param rekey whether we do a rekey or not
* @param tsi source of triggering packet, or NULL
* @param tsr destination of triggering packet, or NULL
+ * @param seq optional sequence number of triggering acquire, or 0
* @return child_create task to handle by the task_manager
*/
child_create_t *child_create_create(ike_sa_t *ike_sa,
- child_cfg_t *config, bool rekey,
- traffic_selector_t *tsi, traffic_selector_t *tsr);
+ child_cfg_t *config, bool rekey,
+ traffic_selector_t *tsi,
+ traffic_selector_t *tsr, uint32_t seq);
#endif /** CHILD_CREATE_H_ @}*/
child_cfg = child_sa->get_config(child_sa);
this->ike_sa->queue_task(this->ike_sa, (task_t*)
child_create_create(this->ike_sa, child_cfg->get_ref(child_cfg),
- FALSE, NULL, NULL));
+ FALSE, NULL, NULL, 0));
}
return NEED_MORE;
}
config = this->child_sa->get_config(this->child_sa);
this->child_create = child_create_create(this->ike_sa,
- config->get_ref(config), TRUE, NULL, NULL);
+ config->get_ref(config), TRUE, NULL, NULL, 0);
proposal = this->child_sa->get_proposal(this->child_sa);
if (proposal->get_algorithm(proposal, KEY_EXCHANGE_METHOD,
this->public.task.build = _build_r;
this->public.task.process = _process_r;
this->initiator = FALSE;
- this->child_create = child_create_create(ike_sa, NULL, TRUE, NULL, NULL);
+ this->child_create = child_create_create(ike_sa, NULL, TRUE,
+ NULL, NULL, 0);
}
return &this->public;