op_pk_num_fields_get()
Abstract
Obtains the number of formatted and unformatted fields in a packet.
Syntax
op_pk_num_fields_get (pkptr, num_fmd_fields, num_unfmd_fields)
| Argument | Type | Description |
|---|---|---|
pkptr |
Packet * |
pointer to the packet-of-interest |
num_fmd_fields |
int * |
Area to hold the number of formatted fields, or OPC_INT_INVALID if none. |
num_unfmd_fields |
int * |
Area to hold the number of unformatted fields, or OPC_INT_INVALID if none. |
Return Type
void
No return value.
Example
int fmt_fds, unfmt_fds;
op_pk_num_fields_get (pkptr, &fmt_fds, &unfmt_fds);
Details
None.
Purpose
Provides a way to get the number of formatted and unformatted (stripped) fields in a packet.
Errors
- Program Abort: Segmentation violation. (due to invalid pkptr or value_ptr arguments)
- Program Abort: Packet pointer is NIL.
- Program Abort: Packet pointer references destroyed packet.
- Recoverable Error: Contents of packet (
<pk_id>) is a value vector. Packet doesn’t allow field operations.
Reference
- Use the KP op_pk_num_fds() to obtain the total number of fields in a packet