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

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

?? gpr_wlan_mac_interface.pr.c

?? ad hoc網絡mac層協議修改和仿真源程序
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* Process model C form file: gpr_wlan_mac_interface.pr.c */
/* Portions of this file copyright 1992-2003 by OPNET Technologies, Inc. */



/* This variable carries the header into the object file */
const char gpr_wlan_mac_interface_pr_c [] = "MIL_3_Tfile_Hdr_ 100A 30A op_runsim 7 42FB0CDA 42FB0CDA 1 zhangzhong jc 0 0 none none 0 0 none 0 0 0 0 0 0 0 0 8f3 1                                                                                                                                                                                                                                                                                                                                                                                                           ";
#include <string.h>



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



/* Header Block */

/***** Include Files. *****/

/* Address assignment definitions.	*/
#include "oms_auto_addr_support.h"

/* Topology analysis-related definitions. */
#include "oms_tan.h"

/* Process registry-related definitions. */
#include "oms_pr.h"

#define INT_MAC_ADDR_CFG	106


/***** Transition Macros ******/
#define MAC_LAYER_PKT_ARVL	(intrpt_type == OPC_INTRPT_STRM && intrpt_strm == instrm_from_mac)
#define APPL_LAYER_PKT_ARVL	(intrpt_type == OPC_INTRPT_STRM && intrpt_strm != instrm_from_mac)
#define MAC_BROADCAST		-1

/***** Functional declaration ******/
static void			wlan_mac_higher_layer_intf_sv_init ();
static void			wlan_mac_higher_layer_register_as_arp ();


/* End of Header Block */


#if !defined (VOSD_NO_FIN)
#undef	BIN
#undef	BOUT
#define	BIN		FIN_LOCAL_FIELD(_op_last_line_passed) = __LINE__ - _op_block_origin;
#define	BOUT	BIN
#define	BINIT	FIN_LOCAL_FIELD(_op_last_line_passed) = 0; _op_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 */
	Objid	                  		my_objid;
	Objid	                  		my_node_objid;
	int	                    		instrm_from_mac;
	int	                    		outstrm_to_mac;
	int	                    		destination_address;
	OmsT_Aa_Address_Handle	 		oms_aa_handle;
	int	                    		mac_address;
	Ici*	                   		wlan_mac_req_iciptr;
	} gpr_wlan_mac_interface_state;

#define pr_state_ptr            		((gpr_wlan_mac_interface_state*) (OP_SIM_CONTEXT_PTR->mod_state_ptr))
#define my_objid                		pr_state_ptr->my_objid
#define my_node_objid           		pr_state_ptr->my_node_objid
#define instrm_from_mac         		pr_state_ptr->instrm_from_mac
#define outstrm_to_mac          		pr_state_ptr->outstrm_to_mac
#define destination_address     		pr_state_ptr->destination_address
#define oms_aa_handle           		pr_state_ptr->oms_aa_handle
#define mac_address             		pr_state_ptr->mac_address
#define wlan_mac_req_iciptr     		pr_state_ptr->wlan_mac_req_iciptr

/* These macro definitions will define a local variable called	*/
/* "op_sv_ptr" in each function containing a FIN statement.	*/
/* This variable points to the state variable data structure,	*/
/* and can be used from a C debugger to display their values.	*/
#undef FIN_PREAMBLE_DEC
#undef FIN_PREAMBLE_CODE
#if defined (OPD_PARALLEL)
#  define FIN_PREAMBLE_DEC	gpr_wlan_mac_interface_state *op_sv_ptr; OpT_Sim_Context * tcontext_ptr;
#  define FIN_PREAMBLE_CODE	\
		if (VosS_Mt_Perform_Lock) \
			VOS_THREAD_SPECIFIC_DATA_GET (VosI_Globals.simi_mt_context_data_key, tcontext_ptr, SimT_Context *); \
		else \
			tcontext_ptr = VosI_Globals.simi_sequential_context_ptr; \
		op_sv_ptr = ((gpr_wlan_mac_interface_state *)(tcontext_ptr->mod_state_ptr));
#else
#  define FIN_PREAMBLE_DEC	gpr_wlan_mac_interface_state *op_sv_ptr;
#  define FIN_PREAMBLE_CODE	op_sv_ptr = pr_state_ptr;
#endif


/* Function Block */


