op_ev_current()

Abstract

Obtains the event handle that refers to the currently executing event.

Syntax

op_ev_current ()
Argument Type Description
no arguments

Return Type

Evhandle

Event handle for the currently executing event.

Example

/* Obtain the currently executing event */
this_event = op_ev_current ();

/* If it is a packet arrival, get the packet.     */
/* If it is a self interrupt, send the packet on. */
if (op_ev_type (this_event) == OPC_INTRPT_STRM)
	pkptr = op_pk_get (op_ev_strm (this_event));
else if (op_ev_type (this_event) == OPC_INTRPT_SELF)
	op_pk_send (pkptr, 0);

Details

When this KP is invoked from a process within a processor or queue module, the Evhandle refers to the event that interrupted the process. Thus some Event Package KPs used with op_ev_current() return the same value as some Intrpt Package KPs; for example, op_ev_type (op_ev_current()) is equivalent to op_intrpt_type().

Purpose

Provides a mechanism to obtain the Evhandle of the current event. This is a useful starting point for looping through all events (using op_ev_next()) or through local events (using op_ev_next_local()).

Errors

  • No errors are trapped.

Reference

  • Use the KP op_ev_next() to obtain the succeeding events’ Evhandle(s)
  • Use the KP op_ev_next_local() to obtain the succeeding local events’ Evhandle(s)

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