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

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

?? gpr_wlan_mac_interface.pr.c

?? opnetadhoc自組網絡源碼
?? 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一区二区三区免费野_久草精品视频
色综合天天性综合| 综合激情成人伊人| 中文字幕va一区二区三区| 一级特黄大欧美久久久| 麻豆精品精品国产自在97香蕉| 国产91在线|亚洲| 欧美精品第1页| 国产精品国产三级国产普通话蜜臀| 日本特黄久久久高潮| 色综合久久综合网欧美综合网| 久久综合色综合88| 青青草原综合久久大伊人精品| 欧美亚洲动漫制服丝袜| 国产精品久久久久久久久免费相片 | 粉嫩欧美一区二区三区高清影视| 欧美日韩一区二区三区在线看| 欧美国产在线观看| 精品一区二区精品| 欧美岛国在线观看| 日韩综合小视频| 欧美性极品少妇| 亚洲视频一区二区在线| 国产91对白在线观看九色| 日韩一区二区在线看| 日韩和欧美一区二区三区| 欧美色涩在线第一页| 亚洲自拍欧美精品| 欧美午夜不卡在线观看免费| 亚洲精品国产成人久久av盗摄| 成人的网站免费观看| 久久精品视频一区二区| 国产乱码字幕精品高清av| 亚洲精品一区二区在线观看| 人人爽香蕉精品| 91精品国产91久久综合桃花 | 欧美午夜精品久久久久久超碰| 中文字幕制服丝袜一区二区三区| 国产激情一区二区三区| 亚洲国产精品激情在线观看| 成人免费高清在线| 亚洲欧美精品午睡沙发| 欧美影视一区二区三区| 亚洲成人1区2区| 91精品视频网| 精品在线免费观看| 久久久久国产免费免费| 国产91在线观看丝袜| 亚洲日本乱码在线观看| 色94色欧美sute亚洲线路一ni| 亚洲国产精品精华液网站| 日韩一区二区三区三四区视频在线观看 | 欧美性大战久久久久久久蜜臀| 一区二区欧美国产| 在线不卡一区二区| 国产九九视频一区二区三区| 国产精品天干天干在线综合| 91视频观看视频| 亚洲成av人片在线观看无码| 日韩欧美一区二区视频| 国产乱码精品1区2区3区| 综合色中文字幕| 制服丝袜av成人在线看| 国产精品资源在线观看| 亚洲乱码中文字幕| 欧美一区二区三区日韩视频| 国产99久久精品| 亚洲一区二区视频在线| 欧美α欧美αv大片| 97国产一区二区| 美女国产一区二区| 亚洲女厕所小便bbb| 日韩欧美二区三区| av爱爱亚洲一区| 久久国内精品视频| 亚洲免费看黄网站| 久久久91精品国产一区二区精品 | 精品99一区二区| 不卡的av电影在线观看| 日韩av电影免费观看高清完整版在线观看| xfplay精品久久| 欧美三级日韩在线| av不卡在线播放| 激情五月婷婷综合| 亚洲国产日产av| 亚洲国产精品成人久久综合一区 | 国产日韩精品一区二区浪潮av| 欧美系列一区二区| 成人午夜视频在线观看| 日韩国产精品久久| 亚洲蜜臀av乱码久久精品| xnxx国产精品| 日韩欧美一区二区在线视频| 欧洲一区二区av| 不卡视频一二三四| 国产成人午夜视频| 日本sm残虐另类| 亚洲曰韩产成在线| 中文字幕人成不卡一区| 国产亚洲欧美色| 精品不卡在线视频| 日韩一区二区三区视频| 欧美日韩国产首页在线观看| 色综合视频在线观看| 大桥未久av一区二区三区中文| 国内精品免费在线观看| 美女视频黄 久久| 日日夜夜精品视频免费| 亚洲v日本v欧美v久久精品| 亚洲欧美日韩国产中文在线| 亚洲国产精品v| 欧美国产激情二区三区 | 国产·精品毛片| 国产毛片一区二区| 国产精品99久久久久久久女警 | 欧美mv日韩mv| 日韩免费一区二区| 欧美videossexotv100| 日韩免费高清视频| 久久夜色精品国产欧美乱极品| 欧美sm美女调教| 久久午夜国产精品| 国产日韩欧美激情| 日韩一区在线播放| 一区二区成人在线| 亚洲成人av电影| 蜜臀av一区二区| 国产专区欧美精品| 国内精品视频666| 成人精品免费看| 色婷婷久久久综合中文字幕| 91精品福利视频| 欧美精品久久99久久在免费线| 日韩一区二区中文字幕| 国产亚洲综合av| 国产精品成人网| 亚洲一区二区三区免费视频| 日韩精品亚洲专区| 国产露脸91国语对白| 91蝌蚪porny| 欧美二区乱c少妇| 久久久久久久久久久黄色| 国产精品电影院| 午夜影视日本亚洲欧洲精品| 激情综合网激情| 99国产精品久久久久久久久久| 欧美日韩国产综合视频在线观看| 欧美一区二区播放| 国产精品日产欧美久久久久| 一区二区久久久| 黄色资源网久久资源365| 99久久99久久久精品齐齐| 欧美手机在线视频| 国产亚洲一二三区| 亚洲h动漫在线| 成人黄色在线网站| 欧美一区二区三区四区高清| 亚洲欧洲国产日韩| 热久久一区二区| 成人av免费网站| 精品久久久久久久久久久久久久久| 中文字幕一区二区视频| 日本美女视频一区二区| 色悠久久久久综合欧美99| 亚洲精品一区在线观看| 亚洲大片免费看| 99综合电影在线视频| 精品国产露脸精彩对白| 亚洲电影激情视频网站| kk眼镜猥琐国模调教系列一区二区| 欧美老肥妇做.爰bbww| 国产精品久久久久久久久免费丝袜| 日韩av一区二| 欧美色图激情小说| 国产精品毛片大码女人| 激情偷乱视频一区二区三区| 欧美美女直播网站| 亚洲精品国久久99热| 成人免费看视频| 精品欧美黑人一区二区三区| 亚洲大片精品永久免费| 91蜜桃在线观看| 国产精品丝袜久久久久久app| 久久9热精品视频| 在线播放日韩导航| 香蕉成人伊视频在线观看| 色综合久久天天| 椎名由奈av一区二区三区| 成人亚洲一区二区一| 2020国产精品自拍| 久久国产精品无码网站| 日韩一级高清毛片| 日本在线播放一区二区三区| 在线观看一区二区视频| 亚洲人成网站色在线观看| 成人免费视频网站在线观看| 中文字幕欧美激情| 国产不卡视频在线播放| 国产日产欧产精品推荐色| 国产伦精品一区二区三区视频青涩| 日韩免费高清av|