亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? aodv_wlan_mac.pr.c

?? 感知無線電有關仿真
?? C
?? 第 1 頁 / 共 5 頁
字號:
/* Process model C form file: aodv_wlan_mac.pr.c */
/* Portions of this file copyright 1992-2002 by OPNET Technologies, Inc. */



/* This variable carries the header into the object file */
static const char aodv_wlan_mac_pr_c [] = "MIL_3_Tfile_Hdr_ 81A 30A modeler 7 47F08F70 47F08F70 1 jujumao Administrator 0 0 none none 0 0 none 0 0 0 0 0 0                                                                                                                                                                                                                                                                                                                                                                                                                ";
#include <string.h>



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

#if defined (__cplusplus)
extern "C" {
#endif
FSM_EXT_DECS
#if defined (__cplusplus)
} /* end of 'extern "C"' */
#endif


/* Header Block */

#include <math.h>
#include "oms_pr.h"
#include "oms_tan.h"
#include "oms_bgutil.h"

/* Definitions to all protocol specific parameters*/
#include "wlan_support.h"

/* Station address assignment definitions.				  */ 
#include "oms_auto_addr_support.h"
#include "oms_dist_support.h"

//$$$$$$$$$$$$$$$$$$ DSR $$$$$$$$$$$$$$$$$$$$$$$$
// define packet Types
#define DATA_PACKET_TYPE 5
#define REQUEST_PACKET_TYPE 7
#define REPLY_PACKET_TYPE 11
#define ERROR_PACKET_TYPE 13

// remote intrpt or self intrpt codes definition
#define ACK_CODE 10000
#define ERROR_CODE 20000
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
//#define WLANC_MSDU_HEADER_SIZE 272

/* incoming statistics and stream wires */
#define 	TRANSMITTER_INSTAT				2
#define		RECEIVER_BUSY_INSTAT	    	1
#define		RECEIVER_COLL_INSTAT	    	0
#define		LOW_LAYER_INPUT_STREAM_CH4		3
#define 	LOW_LAYER_OUT_STREAM_CH1		0
#define 	LOW_LAYER_OUT_STREAM_CH2		1
#define 	LOW_LAYER_OUT_STREAM_CH3		2
#define 	LOW_LAYER_OUT_STREAM_CH4		3

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


//$$$$$$$$$$$$$$$$$$ DSR $$$$$$$$$$$$$$$$$$$$$$$$
Stathandle stat_mac_failed_data;
int mac_failed_data;
Stathandle stat_mac_failed_reply;
int mac_failed_reply;
Stathandle stat_mac_failed_error;
int	mac_failed_error=0;
Stathandle stat_mac_total_failed;
int mac_total_failed=0;
Stathandle stat_mac_retry_rts;
int mac_retry_rts;
Stathandle stat_mac_retry_data;
int mac_retry_data;
Stathandle stat_mac_retry_reply;
int mac_retry_reply;
Stathandle stat_mac_retry_error;
int mac_retry_error;
Stathandle stat_mac_total_retry;
int mac_total_retry;
//$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$

/* 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_Frame_Timeout,	/* No frame rcvd in set duration (infer collision)	*/
	WlanC_Backoff_Elapsed,  /* Backoff done before frame transmission			*/
	WlanC_CW_Elapsed		/* Bakcoff done after successful frame transmission	*/	
	} WlanT_Mac_Intrpt_Code;

/* Define codes for data and managment frames use in DCF		        */
/* The code defined is consistent with IEEE 802.11 format			    */
/* There are 6 bits used to define the code and in the following        */
/* enumeration the first 6 bits are used in the type field of the frame.*/
typedef enum WlanT_Mac_Frame_Type
	{
	WlanC_Rts  = 0x6C, /* Rts code set into the Rts control frame */
    WlanC_Cts  = 0x70, /* Cts code set into the Cts control frame */
	WlanC_Ack  = 0x74, /* Ack code set into the Ack control frame */
 	WlanC_Data = 0x80, /* Data code set into the Data frame       */
	WlanC_None = 0x00  /* None type 							  */
	} 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					
	} WlanT_Phy_Char_Code;

/* 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
	{
	Boolean 	data_frame_to_send; /* Flag to check when station needs to transmit.		*/ 
	Boolean     backoff_flag;  	    /* Backoff flag is set when either the collision is		*/
	                                /* inferred or the channel switched from busy to idle	*/
	Boolean		rts_sent;   		/* Flag to indicate that wether the Rts for this		*/
								    /* particular data frame is sent						*/
	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		cw_required;		/* Indicates the arrival of an ACK making the 			*/
									/* transmission successful, which requires a CW period.	*/
	Boolean		nav_updated;		/* Indicates a new NAV value since the last time when	*/
									/* self interrupt is scheduled for the end of deference.*/
	} WlanT_Mac_Flags;

/* This structure contains the destination address to which the received */
/* data packet needs to be sent and the contents of the recieved 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;

/**	Macros	Definition														**/
/** The data frame send flag is set whenever there is a data to be send by	**/
/** the higher layer or the response frame needs to be sent. However,in 	**/
/** either case the flag will not be set if the receiver is busy			**/
/** Frames cannot be transmitted until medium is idle. Once, the medium 	**/
/** is available then the station is eligible to transmit provided there	**/
/** is a need for backoff. Once the transmission is complete then the		**/
/** station will wait for the response provided the frame transmitted  		**/
/** requires a response (such as Rts and Data frames). If response			**/
/** is not needed then the station will defer to transmit next packet		**/

/* After receiving a stream interrupt, we need to switch states from	*/
/* idle to defer or transmit if there is a frame to transmit and the	*/
/* receiver is not busy													*/ 
#define READY_TO_TRANSMIT		((intrpt_type == OPC_INTRPT_STRM || (intrpt_type == OPC_INTRPT_SELF && intrpt_code == WlanC_CW_Elapsed)) && \
								(wlan_flags->data_frame_to_send == OPC_BOOLINT_ENABLED || fresp_to_send != WlanC_None) && \
								wlan_flags->receiver_busy == OPC_BOOLINT_DISABLED && \
								(current_time >= cw_end || fresp_to_send != WlanC_None))
	
/* When we have a frame to transmit, we move to transmit state if the	*/
/* medium was idle for at least a DIFS time, otherwise we go to defer	*/
/* state.																*/
#define MEDIUM_IS_IDLE			((current_time - nav_duration >= difs_time) && \
	             				 (wlan_flags->receiver_busy == OPC_BOOLINT_DISABLED) && \
								 (current_time - rcv_idle_time >= difs_time))

/* Change state to Defer from Frm_End, if the input buffers are not empty or a frame needs	*/
/* to be retransmitted or the station has to respond to some frame.							*/		
#define FRAME_TO_TRANSMIT		((wlan_flags->data_frame_to_send == OPC_BOOLINT_ENABLED && current_time >= cw_end) || \
	                             fresp_to_send != WlanC_None || \
	                             retry_count != 0)
	
/* After defering for either collision avoidance or interframe gap      */
/* the channel will be available for transmission 						*/
#define DEFERENCE_OFF			(intrpt_type == OPC_INTRPT_SELF && \
								 intrpt_code == WlanC_Deference_Off && \
								 wlan_flags->receiver_busy == OPC_BOOLINT_DISABLED)

/* Isssue a transmission complete stat once the packet has successfully */
/* been transmitted from the source station								*/						 
#define TRANSMISSION_COMPLETE	(intrpt_type == OPC_INTRPT_STAT && \
								 op_intrpt_stat () == TRANSMITTER_INSTAT)

/* Backoff is performed based on the value of the backoff flag.			*/
#define PERFORM_BACKOFF			(wlan_flags->backoff_flag == OPC_BOOLINT_ENABLED)

/* Need to start transmitting frame once the backoff (self intrpt) 		*/
/* completed															*/
#define BACKOFF_COMPLETED		(intrpt_type == OPC_INTRPT_SELF && \
								 intrpt_code == WlanC_Backoff_Elapsed && \
								 wlan_flags->receiver_busy == OPC_BOOLINT_DISABLED)

/* After transmission the station will wait for a frame response for   */
/* Data and Rts frames.												   */
#define WAIT_FOR_FRAME          (expected_frame_type != WlanC_None)

/* Need to retransmit frame if there is a frame timeout and the        */
/* required frame is not received									   */
#define FRAME_TIMEOUT           (intrpt_type == OPC_INTRPT_SELF && intrpt_code == WlanC_Frame_Timeout)

/* If the frame is received appropriate response will be transmitted   */
/* provided the medium is considered to be idle						   */
#define FRAME_RCVD			    (intrpt_type == OPC_INTRPT_STRM && wlan_flags->rcvd_bad_packet == OPC_BOOLINT_DISABLED && \
		 						 i_strm <= LOW_LAYER_INPUT_STREAM_CH4)

/* Skip backoff if no backoff is needed								   */
#define TRANSMIT_FRAME			(wlan_flags->backoff_flag == OPC_BOOLINT_DISABLED)

/* Expecting frame response	after data or Rts transmission			   */
#define EXPECTING_FRAME			(expected_frame_type != WlanC_None)

