SPPICMD CSECT SPP00010 *********************************************************************** SPP00020 *********************************************************************** SPP00030 *** *** SPP00040 *** (C) Copyright IBM Corp. 1990, 1991, 1992 *** SPP00050 *** No warranty expressed or implied. *** SPP00060 *** *** SPP00070 *** SPPICMD *** SPP00080 *** *** SPP00090 *** SPPICMD accepts a MVS system command string via the EXEC *** SPP00100 *** parm and then sends it to a application called RPPICMD *** SPP00110 *** using the NetView Program-to-Program Interface. RPPICMD *** SPP00120 *** is a NetView subtask which receives the commands from SPPICMD *** SPP00130 *** and then executes them. *** SPP00140 *** *** SPP00150 *** For Security the following safeguards are built-in: *** SPP00160 *** *** SPP00170 *** 1. RPPICMD runs APF authorized and tells the NetView *** SPP00180 *** PPI that it will only receive data from a application *** SPP00190 *** called SPPICMD which also runs APF authorized. *** SPP00200 *** *** SPP00210 *** 2. Both SPPICMD and RPPICMD must be put in a authorized *** SPP00220 *** library and must be linkedited as AC=1. *** SPP00230 *** *** SPP00240 *** 3. The command sent is prefixed with a 8 character password.*** SPP00250 *** The password is hardcoded in both the SPPICMD and *** SPP00260 *** RPPICMD programs. RPPICMD checks the password when any *** SPP00270 *** data is received. *** SPP00280 *** *** SPP00290 *** The password can be changed, but must be changed in *** SPP00300 *** both programs, and the programs must be restarted. *** SPP00310 *** *** SPP00320 *** *** SPP00330 *** For added protection the SPPICMD module should be RACF *** SPP00340 *** protected and only authorized for the intended user. *** SPP00350 *** This will prevent unauthorized users from running *** SPP00360 *** the program and sending commands to NetView for execution. *** SPP00370 *** *** SPP00380 *** *** SPP00390 *** Installation: *** SPP00400 *** *** SPP00410 *** 1. Assemble and linkedit code *** SPP00420 *** *** SPP00430 *** Linkage editor options 'AMODE=31,RMODE=ANY,AC=1' *** SPP00440 *** *** SPP00450 *** Note: SPPICMD is not reentrant. *** SPP00460 *** *** SPP00470 *** Operation: *** SPP00480 *** *** SPP00490 *** 1. Run as a batch job or started task *** SPP00500 *** *** SPP00510 *** // EXEC PGM=SPPICMD,PARM='mvs-command-and-parameters' *** SPP00520 *** //STEPLIB DD DSN=your-load-library,DISP=SHR *** SPP00530 *** // DD DSN=netview-load-library,DISP=SHR *** SPP00540 *** *** SPP00550 *** *** SPP00560 *** Gary Forghetti *** SPP00570 *** IBM Corporation *** SPP00580 *** Network Mgmt Products Field Support *** SPP00590 *** Research Triangle Park, North Carolina *** SPP00600 *** *** SPP00610 *********************************************************************** SPP00620 *********************************************************************** SPP00630 R0 EQU 0 SPP00640 R1 EQU 1 SPP00650 R2 EQU 2 SPP00660 R3 EQU 3 SPP00670 R4 EQU 4 SPP00680 R5 EQU 5 SPP00690 R6 EQU 6 SPP00700 R7 EQU 7 SPP00710 R8 EQU 8 SPP00720 R9 EQU 9 SPP00730 R10 EQU 10 SPP00740 R11 EQU 11 SPP00750 R12 EQU 12 SPP00760 R13 EQU 13 SPP00770 R14 EQU 14 SPP00780 R15 EQU 15 SPP00790 USING *,R15 SPP00800 B PROLOG SPP00810 DC C'SPPICMD &SYSDATE. AT &SYSTIME. ' SPP00820 DC C'COPYRIGHT IBM CORPORATION ' SPP00830 DC C'NO WARRANTY EXPRESSED OR IMPLIED ' SPP00840 PROLOG DS 0H SPP00850 STM R14,R12,12(R13) SAVE CALLING PGMS REGISTERS SPP00860 LR R12,R15 GET ENTRY POINT ADDR FOR BASE REG SPP00870 DROP R15 SPP00880 USING SPPICMD,R12 R12 IS MODULE BASE REGISTER SPP00890 ST R13,SAVEAREA+4 SAVE CALLING PGMS SAVEAREA ADDRESS SPP00900 LR R10,R13 SAVE CALLING PGMS SAVEAREA ADDRESS SPP00910 LA R13,SAVEAREA R13 IS ADDR OF THIS PGMS SAVEAREA SPP00920 ST R13,8(R10) STORE ADDR IN CALLING PGMS SAVEAREA SPP00930 * SPP00940 LA R11,RPB GET ADDRESS OF RPB SPP00950 USING DSIDTR,R11 R11 IS BASE REG FOR RPB SPP00960 * SPP00970 XC DTRRETC,DTRRETC CLEAR RETURN CODE SPP00980 * SPP00990 L R2,0(R1) GET ADDRESS OF PARM SPP01000 CLC 0(2,R2),=H'0' ANY DATA SPECIFIED? SPP01010 BE MODEXIT NO, EXIT SPP01020 * SPP01030 LOAD EP=CNMCNETV DYNAMICALLY LOAD CNMCNETV SPP01040 ST R0,MODADDR SAVE CNMCNETV ADDRESS SPP01050 * SPP01060 MVC DTRLEN,=A(DTREND-DSIDTR) PUT LENGTH IN RPB SPP01070 * SPP01080 MVC DTRREQT,=H'1' QUERY NETVIEW SUBSYSTEM STATUS SPP01090 MVC DTRWKPTR,=A(WORKAREA) SPP01100 * SPP01110 L R15,MODADDR GET CNMCNETV MODULE ADDRESS SPP01120 CALL (15),RPB INVOKE NETVIEW APPI SPP01130 * SPP01140 CLC DTRRETC,=F'10' NETVIEW SUBSYSTEM ACTIVE? SPP01150 BE MAINRTN1 YES, CONTINUE SPP01160 * SPP01170 WTO 'SPPICMD: NETVIEW SSI IS NOT ACTIVE',ROUTCDE=11 SPP01180 B RETURN EXIT SPP01190 * SPP01200 MAINRTN1 EQU * SPP01210 * SPP01220 MVC DTRREQT,=H'2' QUERY A RECEIVERS STATUS SPP01230 MVC DTRRVID,=CL8'RPPICMD' ID OF RECEIVER SPP01240 * SPP01250 L R15,MODADDR GET CNMCNETV MODULE ADDRESS SPP01260 CALL (15),RPB INVOKE NETVIEW APPI SPP01270 * SPP01280 CLC DTRRETC,=F'14' RECEIVER PROGRAM ACTIVE? SPP01290 BE MAINRTN2 YES, SEND DATA BUFFER SPP01300 * SPP01310 CLC DTRRETC,=F'15' RECEIVER PROGRAM INACTIVE? SPP01320 BE MAINRTN2 YES, SEND DATA BUFFER FOR QUEUEING SPP01330 * SPP01340 WTO 'SPPICMD: PPI QUERY RECEIVER FAILED',ROUTCDE=11 SPP01350 B RETURN EXIT SPP01360 * SPP01370 MAINRTN2 EQU * SPP01380 * SPP01390 LH R3,0(R2) GET LENGTH OF COMMAND PARM SPP01400 * SPP01410 BCTR R3,0 MAKE LENGTH EXECUTEABLE SPP01420 EX R3,MOVECMD MOVE COMMAND FROM PARM TO BUFFER SPP01430 * SPP01440 MVC DTRREQT,=H'14' SEND A DATA BUFFER SPP01450 MVC DTRSDID,=CL8'SPPICMD' ID OF SENDER SPP01460 MVC DTRRVID,=CL8'RPPICMD' ID OF RECEIVER SPP01470 * SPP01480 LA R2,PPIBUFFR GET ADDRESS OF BUFFER TO SEND SPP01490 ST R2,DTRUBPTR SAVE ADDRESS OF BUFFER SPP01500 * SPP01510 LA R3,9(R3) RESET LENGTH AND INCLUDE PASSWORD SPP01520 ST R3,DTRUBL SAVE LENGTH OF BUFFER SPP01530 * SPP01540 L R15,MODADDR GET CNMCNETV MODULE ADDRESS SPP01550 CALL (15),RPB INVOKE NETVIEW APPI SPP01560 * SPP01570 CLC DTRRETC,=F'0' RECEIVER ACTIVE/SEND SUCCESSFUL? SPP01580 BE RETURN YES, EXIT SPP01590 * SPP01600 CLC DTRRETC,=F'4' RECEIVER INACTIVE/SEND SUCCESSFUL? SPP01610 BE RETURN YES, EXIT SPP01620 * SPP01630 WTO 'SPPICMD: PPI SEND DATA FAILED',ROUTCDE=11 SPP01640 * SPP01650 RETURN EQU * SPP01660 * SPP01670 OC MODADDR,MODADDR WAS CNMCNETV LOADED? SPP01680 BZ MODEXIT NO, EXIT SPP01690 * SPP01700 DELETE EP=CNMCNETV DELETE CNMCNETV SPP01710 * SPP01720 MODEXIT EQU * SPP01730 L R15,DTRRETC GET RETURN CODE SPP01740 L R13,SAVEAREA+4 RESTORE CALLING PGMS SAVEAREA SPP01750 RETURN (14,12),RC=(15) RESTORE CALLING PGMS REGS & RETURN SPP01760 * SPP01770 MOVECMD MVC COMMAND(0),2(R2) MOVE COMMAND FROM PARM TO BUFFER SPP01780 EJECT SPP01790 LTORG SPP01800 SAVEAREA DS 18F SPP01810 * SPP01820 MODADDR DC A(0) SPP01830 * SPP01840 PPIBUFFR DS 0CL108 SPP01850 PASSWORD DC XL8'00FF00FF00FF00FF' SPP01860 COMMAND DS CL100 SPP01870 * SPP01880 RPB DS CL(RPBLENG) SPP01890 * SPP01900 WORKAREA DS CL128 SPP01910 * SPP01920 DSIDTR ASSEMBLER DSECT FOR RPB SPP01930 RPBLENG EQU *-DSIDTR SPP01940 * SPP01950 END SPP01960