return SUCCESS;
}
+METHOD(kernel_interface_t, ref_reqid, status_t,
+ private_kernel_interface_t *this, uint32_t reqid)
+{
+ reqid_entry_t *entry, tmpl = {
+ .reqid = reqid,
+ };
+
+ this->mutex->lock(this->mutex);
+ entry = this->reqids->get(this->reqids, &tmpl);
+ if (entry)
+ {
+ entry->refs++;
+ }
+ this->mutex->unlock(this->mutex);
+ return entry ? SUCCESS : NOT_FOUND;
+}
+
METHOD(kernel_interface_t, release_reqid, status_t,
private_kernel_interface_t *this, uint32_t reqid)
{
.get_spi = _get_spi,
.get_cpi = _get_cpi,
.alloc_reqid = _alloc_reqid,
+ .ref_reqid = _ref_reqid,
.release_reqid = _release_reqid,
.add_sa = _add_sa,
.update_sa = _update_sa,
uint32_t if_id_out, sec_label_t *label,
uint32_t *reqid);
+ /**
+ * Increase the reference count for the given reqid that was previously
+ * allocated by alloc_reqid().
+ *
+ * The reference must be released with a call to release_reqid().
+ *
+ * @param reqid previously allocated reqid
+ * @return SUCCESS if refcount increased, NOT_FOUND if reqid is
+ * unknown (shouldn't happen)
+ */
+ status_t (*ref_reqid)(kernel_interface_t *this, uint32_t reqid);
+
/**
* Release a previously allocated reqid.
*