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

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

?? sl_aloha_ip.pr.c

?? 網絡仿真軟件OPNET ALOHA協(xié)議模型的文件
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* Process model C form file: sl_aloha_ip.pr.c */
/* Portions of this file copyright 1992-2000 by OPNET, Inc. */



/* This variable carries the header into the object file */
static const char sl_aloha_ip_pr_c [] = "MIL_3_Tfile_Hdr_ 70B 30A op_runsim 7 39C65233 39C65233 1 compaq opdemo 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 "nato.h"
#include "ip_addr_v4.h"
#include "ip_dgram_sup.h"
#include "oms_pr.h"
#include "ip_rte_v4.h"
#include <math.h>

#define MIL				1000000
#define SUB_Q			0
#define TX_PACKET		0

#define	GATEWAY_NODE	0
#define	REMOTE_NODE		1

/* Conditional macros */
#define UPPER_ARRIVAL	((intrpt_type == OPC_INTRPT_STRM) && (intrpt_strm == ip_in_strm))
#define	LOWER_ARRIVAL	((intrpt_type == OPC_INTRPT_STRM) && (intrpt_strm == rx_in_strm))
#define Q_EMPTY			(op_subq_empty (SUB_Q))
#define BEG_SLOT		((intrpt_type == OPC_INTRPT_SELF) && (intrpt_code == TX_PACKET))
#define SET_SLOT 		(op_intrpt_schedule_self ( op_sim_time() + slot_length + guard_band, TX_PACKET))

static void	put_in_q (void);
static void	send_to_ip (void);


/* 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 */
	double	                 		slot_length;
	double	                 		guard_band;
	Stathandle	             		chan_access_local_handle;
	Stathandle	             		chan_access_global_handle;
	IpT_Address	            		ip_address;
	int	                    		rx_in_strm;
	int	                    		ip_in_strm;
	int	                    		tx_out_strm;
	int	                    		ip_out_strm;
	Objid	                  		mod_objid;
	Objid	                  		node_objid;
	int	                    		node_type;
	} sl_aloha_ip_state;

#define pr_state_ptr            		((sl_aloha_ip_state*) SimI_Mod_State_Ptr)
#define slot_length             		pr_state_ptr->slot_length
#define guard_band              		pr_state_ptr->guard_band
#define chan_access_local_handle		pr_state_ptr->chan_access_local_handle
#define chan_access_global_handle		pr_state_ptr->chan_access_global_handle
#define ip_address              		pr_state_ptr->ip_address
#define rx_in_strm              		pr_state_ptr->rx_in_strm
#define ip_in_strm              		pr_state_ptr->ip_in_strm
#define tx_out_strm             		pr_state_ptr->tx_out_strm
#define ip_out_strm             		pr_state_ptr->ip_out_strm
#define mod_objid               		pr_state_ptr->mod_objid
#define node_objid              		pr_state_ptr->node_objid
#define node_type               		pr_state_ptr->node_type

/* This macro definition 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
#define FIN_PREAMBLE	sl_aloha_ip_state *op_sv_ptr = pr_state_ptr;


/* Function Block */

enum { _block_origin = __LINE__ };
static void
put_in_q (void)
	{
	Packet	*pkptr;

	FIN (put_in_q ())
	
    /* get the packet from the strm. */
	pkptr = op_pk_get (ip_in_strm);

	/* insert in q. */
    op_subq_pk_insert (SUB_Q, pkptr, OPC_QPOS_TAIL);

	FOUT
	}

static void
send_to_ip (void)
	{
	Packet				*pk_ptr;
	IpT_Dgram_Fields	*pk_fd_ptr;

	FIN (send_to_ip ())

	/* Obtain the packet off the incoming stream. */
	pk_ptr = op_pk_get (rx_in_strm);

	/* Access the fields from the packet. */
	op_pk_nfd_access (pk_ptr, "fields", &pk_fd_ptr);

	/* Check to see if this packet should be sent to IP or not. */
	if (node_type == GATEWAY_NODE)
		{
		if (pk_fd_ptr->src_addr == ip_address)
			op_pk_destroy (pk_ptr);
		else
			op_pk_send (pk_ptr, ip_out_strm);
		}
	else
		{
		if (pk_fd_ptr->dest_addr != ip_address)
			op_pk_destroy (pk_ptr);
		else
			op_pk_send (pk_ptr, ip_out_strm);
		}

	FOUT
	}

