op_ici_install()

Abstract

Establishes the specified ICI as the installed ICI, which is automatically associated with outgoing interrupts scheduled by the invoking process.

Syntax

op_ici_install (iciptr)
Argument Type Description
iciptr Ici * pointer to the ICI-of-interest
[A pointer to an ICI can be obtained from two KPs: op_ici_create() returns a pointer to a newly allocated ICI (in an ICI-sending process), and op_intrpt_ici() returns a pointer to an ICI associated with an incoming interrupt (in an ICI-receiving process).]

Return Type

Ici *

Previously installed ICI, or OPC_NIL if none.

Example

Excerpt from: example model (models\std\eth_net); process model (eth_gen); state (ARRIVAL); enter execs.

/* determine the length of the packet to be generated */
pklen = op_dist_outcome (len_dist_ptr);
/* determine the destination of the packet... */
gen_packet: dest_addr = op_dist_outcome (dest_dist_ptr);
if (dest_addr != -1 && dest_addr == station_addr)
	goto gen_packet;
/* create an unformatted packet to send to mac */
pkptr = op_pk_create (pklen);
/* place the destination address into the ICI... */
op_ici_attr_set (mac_iciptr, "dst_addr", dest_addr);
/* send the packet coupled with the ICI. Then deinstall the ICI to prevent */
/* it from being associated with other interrupts scheduled by this process.*/
op_ici_install (mac_iciptr);
op_pk_send (pkptr, MAC_LAYER_OUT_STREAM);
op_ici_install (OPC_NIL);

Details

At any time, at most one ICI is installed for a given process. Installed ICIs are maintained separately for each process residing in a queue/processor module. The operation of installation informs the Simulation Kernel that all interrupts scheduled by the invoking process should be tagged with the specified ICI pointer. This permits many scheduled interrupts to automatically have associated ICIs, instead of having to create an ICI and tag for each individual interrupt.

Scheduled interrupts that have an associated ICI will maintain that association regardless of any transformation that an ICI undergoes during the time between interrupt scheduling and interrupt delivery. This includes modifications of the ICI contents or even ICI destruction. In such circumstances, the process that receives the interrupt may receive information other than that which was intended. In order to avoid such situations, it is recommended that interrupt recipients always be responsible for ICI destruction, and that in general a new ICI be created and installed by the originating process for each individual interrupt.

Deinstallation is not explicitly provided for because it is not generally “harmful” to have an ICI associated with an interrupt, if the processing of that interrupt does not make use of associated ICIs. Thus it is a common practice to leave ICIs installed until it is necessary to associate a different ICI with an outgoing interrupt. However, this KP does provide the ability to deinstall an ICI and thus prevent its further association with outgoing interrupts, by passing the constant OPC_NIL for the argument iciptr.

Purpose

Provides a mechanism for associating prepared ICIs and outgoing interrupts. Each process maintains an internal pointer which references the installed ICI. Thus the currently installed ICI is persistent across unforced states and multiple process invocations.

Errors

  • Program Abort: Segmentation violation. (due to an invalid ICI pointer or malformed ICI data structure)
  • Program Abort: KP requires process context.

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