FTAM/9000 Programmer's Guide

82 Chapter 3
HP FTAM/9000 Data Structures
Directory Services Data Structures
be “3”.
*/
(void)addrdn( & (*dirname)->rdn[3], 3, “machine_name”);
/*
AE = ftam_resp
The Application Entity attribute id is defined by ISO to
be “3”.
*/
(void)addrdn( & (*dirname)->rdn[4], 3, “ftam_resp”);
}
/*
*** addrdn
**
** DESCRIPTION:
** This routine sets up the Dir_rdn structure using the input
** parameters for values.
**
**
** PARAMETERS:
** Input:
** att_id : integer value for the attribute id
** att_value : character string for the attribute value
**
** Output:
** rdn : pointer to struct Dir_rdn being set up
**
*/
Sint32
addrdn(rdn, att_id, att_value)
struct Dir_rdn *rdn;
int att_id;
char *att_value;
{
/* Allocate the memory for struct Dir_ava
*/
rdn->n = 1;
rdn->avas = (struct Dir_ava *)malloc(sizeof(struct Dir_ava));
rdn->avas->attr_value.pointer = (Octet *)malloc
(strlen(att_value)*sizeof(Octet));
rdn->avas->attr_id.element = (Sint32 *)malloc(sizeof(Sint32));
/*
Set up the attribute id
*/
*(rdn->avas->attr_id.element) = att_id;
rdn->avas->attr_id.length = 1;
/*
Set up the attribute value
*/
memcpy(rdn->avas->attr_value.pointer, att_value,
strlen(att_value));
rdn->avas->attr_value.length = strlen(att_value);
/*
The syntax id is for future use
*/
rdn->avas->syntax_id.element = NULL;
rdn->avas->syntax_id.length = 0;
}