op_intrpt_port_deregister()

Abstract

Reverses effect of a previous call to op_intrpt_port_register(), which routes specific stream or statwire interrupts to a particular process within the currently executing module. Interrupts arriving on the specified stream or statwire are then routed to default processes in the module instead.

Syntax

op_intrpt_port_deregister (port_type, port_index)
Argument Type Description
port_type int type of port for which interrupt registration is to be deactivated.
[This is an integer symbolic constant that specifies either a stream or statistic input. Possible values are OPC_PORT_TYPE_STRM and OPC_PORT_TYPE_STAT.]
port_index int index of port for which interrupt registration is to be deactivated.
[Indices for both stream and statistic wire inputs begin at zero for the first port.]

Return Type

void

no return value

Example

/* Obtain the error notification packet that just arrived. */
err_pkptr = op_pk_get (STRM_ERR);

/* Decode the error message contents. */
op_pk_nfd_get (err_pkptr, "cause", &err_level)

/* If the error level is sufficiently serious, shut down */
/* special processing of errors: this involves destroying */
/* the error handling process and deregistering it from */
/* the error port. */
if (err_level > ERR_LEVEL_5)
	{
	/* Once this deregistration occurs, packets arriving on */
	/* error stream (if any) will be routed to the default */
	/* stream handling process if it is installed, or the root */
	/* process otherwise. */
	op_intrpt_port_deregister (OPC_PORT_TYPE_STRM, STRM_ERR);

	/* Destroy the error handling process which is no longer needed. */
	op_pro_destroy (err_pro_handle);
	}

Details

By default stream or statistic interrupts are routed to the root process of the module where they arrive. However, two mechanisms are available for altering this behavior and causing such interrupts to be routed instead to another process within the module. The first mechanism makes use of the KP op_intrpt_type_register() to designate a process to receive all interrupts of type stream or statistic. A second mechanism, which is supported by the KP op_intrpt_port_register(), is more specific and allows direct delivery of interrupts to a designated process when stream or statistic interrupts arrive on particular input ports. Port registration overrides type registration when both are active.

The KP op_intrpt_port_deregister() “undoes” the effect of all previous calls to op_intrpt_port_register() on a particular port for stream or statistic interrupts. Thus, if type registration for stream or statistic interrupts is in effect at the time of this call, then interrupt handling will be determined by the specifications made via that mechanism; otherwise subsequent interrupts that would have been affected by the port registration will be routed to the root process of the module.

This KP has no effect if port registration is not in effect for the appropriate interrupt type and port at the time where the KP is called.

Port types are either stream or statistic, and are represented by the symbolic constants OPC_PORT_TYPE_STRM and OPC_PORT_TYPE_STAT.

Purpose

This KP is used to cancel the effect of prior calls to op_intrpt_port_register(), thus restoring default processing of stream or statistic interrupts arriving on a particular input of the currently executing module. The KP has no use if the KP op_intrpt_port_register() is not also used by the processes of the module.

Errors

  • Recoverable Error: Stream index (<port_index>) is out of range.
  • Recoverable Error: Statistic index (<port_index>) is out of range.
  • Recoverable Error: Port type (<port_type>) is unrecognized.
  • Program Abort: KP requires process context. (if called from outside a processor or queue)

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