Ace_Packet_Protocol_Info_Get()

Abstract

Gets the protocol information at a certain layer in the stack.

Syntax

Ace_Packet_Protocol_Info_Get (pk_ptr, layer)
Argument Type Description
pk_ptr AceT_Packet * Packet of interest.
layer int Protocol layer of interest.

Return Type

AceT_Pk_Protocol_Info *

Protocol information, or PRGC_NIL if out of bounds.

ace_client_api.h

Example

AceT_Decode_Status
op_tcp_decoder_details (void * state_ptr, AceT_Packet * pk_ptr, int layer,
	PrgT_List * details_lptr)
	{
	AceT_Decode_Status        retval = AceC_Decode_OK;
	OpT_Tcp_Info              tcp_info;
	AceT_Pk_Protocol_Info  * tcp_protocol_info_ptr;
	int                       offset;
	unsigned char            * tcp_data;
	
	FIN (op_tcp_decoder_details);

	/* Make sure all of tcpinfo's members are initialized to 0. */
	memset (&tcp_info, 0, sizeof (OpT_Tcp_Info));

	tcp_protocol_info_ptr = Ace_Packet_Protocol_Info_Get (pk_ptr, layer);
	offset = Ace_Protocol_Info_Offset_Get (tcp_protocol_info_ptr);
	
	retval = op_tcp_info_obtain (pk_ptr, layer, offset, &tcp_info, &tcp_data);
	if (retval == AceC_Decode_OK)
		{
		op_tcp_details_make (pk_ptr, &tcp_info, details_lptr);
		}
	
	FRET (retval);
	}

Details

See Protocol Info Sub-Package for a description of how to access fields from the AceT_Pk_Protocol_Info data structure.

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