QsyFindValidationLstEntryAttrs()--Find Validation List Entry Attributes API


  Syntax
 #include <qsyvldl.h>

 int QsyFindValidationLstEntryAttrs
        (Qsy_Qual_Name_T           *Validation_Lst,
         Qsy_Entry_ID_Info_T       *Entry_ID,
         Qsy_Rtn_Vld_Lst_Ent_T     *Rtn_Entry,
         Qsy_Attr_Info_T           *Rtn_Attributes);  
 
  Service Program Name: QSYVLDL

  Default Public Authority: *USE

  Threadsafe: Yes

The QsyFindValidationLstEntryAttrs() function finds an entry in a validation list object, and the attributes associated with the entry. The function then returns the information for the entry in the buffer that is pointed to by the Rtn_Entry parameter, and the information for the attributes in the buffer that is pointed to by the Rtn_Attributes parameter. To find an entry, there must be an exact match in the entry for the value that is specified in the Entry_ID parameter and the length of the entry ID. For example, an entry ID value of "SMITH" with a length of 5 would not find an entry where the entry ID is "SMITH " and the length is 7.


Authorities

Validation List Object
*USE

Validation List Object Library
*EXECUTE

Note: If the QsyEncryptData attribute is set to QSY_VFY_FIND (1), then the user must have *USE, *ADD, and *UPD authority to the validation list to get the data to be encrypted returned in the Rtn_Entry parameter.


Parameters

Validation_Lst
(Input)

A pointer to the qualified object name of the validation list in which to find the entry. The first 10 characters specify the validation list name, and the second 10 characters specify the library. You can use these special values for the library name:


Entry_ID
(Input)

A pointer to the entry ID information. The format of the Qsy_Entry_ID_Info_T structure is as follows:


Rtn_Entry
(Output)

A pointer to the buffer where the entry information is placed. The buffer must be allocated to the size of the Qsy_Rtn_Vld_Lst_Ent_T structure or the results will be unpredictable. The format of the Qsy_Rtn_Vld_Lst_Ent_T structure is as follows:


See the Entry_ID parameter for the format of the Qsy_Entry_ID_Info_T structure.


The format of the Qsy_Entry_Encr_Data_Info_T structure is as follows:



The format of the Qsy_Entry_Data_Info_T structure is as follows:


Rtn_Attributes
(Input) A pointer to a structure that indicates the attributes to return. The format of the Qsy_Attr_Info_T structure is as follows:



The format of the Qsy_Attr_Descr_T structure is as follows:



The format of the Attr_Data_Info union is as follows:



The format of the Qsy_In_VLDL_T structure is as follows:



The format of the Qsy_Rtn_VLDL_Attr_T structure is as follows:



The format of the Qsy_Rtn_Entry_Usage_Attr_T structure is as follows:


Return Value



Error Conditions

If QsyFindValidationLstEntryAttrs() is not successful, errno indicates one of the following errors:



Example

The following example finds an entry for a user named FRED in the validation list object WEBUSRS, and returns the attribute that is associated with the encrypted data field.

Note: By using the code examples, you agree to the terms of the Code license and disclaimer information.

#include <stdlib.h>
#include <qsyvldl.h>
#include <errno.h>

main()
{
  #define VLD_LST  "WEBUSRS   WEBLIB    "
  Qsy_Rtn_Vld_Lst_Ent_T   rtn_ent;
  struct {
    Qsy_Attr_Info_T       attr_info;
    Qsy_Attr_Desc_T       attr_desc;
  } rtn_attr;
  struct {
    Qsy_Rtn_VLDL_Attr_T   encr_info;
    char                  encr_val;
  } encr_attr;
  Qsy_Entry_ID_Info_T    *input_entry;

  /* Set up entry ID to find.                                       */
  strncpy(rtn_ent.Entry_ID_Info.Entry_ID,"FRED",4);
  rtn_ent.Entry_ID_Info.Entry_ID_Len = 4;

  /* Set up the attribute information.                              */
                                  /* Initialize reserved fields.    */
  memset(rtn_attr.attr_desc.Attr_Res.Res_1,
         0,
         sizeof(rtn_attr.attr_desc.Attr_Res.Res_1));
  memset(rtn_attr.attr_desc.Attr_Other_Descr.Res_1,
         0,
         sizeof(rtn_attr.attr_desc.Attr_Other_Descr.Res_1));
  memset(rtn_attr.attr_desc.Attr_Data_Info.Attr_In_Other.Res_1,
         0,
         sizeof(rtn_attr.attr_desc.Attr_Data_Info.Attr_In_Other.Res_1));
  memset(rtn_attr.attr_desc.Attr_Other_Data.Res_1,
         0,
         sizeof(rtn_attr.attr_desc.Attr_Other_Data.Res_1));

                                  /* Set number of attrs.           */
  rtn_attr.attr_info.Numbers_Attrs = 1;
                                  /* Set location of attribute.     */
  rtn_attr.attr_desc.Attr_Location = QSY_IN_VLDL;
                                  /* Set attribute type.            */
  rtn_attr.attr_desc.Attr_Type = QSY_SYSTEM_ATTR;
                                  /* Set attribute type.            */
  rtn_attr.attr_desc.Attr_ID = (char *)QSY_ENCRYPT_DATA;
                                  /* Set length to retrieve.        */
  rtn_attr.attr_desc.Attr_Data_Info.Attr_VLDL.Attr_Len =
                                 sizeof(encr_attr);
                                  /* Set CCSID value.               */
  rtn_attr.attr_desc.Attr_Data_Info.Attr_VLDL.Attr_CCSID = -1;
                                  /* Set pointer to return buffer   */
  rtn_attr.attr_desc.Attr_Data_Info.Attr_VLDL.Attr_Value =
    (void *)&encr_attr;

  /* Try to find an entry for 'FRED'.                               */
  if (0 == QsyFindValidationLstEntryAttrs(
                     (Qsy_Qual_Name_T *)&VLD_LST,
                     &rtn_ent.Entry_ID_Info,
                     &rtn_ent,
                     (Qsy_Attr_Info_T *)&rtn_attr))
  { /* Entry was found                                              */
          .
          .
          .
     (process the entry)
          .
          .
          .
  }
  else /* Error on find of entry.                                   */
    perror("Find of validation list entry");

}


API introduced: V4R2

[ Back to top | Security APIs | APIs by category ]