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

📄 dpt_txdel_0.ps.c

📁 实验室前辈用OPNET做的光突发交换网络的仿真实验
💻 C
字号:
/* dpt_txdel.ps.c */                                                       
/* Default transmission delay model for pt-to-pt link Transceiver Pipeline */

/****************************************/
/*		  Copyright (c) 1993-2001		*/
/*		by OPNET Technologies, Inc.		*/
/*		(A Delaware Corporation)		*/
/*	7255 Woodmont Av., Suite 250  		*/
/*		   Bethesda, MD, U.S.A. 		*/
/*			All Rights Reserved.		*/
/****************************************/

#include "opnet.h"


#if defined (__cplusplus)
extern "C"
#endif
void
dpt_txdel (Packet * pkptr)
	{
	Objid		tx_ch_obid;
	int			pklen;
	double		tx_drate, tx_delay;

	/** Compute transmission delay associated with a	**/
	/** packet transmission on a point-to-point link.	**/
	FIN (dpt_txdel (pkptr));

	/* Obtain object id of transmitter channel forwarding transmission. */
	tx_ch_obid = op_td_get_int (pkptr, OPC_TDA_PT_TX_CH_OBJID);

	/* Obtain the transmission rate of that channel. */
	if (op_ima_obj_attr_get (tx_ch_obid, "data rate", &tx_drate) == OPC_COMPCODE_FAILURE)
		op_sim_end ("Error in point-to-point transmission delay pipeline stage (dpt_txdel):",
			"Unable to get transmission rate from channel attribute.", OPC_NIL, OPC_NIL);

	/* Obtain length of packet. */
	pklen = op_pk_total_size_get (pkptr);

	/* Compute time required to complete transmission of packet. */
	tx_delay =0;

	/* Place transmission delay in packet transmission data attribute. */
	op_td_set_dbl (pkptr, OPC_TDA_PT_TX_DELAY, tx_delay);

	FOUT;
	}                

⌨️ 快捷键说明

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