op_pk_fd_get_objid()
Abstract
Obtains the value of an object ID field in the specified packet; the field-of-interest is specified by a numeric index.
Syntax
op_pk_fd_get_objid (pkptr, field_index, value_ptr)
| 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().] |
field_index |
int |
numeric index of the field-of-interest [This value must be non-negative.] |
value_ptr |
Objid* |
pointer to a variable to be filled in with the specified field’s value |
Return Type
Compcode
OPC_COMPCODE_FAILURE if the field is not obtained; OPC_COMPCODE_SUCCESS otherwise.
Example
/* variable declarations */
Objid prev_node_id; Packet *pkptr
/* Obtain the node identifier of the node which */
/* forwarded this frame to the current node. */
op_pk_fd_get_objid (pkptr, prev_node_id_field, &prev_node_id);
Details
None.
Purpose
Provides a mechanism to obtain the value of a packet’s field. This KP works identically to op_pk_fd_get(), but applies only to object attributes of data type object ID. Refer to op_pk_fd_get() for full purpose and details.
Errors
- Same as op_pk_fd_get().
Reference
- Same as op_pk_fd_get().