op_pk_nfd_set_int64()
Abstract
Assigns the value of a 64-bit integer field in the specified packet; the field-of-interest is specified by name.
Syntax
op_pk_nfd_set_int64 (pkptr, fd_name, value)
| 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_fmt(), op_pk_copy(), op_pk_get(), op_subq_pk_access(), and op_subq_pk_remove().] |
fd_name |
const char* |
name of the field-of-interest [This name must be a defined field within the packet's format, or an error will occur.] |
value |
OpT_Int64 |
value to be assigned to the field |
Return Type
Compcode
OPC_COMPCODE_SUCCESS if the value of the field could be set; OPC_COMPCODE_FAILURE otherwise.
Example
/* create a formatted packet */
f_pkptr = op_pk_create_fmt ("example_pkt");
/* assign 32- and 64-bit integer fields in the packet */
op_pk_nfd_set_int32 (f_pkptr, "fd_int_32", 2511);
int64_value = 5 * 200;
op_pk_nfd_set_int64 (f_pkptr, "fd_int_64", int64_value);
/* send the defined packet out of the processor */
op_pk_send (f_pkptr, OUTSTRM);
Details
If the specified field has not been set before, the size of the new field is determined from the packet's format and added to the total size of the packet.
Purpose
Provides a way to set the value of a 64-bit integer field within a packet. Because the packet is formatted, only the value of the field needs to be specified; the type and size of the field are automatically obtained from the format. This KP should only be applied to formatted packets; otherwise, an error will occur.
Errors
- Same as
op_pk_nfd_set(). (integer, double, and packet field version)
Reference
- Same as
op_pk_nfd_set(). (integer, double, and packet field version)