op_pk_fd_info_get()

Abstract

Retrieve information about a packet's fields and their properties; the field-of-interest is specified by a numeric index.

Syntax

op_pk_fd_info_get (pk_ptr, field_index, property, value_ptr)
Argument Type Description
pk_ptr Packet* pointer to the packet of interest
field_index int index of the field of interest
property int property of the field to be retrieved (see Details)
value_ptr void* pointer to a variable to be filled in with the specified field property's value

Return Type

void

No return value.

Example

/* Determine the size of this field. */
op_pk_fd_info_get (pkptr, fd_index, OPC_PK_FD_PROPERTY_SIZE,
	&defined_fd_size);

Details

This KP provides a way to retrieve information about a packet's fields and their properties. The constants listed below may be passed as the property argument. The KP writes the value of the property into a variable of the type specified.

Table 13: Packet Field Properties

Constant Property Variable type
OPC_PK_FD_PROPERTY_CONV_FROM_VVEC_PROC pointer to conversion function Pk_Fd_From_Vvec_Proc
OPC_PK_FD_PROPERTY_CONV_NAME field conversion method character array
OPC_PK_FD_PROPERTY_CONV_ORDER field conversion order integer
OPC_PK_FD_PROPERTY_CONV_TO_VVEC_PROC pointer to conversion function Pk_Fd_To_Vvec_Proc
OPC_PK_FD_PROPERTY_DEF_VAL_STR default value for field character array
OPC_PK_FD_PROPERTY_ENCODING value of field attribute encoding character array
OPC_PK_FD_PROPERTY_NAME name of field character array
OPC_PK_FD_PROPERTY_SIZE field size (in bits) 32-bit integer (value_ptr should be int*)
OPC_PK_FD_PROPERTY_SIZE_INT64 field size (in bits) 64-bit integer (value_ptr should be OpT_Packet_Size*)
OPC_PK_FD_PROPERTY_TYPE datatype of field integer

Purpose

Provides a mechanism for retrieving information about packet fields and their properties.

Errors

  • Recoverable Error: Property identifier (<property>) is invalid.

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