*/
uint32_t unique_id;
+ /**
+ * Optional sequence number associated with triggering acquire
+ */
+ uint32_t seq;
+
/**
* Whether FWD policies in the outbound direction should be installed
*/
return this->label ?: this->config->get_label(this->config);
}
+METHOD(child_sa_t, get_acquire_seq, uint32_t,
+ private_child_sa_t *this)
+{
+ return this->seq;
+}
+
+METHOD(child_sa_t, set_acquire_seq, void,
+ private_child_sa_t *this, uint32_t seq)
+{
+ this->seq = seq;
+}
+
METHOD(child_sa_t, get_lifetime, time_t,
private_child_sa_t *this, bool hard)
{
};
sa = (kernel_ipsec_add_sa_t){
.reqid = this->reqid,
+ .seq = this->seq,
.mode = this->mode,
.src_ts = src_ts,
.dst_ts = dst_ts,
.get_mark = _get_mark,
.get_if_id = _get_if_id,
.get_label = _get_label,
+ .get_acquire_seq = _get_acquire_seq,
+ .set_acquire_seq = _set_acquire_seq,
.has_encap = _has_encap,
.get_ipcomp = _get_ipcomp,
.set_ipcomp = _set_ipcomp,
.if_id_in = config->get_if_id(config, TRUE) ?: data->if_id_in_def,
.if_id_out = config->get_if_id(config, FALSE) ?: data->if_id_out_def,
.label = data->label ? data->label->clone(data->label) : NULL,
+ .seq = data->seq,
.install_time = time_monotonic(NULL),
.policies_fwd_out = config->has_option(config, OPT_FWD_OUT_POLICIES),
);
*/
sec_label_t *(*get_label)(child_sa_t *this);
+ /**
+ * Get the optional sequence number associated with the acquire that
+ * triggered this CHILD_SA.
+ *
+ * @return sequence number associated with the acquire or 0
+ */
+ uint32_t (*get_acquire_seq)(child_sa_t *this);
+
+ /**
+ * Set the optional sequence number associated with the acquire that
+ * triggered this CHILD_SA.
+ *
+ * @param seq sequence number associated with the acquire
+ */
+ void (*set_acquire_seq)(child_sa_t *this, uint32_t seq);
+
/**
* Create an enumerator over traffic selectors of one side.
*
uint32_t if_id_out_def;
/** Optional security label to apply on SAs (cloned) */
sec_label_t *label;
+ /** Optional sequence number associated with the acquire that triggered
+ * this SA */
+ uint32_t seq;
/** TRUE to enable UDP encapsulation (NAT traversal) */
bool encap;
};