op_pk_deliver_quiet()

Abstract

Forwards the specified packet to a remote module without scheduling an interrupt or invoking the process running at the module, and releases ownership of the packet by the invoking process.

Syntax

op_pk_deliver_quiet (pkptr, mod_objid, instrm_index)
Argument Type Description
pkptr Packet* pointer to the packet-of-interest
[A pointer to a packet can be obtained from many KPs, including op_pk_create(), op_pk_create_fmt(), op_pk_copy(), op_pk_get(), op_subq_pk_access(), and op_subq_pk_remove().]
mod_objid Objid object ID of the remote module
[An module object ID can be obtained from several KPs in the Topo and Id packages: op_id_self(), op_topo_child(), and op_id_from_name().]
instrm_index int index of an input packet stream of the remote module

Return Type

void

No return value.

Example

/* obtain the object ID of remote telemetry processor */
node_objid = op_id_from_name (0, OPC_OBJTYPE_NODE_FIXED, "tlm_node");
proc_objid = op_id_from_name (node_objid, OPC_OBJTYPE_PROC, "tlm_proc");

/* create a packet */
oc_pkptr = op_pk_create (128);

/* stuff packet with operation code */
op_pk_fd_set (oc_pkptr, 0, OPC_FIELD_TYPE_INTEGER, REQUEST_UPDATE, 0);

/* deliver the packet to remote processor quietly; */
/* processor will read in at next update interval */
op_pk_deliver_quiet (oc_pkptr, proc_objid, 0);

Details

This KP forwards the specified packet to the specified remote module without any delay or scheduling. The packet arrival is not scheduled, so the simulation event list is not involved in this operation. No interrupt is delivered to the remote module due to the packet arrival, hence the term “quiet”. The remote module process is thus responsible for detecting the forwarded packet’s presence in an input stream at some time in the future when the process is invoked due to some other interrupt. Multiple packets can be sent to the same remote module during a single process invocation, since the remote module input stream will buffer incoming packets. When the remote process is next invoked, it can detect packets which have quietly arrived in its input streams using the KPs op_strm_empty() or op_strm_pksize(). If packets are present in the streams, they can be obtained via the KP op_pk_get().

Once a packet is passed to this KP, the invoking process loses ownership of the packet, since the ownership is transferred to the remote module. Any KPs invoked by the delivering process which are passed the “stale” packet pointer will result in packet ownership errors.

Both unformatted and formatted packets can be transferred via this KP.

Purpose

Provides a mechanism to transfer packets between modules without relying on packet streams. Delivering packets using this KP is an alternative to the packet stream-oriented op_pk_send…() series of KPs. This KP is a variation of the basic op_pk_deliver() operation. op_pk_deliver_quiet() is useful when the remote module should not receive asynchronous notification of a packet arrival. Other variants of op_pk_deliver() provide delayed or forced arrivals at the remote module. Packets may be delivered to other processes running in processors or queues, or to transmitter modules.

Errors

  • Program Abort: Segmentation violation. (due to an invalid packet pointer or malformed packet)
  • Program Abort: Packet pointer is NIL.
  • Program Abort: Packet pointer references destroyed packet.
  • Program Abort: Packet pointer references unowned packet (<pk_id>).
  • Program Abort: Packet pointer references static packet (<pk_id>).
  • Program Abort: Packet delivery failed at object (<mod_objid>), stream (<instrm_index>).
  • Recoverable Error: Object ID (<mod_objid>) is out-of-range.

Reference

  • Use the KP op_pk_deliver() to deliver a packet through the normal event-scheduling technique
  • Use the KP op_pk_deliver_delayed() to deliver a packet with a delayed arrival
  • Use the KP op_pk_deliver_forced() to deliver a packet for immediate processing at a remote module
  • Use the op_pk_send…() KPs to forward packets to adjacent modules using packet streams
  • Use the KP op_pk_get() to obtain a pointer to an arriving packet

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