+/**
+ * \file fwp_contract.c
+ *
+ * Routines for manipulation with contract
+ *
+ */
#include "fwp_msg.h"
#include "fwp_contract.h"
#include "fwp_contract_table.h"
* Negotiates contract for application. Negotiation request is sent to
* fwp agent and then waits for response.
*
- * \param[in] contractd descriptor of the contract to negotiate
- * \param[out] vresd Id of vres after the contract was accepted
+ * \param[in] contractd Descriptor of the contract to negotiate
+ * \param[out] vresd Vres descriptor after the contract was accepted
*
* \return
* If successful, the function returns zero and vres descriptor is
return 0;
}
+/**
+ * Creates contract
+ *
+ * \param[in] contract User-level contract
+ *
+ * \return On success, returns contract descriptor
+ *
+ */
/*fwp_contract_d_t fwp_contract_create(fwp_contract_t *contract, resource_d_t resource)*/
fwp_contract_d_t fwp_contract_create(fwp_contract_t *contract)
{
return contdata;
}
+/**
+ * Destroys contract
+ *
+ * \param[in] contractd Contract descriptor
+ *
+ * \return On success, returns zero.
+ * On error, returns negative error code.
+ *
+ */
int fwp_contract_destroy(fwp_contract_d_t contractd)
{
fwp_contract_data_t *contdata = contractd;
return 0;
}
+/**
+ * Reserves contract
+ *
+ * \param[in] contractd Contract descriptor
+ *
+ * \return On success, returns zero.
+ * On error, returns negative error code.
+ *
+ */
int fwp_contract_reserve(fwp_contract_d_t contractd)
{
fwp_contract_data_t *contdata = contractd;
return 0;
}
+/**
+ * Commits contract
+ *
+ * \param[in] contractd Contract descriptor
+ * \param[out] vresd Descriptor of vres
+ *
+ * \return On success, returns zero.
+ * On error, returns negative error code.
+ *
+ */
int fwp_contract_commit(fwp_contract_d_t contractd, fwp_vres_d_t *vresdp)
{
fwp_contract_data_t *contdata = contractd;
return 0;
}
+/**
+ * Cancels contract
+ *
+ * \param[in] contractd Contract descriptor
+ *
+ * \return On success, returns zero.
+ * On error, returns negative error code.
+ *
+ */
int fwp_contract_cancel(fwp_contract_d_t contractd)
{
fwp_contract_data_t *contdata = contractd;