Ace_Decoder_Protocol_ID_Get()
Abstract
Gets a unique ID for a specified protocol name.
Syntax
Ace_Decoder_Protocol_ID_Get (import_ptr, protocol_name)
| Argument | Type | Description |
|---|---|---|
import_ptr |
AceT_Import_Handle * |
Context information. |
protocol_name |
const char * |
Protocol name. |
Return Type
int
Protocol ID.
Header
ace_client_api.h
Example
/* Make sure that the tcp has payload before adding a next protocol */
if (!port_name_ptr || tcp_info.tcp_payload_len == 0)
{
*next_protocol_id = ACEC_DECODER_PROTOCOL_UNKNOWN;
}
else
{
/* port_name_ptr exists. */
*next_protocol_id = Ace_Decoder_Protocol_ID_Get (import_ptr,
port_name_ptr->short_name);
if (*next_protocol_id == ACEC_DECODER_PROTOCOL_UNKNOWN)
{
*next_protocol_id = Ace_Decoder_Protocol_Add (import_ptr,
port_name_ptr->short_name, port_name_ptr->short_name);
}
}