op_pk_format_info_get()

Abstract

Retrieve information about a packet’s format and its properties.

Syntax

op_pk_format_info_get (pk_ptr, property, value_ptr)
Argument Type Description
pk_ptr Packet* pointer to a formatted packet
property int property of the packet format to be retrieved
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 if there are unformatted fields in this packet, and */
/* return failure if unformatted fields are found. */

/* Determine the total number of set fields in the packet */
max_fd_index = op_pk_fd_max_index (pkptr);

/* Determine the number of formatted fields in the packet’s format */
op_pk_format_info_get (pkptr, OPC_PK_PROPERTY_NUMBER_FIELDS,
	&num_formatted_fields);
if (max_fd_index + 1 > num_formatted_fields)
	{
	/* This packet currently has more fields set than it has */
	/* formatted fields, therefore there must be unformatted */
	/* fields that have been added.                                */
	...
	}

Details

This KP provides a way to retrieve information about a packet’s formats 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 11: Packet Format Properties

Constant Property Variable type
OPC_PK_PROPERTY_BULK_FILL_PATTERN value of attribute bulk fill pattern character array
OPC_PK_PROPERTY_CONV_FROM_VVEC_PROC pointer to conversion function Pk_From_Vvec_Proc
OPC_PK_PROPERTY_CONV_NAME packet conversion method character array
OPC_PK_PROPERTY_CONV_TO_VVEC_PROC pointer to conversion function Pk_To_Vvec_Proc
OPC_PK_PROPERTY_FORMAT_NAME name of packet format character array
OPC_PK_PROPERTY_NUMBER_FIELDS number of fields in packet format integer
OPC_PK_PROPERTY_SUPPORT_CONVERSION packet conversion support integer

Purpose

Provides a mechanism for retrieving information about packet formats 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