FTAM/9000 Programmer's Guide

Chapter 3 81
HP FTAM/9000 Data Structures
Directory Services Data Structures
Setting Ae_dir_name Example
This example sets the Ae_dir_name structure.
#include “map.h”
#include “mapftam.h”
#include %<stdio.h>
#include %<malloc.h>
/*
**
** setup_ddn
**
** DESCRIPTION:
** This routine assigns valid values to the Ae_dir_name
** structure.
**
**
** PARAMETERS:
** Outputs:
** dirname : pointer to the Ae_dir_name structure
** Ae_dir_name is a pointer to struct
** Dir_dn.
**
*/
void
setup_ddn(dirname)
Ae_dir_name *dirname;
{
/*
Initialize all fields of the Ae_dir_name structure.
Set up:
“/C=us/O=hp/OU=org_unit/CN=machine_name/CN=ftam_resp”
*/
*dirname = (struct Dir_dn *)malloc(sizeof(struct Dir_dn));
(*dirname)->rdn=(struct Dir_rdn *)malloc(5*sizeof(struct
Dir_rdn));
(*dirname)->n = 5;
/*
C = us
The Country attribute id is defined by ISO to be “6”.
*/
(void)addrdn( & (*dirname)->rdn[0], 6, “us”);
/*
O = hp
The Organization attribute id is defined by ISO to be
“10”.
*/
(void)addrdn( & (*dirname)->rdn[1], 10, “hp”);
/*
OU = org_unit
The Organization Unit attribute id is defined by ISO to be
“11”.
*/
(void)addrdn( & (*dirname)->rdn[2], 11, “org_unit”);
/*
AP = machine_name
The Application Process attribute id is defined by ISO to