* fwp agent and then waits for response.
*
* \param contract Contract to negotiate
+ * \param vres_id Id of vres if the contract was negotiated
*
- * \return It returns non-zero value if the contract is negotiated
- *
+ * \return It returns value 0 when the contract negotiation process was
+ * successful with the result stored in contract->status.
+ * On error, negative error code is returned.
+ *
*/
-int fwp_contract_negotiate(struct fwp_contract *contract)
+int fwp_contract_negotiate(struct fwp_contract *contract, int *vres_id)
{
struct fwp_msgb *msgb;
unsigned int code, hid;
if (contract->status == FWP_CNT_NEGOTIATED) {
FWP_DEBUG("Contract negotiated\n");
- return fwp_vres_open(contract);
+ *vres_id = fwp_vres_open(contract);
}
fwp_msgb_free(msgb);
- return -1;
+ return 0;
}
int fwp_contract_cancel(unsigned int vres_id)