⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 jigb_wlan_mac_sheu.pr.c

📁 利用opnet网络仿真软件,研究802.11的QOS,可以利用此模块研究802.11e
💻 C
📖 第 1 页 / 共 5 页
字号:
/* Process model C form file: JIGB_wlan_mac_Sheu.pr.c */
/* Portions of this file copyright 1992-2004 by OPNET Technologies, Inc. */



/* This variable carries the header into the object file */
const char JIGB_wlan_mac_Sheu_pr_c [] = "MIL_3_Tfile_Hdr_ 110A 30A modeler 7 44B4D3CD 44B4D3CD 1 DIPRO2 pfc 0 0 none none 0 0 none 0 0 0 0 0 0 0 0 b56 1                                                                                                                                                                                                                                                                                                                                                                                                                ";
#include <string.h>



/* OPNET system definitions */
#include <opnet.h>



/* Header Block */

/** Include files **/

#include <math.h>
#include <string.h>
#include "oms_pr.h"
#include "oms_tan.h"
#include "oms_bgutil.h"
#include "JIGB_wlan_support.h"
#include "oms_auto_addr_support.h"
#include "oms_dist_support.h"
#include "bridge_header.h"	
#include "prg_mapping.h"
#include <prg_geo.h>
#include <oms_rr.h>  

/** Constants **/

/* Incoming statistics and stream wires.							*/
#define 	TRANSMITTER_BUSY_INSTAT		1
#define		LOW_LAYER_INPUT_STREAM		0
#define		LOW_LAYER_OUTPUT_STREAM		0

/* Flags to load different variables based on attribute settings.	*/
#define		WLAN_AP						1
#define		WLAN_STA					0

/* Flags to indicate the medium access mode (PCF/DCF).				*/
#define		PCF_ACTIVE					1
#define		PCF_INACTIVE				0

/* Special value indicating BSS identification is not used.			*/
#define		WLAN_BSSID_NOT_USED			-1

/* Special value indicating radio transceiver frequencies are set	*/
/* based on the BSS identification.									*/
#define 	BSS_BASED_FREQ_USED			-1.0

/* Special value indicating that the bandwidth of the transceiver	*/
/* channels are configured to use the standard value of the			*/
/* specified physical layer technology.								*/
#define		PHY_TECH_BASED_BW_USED		-1.0

/* Special value indicating that the number of back-off slots are	*/
/* not determined yet.												*/
#define		BACKOFF_SLOTS_UNSET			-1.0

/* Special value for nav_reset_time when NAV is not set based on a	*/
/* received RTS.													*/
#define		NAV_RESET_TIME_UNSET		-1.0
	
/* Define a small value (= 1 psec), which will be used to recover	*/
/* from double arithmetic precision losts while doing time related	*/
/* precision sensitive computations.								*/
#define		PRECISION_RECOVERY			0.000000000001

/* Special value indicating BSS identification is currently unset.	*/
#define 	WLANC_BSS_ID_UNKNOWN		-2

/* Speed of light (m/s). 											*/
#define 	C							3.0E+08		

/* 16 times pi-squared. 											*/
#define 	SIXTEEN_PI_SQ				(16.0 * VOSC_NA_PI * VOSC_NA_PI)	

/* A small delay (= 10 nsec) between the transmission and reception	*/
/* of a CTS-to-self message to guarantee that the packet isn't		*/
/* delivered before the transmitter completes the transmission.		*/
#define		CTS_TO_SELF_RX_DELAY		0.00000001

/* In the idle state, number of beacon intervals after which the STA will wake	*/
/* up to check if it is still connected, if scanning is based on beacon			*/
/* reliability. There are no interrupts pending in the idle state, therefore,	*/
/* it is possible that the STA's state may be set to "scan" from a pipeline		*/
/* state without the MAC becoming aware of the state change till a packet		*/
/* arrives from the higher layer. Hence, there is a need to schedule periodic	*/
/* interrupts when in IDLE.    													*/
#define WLANC_CONN_CHK_BEACON_MULT		5.0  

