op_pk_fd_set_int64()

Abstract

Assigns the type, value, and size of a 64-bit integer field in the specified packet; the field-of-interest is specified by a numeric index.

Syntax

op_pk_fd_set_int64 (pkptr, field_index, value, field_size)
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, or an error will occur.]
value OpT_Int64 value to be assigned to the field
field_size OpT_Int64 modeled size (in bits) of the field contents, or OPC_FIELD_SIZE_UNCHANGED (see Details)

Return Type

Compcode

OPC_COMPCODE_SUCCESS if the field could be set; OPC_COMPCODE_FAILURE otherwise.

Example

/* create an unformatted packet */
uf_pkptr = op_pk_create (64);

/* assign integer fields in the packet */
op_pk_fd_set_int32 (uf_pkptr, 0, 2511, 16);
int64_value = 5 * 200000000000;
op_pk_fd_set_int64 (uf_pkptr, 1, int64_value, 16);

Details

If field_size is different from the previous size of the field, the total size of the packet will change accordingly. If field_size is specified as OPC_FIELD_SIZE_UNCHANGED, the size of the field will remain as defined in the packet.

Purpose

Provides a way to set the value of a 64-bit integer field within a packet. This KP is usually applied to unformatted packets, but it can be applied to formatted packets as well (formatted packet field names can be converted into numeric indices using the KPs op_pk_name_to_index() and op_pk_nfd_name_to_index()).

Errors

Reference

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · Documentation compiled and provided by Beijing ZNetLink Technology Co., Ltd.

交流群 · QQ Group:OPNET/智网妙算网络仿真交流群(群号 486383494)

原文档 © 2017 Riverbed Technology · 本站为公益翻译,由 AI 辅助完成,请仔细甄别

Original documentation © 2017 Riverbed Technology. Community translation, AI-assisted. Contact: jiazequn@znetlink.com