/********************************************************************/ /* CL program CHGFTPEXTC - Change FTP Exit Program data area */ /* */ /* This program is the CPP for the CHGFTPEXT command. */ /* The program uses command parameters to set values in data */ /* area DAFTPEXIT, used with the FTPEXIT Exit Point program. */ /* */ /* The data area must be QGPL/DAFTPEXIT, character, length 150. */ /********************************************************************/ /* Data area map */ /* */ /* Positions Description */ /* --------- ----------------------------------------------- */ /* 1 - 3 Common options for all servers */ /* 11 - 21 Options for FTP Server */ /* 31 - 41 Options for Anonymous FTP Server */ /* 51 - 56 Options for FTP Client */ /* 61 - 63 Options for REXEC Server */ /* 71 - 73 Options for TFTP Server */ /* 81 - 84 Options for Application Logon Server */ /* 91 - 100 Override-to library for Anonymous FTP */ /* 101 - 150 Override-to path for Anonymous FTP */ /********************************************************************/ /* Copyright (c) 1998, Bits & Bytes Programming */ /* ALL RIGHTS RESERVED */ /* */ /* Craig Pelkie */ /* Bits & Bytes Programming */ /* P.O. Box 1473 */ /* Valley Center, CA 92082-1473 */ /* craig@web400.com */ /********************************************************************/ chgftpextc: pgm parm(&Print /* Print activity report */ + &File /* Log activity to file */ + &INLR /* Set *INLR on */ + &FTPServer /* Parms for FTP Server */ + &FTPAnon /* Parms for FTP Anon */ + &FTPClient /* Parms for FTP Client */ + &REXEC /* Parms for REXEC Server */ + &TFTPServer /* Parms for TFTP Server */ + &APPLogon ) /* Parms for App Logon */ /********************************************************************/ /* Variables used in program */ /* */ /* &Print - print Exit Point activity report */ /* &File - log Exit Point activity to QGPL/FTPEXIT */ /* &INLR - return with *INLR on */ /* */ /* Note: bytes 1 and 2 of options are list count bytes (ignored) */ /* */ /* &FTPServer - options for FTP Server */ /* &FTPAnon - options for Anonymous FTP */ /* &FTPClient - options for FTP Client */ /* &REXEC - options for REXEC Server */ /* &TFTPServer - options for TFTP Server */ /* &APPLogon - options for Application Server Logon */ /* */ /* &lenFTPS - length of FTP Server parameter */ /* &lenFTPA - length of Anonymous FTP parameter */ /* &lenFTPC - length of FTP Client parameter */ /* &lenREXEC - length of REXEC parameter */ /* &lenTFTP - length of TFTP Server parameter */ /* */ /* &ftpexit - string to write out to data area */ /* &k - substring position in &ftpexit */ /* &n - loop counter */ /* &rtnlbl - label to return to from GetChoice routine */ /* &selections - selections to process in GetChoice routine */ /* &work1 - work field */ /* &work7 - work field */ /* */ /* &ALLOW - Allow operation response */ /* &ALWAYS - Always allow operation response */ /* &NEVER - Never allow operation response */ /* &NO - NO response */ /* &REJECT - Reject operation response */ /* &YES - YES response */ /* */ /* &cAllow - parm value from command (*ALLOW) */ /* &cAlways - parm value from command (*ALWAYS) */ /* &cNever - parm value from command (*NEVER) */ /* &cNo - parm value from command (*NO) */ /* &cReject - parm value from command (*REJECT) */ /* &cYes - parm value from command (*YES) */ /* */ /* &RTNFTPS - label to return to from GetChoice routine */ /* &RTNFTPA - label to return to from GetChoice routine */ /* &RTNFTPC - label to return to from GetChoice routine */ /* &RTNREXEC - label to return to from GetChoice routine */ /* &RTNTFTP - label to return to from GetChoice routine */ /********************************************************************/ dcl &Print *char 4 dcl &File *char 4 dcl &INLR *char 4 dcl &FTPServer *char 76 dcl &FTPAnon *char 76 dcl &FTPClient *char 41 dcl &REXEC *char 20 dcl &TFTPServer *char 20 dcl &APPLogon *char 87 dcl &lenFTPS *dec value(76) dcl &lenFTPA *dec value(76) dcl &lenFTPC *dec value(41) dcl &lenREXEC *dec value(20) dcl &lenTFTP *dec value(20) dcl &ftpexit *char 150 dcl &k *dec dcl &n *dec dcl &rtnlbl *char 10 dcl &selections *char 80 dcl &work1 *char 1 dcl &work7 *char 7 dcl &ALLOW *char value('A') dcl &ALWAYS *char value('L') dcl &NEVER *char value('V') dcl &NO *char value('N') dcl &REJECT *char value('R') dcl &YES *char value('Y') dcl &cAllow *char value('*ALLOW') dcl &cAlways *char value('*ALWAYS') dcl &cNever *char value('*NEVER') dcl &cNo *char value('*NO') dcl &cReject *char value('*REJECT') dcl &cYes *char value('*YES') dcl &RTNFTPS *char value('rtn_ftps') dcl &RTNFTPA *char value('rtn_ftpa') dcl &RTNFTPC *char value('rtn_ftpc') dcl &RTNREXEC *char value('rtn_rexec') dcl &RTNTFTP *char value('rtn_tftp') /********************************************************************/ /* Set options for Output, Program End */ /* */ /* Values used: */ /* Y/N - Yes/No */ /* */ /* Position 1 - Print activity report (Y/N) */ /* Position 2 - Log to QGPL/FTPEXIT (Y/N) */ /* Position 3 - Return with *INLR on (Y/N) */ /********************************************************************/ chgvar %sst(&ftpexit 1 1) value(&NO) chgvar %sst(&ftpexit 2 1) value(&NO) chgvar %sst(&ftpexit 3 1) value(&NO) if (&Print *eq &cYes) then( + chgvar %sst(&ftpexit 1 1) value(&YES)) if (&File *eq &cYes) then( + chgvar %sst(&ftpexit 2 1) value(&YES)) if (&INLR *eq &cYes) then( + chgvar %sst(&ftpexit 3 1) value(&YES)) /********************************************************************/ /* Set options for FTP Server */ /* */ /* Values used: */ /* Y/N - Yes/No */ /* N/R/A/Y - Never/Reject/Allow/Always */ /* */ /* Defaults: */ /* No Debug */ /* Allow all operations */ /* */ /* Position 11 - Allow Debug (Y/N) */ /* Position 12 - Allow session initialization (N/R/A/Y) */ /* Position 13 - Allow directory/library creation (N/R/A/Y) */ /* Position 14 - Allow directory/library deletion (N/R/A/Y) */ /* Position 15 - Allow set current directory (N/R/A/Y) */ /* Position 16 - Allow list files (N/R/A/Y) */ /* Position 17 - Allow file deletion (N/R/A/Y) */ /* Position 18 - Allow send files (N/R/A/Y) */ /* Position 19 - Allow receive files (N/R/A/Y) */ /* Position 20 - Allow rename file (N/R/A/Y) */ /* Position 21 - Allow Exec CL commands (N/R/A/Y) */ /********************************************************************/ /********************************************************************/ /* Check for Debug request for FTP Server */ /********************************************************************/ chgvar %sst(&ftpexit 11 1) value(&NO) if (%sst(&FTPServer 3 4) *eq &cYes) then( + chgvar %sst(&ftpexit 11 1) value(&YES)) /********************************************************************/ /* Process Operations list for FTP Server */ /* &n - starting position in &selections */ /* &k - starting position for this list in Data Area */ /********************************************************************/ chgvar &n 7 chgvar &k 11 chgvar &selections &FTPServer chgvar &rtnlbl &RTNFTPS loop_ftps: goto GetChoice rtn_ftps: if (&n *lt &lenFTPS) goto loop_ftps /********************************************************************/ /* Set options for Anonymous FTP Server */ /* */ /* Values used: */ /* Y/N - Yes/No */ /* N/R/A/Y - Never/Reject/Allow/Always */ /* */ /* Defaults: */ /* No Debug */ /* Allow Session Initialization, */ /* List Files, */ /* Send Files */ /* Reject all others (*REJECT) */ /* */ /* Position 31 - Allow Debug (Y/N) */ /* Position 32 - Allow session initialization (N/R/A/Y) */ /* Position 33 - Allow directory/library creation (N/R/A/Y) */ /* Position 34 - Allow directory/library deletion (N/R/A/Y) */ /* Position 35 - Allow set current directory (N/R/A/Y) */ /* Position 36 - Allow list files (N/R/A/Y) */ /* Position 37 - Allow file deletion (N/R/A/Y) */ /* Position 38 - Allow send files (N/R/A/Y) */ /* Position 39 - Allow receive files (N/R/A/Y) */ /* Position 40 - Allow rename file (N/R/A/Y) */ /* Position 41 - Allow Exec CL commands (N/R/A/Y) */ /********************************************************************/ /********************************************************************/ /* Check for Debug request for Anonymous FTP Server */ /********************************************************************/ chgvar %sst(&ftpexit 31 1) value(&NO) if (%sst(&FTPAnon 3 4) *eq &cYes) then( + chgvar %sst(&ftpexit 31 1) value(&YES)) /********************************************************************/ /* Process Operations list for Anonymous FTP Server */ /* &n - starting position in &selections */ /* &k - starting position for this list in Data Area */ /********************************************************************/ chgvar &n 7 chgvar &k 31 chgvar &selections &FTPAnon chgvar &rtnlbl &RTNFTPA loop_ftpa: goto GetChoice rtn_ftpa: if (&n *lt &lenFTPA) goto loop_ftpa /********************************************************************/ /* Set options for FTP Client */ /* */ /* Values used: */ /* Y/N - Yes/No */ /* N/R/A/Y - Never/Reject/Allow/Always */ /* */ /* Position 51 - Allow Debug (Y/N) */ /* Position 52 - Allow session initialization (N/R/A/Y) */ /* Position 53 - Allow set current directory (N/R/A/Y) */ /* Position 54 - Allow send files (N/R/A/Y) */ /* Position 55 - Allow receive files (N/R/A/Y) */ /* Position 56 - Allow Exec CL commands (N/R/A/Y) */ /********************************************************************/ /********************************************************************/ /* Check for Debug request for FTP Client */ /********************************************************************/ chgvar %sst(&ftpexit 51 1) value(&NO) if (%sst(&FTPClient 3 4) *eq &cYes) then( + chgvar %sst(&ftpexit 51 1) value(&YES)) /********************************************************************/ /* Process Operations list for FTP Client */ /* &n - starting position in &selections */ /* &k - starting position for this list in Data Area */ /********************************************************************/ chgvar &n 7 chgvar &k 51 chgvar &selections &FTPClient chgvar &rtnlbl &RTNFTPC loop_ftpc: goto GetChoice rtn_ftpc: if (&n *lt &lenFTPC) goto loop_ftpc /********************************************************************/ /* Set options for REXEC Server */ /* */ /* Values used: */ /* Y/N - Yes/No */ /* N/R/A/Y - Never/Reject/Allow/Always */ /* */ /* Position 61 - Allow Debug (Y/N) */ /* Position 62 - Allow session initialization (N/R/A/Y) */ /* Position 63 - Allow Exec CL commands (N/R/A/Y) */ /********************************************************************/ /********************************************************************/ /* Check for Debug request for REXEC */ /********************************************************************/ chgvar %sst(&ftpexit 61 1) value(&NO) if (%sst(&REXEC 3 4) *eq &cYes) then( + chgvar %sst(&ftpexit 61 1) value(&YES)) /********************************************************************/ /* Process Operations list for REXEC */ /* &n - starting position in &selections */ /* &k - starting position for this list in Data Area */ /********************************************************************/ chgvar &n 7 chgvar &k 61 chgvar &selections &REXEC chgvar &rtnlbl &RTNREXEC loop_rexec: goto GetChoice rtn_rexec: if (&n *lt &lenREXEC) goto loop_rexec /********************************************************************/ /* Set options for TFTP Server */ /* */ /* Values used: */ /* Y/N - Yes/No */ /* N/R/A/Y - Never/Reject/Allow/Always */ /* */ /* Position 71 - Allow Debug (Y/N) */ /* Position 72 - Allow send files (N/R/A/Y) */ /* Position 73 - Allow receive files (N/R/A/Y) */ /********************************************************************/ /********************************************************************/ /* Check for Debug request for TFTP Server */ /********************************************************************/ chgvar %sst(&ftpexit 71 1) value(&NO) if (%sst(&TFTPServer 3 4) *eq &cYes) then( + chgvar %sst(&ftpexit 71 1) value(&YES)) /********************************************************************/ /* Process Operations list for FTP Client */ /* &n - starting position in &selections */ /* &k - starting position for this list in Data Area */ /********************************************************************/ chgvar &n 7 chgvar &k 71 chgvar &selections &TFTPServer chgvar &rtnlbl &RTNTFTP loop_tftp: goto GetChoice rtn_tftp: if (&n *lt &lenTFTP) goto loop_tftp /********************************************************************/ /* Set options for Application Server Logon */ /* */ /* Values used: */ /* Y/N - Yes/No */ /* R/A - Reject/Allow */ /* */ /* Position 81 - Allow Debug (Y/N) */ /* Position 82 - Allow Logon to FTP Server (R/A) */ /* Position 83 - Allow Anonymous FTP (R/A) */ /* Position 84 - Allow Logon to REXEC Server (R/A) */ /* Position 91 - 100 - Initial library for Anonymous FTP */ /* *USRPRF - use library name in User Profile*/ /* lib_nam - use specified library name */ /* Position 101 - 150- Initial path for Anonymous FTP */ /********************************************************************/ /********************************************************************/ /* Check for Debug request for Application Server Logon */ /********************************************************************/ chgvar %sst(&ftpexit 81 1) value(&NO) if (%sst(&APPLogon 3 4) *eq &cYes) then( + chgvar %sst(&ftpexit 81 1) value(&YES)) /********************************************************************/ /* Check for Allow Logon to FTP Server */ /********************************************************************/ chgvar %sst(&ftpexit 82 1) value(&REJECT) if (%sst(&APPLogon 7 7) *eq &cALLOW) then( + chgvar %sst(&ftpexit 82 1) value(&ALLOW)) /********************************************************************/ /* Check for Allow Anonymous FTP */ /********************************************************************/ chgvar %sst(&ftpexit 83 1) value(&REJECT) if (%sst(&APPLogon 14 7) *eq &cALLOW) then( + chgvar %sst(&ftpexit 83 1) value(&ALLOW)) /********************************************************************/ /* Check for Allow Logon to REXEC Server */ /********************************************************************/ chgvar %sst(&ftpexit 84 1) value(&REJECT) if (%sst(&APPLogon 81 7) *eq &cALLOW) then( + chgvar %sst(&ftpexit 84 1) value(&ALLOW)) /********************************************************************/ /* Store value for Initial Library for Anonymous FTP */ /********************************************************************/ chgvar %sst(&ftpexit 91 10) + %sst(&APPLogon 21 10) /********************************************************************/ /* Store value for Initial Path for Anonymous FTP */ /********************************************************************/ chgvar %sst(&ftpexit 101 50) + %sst(&APPLogon 31 50) /********************************************************************/ /* Update data area with selected options */ /********************************************************************/ chgdtaara dtaara(qgpl/daftpexit) + value(&ftpexit) return /********************************************************************/ /* Subroutine to process Operation choice */ /* */ /* &selections - selected options list from command parameter */ /* &n - start-at position in &selections */ /* &k - position to update in &ftpexit data area */ /********************************************************************/ GetChoice: chgvar &work7 %sst(&selections &n 7) if (&work7 *eq &cNever) then( + chgvar &work1 &NEVER) if (&work7 *eq &cReject) then( + chgvar &work1 &REJECT) if (&work7 *eq &cAllow) then( + chgvar &work1 &ALLOW) if (&work7 *eq &cAlways) then( + chgvar &work1 &ALWAYS) chgvar &k (&k + 1) chgvar %sst(&ftpexit &k 1) &work1 chgvar &n (&n + 7) if (&rtnlbl *eq &RTNFTPS) then(goto rtn_ftps) if (&rtnlbl *eq &RTNFTPA) then(goto rtn_ftpa) if (&rtnlbl *eq &RTNFTPC) then(goto rtn_ftpc) if (&rtnlbl *eq &RTNREXEC) then(goto rtn_rexec) if (&rtnlbl *eq &RTNTFTP) then(goto rtn_tftp) endpgm