op_pk_vvec_get()

Abstract

Extracts a value vector from a value vector packet.

Syntax

op_pk_vvec_get (vvec_pk_ptr, value_vector_ptr)
Argument Type Description
vvec_pk_ptr Packet* pointer to the packet containing the value vector
value_vector_ptr Vvec_Vector* pointer to value vector to be filled in by the contents of the packet

Return Type

Compcode

Completion code indicating whether the value vector was successfully retrieved.

[This value can be compared to the two symbolic constants OPC_COMPCODE_SUCCESS and OPC_COMPCODE_FAILURE.]

Example

if (op_pk_type (pkptr) != OPC_PK_TYPE_VVEC)
	{
	/* Convert packet to value vector form */
	op_pk_convert_to_vvec (pkptr);
	}

/* Extract the value vector from the converted pakcet */
op_pk_vvec_get (pkptr, &pk_vvec);

/* The packet is no longer needed */
op_pk_destroy (pkptr);

/* Invoke child process to "clock" the bits of the packet */
/* to the external system... */

Details

This function places a value vector contained inside a value vector packet into an empty value vector. The size of the value vector packet decreases by the size of the value vector removed, but the packet is not destroyed and can be used again.

Note: If the packet passed as an argument to op_pk_vvec_get() is a Sar segment that is also a value vector packet, the function places a copy of the value vector in value_vector_ptr but does not remove the value vector from the value vector packet.

Purpose

Provides a mechanism to remove value vectors from value vector packets.

Errors

  • Program Abort: Packet pointer references unowned packet (<pk_id>).
  • Program Abort: Packet pointer references destroyed packet.
  • Program Abort: Packet pointer does not reference value vector packet.
  • Recoverable Error: Value vector 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