FTAM/9000 Programmer's Guide

Chapter 10 375
Example Programs
Setting Ae_dir_dn and P_address Utility Example
/*
** Set up the syntax_id to NULL. -- For Future Use --
*/
(*dirname)->rdn[index].avas->syntax_id.length = 0;
(*dirname)->rdn[index].avas->syntax_id.element = NULL;
/*
** Which attribute is this? Set the fourth element of the
** attr_id accordingly.
*/
if (strcmp(attr,“C”) == SUCCESS) {
/*
** C = Country
*/
(*dirname)->rdn[index].avas->attr_id.element[0] = 6;
} else if (strcmp(attr,“L”) == SUCCESS) {
/*
** L = Locality
*/
(*dirname)->rdn[index].avas->attr_id.element[0] = 7;
} else if (strcmp(attr,“O”) == SUCCESS) {
/*
** O = Organization
*/
(*dirname)->rdn[index].avas->attr_id.element[0] = 10;
} else if (strcmp(attr,“OU”) == SUCCESS) {
/*
** OU = Organizational Unit
*/
(*dirname)->rdn[index].avas->attr_id.element[0] = 11;
} else if ((strcmp(attr,“CN”) == SUCCESS) ||
(strcmp(attr,“AE”) == SUCCESS) ||
(strcmp(attr,“AP”) == SUCCESS)) {
/*
** CN = Common Name
** AE = Application Entity
** AP = Application Process
*/
(*dirname)->rdn[index].avas->attr_id.element[0] = 3;
} else {
/*
** Unsupported attr_id.
*/
(*dirname)->rdn[index].avas->attr_id.element[0] = 9999;
}
/*
** Reset counters and flags for the next rdn structure
*/
i = 0;
k = 0;
++j;
++index;
val_flag = 0;
/*
** If there is another delimiter, move to the next
** Dir_rdn structure and the next character in the string.
*/
while (name[j] == ‘/’) {
++j;
++index;
}
}