op_intrpt_ici()

Abstract

Obtains the ICI associated with the current interrupt.

Syntax

op_intrpt_ici ()
Argument Type Description
no arguments

Return Type

Ici*

Pointer to the ICI that is associated with the current interrupt.

The symbolic constant OPC_NIL is returned when there is no ICI associated with the current interrupt of the invoking process.

Example

Excerpt from: example model (models/std/eth_net); process model (eth_mac); function block; function eth_mac_llc_pk_accept().

/* get a handle on the ICI associated with this mac invocation */
iciptr = op_intrpt_ici ();

/* from the ICI, obtain the intended destination address */
op_ici_attr_get (iciptr, “dst_addr”, &dest_addr);

/* create an ethernet frame in which to encapsulate the llc data */
eth_pkptr = op_pk_create_fmt (“ethernet”);
op_pk_nfd_set (eth_pkptr, “data”, llc_pkptr);

/* assign the destination address of the new frame */
op_pk_nfd_set (eth_pkptr, “dst_addr”, dest_addr);

/* assign this station’s address to the source address field */
op_pk_nfd_set (eth_pkptr, “src_addr”, my_address);

Details

Process interrupts carry several types of information with them: the type of interrupt, a flag or code associated with the interrupt, and optionally, an ICI. Obtaining a pointer to an ICI allows the receiving process to extract its contents. If the contents of an ICI have been completely “processed” (i.e., the ICI is no longer of use to the receiving process), then it may be possible to recycle the ICI via the primitive op_ici_destroy(). However, destroying an ICI should only be done if the originating process creates fresh ICI’s for each outgoing interrupt, as opposed to the approach that is sometimes used where a single ICI is installed once and continually reused.

Purpose

Provides a mechanism for a process to obtain a pointer to a received ICI, which is associated with the current interrupt. Once the pointer is obtained, the contents of the ICI can be extracted via a KP such as op_ici_attr_get_dbl().

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