op_pk_nfd_get_pkid()

Abstract

Obtains the value of a packet ID field in the specified packet, changing the status of some field types to unset; the field-of-interest is specified by name.

Syntax

op_pk_nfd_get_pkid (pkptr, fd_name, value_ptr)
Argument Type Description
pkptr Packet* 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_ptr OpT_Packet_Id* variable to be filled with the specified field's value

Return Type

Compcode

OPC_COMPCODE_SUCCESS if the value of the field can be obtained; OPC_COMPCODE_FAILURE otherwise.

Example

/* variable declarations */
OpT_Packet_Id pkt_id; Packet *pkptr;

/* obtain an arriving packet */
pkptr = op_pk_get (0);

/* retrieve a packet ID field */
op_pk_nfd_get_pkid (pkptr, "packet ID", &pkt_id);

Details

None.

Purpose

Provides a way to obtain the value of a packet field. This KP works identically to op_pk_nfd_get(), but applies only to packet fields of data type packet ID. Refer to op_pk_nfd_get() for full purpose and details.

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