op_intrpt_type()

Abstract

Obtains the type of the current interrupt of the invoking process.

Syntax

op_intrpt_type ()
Argument Type Description
no arguments

Return Type

int

Type of the current interrupt.

[This is an integer numeric code that represents one of the possible interrupt types (see Table 59 “Interrupt Type Symbolic Constants“ on page 15; the possible values of this code are also listed in the Details section).]

Example

type = op_intrpt_type ();
switch (type)
	{
	case (OPC_INTRPT_STRM):
		/* handle stream interrupts... */
		break;

	case (OPC_INTRPT_SELF):
		/* handle self interrupts... */
		break;

	case (OPC_INTRPT_STAT):
		/* handle statistic wire interrupts... */
		break;

	default:
		op_sim_end ("err: link mac: unexpected intrpt", "", "", "");
	}

Details

The interrupt type returned by this KP is that of the most recent process interrupt processed. For a child process, this is the same interrupt type as in the parent.

The numeric value returned can be compared to one of the interrupt type symbolic constants listed below:

  • OPC_INTRPT_ACCESS—access interrupt
  • OPC_INTRPT_BEGSIM—begin simulation interrupt
  • OPC_INTRPT_ENDSIM—end simulation interrupt
  • OPC_INTRPT_ESYS_INTERFACE—external system interrupt
  • OPC_INTRPT_ESYS_INTERFACE_EXT—external system interrupt (from cosimulator)
  • OPC_INTRPT_FAIL—node/link failure interrupt
  • OPC_INTRPT_MCAST—multicast interrupt
  • OPC_INTRPT_PROCEDURE—procedure interrupt
  • OPC_INTRPT_PROCESS—process interrupt
  • OPC_INTRPT_RECOVER—node/link recovery interrupt
  • OPC_INTRPT_REGULAR—regular interrupt
  • OPC_INTRPT_REMOTE—remote interrupt)
  • OPC_INTRPT_REMOTE_END_RCV—end of packet arrival at receiver
  • OPC_INTRPT_REMOTE_START_RCV—beginning of packet arrival at receiver
  • OPC_INTRPT_REMOTE_START_XMT—beginning of packet transmission at transmitter when the “split_start_radio_transmission“ preference is TRUE
  • OPC_INTRPT_SELF—self interrupt
  • OPC_INTRPT_SELF_END_XMT—end of packet transmission at transmitter
  • OPC_INTRPT_STAT—statistic interrupt
  • OPC_INTRPT_STRM—stream interrupt

Purpose

Provides a mechanism to determine what caused the invoking process to “wake up.” This KP is among the most fundamental, since almost every process model will make use of it. Many process models have one or more “branch states” which store the value returned by this procedure in a temporary variable, then choose an outgoing transition depending on the value.

Errors

  • No errors are trapped.

Reference

  • Use the KP op_intrpt_code() to determine the numeric code associated with the current interrupt
  • Use the KP op_intrpt_strm() to determine the stream index associated with the current interrupt
  • Use the KP op_intrpt_stat() to determine the input statistic index associated with a statistic interrupt
  • Use the KP op_intrpt_ici() to obtain the ICI associated with the current interrupt

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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