op_pk_is_format()
Abstract
Tests the name of a packet format.
Syntax
op_pk_is_format (pktptr, fmt_name)
| Argument | Type | Description |
|---|---|---|
pktptr |
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().] |
fmt_name |
const char * |
name of a packet format, or VOSC_NIL for unformatted packets |
Return Type
VosT_Boolean
VOSC_TRUE if the packet has the named format; VOSC_FALSE if the packet has a different format or an error occurred.
Example
/* obtain the arriving packet */
pkptr = op_pk_get (INPUT_STRM);
/* test the format of the packet and process accordingly */
if (op_pk_is_format (pkptr, "my_format"))
{
/* ... */
}
Details
None.
Purpose
Provides a fast way to test the name of a packet format.
Errors
- None.
Reference
- Use the KP op_pk_format() to get the name of a packet’s format for manual testing