op_ici_format()

Abstract

Obtains the name of the ICI format associated with the specified ICI.

Syntax

op_ici_format (iciptr, format_name)
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).]
format_name char * name of the ICI format on which the specified ICI is based
[This value should be a statically declared character array, or a character pointer which points to dynamically allocated memory; either way, it must point to a string large enough to hold the format name for the specified packet.]

Return Type

void

no return value

Example

Excerpt adapted from: example model (models\std\x25); process (cloud_encap); state (ENCAP); enter execs.

/* Get the ICI associated with the new arrival. */
iciptr = op_intrpt_ici ();

/* Extract the addressing information from the ICI and insert it into the */
/* network packet. */
op_ici_attr_get (iciptr, "primitive", &primitive);

/* Obtain the ICI format name and interpret its contents accordingly. */
op_ici_format (iciptr, format_name);

if (strcmp (name, "X25_connect") == 0)
	{
	/* ... */
	}
else 
	{
	/* ... */
	}

Details

This KP places the specified ICI’s format name in the character string pointed to by format_name. The ICI’s contents or installation status is not affected by invoking this KP.

Purpose

Provides a mechanism to determine the format associated with an ICI. This is useful for process models that receive ICIs of several different types: using this KP, they can distinguish between the different ICIs and then perform appropriate ICI operations.

Errors

  • Program Abort: Segmentation violation. (due to an invalid ICI pointer or an invalid or insufficiently sized fmt_name argument)
  • Recoverable Error: ICI pointer is NIL.

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