gds_decode_alt_addr(3xds) — Subroutines
Name
gds_decode_alt_addr - Converts an alternate address attribute from internal GDS format to a structured format
Synopsis
#include <xom.h>
#include <xds.h>
#include <dce/d2dir.h> d2_ret_val gds_decode_alt_addr(
const D2_str ∗in,
D2_alt_addr ∗∗out);
Parameters
Input
inA pointer to a D2_str structure that contains the alternate address attribute in an internal GDS format.
Output
outA pointer to the structure D2_alt_addr that stores the alternate address attribute in a structured format.
Description
The gds_decode_alt_addr() function converts a linearized string that is stored in a structure D2_str into a structured alternate address format stored in a D2_alt_addr structure. This function is provided for use by DME applications. It converts an alternate address attribute from an internal GDS format (linear octet string) to a structured format for application usage.
The in->d2_size parameter contains the length of the encoded octet string;in->d2_value is a pointer to the beginning of the encoded octet string.
The gds_decode_alt_addr() function allocates memory for the structured alternate address. The (∗out) parameter contains the address of the memory area that should later be freed by the application.
The D2_alt_addr structure contains one field D2_str for the address, followed by a structured field for the set of object identifiers. The structure D2_str consists of the length of the address and a pointer to the beginning of the address (not zero-terminated). The second component of the D2_alt_addr contains the number of object identifiers and the address of the first D2_obj_id structure. To read a set of object identifiers, the address of the first D2_obj_id structure should be increased by sizeof(D2_obj_id) bytes for each object identifier to be read.
The structure D2_obj_id consists of the length of the object identifier and a pointer to the beginning of the object identifier (not zero-terminated). Each object identifier is treated as an octet string; that means that gds_decode_alt_addr() does no BER conversion for object identifiers.
Return Values
d2_ret_valD2_NOERROR (that is, 0) if successful.
D2_ERROR (that is, -1), if unsuccessful (malloc() failure).
Related Information
Functions: gds_encode_alt_addr(3xds).