From: sangorrin Date: Fri, 10 Aug 2007 17:05:44 +0000 (+0000) Subject: renegotiate_sync X-Git-Url: https://rtime.felk.cvut.cz/gitweb/frescor/fna.git/commitdiff_plain/fb0158820b0c4563519ae7c2c3986f7ef6006c5b renegotiate_sync git-svn-id: http://www.frescor.org/private/svn/frescor/fna/trunk@668 35b4ef3e-fd22-0410-ab77-dab3279adceb --- diff --git a/src_rtep/rtep_fna_c.c b/src_rtep/rtep_fna_c.c index f2a23b8..e442dbb 100644 --- a/src_rtep/rtep_fna_c.c +++ b/src_rtep/rtep_fna_c.c @@ -236,7 +236,24 @@ int rtep_fna_contract_renegotiate_sync const fna_vres_id_t vres, const frsh_contract_t *new_contract) { - return 0; + rtep_bwres_contract_t rtep_contract; + int accepted; + int pos = (int) vres; + + // convert FRSH contract to RTEP BWRES contract + rtep_contract.period_max = new_contract->period_max; + rtep_contract.deadline = new_contract->deadline; + rtep_contract.prio = new_contract->preemption_level; + // in RTEP BWRES, budget is given in number of packets. We do a little trick + // in the function bytes_to_network_budget to use a the field tv_sec from + // the timespec in frsh_contract to store the budget in bytes directly + rtep_contract.budget_min = new_contract->budget_min.tv_sec; + + // renegotiate the contract + accepted = rtep_bwres_contract_renegotiate_sync + (&rtep_vres_list[pos], &rtep_contract); + + return accepted; } /**