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.
Header
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.