/* End of Function Block */

#if defined (__cplusplus)
extern "C" {
#endif
	void sl_aloha_ip (void);
	Compcode sl_aloha_ip_init (void **);
	void sl_aloha_ip_diag (void);
	void sl_aloha_ip_terminate (void);
	void sl_aloha_ip_svar (void *, const char *, char **);
#if defined (__cplusplus)
} /* end of 'extern "C"' */
#endif




/* Process model interrupt handling procedure */


void
sl_aloha_ip (void)
	{
	int _block_origin = 0;
	FIN (sl_aloha_ip ());
	if (1)
		{
		/* Packet pointer*/
		Packet *pkptr;
		/* The current time. */
		double current_time;
		
		/* current slot.*/
		int time_slot;
		
		/* Time of next time slot. */
		double next_time_slot;
		
		double chan_access_delay;
		
		int					intrpt_type;
		int					intrpt_strm;
		int					intrpt_code;
		
		List*				proc_record_handle_list_ptr;
		Objid				tx_objid;
		Objid				rx_objid;
		Objid				strm_objid;
		Objid				instrm;
		Objid				outstrm;
		int					record_handle_list_size;
		OmsT_Pr_Handle		process_record_handle;
		IpT_Interface_Info* ip_iface_elem_ptr;
		int					i;
		IpT_Info*			ip_info_ptr;
		Objid				ip_module_objid;
		int					ip_iface_table_size;
		Boolean				ip_addrs_found;


		FSM_ENTER (sl_aloha_ip)

		FSM_BLOCK_SWITCH
			{
			/*---------------------------------------------------------*/
			/** state (q_empty) enter executives **/
			FSM_STATE_ENTER_UNFORCED (0, state0_enter_exec, "q_empty", "sl_aloha_ip () [q_empty enter execs]")
				{
				}


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


			/** state (q_empty) exit executives **/
			FSM_STATE_EXIT_UNFORCED (0, state0_exit_exec, "q_empty", "sl_aloha_ip () [q_empty exit execs]")
				{
				/* Obtain the interrupt type.                            */
				intrpt_type = op_intrpt_type ();
				
				/* If this is a stream interrupt, obtain the stream.     */
				if (intrpt_type == OPC_INTRPT_STRM)
					intrpt_strm = op_intrpt_strm ();
				}


			/** state (q_empty) transition processing **/
			FSM_INIT_COND (UPPER_ARRIVAL)
			FSM_TEST_COND (LOWER_ARRIVAL)
			FSM_TEST_LOGIC ("q_empty")

			FSM_TRANSIT_SWITCH
				{
				FSM_CASE_TRANSIT (0, 1, state1_enter_exec, put_in_q();)
				FSM_CASE_TRANSIT (1, 0, state0_enter_exec, send_to_ip();)
				}
				/*---------------------------------------------------------*/



			/** state (decide_next_time_slot) enter executives **/
			FSM_STATE_ENTER_FORCED (1, state1_enter_exec, "decide_next_time_slot", "sl_aloha_ip () [decide_next_time_slot enter execs]")
				{
				/* Check the time of the global clock. */
				current_time = op_sim_time ();
				
				/* Get the current time slot. */
				time_slot = floor ((current_time * MIL) / ((slot_length + guard_band) * MIL));
				
				/* Figure out the next time slot. */
				next_time_slot = (time_slot + 1) * (slot_length + guard_band);
				
				/* Schedule a self intrpt for the next time slot*/
				op_intrpt_schedule_self (next_time_slot, TX_PACKET);
				}


			/** state (decide_next_time_slot) exit executives **/
			FSM_STATE_EXIT_FORCED (1, state1_exit_exec, "decide_next_time_slot", "sl_aloha_ip () [decide_next_time_slot exit execs]")
				{
				}


			/** state (decide_next_time_slot) transition processing **/
			FSM_TRANSIT_FORCE (2, state2_enter_exec, ;)
				/*---------------------------------------------------------*/



			/** state (q_not_empty) enter executives **/
			FSM_STATE_ENTER_UNFORCED (2, state2_enter_exec, "q_not_empty", "sl_aloha_ip () [q_not_empty enter execs]")
				{
				}


			/** blocking after enter executives of unforced state. **/
			FSM_EXIT (5,sl_aloha_ip)


			/** state (q_not_empty) exit executives **/
			FSM_STATE_EXIT_UNFORCED (2, state2_exit_exec, "q_not_empty", "sl_aloha_ip () [q_not_empty exit execs]")
				{
				/* Obtain the interrupt type.                            */
				intrpt_type = op_intrpt_type ();
				
				/* If this is a stream interrupt, obtain the stream.     */
				if (intrpt_type == OPC_INTRPT_STRM)
					intrpt_strm = op_intrpt_strm ();
				
				/* If this is a self interrupt, obtain the code.         */
				if (intrpt_type == OPC_INTRPT_SELF)
					intrpt_code = op_intrpt_code ();
				}


			/** state (q_not_empty) transition processing **/
			FSM_INIT_COND (BEG_SLOT)
			FSM_TEST_COND (UPPER_ARRIVAL)
			FSM_TEST_COND (LOWER_ARRIVAL)
			FSM_TEST_LOGIC ("q_not_empty")

			FSM_TRANSIT_SWITCH
				{
				FSM_CASE_TRANSIT (0, 3, state3_enter_exec, ;)
				FSM_CASE_TRANSIT (1, 2, state2_enter_exec, put_in_q();)
				FSM_CASE_TRANSIT (2, 2, state2_enter_exec, send_to_ip();)
				}
				/*---------------------------------------------------------*/



			/** state (transmit_packet) enter executives **/
			FSM_STATE_ENTER_FORCED (3, state3_enter_exec, "transmit_packet", "sl_aloha_ip () [transmit_packet enter execs]")
				{
				/* Remove the packet from the Queue. */
				pkptr = op_subq_pk_remove (SUB_Q, OPC_QPOS_HEAD);
				
				/* determine and record channel acces delay */
				chan_access_delay = op_sim_time () - op_pk_creation_time_get (pkptr);
				op_stat_write (chan_access_global_handle,
												 chan_access_delay * 1000.0);
				op_stat_write (chan_access_local_handle,
												 chan_access_delay * 1000.0);
				
				/* Send the packet at the begining of the slot. */
				op_pk_send (pkptr, tx_out_strm);
				
				
				}


			/** state (transmit_packet) exit executives **/
			FSM_STATE_EXIT_FORCED (3, state3_exit_exec, "transmit_packet", "sl_aloha_ip () [transmit_packet exit execs]")
				{
				}


			/** state (transmit_packet) transition processing **/
			FSM_INIT_COND (Q_EMPTY)
			FSM_TEST_COND (!Q_EMPTY)
			FSM_TEST_LOGIC ("transmit_packet")

			FSM_TRANSIT_SWITCH
				{
				FSM_CASE_TRANSIT (0, 0, state0_enter_exec, ;)
				FSM_CASE_TRANSIT (1, 2, state2_enter_exec, SET_SLOT;)
				}
				/*---------------------------------------------------------*/



			/** state (init) enter executives **/
			FSM_STATE_ENTER_UNFORCED (4, state4_enter_exec, "init", "sl_aloha_ip () [init enter execs]")
				{
				/* Obtain the module and node object ids. */
				mod_objid = op_id_self ();
				node_objid = op_topo_parent (mod_objid);
				
				/* get the promoted attributes at run time */
				slot_length = 0.01;
				if (op_ima_sim_attr_exists ("ALOHA Slot Length") == OPC_TRUE)
					op_ima_sim_attr_get (OPC_IMA_DOUBLE, "ALOHA Slot Length", &slot_length);
				guard_band = 0.001;
				if (op_ima_sim_attr_exists ("ALOHA Guard Band") == OPC_TRUE)
					op_ima_sim_attr_get (OPC_IMA_DOUBLE, "ALOHA Guard Band", &guard_band);
				
				/* get the statistics handles */
				chan_access_local_handle = op_stat_reg ("Chan Access Delay (msec)",
												OPC_STAT_INDEX_NONE, OPC_STAT_LOCAL);
				chan_access_global_handle = op_stat_reg ("Chan Access Delay (msec)",
												OPC_STAT_INDEX_NONE, OPC_STAT_GLOBAL);
				
				/* Obtain the object id of the connected transmitter. */
				tx_objid = op_topo_assoc (mod_objid, OPC_TOPO_ASSOC_OUT, OPC_OBJMTYPE_XMIT, 0);
				
				/* Obtain the index of the interconnecting stream. */
				strm_objid = op_topo_connect (mod_objid, tx_objid, OPC_OBJTYPE_STRM, 0);
				op_ima_obj_attr_get (strm_objid, "src stream", &tx_out_strm); 
				
				/* Obtain the object id of the connected receiver. */
				rx_objid = op_topo_assoc (mod_objid, OPC_TOPO_ASSOC_IN, OPC_OBJMTYPE_RECV, 0);
				
				/* Obtain the index of the interconnecting stream. */
				strm_objid = op_topo_connect (rx_objid, mod_objid, OPC_OBJTYPE_STRM, 0);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲欧美一区二区在线观看| 亚洲午夜免费视频| 国产精品免费视频网站| 亚洲一区在线看| 国产高清在线精品| 91精品欧美久久久久久动漫| 国产拍欧美日韩视频二区| 午夜私人影院久久久久| 成人的网站免费观看| 91精品国产色综合久久不卡电影| 国产日韩成人精品| 久久精品国产在热久久| 色又黄又爽网站www久久| 国产拍欧美日韩视频二区| 日韩av电影免费观看高清完整版在线观看| 波多野结衣在线aⅴ中文字幕不卡| 日韩一区二区免费在线电影 | 欧美一级免费大片| 亚洲免费观看高清完整版在线观看熊 | 午夜一区二区三区视频| 91在线高清观看| 中文字幕av在线一区二区三区| 久久国产精品99久久人人澡| 欧美日韩dvd在线观看| 一区二区在线观看免费| 99re成人精品视频| 自拍偷拍亚洲综合| 97精品国产97久久久久久久久久久久| 2023国产精品| 国产一区在线视频| wwwwww.欧美系列| 国产高清在线精品| 国产精品视频观看| 99精品桃花视频在线观看| 国产精品私人影院| 99re亚洲国产精品| 亚洲免费伊人电影| 精品视频一区 二区 三区| 亚洲一区二区三区美女| 欧美性生活久久| 午夜精品一区二区三区电影天堂 | 欧美日韩免费一区二区三区视频| 中文字幕字幕中文在线中不卡视频| 成人高清免费在线播放| 国产精品污污网站在线观看| av不卡一区二区三区| 亚洲人成网站色在线观看| 91黄色小视频| 日韩国产在线观看一区| 日韩欧美不卡在线观看视频| 国产一区二区三区电影在线观看| 久久综合999| 99国产精品99久久久久久| 亚洲在线免费播放| 欧美大片拔萝卜| 国产丶欧美丶日本不卡视频| 午夜视频一区二区三区| 91精品婷婷国产综合久久竹菊| 精品夜夜嗨av一区二区三区| 久久久亚洲午夜电影| 色哟哟一区二区| 奇米精品一区二区三区四区| 国产欧美日韩亚州综合 | 亚洲欧美中日韩| 欧美日韩一级黄| 国产精品一区三区| 亚洲精品老司机| 欧美成人video| 99视频精品在线| 免费在线看一区| 椎名由奈av一区二区三区| 日韩午夜小视频| 99久久国产综合精品女不卡| 免费人成在线不卡| 国产精品国产三级国产普通话三级 | 国产一区二区91| 一卡二卡三卡日韩欧美| 精品日产卡一卡二卡麻豆| 9色porny自拍视频一区二区| 免费一级片91| 依依成人综合视频| 国产精品欧美一区二区三区| 欧美人狂配大交3d怪物一区| 丁香亚洲综合激情啪啪综合| 午夜欧美大尺度福利影院在线看| 欧美极品aⅴ影院| 日韩欧美一二区| 欧美亚洲另类激情小说| 成人国产精品免费| 久久99精品久久久久婷婷| 亚洲影视资源网| 国产精品污污网站在线观看| 精品伦理精品一区| 欧美日韩一区二区三区四区五区| 成人精品视频网站| 国产一区在线观看麻豆| 日韩二区三区四区| 一区二区三区日韩欧美| 中文字幕欧美三区| 久久久久青草大香线综合精品| 欧美三区免费完整视频在线观看| 成人午夜视频福利| 国产麻豆精品95视频| 蜜桃av噜噜一区| 日韩国产精品大片| 亚洲电影第三页| 亚洲一区二区五区| 一区二区三区毛片| 一区二区在线观看视频| 国产精品久久久久9999吃药| 国产欧美精品日韩区二区麻豆天美| 欧美变态tickle挠乳网站| 欧美一区二区免费| 日韩午夜小视频| 亚洲精品在线电影| 久久久久久久国产精品影院| 精品国产一区二区国模嫣然| 欧美成人a在线| 亚洲精品一区在线观看| www欧美成人18+| 亚洲国产精品精华液2区45| 国产无一区二区| 国产精品久久久久aaaa| 亚洲视频1区2区| 亚洲黄色小说网站| 亚洲国产欧美日韩另类综合| 亚洲高清中文字幕| 日韩高清不卡一区二区三区| 美女视频一区二区| 国产一区啦啦啦在线观看| 国产成人在线视频免费播放| 国产不卡视频一区二区三区| 国产成人在线视频免费播放| 成人黄色在线看| 色拍拍在线精品视频8848| 在线视频你懂得一区二区三区| 欧美日韩亚洲综合在线| 91精品国产一区二区三区 | 欧美乱妇15p| 日韩精品资源二区在线| 久久视频一区二区| 亚洲欧美日韩久久精品| 首页综合国产亚洲丝袜| 国产精品影视天天线| av毛片久久久久**hd| 欧美日韩一级视频| 精品999久久久| 亚洲同性同志一二三专区| 日日夜夜精品免费视频| 国产米奇在线777精品观看| 成人高清免费在线播放| 欧美二区在线观看| 亚洲国产精品影院| 国产美女一区二区三区| 一本久久综合亚洲鲁鲁五月天| 欧美人体做爰大胆视频| 久久久久88色偷偷免费| 亚洲午夜电影在线| 国产精品一区一区| 欧美精选午夜久久久乱码6080| 欧美α欧美αv大片| 亚洲一区二区三区四区中文字幕| 麻豆国产精品777777在线| 91尤物视频在线观看| 日韩一级黄色片| 亚洲精品免费视频| 国产一区美女在线| 3d动漫精品啪啪1区2区免费| 国产精品久久久久久久久免费樱桃| 午夜欧美电影在线观看| eeuss鲁一区二区三区| 欧美成人一区二区| 亚洲电影中文字幕在线观看| 成人性生交大片免费看视频在线| 欧美日韩1区2区| 亚洲综合在线电影| 成人免费视频播放| 精品福利一区二区三区| 亚洲福利一二三区| 色呦呦国产精品| 国产精品久久久久久亚洲毛片| 黑人巨大精品欧美一区| 欧美精三区欧美精三区| 一级做a爱片久久| 色综合久久中文综合久久97| 国产亚洲制服色| 久久99深爱久久99精品| 91精品国产色综合久久不卡蜜臀| 亚洲女人的天堂| 99久久精品国产网站| 国产日产欧产精品推荐色| 国产综合久久久久久鬼色| 日韩午夜精品电影| 成人国产亚洲欧美成人综合网| 久久午夜老司机| 国产一二精品视频| 国产日产亚洲精品系列| 国产精品中文欧美| 久久综合久久久久88| 国产综合久久久久影院|