op_ev_type()

Abstract

Obtains the type of the event.

Syntax

op_ev_type (evhandle)
Argument Type Description
evhandle Evhandle event handle that identifies the event
[An event handle can be obtained from several KPs in this package—such as op_ev_current(), op_ev_seek_time(), and op_ev_next()—and others such as op_intrpt_schedule_self().].

Return Type

int

Type of the specified event (also referred to as the interrupt type).

This is an integer numeric code representing one of the possible event types (see Table 59 “Interrupt Type Symbolic Constants“ on page 15). The constant OPC_INTRPT_INVALID is returned if a recoverable error occurs.

Example

/* Obtain the currently executing event (it must be at this module, */
/* since this module woke up.) and the one after it. */
this_event = op_ev_current ();
next_event = op_ev_next_local (this_event);

/* Loop through all of the events scheduled for this module */
/* and cancel any that are retransmission timers. */
while (op_ev_valid (next_event))
	{
	if ((op_ev_type (next_event) == OPC_INTRPT_SELF) &&
		(op_ev_code (next_event) == RETRANS_TIMER))
		{
		retrans_timer = next_event;
		next_event = op_ev_next_local (retrans_timer);
		op_ev_cancel (retrans_timer);
		}
	else
		/* Obtain the next event; if there are no more events, op_ev_next_local () */
		/* will return an invalid event handle and the loop will terminate. */
		next_event = op_ev_next_local (next_event);
	}

Details

This KP returns a numeric value that 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 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 type of event an Evhandle refers to.

Errors

  • Program Abort: Segmentation violation. (due to a malformed event handle)
  • Recoverable Error: Event handle refers to an event that is either invalid or not currently scheduled.

Reference

  • Use the KP op_ev_valid() to determine if the Evhandle is valid
  • Use the KP op_ev_code() to determine the code of a self, remote, or multicast interrupt
  • Use the KP op_ev_strm() to determine the stream index associated with a stream interrupt
  • Use the KP op_ev_stat() to determine the input statistic index associated with a statistic interrupt
  • Use the KP op_ev_time() to determine the scheduled time of the event
  • Use the KP op_ev_ici() to obtain the ICI associated with the event

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