AceT_Decoder_Details_Proc
Abstract
Callback: Used to generate detail lines.
Syntax
<details_proc> (state_ptr, pk_ptr, layer, details_lptr)
| Argument | Type | Description |
|---|---|---|
state_ptr |
void * |
State information. |
pk_ptr |
AceT_Packet * |
Packet of interest. |
layer |
int |
The layer of the protocol being decoded. |
details_lptr |
PrgT_List * |
Area to hold list of detail lines. |
Return Type
AceT_Decode_Status
Completion status of the decode operation (one of the values shown in Table 4 Callback Symbolic Constants).
Header
ace_client_api.h
Example
AceT_Decode_Status
op_xyz_decoder_details (void * state_ptr, AceT_Packet * pk_ptr, int layer,
PrgT_List * details_lptr)
{
/* PURPOSE: To add details for the given packet to the details_lptr */
/* RETURNS: Success , packet failure, fatal_error. */
AceT_Decode_Status retval = AceC_Decode_OK;
static unsigned char * rec_data = PRGC_NIL;
static int rec_data_arr_size = 0;
int rec_data_size;
AceT_Pk_Protocol_Info * info_ptr;
int protocol_offset;
AceT_Import_Handle * import_ptr = (AceT_Import_Handle *) state_ptr;
char decode_info_str [128];
FIN (op_xyz_decoder_details);
info_ptr = Ace_Packet_Protocol_Info_Get (pk_ptr, layer);
protocol_offset = Ace_Protocol_Info_Offset_Get (info_ptr);
rec_data_size = Ace_Packet_Raw_Binary_Get (pk_ptr, 0, &rec_data,
rec_data_arr_size);
if ((rec_data_size - protocol_offset) < OPC_XYZ_MIN_FRAME_LENGTH)
{
Ace_Decoder_Packet_Error_Log ("op_xyz",
Ace_Packet_Frame_Number_Get (pk_ptr),
"XYZ Custom Protocol", "Not enough data captured to decode", 0);
FRET (AceC_Decode_Packet_Error);
}
[Logic to parse the binary and figure out the values of the header fields]
[For each line in the decode details, sprintf into the decode_info_str]
prg_list_strings_append (details_lptr, decode_info_str, VOSC_NIL);
FRET (retval);
}
Details
This callback is invoked whenever Transaction Analyzer needs detail lines for a protocol decoded by a custom decoder. It is responsible for generating a list containing all detail lines for the protocol being decoded.