/* Period after which the STA will check for connectivity if scanning is		*/
/* distance based. 																*/
#define WLANC_CONN_CHK_DIST_INTERVAL	10.0

/* When in the SCAN state, the period that an STA will wait before trying a new	*/
/* channel. 																	*/
#define WLANC_NEW_SCAN_BEACON_MULT		2.5


/** Enumerated Types **/

/* Define the three possible values that a global variable takes				*/
/* to check and ensure that all the MAC modules are either BSS ID				*/
/* based or purely subnet based. The variable is initialized to					*/
/* Not_Set and the first wireless MAC process sets it to either					*/
/* Entire_Subnet (if BSS_Identifier is Not Used) or Bssid_Subnet				*/
/* (if the BSS_Identifier is set to some value other than Not					*/
/* Used).																		*/						  
typedef enum WlanT_Bssid_Approach
	{
	WlanC_Not_Set,						/* Type of network not set				*/
	WlanC_Entire_Subnet,				/* The network is a pure subnet			*/
	WlanC_Bss_Divided_Subnet			/* The network is a BSS based subnet	*/
	} WlanT_Bss_Identification_Approach;
 
/* Define interrupt codes for generating handling interrupts					*/
/* indicating changes in deference, frame timeout which infers         			*/
/* that the collision has occurred, random backoff and transmission 			*/
/* completion by the physical layer (self interrupts).							*/
typedef enum WlanT_Mac_Intrpt_Code
	{	
	WlanC_Deference_Off,  	/* Deference before frame transmission 				*/
	WlanC_Pifs_Off,         /* Primera parte espera PIFS del Alg. de Sheu		*/
	WlanC_Sifs_Off,         /* Para identificar la espera SIFS del Alg. de Sheu	*/
	WlanC_Pifs_Off2,        /* Segunda parte espera PIFS del Alg. de Sheu		*/
	WlanC_Frame_Timeout,	/* No frame rcvd in set duration (infer collision)	*/
	WlanC_Backoff_Elapsed,  /* Backoff done before frame transmission			*/
	WlanC_CW_Elapsed,		/* Backoff done after successful frame transmission	*/	
	WlanC_Beacon_Tx_Time,	/* Time to transmit beacon frame                    */
	WlanC_Cfp_End,			/* End of the Contention free period 				*/
	WlanC_Scan_Timeout,		/* End of scan duration for given channel 			*/
	WlanC_AP_Check_Timeout,	/* Time to check the connectivity status with the	*/
							/* current AP.										*/
	WlanC_NAV_Reset_Time	/* Time to reset NAV that is updated by an RTS.		*/
	} WlanT_Mac_Intrpt_Code;


/** Data Structures **/

/* Define a structure to maintain data fragments received by each 	  */
/* station for the purpose of reassembly (or defragmentation)		  */
typedef struct WlanT_Mac_Defragmentation_Buffer_Entry
	{		
	int			tx_station_address    ;/* Store the station address of transmitting station  		*/	 
	double		time_rcvd		      ;/* Store time the last fragment for this frame was received	*/ 
	Sbhandle	reassembly_buffer_ptr ;/* Store data fragments for a particular packet       		*/  		 
	} WlanT_Mac_Defragmentation_Buffer_Entry;

/* Define a structure to maintain a copy of each unique data frame      */
/* received by the station. This is done so that the station can    	*/
/* discard any additional copies of the frame received by it. 	   		*/
typedef struct WlanT_Mac_Duplicate_Buffer_Entry
	{	
	int         tx_station_address;  /* store the station address of transmitting station	*/
	int 		sequence_id		  ;  /* rcvd packet sequence id 						 	*/	
	int		    fragment_number	  ;  /* rcvd packet fragment number                      	*/	 
	} WlanT_Mac_Duplicate_Buffer_Entry;

/* This structure contains all the flags used in this process model to determine	*/
/* various conditions as mentioned in the comments for each flag					*/
typedef struct WlanT_Mac_Flags

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -