op_pk_num_fields_get()

Abstract

Obtains the number of formatted and unformatted fields in a packet.

Syntax

op_pk_num_fields_get (pkptr, num_fmd_fields, num_unfmd_fields)
Argument Type Description
pkptr Packet * pointer to the packet-of-interest
num_fmd_fields int * Area to hold the number of formatted fields, or OPC_INT_INVALID if none.
num_unfmd_fields int * Area to hold the number of unformatted fields, or OPC_INT_INVALID if none.

Return Type

void

No return value.

Example

int    fmt_fds, unfmt_fds;

op_pk_num_fields_get (pkptr, &fmt_fds, &unfmt_fds);

Details

None.

Purpose

Provides a way to get the number of formatted and unformatted (stripped) fields in a packet.

Errors

  • Program Abort: Segmentation violation. (due to invalid pkptr or value_ptr arguments)
  • Program Abort: Packet pointer is NIL.
  • Program Abort: Packet pointer references destroyed packet.
  • Recoverable Error: Contents of packet (<pk_id>) is a value vector. Packet doesn’t allow field operations.

Reference

  • Use the KP op_pk_num_fds() to obtain the total number of fields in a packet

本站文档由 北京智网畅联科技有限公司 整理、翻译并提供 · 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