📄 jigb_wlan_support.h
字号:
/** JIGB_wlan_support.h **/
/****************************************/
/* Copyright (c) 1987 - 2003 */
/* by OPNET Technologies, Inc. */
/* (A Delaware Corporation) */
/* 7255 Woodmont Av., Suite 250 */
/* Bethesda, MD 20814, U.S.A. */
/* All Rights Reserved. */
/****************************************/
/* Protect against multiple includes. */
#ifndef _WLAN_SUPPORT_H_INCLUDED_
#define _WLAN_SUPPORT_H_INCLUDED_
/** Include directives. **/
#include <opnet.h>
#include <oms_bgutil.h>
#if defined (__cplusplus)
extern "C" {
#endif
/** Constants **/
/* Packet lengths for control frames. */
#define WLANC_ACK_LENGTH 112 /* bits */
#define WLANC_CTS_LENGTH 112 /* bits */
#define WLANC_RTS_LENGTH 160 /* bits */
#define WLANC_REQ_LENGTH 213 /* bits */
/* Maximum data bits in MAC service data unit */
/* received from higher layer. */
#define WLANC_MAXMSDU_LENGTH 18432 /* bits */
/* Total size of MAC frame header and the FCS */
/* field in bits for the data frames that do */
/* not use the "Address 4" field. */
#define WLANC_MSDU_HEADER_SIZE 224 /* bits */
/* The size of SERVICE and Tail fields in the */
/* OFDM PLCP headers. */
#define WLANC_SERVICE_AND_TAIL_SIZE 22 /* bits */
/* Maximum tuple (or duplicate) buffer size. */
#define WLANC_TUPLE_SIZE 100 /* pkts */
/* Number of operational WLAN channels. */
#define WLANC_11a_OPER_CHNL_COUNT 12
#define WLANC_11b_OPER_CHNL_COUNT 11
/* Physical layer standard specific parameters. */
#define WLANC_11a_CHNL_BANDWIDTH 20.0 /* MHz */
#define WLANC_11b_CHNL_BANDWIDTH 22.0 /* MHz */
#define WLANC_11a_FIRST_CHNL_MIN_FREQ 5170.0 /* MHz */
#define WLANC_11b_FIRST_CHNL_MIN_FREQ 2401.0 /* MHz */
#define WLANC_11b_LAST_CHNL_MAX_FREQ 2473.0 /* MHz */
#define WLANC_11a_CHNL_SPACING 20.0 /* MHz */
#define WLANC_11b_CHNL_SPACING 5.0 /* MHz */
#define WLANC_11a_MIN_MANDATORY_DRATE 6000000.0 /* bps */
#define WLANC_11b_MIN_MANDATORY_DRATE 1000000.0 /* bps */
#define WLANC_11b_CHIP_RATE 11000000.0 /* cps */
/* PLCP overheads based on physical layer */
/* technology. */
#define WLANC_PLCP_OVERHEAD_FHSS 128E-06 /* sec */
#define WLANC_PLCP_OVERHEAD_DSSS_LONG 192E-06 /* sec */
#define WLANC_PLCP_OVERHEAD_DSSS_SHORT 96E-06 /* sec */
#define WLANC_PLCP_OVERHEAD_IR_1MBPS 57E-06 /* sec */
#define WLANC_PLCP_OVERHEAD_IR_2MBPS 45E-06 /* sec */
#define WLANC_PLCP_OVERHEAD_OFDM 20E-06 /* sec */
/* The minimum PLCP overhead in bits (infra-red */
/* PHY using 1 Mbps), which is already included */
/* in the WLAN packet formats. */
#define WLANC_DEFAULT_PLCP_OVERHEAD 57 /* bits */
/* Signal (length) extension that follows */
/* 802.11g transmissions using ERP-OFDM mode. */
#define WLANC_11g_SIGNAL_EXTENSION 6E-06 /* sec */
/* Constants used in customized WLAN pipeline */
/* stage models. */
#define WLANC_NEIGHBOR_BSS_PKT_REJECT -1
/* Reliability related constants. */
#define WLANC_AP_RELIABLE 1.0
#define WLANC_AP_UNRELIABLE 0.0
#define WLANC_AP_RELIABILITY_UNKNOWN -1.0
#define WLANC_AP_SCAN_START_THRESHOLD 0.5
#define WLANC_AP_RELIABILITY_COEFF 0.8
/* A large, random, 4-byte intger ID to */
/* identify the radio receiver channels as WLAN */
/* receiver channels before accessing their */
/* state information. */
#define WLANC_RXCH_STATE_ID 0x46FA62A7
/** Enumarated Types **/
/* Define an enumarated type for the the modeled wireless LAN frame */
/* types. Assign an hexadecimal value to represent the 2-bit type and */
/* 4-bit subtype information as specified in section 7.1.3.1.2 of IEEE */
/* 802.11 standard. Use the last two bits of the first 4 bits for type, */
/* and last 4 bits for subtype information (i.e., use the bit order/ */
/* values "0 0 b3 b2 b7 b6 b5 b4" for the hexadecimal number, where */
/* b2,...,b7 are the bit values listed in section 7.1.3.1.2). */
typedef enum WlanT_Mac_Frame_Type
{
WlanC_Beac = 0x08, /* Beacon management frame */
WlanC_Rts = 0x1B, /* RTS code set into the RTS control frame */
WlanC_Cts = 0x1C, /* CTS code set into the CTS control frame */
WlanC_Ack = 0x1D, /* ACK code set into the ACK control frame */
WlanC_Cf_End = 0x1E, /* Frame indicates the end of CFP during PCF */
WlanC_Cf_End_A = 0x1F, /* A CFP end frame with a piggybacked ACK */
WlanC_Data = 0x20, /* Data code set into the Data frame */
WlanC_Data_Ack = 0x21, /* A data frame with a pigbacked ACK sent in */
/* CFP */
WlanC_Data_Poll = 0x22, /* Send data from AP when the addressed STA */
/* is permitted to transmit during the PCF */
WlanC_Data_A_P = 0x23, /* Data + CF-Ack + CF-Poll frame */
WlanC_Data_Null = 0x24, /* If the station has been polled and no ACK */
/* or data pending to be sent, Data_Null */
/* will be transmitted */
WlanC_Cf_Ack = 0x25, /* If a pending ACK needs to be transmitted */
WlanC_Cf_Poll = 0x26, /* CFP poll frame */
WlanC_Cf_A_P = 0x27, /* CF-Ack + CF-Poll (no data) frame */
WlanC_BB = 0x28, /* Tipo A馻dido BB */
WlanC_Req = 0x29,
WlanC_None = 0xFF /* Special value for unset frame type info */
} WlanT_Mac_Frame_Type;
/* Defining codes for the physical layer characteristics type. */
typedef enum WlanT_Phy_Char_Code
{
WlanC_Frequency_Hopping,
WlanC_Direct_Sequence,
WlanC_Infra_Red,
WlanC_OFDM_11a,
WlanC_ERP_OFDM_11g
} WlanT_Phy_Char_Code;
/* Physical layer technology types based on the corresponding standard. */
typedef enum WlanT_Phy_Type
{
WlanC_11a_PHY,
WlanC_11b_PHY,
WlanC_11g_PHY
} WlanT_Phy_Type;
/* Multiple scan types are available for roaming. */
typedef enum
{
WlanC_Scan_Type_Beacon,
WlanC_Scan_Type_Distance
} WlanC_Scan_Type;
/** Structure Definitions **/
/* Data structure used within WLAN Header field of */
/* the WLAN Data packets. */
typedef struct
{
int more_frag;
int retry;
int order;
int tods;
int fromds;
double duration; /* Duration for which the channel is contended for. Network */
/* Allocation Vector per the IEEE802.11 standard. */
int address1; /* Destination Address of the final recipient(s) of the frame. */
int address2; /* Source Address from where the frame is originated. */
int address3; /* Receiver Address that identifies the immediated receipient */
/* station(s) address. */
int fragment_number; /* Sequence control field which contains fragment number */
int sequence_number; /* Sequence contorl field which contains sequence number */
int address4; /* Transmitter Address of the station that has last transmitted */
/* the frame. */
int more_data; /*If set, indicates STA has additional packets to send */
/* Currently only implemented for PCF*/
} WlanT_Data_Header_Fields;
/* Estructura para el REQ */
typedef struct
{
int more_frag;
int retry;
int order;
int tods;
int fromds;
double duration; /* Duration for which the channel is contended for. Network */
/* Allocation Vector per the IEEE802.11 standard. */
int rx_addr; /* Destination Address of the final recipient(s) of the frame. */
int tx_addr; /* Source Address from where the frame is originated. */
int P;
int Lm;
int lm;
int Nm;
int flagm;
} WlanT_Req_Header_Fields;
/* Data structure for header fields of the */
/* wireless_lan control (Rts, Cts, Ack) packet. */
typedef struct
{
int more_frag;
int retry;
int order;
int tods;
int fromds;
double duration; /* Duration for which the channel is contended for. Network */
/* Allocation Vector per the IEEE802.11 standard. */
int rx_addr; /* Destination Address of the final recipient(s) of the frame. */
int tx_addr; /* Source Address from where the frame is originated. */
} WlanT_Control_Header_Fields;
/* For PCF support, Contention Free Paramaters */
/* structure. */
typedef struct
{
double cfp_count; /* Indicates the number of beacon frames remaining till the */
/* next CFP. */
/* If this value is set to 0, indicates the start of CFP. */
int cfp_period; /* Number of beacons to be sent between the CFPs. */
double cfp_maxduration; /* Maximum allowed length of CFP in seconds. */
double cfp_durremaining; /* Time in seconds remaining in the current CFP period. */
} WlanT_CF_Parameters;
/* Beacon body structure. */
typedef struct
{
double timestamp; /* Actual tx time of the beacon frames in seconds. */
double beacon_intv; /* Time interval between target beacon transmit times. */
WlanT_CF_Parameters cf_par; /* PCF Parameters. */
Boolean non_erp_present; /* "Non ERP Present" field of ERP information element */
/* specified in 802.11g standard. */
} WlanT_Beacon_Body_Fields;
/* Record to store information related to roaming. */
typedef struct
{
PrgT_Mutex* roam_info_mutex;/* Mutex to serialize accessing the roam state information */
/* between the MAC and the power pipeline stage. */
Boolean enable_roaming; /* Roaming may be disabled based on this flag. */
Boolean scan_mode; /* Mode that indicates that the STA is scanning for a new AP . */
/* The STA will switch channels, stop transmitting until a new */
/* AP is found. */
WlanC_Scan_Type scan_type; /* We can either use beacon reception or distance to find the */
/* best AP to connect to. */
int current_bss_id; /* BSS ID for scanning purpose. */
Objid last_accepted_ap_ch_objid;
double ap_reliability; /* Indicator that stores the reliability of the current AP. */
double lat; /* Position cached for distance based roaming. */
double lon;
double alt;
} WlanT_Roam_State_Info;
/* Receiver channel state information. */
typedef struct
{
int state_info_id; /* Number to identify WLAN rx channel state info. */
Objid mac_strm_objid; /* Obj ID of the packet stream from receiver to MAC.*/
WlanT_Phy_Type phy_tech; /* WLAN Standard/PHY tech that receiver supports. */
WlanT_Roam_State_Info* roaming_info_ptr; /* Roaming relarted information. */
double rx_power_thresh; /* Power threshold for accepting received frames. */
double rx_end_time; /* Reception end time of the last received frame. */
/* Variables used in congestion areas analysis. */
double data_rate;
char * port_name_ptr;
char * node_name_ptr;
Boolean congestion_area;
OmsT_Bgutil_Routed_State* routed_bgutil_state_ptr;
} WlanT_Rx_State_Info;
/** Function Prototypes **/
WlanT_Data_Header_Fields* wlan_mac_pk_dhstruct_create (void);
WlanT_Control_Header_Fields* wlan_mac_pk_chstruct_create (void);
WlanT_Req_Header_Fields* wlan_mac_pk_rhstruct_create (void);
WlanT_Data_Header_Fields* wlan_mac_pk_dhstruct_copy (WlanT_Data_Header_Fields* pk_dh_ptr);
WlanT_Control_Header_Fields* wlan_mac_pk_chstruct_copy (WlanT_Control_Header_Fields* pk_ch_ptr);
WlanT_Req_Header_Fields* wlan_mac_pk_rhstruct_copy (WlanT_Req_Header_Fields* pk_rh_ptr);
void wlan_mac_pk_dhstruct_destroy (WlanT_Data_Header_Fields* pk_ffstruct_ptr);
void wlan_mac_pk_chstruct_destroy (WlanT_Control_Header_Fields* pk_sfstruct_ptr);
void wlan_mac_pk_rhstruct_destroy (WlanT_Req_Header_Fields* pk_sfstruct_ptr);
void wlan_mac_pk_data_header_pkprint (void* pk_dh_ptr, PrgT_List* output_list);
void wlan_mac_pk_control_header_pkprint (void* pk_ch_ptr, PrgT_List* output_list);
void wlan_mac_pk_req_header_pkprint (void* pk_rh_ptr, PrgT_List* output_list);
WlanT_Beacon_Body_Fields* wlan_mac_pk_bbstruct_create (void);
WlanT_Beacon_Body_Fields* wlan_mac_pk_bbstruct_copy (WlanT_Beacon_Body_Fields* pk_bb_ptr);
void wlan_mac_pk_bbstruct_destroy (WlanT_Beacon_Body_Fields* pk_bbstruct_ptr);
void wlan_mac_pk_beacon_body_pkprint (void* pk_bb_ptr, Prg_List* output_list);
void wlan_ap_reliability_eval (Packet *beacon_pkptr, int accepted, WlanT_Roam_State_Info*);
#if defined (__cplusplus)
} /* end of 'extern "C" {' */
#endif
/* End if for protection against multiple includes. */
#endif /* _WLAN_SUPPORT_H_INCLUDED_ */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -