Skip to content

Commit

Permalink
Merge pull request #106 from BroadcomMFD/Steve-Hosie-patch-1
Browse files Browse the repository at this point in the history
Steve hosie patch 1
  • Loading branch information
adam-wolfe authored Nov 18, 2024
2 parents e4a8558 + 27114df commit 5aba89e
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 0 deletions.
67 changes: 67 additions & 0 deletions cybersecurity-scripts/zOS/LISTAPF/LISTAPF.rexx.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
/*REXX ***************************************************************/ 00001006
/* ---------------------------------------------------------------- */ 00002006
/* Purpose: This REXX exec provides an effient method to */ 00003006
/* interactively list the APF and placing the output */ 00004006
/* into a temp dataset to allow scrolling, browsing and searching */ 00005006
/* ---------------------------------------------------------------- */ 00006006
/* This rexx is an example of the art of the possible */ 00007006
/* */ 00009006
/* ---------------------------------------------------------------- */ 00009606
/* Syntax: LISTAPF */ 00009706
/* */ 00009806
/* trace(i) */ 00020800
current_seconds = TIME(S) 00021100
last_qual = "D"current_seconds 00021200
user = userid() 00021300
udsn = user'.TSS.TEMP.'last_qual'.LISTAPF' 00021400
udsn = strip(udsn) 00021500
ddname = "A"current_seconds 00021600
00021700
if sysdsn("'"udsn"'") = OK then 00021800
"alloc f("ddname") da('"udsn"') shr reu" 00021900
else 00022000
"alloc f("ddname") da('"udsn"') NEW SP(200 200) 00023000
TR DSORG(PS) RECFM(F B) LRECL(133)" 00024000
i = 1 00025000
00026005
numeric digits 20 /* need this for D2X/C2D */ 00029000
CVT = C2D(STORAGE(10,4)) /* CVT Pointer */ 00030000
CVTAUTHL = C2D(STORAGE(D2X(CVT + 484),4)) 00040000
if CVTAUTHL = C2D('7FFFF001'x) then 00050005
do 00051005
/* The APF Table is Dynamic, not Static */ 00060005
CVTECVT = C2D(STORAGE(D2X(CVT + 140),4)) 00061005
ECVTCSVT = C2D(STORAGE(D2X(CVTECVT + 228),4)) 00062005
APF_PTR = c2d(storage(d2x(ECVTCSVT+12),4)) 00063005
CUR = c2d(storage(d2x(APF_PTR+8),4)) 00064005
LAST = c2d(storage(d2x(APF_PTR+12),4)) 00065005
do forever 00066005
DATASET = storage(d2x(CUR+24),44) 00067005
if substr(DATASET,1,1) \= '00'x then /* Its not deleted */ 00068005
do 00068105
VOL_SMS = storage(d2x(CUR+4),1) 00069005
IF bitand(VOL_SMS,'80'x) = '80'x then VOLUME = 'SMS ' 00069105
ELSE VOLUME = STORAGE(D2X(CUR+68),6) 00069205
/* Here we list the found items */ 00069305
apf_rec.i = volume strip(dataset) 00069405
i = i + 1 00069505
end 00069605
if CUR = LAST then leave 00069705
else CUR = C2D(STORAGE(D2X(CUR+8),4)) 00069805
END /* Do */ 00069905
END /* End of Dynamic */ 00070005
00080005
"EXECIO * DISKW "ddname" (stem apf_rec. finis" 00124600
IF RC > 1 THEN DO 00126000
SAY "STORAGE OF COMMAND OUTPUT FAILED. EXECIO RC=" RC 00127000
SAY "TRUNCATED OUTPUT MAY BE VIEWED IN" udsn 00128000
EXIT 00129000
END 00130000
ELSE 00140000
/* the ISPEXEC command below can be changed to just browse */ 00150000
/* if needed. ISPEXEC BROWSE DATASET(" DSN ") */ 00160000
"ISPEXEC EDIT DATASET('"udsn"')" 00170000
STATUS = MSG('OFF') 00171003
address tso "FREE F("ddname")" 00180000
address tso "DELETE '"udsn"'" 00190000
exit(0) 00200000
10 changes: 10 additions & 0 deletions cybersecurity-scripts/zOS/LISTAPF/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Broadcom z/OS LISTAPF REXX Script
LISTAPF simply and quickly lists the APF into a temporary dataset and places you into Edit mode to allow interactive scrolling, searching, and researching.


# Using
Sample scripts for each product are located in the directory that shares its name. If you cannot find a particular use case, [please open an issue](https://github.com/BroadcomMFD/broadcom-product-scripts/issues/new).

What to do:
1. Upload the LISTAPF.rexx.txt as AC into your CLIST/REXX library.
2. Execute: TSO LISTAPF
13 changes: 13 additions & 0 deletions cybersecurity-scripts/zOS/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Broadcom zOS Scripts
This repository houses sample scripts for use cases involving Broadcom Products.

# Using
Sample scripts for each product are located in the directory that shares its name. For example, TSS samples are in the subsequent child directories. If you cannot find a particular use case, [please open an issue](https://github.com/BroadcomMFD/broadcom-product-scripts/issues/new).

# Folders
1. LISTAPF - LISTAPF example code. LISTAPF REXX provides the capability to qucikly list the APF into a temp dataset, placing the user into edit mode and allowing scrolling/searching as desired.

# Contributing
**We are not accepting third-party contributions at this time. If you are interested in contributing, please contact [email protected] & [email protected] & [email protected] or [email protected] to discuss.**

It is the responsibility of the original contributor to resolve vulnerabilities identified by Dependabot within their contributions.

0 comments on commit 5aba89e

Please sign in to comment.