2 * @brief server side (frm_fwp) functions for communication
3 * resource manager - station
6 #include <frm_generic.h>
11 #include <fres_sa_scenario.h>
15 #include <ul_logreg.h>
19 #include "wifi_agent_idl.h"
20 #include "fwp_admctrl.h"
21 #include "wifi_agent.h"
23 UL_LOG_CUST(ulogd_fwp_wifi_agent_server);
24 ul_log_domain_t ulogd_fwp_wifi_agent_server = {UL_LOGL_MSG, "fwp_wifi_agent_server"};
25 UL_LOGREG_SINGLE_DOMAIN_INIT_FUNCTION(fwp_wifi_agent_server_logreg_domains, ulogd_fwp_wifi_agent_server);
27 struct forb_wifi_agent_idl_impl wifi_agent_impl = {
28 .add = wifi_agent_idl_add,
29 .print_state = wifi_agent_idl_print_state,
33 * Print list of stored stations
35 void wifi_agent_idl_print_state(wifi_agent_idl _obj, CORBA_Environment *ev)
38 struct frm_fwp_priv *frm_fwp_state = forb_instance_data(_obj);
40 ul_logmsg("Actual_list_of_stations\n");
41 ul_list_for_each(sta_list, &frm_fwp_state->sta_list, sta2){
42 ul_logmsg("%llu_-_%d\n", sta2->client_mac_addr, sta2->rate);
44 ul_logmsg("------------\n\n");
49 * Add information about STA (mac_address & bit rate)
51 CORBA_long wifi_agent_idl_add(wifi_agent_idl _obj, const CORBA_long rate, const CORBA_long_long client_mac_addr, CORBA_Environment *ev)
54 struct frm_fwp_priv *frm_fwp_state = forb_instance_data(_obj);
56 fwp_sta_t *new_to_add;
58 /*fill the linked list here*/
59 ul_list_for_each(sta_list, &frm_fwp_state->sta_list, sta){
60 /*client was sending info before*/
61 if(sta->client_mac_addr == client_mac_addr) {
62 /*mac address is the same change only rate*/
67 new_to_add = (fwp_sta_t*)malloc(sizeof(fwp_sta_t));
68 /*client was not sending info yet*/
69 new_to_add->rate = rate;
70 new_to_add->client_mac_addr = client_mac_addr;
71 sta_list_ins_tail(&frm_fwp_state->sta_list, new_to_add);