Member GETVLDLE in WEBSECURE / QRPGLESRC

1.00
       *********************************************************************
2.00
       *  RPG ILE MODULE WEBSECURE/GETVLDLE
3.00
       *  Get the first/next validation list entry
4.00
       *
5.00
       *
6.00
       *=====================================================
7.00
       *  The following parameters must be passed
8.00
       * Input
9.00
       *  1-Validation list name               char 10
10.00
       *  2-Validation list library name       char 10
11.00
       *  3-Type of request                    char  1
12.00
       *    - "1" = get the 1st  validation list entry
13.00
       *    - "N" = get the next validation list entry
14.00
       * Output
15.00
       *  4-Validation list entry data         char 1700
16.00
       *    mapped as follow
17.00
       *    - Entry ID             1- 100
18.00
       *    - Password           101- 700
19.00
       *    - Comments           701-1700
20.00
       *  5-Length of the password             integer
21.00
       *  6-Length of the comment              integer
22.00
       *  7-Return code                        integer
23.00
       *      0 =  successful operation
24.00
       *     -1 = unsuccessful operation
25.00
       *
26.00
       *********************************************************************
27.00
       /copy websecure/qrpglesrc,hspecs
28.00
       *=====================================================================
29.00
       * Prototype "getVldlE1" for calling API
30.00
       *  "QsyFindFirstValidationLstEntry()"
31.00
       *  (Find First Validation List Entry)
32.00
       * For documentation:
33.00
       *http://publib.boulder.ibm.com/pubs/html/as400/v4r5/ic2924/info/apis/QSYFFVLE.htm
34.00
       * See also QSYSINC/QRPGLESRC QSYVLDL
35.00
       *=====================================================================