/* Macros that check the change in the busy status of the receiver.	   */
#define	RECEIVER_BUSY_HIGH		(intrpt_type == OPC_INTRPT_STAT && intrpt_code == RECEIVER_BUSY_INSTAT && \
								 op_stat_local_read (RECEIVER_BUSY_INSTAT) == 1.0)
#define	RECEIVER_BUSY_LOW		(intrpt_type == OPC_INTRPT_STAT && intrpt_code == RECEIVER_BUSY_INSTAT && \
								 op_stat_local_read (RECEIVER_BUSY_INSTAT) == 0.0)

/* Function declarations.	*/
static void			wlan_mac_sv_init ();
static void			wlan_higher_layer_data_arrival ();
static void			wlan_physical_layer_data_arrival ();
static void			wlan_hlpk_enqueue (Packet* hld_pkptr, int dest_addr);
Boolean 			wlan_tuple_find (int sta_addr, int seq_id, int frag_num);
static void			wlan_data_process (Packet* seg_pkptr, int sta_addr, int final_dest_addr, int frag_num, int more_frag, int pkt_id, int rcvd_sta_bssid);
static void			wlan_accepted_frame_stats_update (Packet* seg_pkptr);
static void			wlan_interrupts_process ();
static void 		wlan_prepare_frame_to_send (int frame_type);
static void			wlan_frame_transmit ();
static void			wlan_schedule_deference ();
static void			wlan_frame_discard ();
static void			wlan_mac_error (char* msg1, char* msg2, char* msg3);


/* End of Header Block */


#if !defined (VOSD_NO_FIN)
#undef	BIN
#undef	BOUT
#define	BIN		FIN_LOCAL_FIELD(last_line_passed) = __LINE__ - _block_origin;
#define	BOUT	BIN
#define	BINIT	FIN_LOCAL_FIELD(last_line_passed) = 0; _block_origin = __LINE__;
#else
#define	BINIT
#endif /* #if !defined (VOSD_NO_FIN) */



