Ace_Packet_Raw_Binary_At_Layer_Get()

Abstract

Gets the raw binary data from a specified layer of a packet.

Syntax

Ace_Packet_Raw_Binary_At_Layer_Get (pk_ptr, layer, binary_buffer, current_buffer_size)
Argument Type Description
pk_ptr AceT_Packet * Packet of interest.
layer int Protocol layer of interest.
binary_buffer unsigned char ** Buffer to be filled with the raw binary data.
current_buffer_size int Size of binary_buffer.

Return Type

int

Size of data filled in binary_buffer, in bytes.

ace_client_api.h

Example

if (Ace_Packet_Fragment_Is (pk_ptr, layer))
	{
	/* Must be fragmented at IP since this is TCP, hence, one layer below this. */
	tcp_info_ptr->frag_group_ptr = Ace_Decoder_Fragment_Group_Get (pk_ptr, layer-1);
	if (!tcp_info_ptr->frag_group_ptr)
		{
		Ace_Decoder_Packet_Error_Log ("op_tcp",
			Ace_Packet_Frame_Number_Get (pk_ptr), "TCP",
			"Could not get group of fragments corresponding to fragmented packet.",
			0);
		FRET (0);
		}
	rec_data_size = Ace_Packet_Raw_Binary_At_Layer_Get (pk_ptr, layer,
		&all_rec_data, all_rec_data_arr_size);
	}
else
	{
	rec_data_size = Ace_Packet_Raw_Binary_Get (pk_ptr, offset, &all_rec_data,
		all_rec_data_arr_size);
	}

Details

If the packet is a fragment, the data will only be returned if it is the first fragment in a group of fragments. In such cases, this function will automatically concatenate the raw data from all of the fragmented packets.

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