36.00
      D getVldlE1       pr            10i 0 extproc('QsyFindFirstValidationLst-
37.00
      D                                     Entry')
38.00
      D pointerE1a                      *   value
39.00
      D pointerE1b                      *   value
40.00
       *=====================================================================
41.00
       * Prototype "getVldlEN" for calling API
42.00
       *  "QsyFindNextValidationLstEntry()"
43.00
       *  (Find Next Validation List Entry)
44.00
       * For documentation:
45.00
       *http://publib.boulder.ibm.com/pubs/html/as400/v4r5/ic2924/info/apis/QSYFNVLE.htm
46.00
       * See also QSYSINC/QRPGLESRC QSYVLDL
47.00
       *=====================================================================
48.00
      D getVldlE2       pr            10i 0 extproc('QsyFindNextValidationLst-
49.00
      D                                     Entry')
50.00
      D pointerE1a                      *   value
51.00
      D pointerE1b                      *   value
52.00
      D pointerE1c                      *   value
53.00
       *====================================================================
54.00
       *  Validation list
55.00
       *====================================================================
56.00
      D vldl            ds
57.00
      D vldlNam                 1     10
58.00
      D vldlLib                11     20
59.00
       *====================================================================
60.00
       *  Structure of output buffer for APIs
61.00
       *  "QsyFindFirstValidationLstEntry()"
62.00
       *  "QsyFindNextValidationLstEntry()"
63.00
       *====================================================================
64.00
       * Qsy_Rtn_Vld_Lst_Ent_T structure
65.00
      D LstEntT         ds                  align
66.00
       * 1- Entry ID information structure
67.00
      DEntry_ID_Len                   10i 0
68.00
      DEntry_ID_CCSID                 10u 0
69.00
      DEntry_ID                      100a
70.00
       * 2- Data to be encrypted information structure
71.00
      DEncr_Data_Len                  10i 0
72.00
      DEncr_Data_CCSID                10u 0
73.00
      DEncr_Data                     600a
74.00
       * 3- Entry data information structure
75.00
      DEntry_Data_Len                 10i 0
76.00
      DEntry_Data_CCSI                10u 0
77.00
      DEntry_Data                   1000a
78.00
       * 4- Ignored field.
79.00
      Dignored                         4a
80.00
       * 5- Pointer currently set to NULL
81.00
      DEntry_More_Info  s               *
82.00
       *====================================================================
83.00
       *  Structure of input buffer for API
84.00
       *  "QsyFindNextValidationLstEntry()"
85.00
       *====================================================================
86.00
       * Qsy_Entry_ID_Info_T structure
87.00
      D PrvEntT         ds                  align
88.00
       * 1- Entry ID information structure
89.00
      DPrvEn_ID_Len                   10i 0
90.00
      DPrvEn_ID_CCSID                 10u 0
91.00
      DPrvEn_ID                      100a
92.00
       *=====================================================================
93.00
       * Other variables
94.00
       *===========================================================================
95.00
       * Input parameters
96.00
      D InpVldlNam      s             10a
97.00
      D InpVldlLib      s             10a
98.00
      D InpVldlETy      s              1a
99.00
       * Output parameters
100.00
      D OutVlDlE        s           1700a
101.00
      D PwdLen          s             10i 0
102.00
      D DtaLen          s             10i 0
103.00
      D OutRC           s             10i 0                                      return code
104.00
       *=====================================================================
105.00
       * *entry parameter list
106.00
       *===========================================================================
107.00
      C     *entry        plist
108.00
      C                   parm                    InpVldlNam
109.00
      C                   parm                    InpVldlLib
110.00
      C                   parm                    InpVldlETy
111.00
      C                   parm                    OutVldlE
112.00
      C                   parm                    PwdLen
113.00
      C                   parm                    DtaLen
114.00
      C                   parm                    OutRC
115.00
       *
116.00
      C                   eval      vldlnam = InpVldlNam
117.00
      C                   eval      vldllib = InpVldlLib
118.00
       *
119.00
      C                   if        InpVldlETy = '1'
120.00
       * Get the 1st  validation list entry
121.00
      C                   exsr      ClrOutBuff
122.00
      C                   eval      OutRC = getVldlE1(%addr(VLDL):
123.00
      C                             %addr(LstEntT))
124.00
      C                   else
125.00
       * Get the next validation list entry
126.00
      C                   eval      PrvEn_ID_Len   = Entry_ID_Len
127.00
      C                   eval      PrvEn_ID_CCSID = Entry_ID_CCSID
128.00
      C                   eval      PrvEn_ID       = Entry_ID
129.00
      C                   exsr      ClrOutBuff
130.00
      C                   eval      OutRC = getVldlE2(%addr(VLDL):
131.00
      C                             %addr(PrvEntT):
132.00
      C                             %addr(LstEntT))
133.00
      C                   endif
134.00
       *
135.00
      C                   if        OutRc = 0
136.00
      C                   eval      OutVldlE = Entry_ID+Encr_Data+Entry_Data
137.00
      C                   eval      PwdLen = Encr_Data_Len
138.00
      C                   eval      DtaLen = Entry_Data_Len
139.00
      C                   else
140.00
      C                   eval      OutVldlE = ' '
141.00
      C                   eval      PwdLen = 0
142.00
      C                   eval      DtaLen = 0
143.00
      C                   endif
144.00
       *
145.00
      C                   return
146.00
       *=====================================================================
147.00
       * Clear output buffer data
148.00
       *===========================================================================
149.00
      C     ClrOutBuff    begsr
150.00
      C                   eval      Entry_ID_Len   =0
151.00
      C                   eval      Entry_ID_CCSID =0
152.00
      C                   eval      Entry_ID       = ' '
153.00
      C                   eval      Encr_Data_Len  =0
154.00
      C                   eval      Encr_Data_CCSID=0
155.00
      C                   eval      Encr_Data      = ' '
156.00
      C                   eval      Entry_Data_Len =0
157.00
      C                   eval      Entry_Data_CCSI=0
158.00
      C                   eval      Entry_Data     = ' '
159.00
      C                   endsr
0.029 sec.s