]> rtime.felk.cvut.cz Git - frescor/frsh-forb.git/blobdiff - src/fwp/fwp/mngr/fwp_mngr.c
frm_fwp: Global variable correction
[frescor/frsh-forb.git] / src / fwp / fwp / mngr / fwp_mngr.c
index 886c71c566f629ecc00311980e7deb0ece7bc843..857d8d2d9a7cae6d8b389546909c2bafc5170cdf 100644 (file)
@@ -87,7 +87,7 @@ int dummy_admission_test(struct fres_sa_scenario *scenario, void *priv,
 #endif
 
 
-struct frm_fwp_priv priv = {
+static struct frm_fwp_priv frm_fwp_state = {
        .rate_mbps = 1,
        .erp_ofdm = false,
        .short_preamble = false,
@@ -100,7 +100,7 @@ static const struct fres_res_manager frm = {
        //.admission_test = dummy_admission_test,
        .name = "WLAN",
        .admission_test = fwp_admctrl_utilization,
-       .priv = &priv,
+       .priv = &frm_fwp_state,
 };
 
 static struct option long_opts[] = {
@@ -149,10 +149,9 @@ int main(int argc, char *argv[])
        struct frm_data frm_data;
 
        wifi_agent_idl wai;     //wifi agent interface
-       struct fwp_sta intern_data;
 
        if (getenv("FWP_BYPASS"))
-               priv.bypass = true;
+               frm_fwp_state.bypass = true;
 
 
        while ((opt = getopt_long(argc, argv, "b:d:hl:os", &long_opts[0], NULL)) != EOF) {
@@ -165,13 +164,13 @@ int main(int argc, char *argv[])
                                ul_log_domain_arg2levels(optarg);
                                break;
                        case 'b':
-                               priv.rate_mbps = atol(optarg);
+                               frm_fwp_state.rate_mbps = atol(optarg);
                                break;
                        case 's':
-                               priv.short_preamble = true;
+                               frm_fwp_state.short_preamble = true;
                                break;
                        case 'o':
-                               priv.erp_ofdm = true;
+                               frm_fwp_state.erp_ofdm = true;
                                break;
                        case 'h':
                        /*default:*/
@@ -196,13 +195,13 @@ int main(int argc, char *argv[])
        if (!worb) error(1, errno, "forb_init");
        
        // Cration of an object implementing myinterface
-        wai = forb_wifi_agent_idl_new(orb, &wifi_agent_impl, &intern_data);
+        wai = forb_wifi_agent_idl_new(orb, &wifi_agent_impl, &frm_fwp_state);
         
        // We can register our object under a name, so that other processes can use it.
         forb_register_reference(wai, "net.sourceforge.frsh-forb.wai");
 
        // Initialize head of linked list
-       sta_list_init_head(&priv.sta_list);
+       sta_list_init_head(&frm_fwp_state.sta_list);
        
        //create executors and register 2 interfaces
        ret = forb_executor_init(&executor_wai);