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_nameargument) - Recoverable Error: ICI pointer is NIL.
Reference
- Use the KP op_ici_is_format() to test the name of an ICI format
- Use the KP op_intrpt_ici() to obtain the pointer to an ICI associated with an incoming interrupt
- Use the KPs op_ici_attr_get_dbl(), op_ici_attr_get_int32(), op_ici_attr_get_int64(), and op_ici_attr_get_ptr() to obtain the value of an ICI attribute
- Use the KP op_pk_format() to obtain the format of a packet