📄 jigb_wlan_mac_bb.pr.c
字号:
Boolean backoff_flag; /* Backoff flag is set when either the collision is */
/* inferred or the channel switched from busy to idle */
Boolean BB_flag; /* Bandera que permite emitir el BlackBurst. */
Boolean BB_ini; /* Bandera que evita desencolar de nuevo un paquete. */
Boolean BB_retry; /* Bandera de reenvio del BlackBurst. */
Boolean Tsch_flag; /* Bandera que indica programaci髇 Tsch activa. */
Boolean frame_size_req_rts; /* Flag that is set when the current frame in process */
/* of transmission is larger than the RTS threshold. */
Boolean rts_sent; /* Flag to indicate that whether the RTS for this */
/* particular data frame is sent and CTS is received. */
Boolean rcvd_bad_packet; /* Flag to indicate that the received packet is bad */
Boolean receiver_busy; /* Set this flag if receiver busy stat is enabled */
Boolean transmitter_busy; /* Set this flag if we are transmitting something. */
Boolean wait_eifs_dur; /* Set this flag if the station needs to wait for eifs */
/* duration. */
Boolean gateway_flag; /* Set this flag if the station is a gateway. */
Boolean bridge_flag; /* Set this flag if the station is a bridge */
Boolean immediate_xmt; /* Set this flag if the new frame can be transmitted */
/* without deferring. */
Boolean forced_bk_end; /* Special case: resume with completion of back-off (or */
/* CW) period regardless of receiver's status. */
Boolean cw_required; /* Indicates that the MAC is in contention window */
/* period following a successful transmission. */
Boolean perform_cw; /* Flag that triggers backoff process for CW period. */
Boolean nav_updated; /* Indicates a new NAV value since the last time when */
/* self interrupt is scheduled for the end of deference.*/
Boolean collision; /* Set this flag if a channel became busy while another */
/* one busy. */
Boolean collided_packet; /* Set this flag to drop the next received packet */
/* because of collision. */
Boolean duration_zero; /* Set this flag if duration should be zero in next ack */
Boolean ignore_busy; /* Set this flag if the STA should ignore receiver busy */
Boolean tx_beacon; /* Set this flag if time to send a beacon */
Boolean tx_cf_end; /* Set this flag if time to send a CF End frame */
Boolean pcf_active; /* Set this flag for AP if PCF is currently in effect */
Boolean polled; /* Set this flag if the station has received a poll */
Boolean more_data; /* Set this flag if must poll for more data (MSDU) */
Boolean more_frag; /* Set this flag if must poll for more fragments */
Boolean pcf_side_traf; /* Set this flag if the AP detects STA to STA traffic */
Boolean active_poll; /* Set this flag if an active poll is outstanding */
Boolean non_erp_present; /* Set this flag if we are an ERP STA and our BSS has */
/* at least one non-ERP STA. */
Boolean cts_to_self; /* Set this flag if the optional 11g CTS-to-self */
/* protection mechanism is enabled for this MAC. */
Boolean rcvd_bad_cts; /* Set if a reception is detected during the last */
/* CTS-to-self transmission. */
Boolean signal_extension; /* Set this flag after an 11g transmission using */
/* ERP-OFDM mode. */
Boolean pcf_lowered_drate; /* Set by an 11g AP, if the data rate of current tx is */
/* lowered due to a piggybacked ACK for a non-ERP STA. */
} WlanT_Mac_Flags;
/* This structure contains the destination address to which the received */
/* data packet needs to be sent and the contents of the received packet */
/* from the higher layer. */
typedef struct WlanT_Hld_List_Elem
{
double time_rcvd; /* Time packet is received by the higher layer */
int destination_address; /* Station to which this packet needs to be sent*/
Packet* pkptr; /* store packet contents */
} WlanT_Hld_List_Elem;
/* Information record for each BSS */
typedef struct bss_mapping_info
{
int bss_idx;
int ap_sta_addr;
Objid ap_objid;
WlanT_Phy_Char_Code ap_phy_char;
int non_erp_sta_count;
PrgT_Mapping_Handle sta_mapping_hndl;
} WlanT_Bss_Mapping_Info;
/* Information record for each STA */
typedef struct sta_mapping_info
{
int sta_addr;
WlanT_Phy_Char_Code sta_phy_char;
PrgT_Mapping_Handle dup_mapping_hndl;
} WlanT_Sta_Mapping_Info;
/* Information record for each STA */
typedef struct dup_mapping_info
{
int rem_sta_addr;
WlanT_Mac_Duplicate_Buffer_Entry* duplicate_ptr;
}WlanT_Duplicate_Mapping_Info;
/* Information regarding the location of each APs */
typedef struct WlanT_AP_Position_Info
{
struct WlanT_AP_Position_Info * next_ptr; /* next in chain */
int ap_bss_id;
int ap_channel_num;
double tx_power;
double lat;
double lon;
double alt;
}
WlanT_AP_Position_Info;
/** Global Variables **/
/* Global linked list of AP position info. */
WlanT_AP_Position_Info* global_ap_pos_info_head = OPC_NIL;
/* Global variable to keep note of the nature of the subnet. */
/* This variable is initialized to not set. */
WlanT_Bss_Identification_Approach bss_id_type = WlanC_Not_Set;
int num_estaciones;
double trafico_enviado_video;
double intento_enviado_video;
double trafico_enviado_voz;
double intento_enviado_voz;
double trafico_enviado_CBR;
double intento_enviado_CBR;
double trafico_enviado_web;
double intento_enviado_web;
double trafico_descartado_video;
double trafico_descartado_voz;
double trafico_descartado_CBR;
double trafico_descartado_web;
double media_retraso_normal;
double media_retraso_real;
double media_retraso_ETE_normal;
double media_retraso_ETE_real;
double num_entradas_normal;
double num_entradas_real;
double num_entradas_ETE_normal;
double num_entradas_ETE_real;
/* Read-only array of the minimum frequencies of the 12 operational 802.11a */
/* WLAN channels. */
double WLANC_11a_CHNL_MIN_FREQ_ARRAY [WLANC_11a_OPER_CHNL_COUNT] =
{5170.0, 5190.0, 5210.0, 5230.0, 5250.0, 5270.0, 5290.0, 5310.0, 5735.0, 5755.0, 5775.0, 5795.0};
/* Read-only arrays for mandatory 802.11a and 802.11g data rates. */
double WLANC_11a_MANDATORY_DRATE_ARRAY [3] = {24000000.0, 12000000.0, 6000000.0};
double WLANC_11g_MANDATORY_DRATE_ARRAY [7] = {24000000.0, 12000000.0, 11000000.0, 6000000.0, 5500000.0, 2000000.0, 1000000.0};
/** Macro Definitions **/
/* When virtual scanning is used, two different thresholds are used to decide */
/* when the STA must start looking for a new AP, and when a new AP is */
/* considered acceptable. This brings in a "hysteresis" which ensures that the */
/* STA does not flip-flop rapidly between APs. */
#define WLANC_ROAM_SCAN_START_VIRTUAL_THRESH rx_power_threshold
#define WLANC_ROAM_NEW_CONN_VIRTUAL_THRESH (rx_power_threshold * 1.1)
/* Macro definitions to compute the PLCP overhead for control and data frames. */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -