struct fwp_contract {
int budget; /**< bytes per period */
int period_usec; /**< all time units are in microseconds */
+ int deadline_usec;
} fwp_contract_t;
struct fwp_contract_data;
/**
* FWP contract.
- * It is an internal representation of contract.
- *
+ * This is an internal representation of contract in every FWP application.
*/
struct fwp_contract_data {
fwp_contract_id_t id;
- /**< contract specified by user */
+ /** contract specified by user */
fwp_contract_t contract;
- /**< parameters from contract negotiated for vres */
+ /** parameters from contract negotiated for vres */
fwp_vres_params_t vres_params;
- /**< the address of agent from that the contract comes */
+ /* * the address of agent from that the contract comes */
/*fwp_transaction_id_t trans_id;*/
/* pointer to fwp_vres or fwp_participant */
/*void *priv; */
fwp_vres_d_t vresd;
fwp_contract_status_t status;
- /**< For future: exclude (replaced) contract
+ /** For future: exclude (replaced) contract
fwp_contract_d_t contex; */
ul_list_node_t list_node;
gavl_node_t tree_node;
- /* owner,
- * acls*/
+ /* owner,
+ * acls*/
};
static inline fwp_contract_data_t* fwp_contract_data_new()
{
- return memset(malloc(sizeof (fwp_contract_data_t)),'\0',
- sizeof(fwp_contract_data_t));
+ fwp_contract_data_t *contdata = malloc(sizeof (fwp_contract_data_t));
+ if (!contdata)
+ return NULL;
+ return memset(contdata,'\0', sizeof(fwp_contract_data_t));
}
static inline void fwp_contract_data_delete(fwp_contract_data_t* contdata)