return this->reqid;
}
+METHOD(child_sa_t, get_reqid_ref, uint32_t,
+ private_child_sa_t *this)
+{
+ if ((this->reqid_allocated || (!this->static_reqid && this->reqid)) &&
+ charon->kernel->ref_reqid(charon->kernel, this->reqid) == SUCCESS)
+ {
+ return this->reqid;
+ }
+ return 0;
+}
+
METHOD(child_sa_t, get_unique_id, uint32_t,
private_child_sa_t *this)
{
.public = {
.get_name = _get_name,
.get_reqid = _get_reqid,
+ .get_reqid_ref = _get_reqid_ref,
.get_unique_id = _get_unique_id,
.get_config = _get_config,
.get_state = _get_state,
/*
- * Copyright (C) 2006-2019 Tobias Brunner
+ * Copyright (C) 2006-2023 Tobias Brunner
* Copyright (C) 2006-2008 Martin Willi
* Copyright (C) 2006 Daniel Roethlisberger
*
*/
uint32_t (*get_reqid)(child_sa_t *this);
+ /**
+ * Get an additional reference to the allocated reqid of this CHILD SA.
+ *
+ * For static reqids or until the reqid is allocated (if none was passed
+ * in the constructor), this returns 0. The returned reqid must be released
+ * via kernel_interface_t::release_reqid().
+ *
+ * @return allocated reqid of the CHILD SA, 0 if reqid is static or
+ * not allocated yet
+ */
+ uint32_t (*get_reqid_ref)(child_sa_t *this);
+
/**
* Get the unique numerical identifier for this CHILD_SA.
*