ACE Decode Sub-Packages
The ACE Decode API is a set of functions that provide support for decoding protocols. These routines can be divided into several distinct categories:
- Buffer sub-package
- Fragmentation sub-package
- Packet sub-package
- Protocol Info sub-package
- TCP Stream sub-package
- Utilities sub-package
Buffer Sub-Package
When decoding protocols, buffers are frequently useful for holding temporary data or intermediate results. The Buffer sub-package contains functions that facilitate the use of buffers in a custom decoder. This sub-package generally is used in conjunction with the TCP Stream sub-package.
Fragmentation Sub-Package
The functions in the Fragmentation sub-package can be used to handle fragmented packets in protocols that support fragmentation.
Packet Sub-Package
The Packet sub-package contains a variety of *_Get() and *_Set() functions used to access and modify elements of individual packets. For example, every packet maintains a socket number (port number) and a host name for both the source and the destination of the packet.
As a general rule, the *_Socket_Set() and *_Host_Set() functions are used by lower-layer protocols and are seldom used when writing a custom application-layer decode. Depending on the decode type, it might be useful to call the *_Socket_Get() and *_Host_Get() functions. These access functions can prove helpful if the protocol in question maintains separate data and control connections or if the socket or host information needs to be included as part of the protocol summary or detail lines.
This package includes Ace_Packet_Protocol_Info_Append(), which is used to create the data structure that will hold the summary and detail lines for each protocol decode.
Protocol Info Sub-Package
The Protocol sub-package contains functions used to access information about a protocol. In particular, it includes Ace_Protocol_Info_Summary_Set(), which is used to set the summary line for a protocol.
The protocol information accessed by the functions of this sub-package is stored in an AceT_Pk_Protocol_Info data structure. Packets have one of these data structures for each protocol layer that has been processed by a decoder. This data structure contains the elements listed in the following table.
Table 2: AceT_Pk_Protocol_Info Data Elements
| Element | Data Type | Description |
|---|---|---|
protocol_id |
int |
ID of the protocol in the corresponding layer. |
offset |
int |
Starting offset of the protocol within the packet, in bytes. |
summary_string |
char * |
Summary information about the corresponding layer. |
fragment_id |
int |
Fragment ID, if the packet is a fragment. |
details |
VosT_Ll_Desc * |
List of detail lines for the corresponding layer. |
This sub-package also contains functions used to access packet attributes.
TCP Stream Sub-Package
The TCP Stream sub-package contains functions for accessing the packets in a TCP data stream.
Utilities Sub-Package
This sub-package contains functions for handling common tasks during a decode, such as reporting errors and retrieving information about the data being decoded.