Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ decode_alt_addr(3xds) — DCE 3.1

Media Vault

Software Library

Restoration Projects

Artifacts Sought

decode_alt_addr(3xds)  —  Subroutines

Name

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> int decode_alt_addr(
const D2_str ∗in,
D2_alt_addr ∗∗out);

Parameters

inA pointer to a D2_str structure which contains the alternate address attribute in an internal GDS format. 

Description

The decode_alt_addr() routine 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. 

in->d2_size contains the length of the encoded octet string. 

in->d2_value is a pointer to the beginning of the encoded octet string. 

The decode_alt_addr() routine allocates memory for the structured alternate address.  The parameter (∗out) 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 decode_alt_addr() does no BER conversion for object identifiers. 

Return Values

∗∗outA pointer to the structure D2_alt_addr which stores the alternate address attribute in a structured format. 

int0 if successful.  -1 if unsuccessful (malloc() failure). 

Related Information

Functions: encode_alt_addr(3xds). 

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026