]> rtime.felk.cvut.cz Git - frescor/fwp.git/blobdiff - fwp/lib/frsh_fwp/fwp_fra.c
Implemented synchronous and asynchronous sending
[frescor/fwp.git] / fwp / lib / frsh_fwp / fwp_fra.c
index 813cd5e5bc9a8852adc1a8cdf98e4296dc4028b2..f6e15c4bdb7070c60195e5113d48a6f71ccedb1b 100644 (file)
@@ -66,7 +66,7 @@ static int create_vres(fres_vres_t *vres, void *priv)
        fres_block_fwp_sched *fwp_sched;
        fres_block_fwp *fwp;
        fwp_vres_params_t vparams = {0};
-       fwp_vres_d_t      fwp_vresd = {0};
+       struct fwp_vres  *fwp_vres = NULL;
        int rv;
        size_t bytes;
        char src[21] = "N/A";
@@ -88,10 +88,10 @@ static int create_vres(fres_vres_t *vres, void *priv)
                snprintf(src, sizeof(src), "%s", inet_ntoa(vparams.src));
        }
        /* Create vres */
-       if ((rv = fwp_vres_create(&vparams, &fwp_vresd))) {
+       if ((rv = fwp_vres_create(&vparams, &fwp_vres))) {
                return  rv;
        }
-       vres->priv = fwp_vresd;
+       vres->priv = fwp_vres;
 
        fres_contract_id_to_string(id, &vres->id, sizeof(id));
        ul_logmsg("Creating FWP VRes (id=%s, period=%ld ms, budget=%ld bytes AC=%d src=%s)\n",
@@ -103,12 +103,12 @@ static int create_vres(fres_vres_t *vres, void *priv)
 
 static int cancel_vres(fres_vres_t *vres, void *priv)
 {
-       fwp_vres_d_t    fwp_vresd;
+       struct fwp_vres *       fwp_vres;
        fres_block_basic *basic;
        char id[40];
 
-       fwp_vresd = (fwp_vres_d_t) vres->priv;
-       fwp_vres_destroy(fwp_vresd);
+       fwp_vres = (struct fwp_vres *) vres->priv;
+       fwp_vres_destroy(fwp_vres);
 
        basic = fres_contract_get_basic(vres->allocated);
        fres_contract_id_to_string(id, &vres->id, sizeof(id));
@@ -124,7 +124,7 @@ int change_vres(fres_vres_t *vres, void *priv)
        fres_block_basic *basic;
        fres_block_fwp_sched *fwp_sched;
        fwp_vres_params_t vparams;
-       fwp_vres_d_t      fwp_vresd;
+       struct fwp_vres *fwp_vres;
        int rv;
        size_t bytes;
        
@@ -136,10 +136,10 @@ int change_vres(fres_vres_t *vres, void *priv)
        vparams.budget = bytes;
        vparams.period = basic->period;
        vparams.ac_id = fwp_sched->ac_id;
-       fwp_vresd = vres->priv;
+       fwp_vres = vres->priv;
 
        /* Changing vres */
-       if ((rv = fwp_vres_set_params(fwp_vresd, &vparams))) {
+       if ((rv = fwp_vres_set_params(fwp_vres, &vparams))) {
                return  rv;
        }