/* State variable definitions */
typedef struct
	{
	/* Internal state tracking for FSM */
	FSM_SYS_STATE
	/* State Variables */
	int	                    		retry_count;
	int	                    		intrpt_type;
	WlanT_Mac_Intrpt_Code	  		intrpt_code;
	int	                    		my_address;
	List*	                  		hld_list_ptr;
	double	                 		operational_speed;
	int	                    		frag_threshold;
	int	                    		packet_seq_number;
	int	                    		packet_frag_number;
	int	                    		destination_addr;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99精品在线观看视频| 亚洲国产高清不卡| 国产午夜精品一区二区三区嫩草| 国产精品入口麻豆九色| 日本视频一区二区三区| 波多野结衣视频一区| 日韩一区二区电影在线| 国产精品国产a级| 青青青伊人色综合久久| 99精品偷自拍| 久久伊99综合婷婷久久伊| 亚洲国产精品久久不卡毛片| 国产凹凸在线观看一区二区| 欧美日韩国产一级| 亚洲另类在线制服丝袜| 国产麻豆视频一区二区| 欧美区一区二区三区| 亚洲美女淫视频| 成人午夜电影网站| 精品国产伦一区二区三区观看方式 | 99精品视频一区二区三区| 欧美大尺度电影在线| 午夜精品123| 欧美丝袜丝交足nylons图片| 亚洲人xxxx| 成人黄页毛片网站| 国产精品美女一区二区在线观看| 久久91精品国产91久久小草| 在线播放91灌醉迷j高跟美女| 一区二区在线观看视频| 色综合天天在线| 亚洲婷婷综合色高清在线| 国产成人自拍网| 欧美高清在线视频| 国产乱码精品一区二区三区忘忧草| 欧美一区二区三区免费大片| 亚洲国产视频一区二区| 色8久久精品久久久久久蜜| 最新国产の精品合集bt伙计| www.亚洲精品| 亚洲人成网站色在线观看| 波波电影院一区二区三区| 国产精品久久久久国产精品日日| av日韩在线网站| 成人欧美一区二区三区| 色综合色综合色综合色综合色综合 | 日本大胆欧美人术艺术动态| 538在线一区二区精品国产| 亚洲成人久久影院| 欧美一区二区三区的| 奇米888四色在线精品| 欧美一级国产精品| 欧美aaa在线| 国产拍欧美日韩视频二区| 成人性生交大片免费看中文| 亚洲欧美综合网| 在线观看成人免费视频| 日韩成人免费看| 国产欧美一区二区三区在线看蜜臀| 国产成人午夜片在线观看高清观看| 国产拍揄自揄精品视频麻豆| 一本色道久久综合精品竹菊| 亚洲午夜久久久久久久久久久| 3751色影院一区二区三区| 国产在线视视频有精品| 国产精品久久久久aaaa樱花 | 国产精品久久久久久久久动漫| 一本色道久久综合狠狠躁的推荐| 天天做天天摸天天爽国产一区| 欧美一区二区三区在线观看| 粉嫩av一区二区三区粉嫩| 亚洲第一主播视频| 久久久久国产精品免费免费搜索| 91美女视频网站| 美女视频黄频大全不卡视频在线播放 | 亚洲国产另类av| 久久久久国产精品麻豆| 欧美亚洲日本一区| 国产精品中文字幕欧美| 一区二区三区毛片| 久久精品人人做人人爽人人| 91福利国产精品| 国产乱国产乱300精品| 亚洲在线一区二区三区| 精品日韩成人av| 日本丶国产丶欧美色综合| 久久66热偷产精品| 亚洲成人av在线电影| 国产精品久久午夜| 日韩一级视频免费观看在线| 91女厕偷拍女厕偷拍高清| 久久99国产精品免费| 午夜欧美大尺度福利影院在线看| 欧美极品aⅴ影院| 日韩一级片网站| 欧美在线免费视屏| 成人免费黄色大片| 狠狠色狠狠色合久久伊人| 婷婷开心激情综合| 最新久久zyz资源站| 国产欧美视频一区二区| 日韩午夜激情电影| 欧美理论电影在线| 色妞www精品视频| www.久久精品| 国产91精品欧美| 九九热在线视频观看这里只有精品| 亚洲成人手机在线| 一区二区三区毛片| 亚洲精品久久久蜜桃| 最近日韩中文字幕| 亚洲欧美在线视频| 国产精品福利在线播放| 国产精品久久影院| 一区精品在线播放| 亚洲六月丁香色婷婷综合久久| 国产精品成人一区二区艾草| 国产欧美精品日韩区二区麻豆天美| 日韩免费高清av| 欧美α欧美αv大片| 精品国产乱码久久久久久久久| 日韩精品一区二区三区中文不卡| 69p69国产精品| 日韩欧美中文一区二区| 日韩欧美中文字幕制服| 日韩免费电影网站| 久久久99精品久久| 国产精品毛片久久久久久久| 中文字幕佐山爱一区二区免费| 中国色在线观看另类| 亚洲日本在线观看| 亚洲一区国产视频| 奇米777欧美一区二区| 国模一区二区三区白浆 | 天堂精品中文字幕在线| 午夜精品久久久久久久99樱桃| 亚洲午夜精品17c| 麻豆成人av在线| 国产精品自在在线| 91在线免费看| 欧美色视频在线观看| 日韩一区二区在线看片| 久久综合色之久久综合| 国产精品久久久久久亚洲伦| 亚洲欧美日韩电影| 日本中文字幕一区| 国产河南妇女毛片精品久久久| jlzzjlzz欧美大全| 精品视频在线免费看| 日韩精品一区二区在线| 国产精品久久久久一区| 日韩精品一级中文字幕精品视频免费观看 | 欧美久久一区二区| 久久久久久久久久久黄色| 中文字幕一区二区三区不卡| 亚洲永久精品大片| 激情综合色丁香一区二区| www.亚洲色图.com| 日韩三级伦理片妻子的秘密按摩| 国产欧美精品日韩区二区麻豆天美| 夜夜嗨av一区二区三区| 精品亚洲成av人在线观看| www.66久久| 2021中文字幕一区亚洲| 亚洲一区二区在线播放相泽| 久久99国产精品麻豆| 日本精品裸体写真集在线观看| 欧美成人精精品一区二区频| 亚洲欧美激情视频在线观看一区二区三区 | 欧美一卡二卡在线| 亚洲激情图片一区| 国产精品99久| 91精品国产色综合久久不卡蜜臀| 综合久久综合久久| 国产黄色精品视频| 日韩精品中文字幕在线不卡尤物| 亚洲美女淫视频| 成人国产亚洲欧美成人综合网| 日韩欧美一级二级三级久久久| 亚洲精品日韩专区silk| 国产成人免费视频网站高清观看视频| 欧美日韩激情在线| 一区二区三区四区在线免费观看 | 精品国产在天天线2019| 亚洲第一主播视频| 色哦色哦哦色天天综合| 1000部国产精品成人观看| 国产福利一区二区三区在线视频| 3d成人h动漫网站入口| 亚洲一卡二卡三卡四卡| 91视频www| 中文字幕在线不卡一区| 国产一区二区三区综合| 88在线观看91蜜桃国自产| 国产精品久线观看视频| 成人国产精品免费观看视频| 日韩一级黄色片| 亚洲综合久久久| 欧美亚洲日本一区| 亚洲桃色在线一区|