op_intrpt_source()

Abstract

Obtains the object ID of the node, link, or module that was the source of the current interrupt of the invoking process.

Syntax

op_intrpt_source ()
Argument Type Description
no arguments

Return Type

Objid

object ID of the module, node, or link that is the source of the current interrupt.

[This value may be the object ID of a node, link, processor, queue, transmitter, or receiver; for interrupts which do not have objects as sources, the special value represented by the symbolic constant OPC_OBJID_INVALID is returned.]

Example

Excerpt from: example model (models/std/tcp_ip); process model (host_ip); state (PROC_ICI); enter execs.

switch (op_intrpt_code ())
	{
	/* error from above */
	case TRANSPORT_ERROR_INDICATION:
		tran_objid = op_intrpt_source ();

		/* Find stream number used to get to this transport entity */
		for (i = 1; i <= op_strm_max_index_in(); i++)
			{
			if (tran_objid == op_topo_assoc (op_id_self (), OPC_TOPO_ASSOC_IN,
				OPC_OBJMTYPE_MODULE, i))
				break;
			}

		/* ... */
		break;

	/* ... */
	}

Details

This procedure will produce valid results when called after any interrupt; however, the following interrupts have as their source object the Simulation Kernel, identified by the constant OPC_OBJID_KERNEL:

  • begin simulation interrupt
  • end simulation interrupt
  • regular interrupt

Interrupts that are caused by a module source include:

  • statistic interrupt
  • stream interrupt
  • self interrupt
  • remote interrupt
  • access interrupt
  • procedure interrupt
  • process interrupt
  • multicast interrupt

Failure and recovery interrupts are caused by network-domain source objects (links and nodes).

Purpose

Provides a mechanism for determining the source object of an interrupt. From this object ID more detailed information can be obtained, such as the object’s type and attribute values. This is useful for writing sophisticated process logic which will respond to interrupts differently depending on aspects of the interrupt source object.

Errors

  • No errors are trapped.

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com