5.7 Extensions

An extension contains TSA specific encoded data. TSAs can return relevant information regarding data sets that cannot be represented by the existing structures and their field definitions using extensions.

An extension is returned as a size, buffer pair. The size holds the number of encoded bytes of information in the buffer. All extension functions require the buffer and size parameters to process the extensions.

Each extension is represented by a extension tag and a tag version. the extension tag is used to denote the type of extension that is returned and the version is used to denote the version of the extension. Extension versions are provided to have the capability to extend existing tags without disrupting existing applications usage of older versions of the same tag.

As extension information for some tags can have dynamic fields, all extension functions allocate the extension pointer and require a close of the extension to free the allocated resources.

Extension structure provides the extension information as a void pointer and hence can be type casted to the appropriate structure for accessing the structure fields.