OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide

C Program Example
OSI/MHS Gateway Programmatic Interface (GPI) Programming Guide424822-001
B-8
/* Return: Return code from the function call */
/* */
/* Description: This function creates the mh_c_bilateral_information */
/* object with the initial value parameter set to TRUE. */
/* This will cause the object to be populated with the */
/* attributes that have default values. One of these */
/* attributes, the PRMD_IDENTIFER, is then removed */
/* because it is not wanted in our message. The */
/* function then adds in the MH_T_INFORMATION attribute,*/
/* before inserting the entire */
/* mh_c_bilateral_information object into the root */
/* object. */
/**************************************************************************/
unsigned short build_and_insert_bilateral_object (unsigned long root_id)
{
unsigned short
local_rc; /* Return code from the function call */
unsigned long
descriptor_count = 1, /* Count of the elements */
total_number, /* The number of values of specified */
/* attribute */
local_object; /* Local object identifier */
OM_descriptor
descriptor_list[] =
{
MH_T_INFORMATION, OM_S_OCTET_STRING, { 5 , "\x04\x03\x00\x00\x00" }
};
printf (" Create the object\n");
local_rc = GPI_OM_CREATE_ ( MH_C_BILATERAL_INFORMATION,
OM_TRUE, /* With defined initial */
/* values */
&local_object,
root_id, /* Root object identifier */
); /* Session not necessary */
if (( local_rc == OM_RC_SUCCESS ) || ( local_rc == ZGPI_RC_WARNING ))
{
if ( local_rc == ZGPI_RC_WARNING )
printf (" WARNING! number: %d \n", local_rc );
printf (" Remove the attribute PRMD_IDENTIFIER\n");
/* Remove the unwanted PRMD_IDENTIFER attribute */
local_rc = GPI_OM_REMOVE_ ( local_object,
MH_T_PRMD_IDENTIFIER, /* Type of the */
/* attribute */
0, /* Value position */
1, /* Maximum number */
&total_number);
if (( local_rc == OM_RC_SUCCESS ) || ( local_rc == ZGPI_RC_WARNING ))
{
if ( local_rc == ZGPI_RC_WARNING )
printf (" WARNING! number: %d \n", local_rc );
printf (" Insert all the required attributes\n");
/*
* Insert bilateral_information attribute since it is required
* and was not created with the default values.
*