QsyAddValidationLstEntry()--Add Validation List Entry API


  Syntax
 #include <qsyvldl.h>

 int QsyAddValidationLstEntry
        (Qsy_Qual_Name_T             *Validation_Lst,
         Qsy_Entry_ID_Info_T         *Entry_ID,
         Qsy_Entry_Encr_Data_Info_T  *Encrypt_Data,
         Qsy_Entry_Data_Info_T       *Entry_Data,
         void                        *Attribute_Info);  


  Service Program Name: QSYVLDL

  Default Public Authority: *USE

  Threadsafe: Yes

The QsyAddValidationLstEntry() function adds an entry to a validation list object. Entries are stored in hexadecimal sort sequence. The first entry will always be the one in which the entry ID has the smallest hexadecimal value.

Conversions are not done on any data when entries are added. The CCSID value for each field is stored as part of the record but is not used when the entry is added to the validation list.


Authorities

Validation List Object
*USE and *ADD

Validation List Object Library
*EXECUTE

Parameters

Validation_Lst
(Input) A pointer to the qualified object name of the validation list to add the entry to. 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:


Encrypt_Data
(Input) A pointer to data that is associated with the entry ID and is encrypted by the system when it is stored. If the pointer is NULL, there is no encrypted data associated with the entry ID. The format of the Qsy_Entry_Encr_Data_Info_T structure is as follows:


Entry_Data
(Input) A pointer to the data information that is associated with the entry ID. If the pointer is NULL, there is no data associated with the entry ID. The format of the Qsy_Entry_Data_Info_T structure is as follows:


Attribute_Info
(Input) A pointer to a structure that contains attribute information that is associated with the entry ID. If the pointer is NULL, there is no attribute information associated with the entry ID. 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:

If the QSY_VFY_FIND value is specified for the QsyEncryptData attribute, the system value QRETSVRSEC (Retain server security data) is used to determine if the data to be encrypted is stored in the entry or not.

If the system value is set to 0 (Do not retain data), the entry will be added, but the data to be encrypted will not be stored with the entry. The return value from this function will be -2 to indicate that the entry was added, but the data to be encrypted was not stored.

If the system value is set to 1 (Retain data), then the data to be encrypted will be stored when the entry is added.


Return Value



Error Conditions

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



Example

The following example adds an entry for a user named FRED to the validation list object WEBUSRS. FRED has encrypted data (password), but no other data. The CCSID for the entry ID is set to the current user's default CCSID. The CCSID for the encryption data is set to 65535.

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

#include <qsyvldl.h>

main()
{
  #define VLD_LST  "WEBUSRS   WEBLIB    "
  Qsy_Entry_ID_Info_T    entry_info;
  Qsy_Entry_Encr_Data_Info_T  encrypt_data;

  entry_info.Entry_ID_Len = 4;
  entry_info.Entry_ID_CCSID = 0;
  strncpy(entry_info.Entry_ID,"FRED",entry_info.Entry_ID_Len);
  encrypt_data.Encr_Data_Len = 7;
  strncpy(encrypt_data.Encr_Data,"N1LJDTS",
            encrypt_data.Encr_Data_Len);
  encrypt_data.Encr_Data_CCSID = 65535;

  if (0 != QsyAddValidationLstEntry((Qsy_Qual_Name_T *)&VLD_LST,
                                    &entry_info,
                                    &encrypt_data,
                                    NULL,
                                    NULL))
     perror("QsyAddValidationLstEntry()");

}


API introduced: V4R1

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