#if !defined (VOSD_NO_FIN)
enum { _op_block_origin = __LINE__ };
#endif
static void
wlan_mac_higher_layer_intf_sv_init ()
	{
	int			type_of_service;

	/** Initializes all state variables used in this	**/
	/** process model.									**/
	FIN (wlan_mac_higher_layer_intf_sv_init ());

	/* Object identifier for the surrounding module and node.	*/
	my_objid = op_id_self ();
	my_node_objid = op_topo_parent (my_objid);

	/* Stream indices to and from the WLAN MAC process.	*/
	/* these will be set in the "exit execs" of "init".	*/
	outstrm_to_mac  = OPC_INT_UNDEF;
	instrm_from_mac = OPC_INT_UNDEF;

	/* Determine the destination to which packet should	*/
	/* be sent,and the prioritization to be provided to	*/
	/* the transmitted packet.							*/
	op_ima_obj_attr_get (my_objid, "Destination Address", &destination_address);
	
	
	
	op_ima_obj_attr_get (my_objid, "Type of Service", 	  &type_of_service);

	/* Some interface control information is needed to	*/
	/* indicate to the MAC of the destination to which	*/
	/* a given packet needs to be sent. Create it.		*/
	wlan_mac_req_iciptr = op_ici_create ("wlan_mac_request");
	op_ici_attr_set (wlan_mac_req_iciptr, "type_of_service", type_of_service);
	op_ici_attr_set (wlan_mac_req_iciptr, "protocol_type",   0x800);

	FOUT;
	}

static void
wlan_mac_higher_layer_register_as_arp ()
	{
	char				proc_model_name [128];
	OmsT_Pr_Handle		own_process_record_handle;
	Prohandle			own_prohandle;

	/** Register this process in the model-wide process registry.	**/
	FIN (wlan_mac_higher_layer_register_as_arp ());

	/* Obtain the process model name and process handle.	*/
	op_ima_obj_attr_get (my_objid, "process model", proc_model_name);
	own_prohandle = op_pro_self ();

	/* Register this process in the model-wide process registry	*/
	own_process_record_handle = (OmsT_Pr_Handle) oms_pr_process_register (
			my_node_objid, my_objid, own_prohandle, proc_model_name);

	/* Register this protocol attribute and the element address	*/
	/* of this process into the model-wide registry.			*/
	oms_pr_attr_set (own_process_record_handle,
		"protocol",		OMSC_PR_STRING,		"arp",
		OPC_NIL);

	FOUT;
	}


/* End of Function Block */

/* Undefine optional tracing in FIN/FOUT/FRET */
/* The FSM has its own tracing code and the other */
/* functions should not have any tracing.		  */
#undef FIN_TRACING
#define FIN_TRACING

#undef FOUTRET_TRACING
#define FOUTRET_TRACING

#if defined (__cplusplus)
extern "C" {
#endif
	void gpr_wlan_mac_interface (OP_SIM_CONTEXT_ARG_OPT);
	VosT_Obtype gpr_wlan_mac_interface_init (int * init_block_ptr);
	VosT_Address gpr_wlan_mac_interface_alloc (VOS_THREAD_INDEX_ARG_COMMA VosT_Obtype, int);
	void gpr_wlan_mac_interface_diag (OP_SIM_CONTEXT_ARG_OPT);
	void gpr_wlan_mac_interface_terminate (OP_SIM_CONTEXT_ARG_OPT);
	void gpr_wlan_mac_interface_svar (void *, const char *, void **);


	VosT_Fun_Status Vos_Define_Object (VosT_Obtype * obst_ptr, const char * name, unsigned int size, unsigned int init_obs, unsigned int inc_obs);
	VosT_Address Vos_Alloc_Object_MT (VOS_THREAD_INDEX_ARG_COMMA VosT_Obtype ob_hndl);
	VosT_Fun_Status Vos_Poolmem_Dealloc_MT (VOS_THREAD_INDEX_ARG_COMMA VosT_Address ob_ptr);
#if defined (__cplusplus)
} /* end of 'extern "C"' */
#endif




/* Process model interrupt handling procedure */


void
gpr_wlan_mac_interface (OP_SIM_CONTEXT_ARG_OPT)
	{

#if !defined (VOSD_NO_FIN)
	int _op_block_origin = 0;
#endif
	FIN_MT (gpr_wlan_mac_interface ());
	if (1)
		{
		List*				proc_record_handle_list_ptr;
		int					record_handle_list_size;
		OmsT_Pr_Handle		process_record_handle;
		Objid				mac_module_objid;
		Boolean				dest_addr_okay = OPC_FALSE;
		double				ne_address = OPC_DBL_UNDEF;
		int					curr_dest_addr = OMSC_AA_AUTO_ASSIGN;
		Packet*				pkptr;
		int					intrpt_type = OPC_INT_UNDEF;
		int					intrpt_strm = OPC_INT_UNDEF;
		int					i;
		OmsT_Aa_Address_Info * ith_address_info_ptr;


		FSM_ENTER ("gpr_wlan_mac_interface")

		FSM_BLOCK_SWITCH
			{
			/*---------------------------------------------------------*/
			/** state (init) enter executives **/
			FSM_STATE_ENTER_UNFORCED_NOLABEL (0, "init", "gpr_wlan_mac_interface [init enter execs]")
				FSM_PROFILE_SECTION_IN (gpr_wlan_mac_interface [init enter execs], state0_enter_exec)
				{
				/* Initialize the state variables used by this model.	*/
				wlan_mac_higher_layer_intf_sv_init ();
				
				/* Register this process as "arp" so that lower layer	*/
				/* MAC process can connect to it.						*/
				wlan_mac_higher_layer_register_as_arp ();
				
				/* Schedule a self interrupt to wait for lower layer	*/
				/* wlan MAC process to initialize and register itself in	*/
				/* the model-wide process registry.						*/
				op_intrpt_schedule_self (op_sim_time (), 0);
				
				}

				FSM_PROFILE_SECTION_OUT (gpr_wlan_mac_interface [init enter execs], state0_enter_exec)

			/** blocking after enter executives of unforced state. **/
			FSM_EXIT (1,"gpr_wlan_mac_interface")


			/** state (init) exit executives **/
			FSM_STATE_EXIT_UNFORCED (0, "init", "gpr_wlan_mac_interface [init exit execs]")
				FSM_PROFILE_SECTION_IN (gpr_wlan_mac_interface [init exit execs], state0_exit_exec)
				{
				/* Schedule a self interrupt to wait for lower layer	*/
				/* wlan MAC process to initialize and register itself in*/
				/* the model-wide process registry.						*/
				op_intrpt_schedule_self (op_sim_time (), 0);
				
				}
				FSM_PROFILE_SECTION_OUT (gpr_wlan_mac_interface [init exit execs], state0_exit_exec)


			/** state (init) transition processing **/
			FSM_TRANSIT_FORCE (5, state5_enter_exec, ;, "default", "", "init", "init2")
				/*---------------------------------------------------------*/



			/** state (idle) enter executives **/
			FSM_STATE_ENTER_UNFORCED (1, "idle", state1_enter_exec, "gpr_wlan_mac_interface [idle enter execs]")
				FSM_PROFILE_SECTION_IN (gpr_wlan_mac_interface [idle enter execs], state1_enter_exec)
				{
				
				}

				FSM_PROFILE_SECTION_OUT (gpr_wlan_mac_interface [idle enter execs], state1_enter_exec)

			/** blocking after enter executives of unforced state. **/
			FSM_EXIT (3,"gpr_wlan_mac_interface")


			/** state (idle) exit executives **/
			FSM_STATE_EXIT_UNFORCED (1, "idle", "gpr_wlan_mac_interface [idle exit execs]")
				FSM_PROFILE_SECTION_IN (gpr_wlan_mac_interface [idle exit execs], state1_exit_exec)
				{
				/* The only interrupt expected in this state is a	*/
				/* stream interrupt. It can be either from the MAC	*/
				/* layer for a packet destined for this node or		*/
				/* from the application layer for a packet destined	*/
				/* for some other node.								*/
				intrpt_type = op_intrpt_type ();
				intrpt_strm = op_intrpt_strm ();
				pkptr = op_pk_get (intrpt_strm);
				
				}
				FSM_PROFILE_SECTION_OUT (gpr_wlan_mac_interface [idle exit execs], state1_exit_exec)


			/** state (idle) transition processing **/
			FSM_PROFILE_SECTION_IN (gpr_wlan_mac_interface [idle trans conditions], state1_trans_conds)
			FSM_INIT_COND (APPL_LAYER_PKT_ARVL)
			FSM_TEST_COND (MAC_LAYER_PKT_ARVL)
			FSM_TEST_LOGIC ("idle")
			FSM_PROFILE_SECTION_OUT (gpr_wlan_mac_interface [idle trans conditions], state1_trans_conds)

			FSM_TRANSIT_SWITCH
				{
				FSM_CASE_TRANSIT (0, 2, state2_enter_exec, ;, "APPL_LAYER_PKT_ARVL", "", "idle", "appl layer arrival")
				FSM_CASE_TRANSIT (1, 3, state3_enter_exec, ;, "MAC_LAYER_PKT_ARVL", "", "idle", "mac layer arrival")
				}
				/*---------------------------------------------------------*/



			/** state (appl layer arrival) enter executives **/
			FSM_STATE_ENTER_FORCED (2, "appl layer arrival", state2_enter_exec, "gpr_wlan_mac_interface [appl layer arrival enter execs]")
				FSM_PROFILE_SECTION_IN (gpr_wlan_mac_interface [appl layer arrival enter execs], state2_enter_exec)
				{
				/* A packet has arrived from the application layer.	*/
				/* If the destination address specified is "Random"	*/
				/* then generate a destination and forward the appl	*/
				/* packet to the MAC layer with that information.	*/
				
				Ici* ici_dest_address;
				int ARP_dest_mac_addr;
				
				
				
				//ztl:should use the mac destinaiton addr resolved by route layer, throuth a ICI
				if (destination_address==-1)//if set to dyn or broadcast, use the dyn dest mac addr
				{
					ici_dest_address = op_intrpt_ici();
					op_ici_attr_get(ici_dest_address,"MAC_Destination",&ARP_dest_mac_addr);
					
					curr_dest_addr=ARP_dest_mac_addr;
					
					op_ici_destroy(ici_dest_address);
					
					if (op_prg_odb_ltrace_active ("ztl_debug") == OPC_TRUE)	
						printf("use the ARP mac addr %d",ARP_dest_mac_addr);
					op_prg_odb_bkpt("ztl_dest");
					
				}
				else
				
				
				if (destination_address == OMSC_AA_AUTO_ASSIGN)
					{
					/* Initialize current destination address to the Auto */
					/* Assign value										  */
					
					if (op_prg_odb_ltrace_active ("ztl_debug") == OPC_TRUE)
						printf("use the Auto mac addr %d ",destination_address);
					curr_dest_addr = destination_address;
				
					/* Call function to generate a random destination	*/
					/* from the pool of available addresses.			*/
					oms_aa_dest_addr_get (oms_aa_handle, &curr_dest_addr);
				
					/* Keep on generating the random addresses until source */
					/* address is not same as current address.				*/
					while (curr_dest_addr == mac_address)
						{
						/* Initialize current destination address to the Auto */
						/* Assign value										  */
						curr_dest_addr = destination_address;
				
						/* Call function to generate a random destination	*/
						/* from the pool of available addresses.			*/
						oms_aa_dest_addr_get (oms_aa_handle, &curr_dest_addr);
						}
				
					}
				else

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品毛片乱码1区2区3区| 欧美色男人天堂| 日本视频中文字幕一区二区三区| 国产精品久久久久四虎| 国产色婷婷亚洲99精品小说| 欧美电影免费观看高清完整版在线| 538在线一区二区精品国产| 在线观看91av| 日韩亚洲国产中文字幕欧美| 欧美岛国在线观看| 国产拍欧美日韩视频二区| 国产欧美久久久精品影院| 国产精品国产三级国产有无不卡| 国产精品成人免费在线| 一区二区三区高清在线| 五月天久久比比资源色| 久久se精品一区二区| 国产成人激情av| eeuss鲁片一区二区三区在线观看| www.欧美日韩国产在线| 欧美色综合久久| 日韩美女主播在线视频一区二区三区| 久久综合狠狠综合久久激情| 国产精品免费丝袜| 亚洲成a人片在线不卡一二三区| 五月激情六月综合| 国产伦理精品不卡| 99精品热视频| 日韩欧美一卡二卡| 国产精品国产自产拍在线| 一区二区三区四区视频精品免费| 五月激情六月综合| 粉嫩欧美一区二区三区高清影视 | 欧美一级日韩不卡播放免费| 精品国产污污免费网站入口| 日韩毛片一二三区| 美女mm1313爽爽久久久蜜臀| 北条麻妃国产九九精品视频| 3atv一区二区三区| 中文字幕综合网| 狠狠色狠狠色合久久伊人| 99精品一区二区三区| 精品久久久久久久久久久久包黑料 | 六月丁香综合在线视频| 91亚洲精华国产精华精华液| 538在线一区二区精品国产| 亚洲精品国产成人久久av盗摄| 日韩中文字幕亚洲一区二区va在线| 国产精品白丝jk黑袜喷水| 欧美视频一区在线观看| 中文幕一区二区三区久久蜜桃| 午夜精品久久一牛影视| www.亚洲色图| 久久九九99视频| 蜜臀av一区二区三区| 色婷婷综合久久久久中文一区二区 | 久久99久久精品| 99国产欧美另类久久久精品| 精品成人私密视频| 午夜激情一区二区三区| 色久优优欧美色久优优| 日本一区二区三区在线观看| 捆绑变态av一区二区三区| 欧美亚洲综合网| 亚洲激情自拍偷拍| 91美女片黄在线| 国产亚洲欧美色| 久久国产成人午夜av影院| 91麻豆精品国产自产在线| 亚洲午夜电影网| 91传媒视频在线播放| 亚洲欧美色一区| 一本在线高清不卡dvd| 国产精品美女久久久久aⅴ | 国产女人18水真多18精品一级做| 麻豆成人在线观看| 欧美精品乱人伦久久久久久| 亚洲国产成人va在线观看天堂| 日本韩国一区二区| 亚洲一区二区三区视频在线播放| 99久久精品一区| 一区二区三区欧美亚洲| 欧美成人精品福利| 秋霞午夜鲁丝一区二区老狼| 555www色欧美视频| 另类调教123区| 国产人伦精品一区二区| 高清不卡一区二区| 亚洲男人都懂的| 欧美三级欧美一级| 青青草97国产精品免费观看| 精品国产sm最大网站| 国产成人h网站| 日韩毛片在线免费观看| 欧美撒尿777hd撒尿| 美女视频一区二区| 国产欧美久久久精品影院| 色综合久久久久| 日韩经典一区二区| 久久久亚洲精品石原莉奈| www.视频一区| 日日夜夜免费精品视频| 26uuu精品一区二区| 91蝌蚪porny成人天涯| 日韩黄色免费电影| 日本一区二区三区高清不卡| 在线观看亚洲专区| 久久99久久久久久久久久久| 中文字幕亚洲欧美在线不卡| 欧美日韩在线综合| 国产传媒欧美日韩成人| 亚洲情趣在线观看| 精品国产一区二区三区久久影院| 93久久精品日日躁夜夜躁欧美| 丝袜亚洲另类欧美| 国产精品女同一区二区三区| 在线成人小视频| av中文字幕一区| 老司机精品视频导航| 天天综合天天做天天综合| 26uuu亚洲综合色欧美| 欧美在线播放高清精品| 国产99久久久久| 青娱乐精品视频| 亚洲精品伦理在线| 久久久99精品免费观看| 欧美精品在线一区二区三区| av高清不卡在线| 韩国av一区二区三区四区 | 99国产精品久久久久久久久久| 图片区小说区国产精品视频| 国产精品乱码一区二三区小蝌蚪| 欧美一区二区三区白人 | 亚洲精品少妇30p| 久久精品日产第一区二区三区高清版| 欧美欧美欧美欧美首页| 色婷婷一区二区三区四区| 国产成人免费视频网站| 久久精品国产亚洲5555| 日韩高清在线一区| 亚洲国产cao| 一级做a爱片久久| 亚洲精选免费视频| 国产精品久久久一本精品 | 亚洲欧洲韩国日本视频| 久久久久久久久伊人| 精品久久久久香蕉网| 日韩精品一区二区三区三区免费| 欧美日本视频在线| 欧美丝袜丝nylons| 欧美日韩综合在线| 欧美日韩在线播放三区| 欧美性猛片aaaaaaa做受| av一区二区三区| 99久久精品国产精品久久| 成人一级黄色片| 成人动漫中文字幕| 99精品在线免费| 色婷婷综合久久久久中文| 91豆麻精品91久久久久久| 91久久精品网| 欧美日韩你懂得| 制服.丝袜.亚洲.中文.综合| 欧美一区二区三区免费视频| 51午夜精品国产| 久久丝袜美腿综合| 日本一区二区三区四区在线视频| 中文字幕不卡在线观看| 中文欧美字幕免费| 亚洲欧美电影院| 亚洲电影第三页| 精品无码三级在线观看视频| 国产成人精品亚洲午夜麻豆| 丁香桃色午夜亚洲一区二区三区| 床上的激情91.| 欧美性感一类影片在线播放| 欧美一区二区三区视频免费| 久久男人中文字幕资源站| 欧美激情在线观看视频免费| 亚洲欧美电影院| 美女视频一区二区三区| 成人手机电影网| 在线播放视频一区| 国产亚洲一区二区在线观看| 亚洲色图欧洲色图| 日韩国产一区二| 99视频在线精品| 欧美一区二区三区精品| 国产精品麻豆视频| 午夜精品久久久| 粉嫩av一区二区三区| 亚洲精品一区二区三区四区高清 | 91女神在线视频| 日韩一区二区三| 亚洲欧美偷拍卡通变态| 久久99精品久久久久久久久久久久| caoporn国产精品| 久久午夜羞羞影院免费观看| 亚洲一区二区三区四区不卡| 福利一区二区在线观看|