home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 18 REXX
/
18-REXX.zip
/
rplrxenu.zip
/
rplrxenu.cmd
Wrap
OS/2 REXX Batch file
|
1996-02-20
|
7KB
|
197 lines
/**2/REXX*********************************************************************/
/* Function Name: RPLRXENU */
/*****************************************************************************/
/* Function Description: */
/* */
/* This routine will list a specified amount of information for all RIPL */
/* machines of a specific type using the RxNetEnumRIPLMachine API call. */
/*****************************************************************************/
/* Example: */
/* */
/* RPLRXENU /L:2 /T:O */
/*****************************************************************************/
/* Algorithm: */
/* */
/* begin rplrxenu */
/* |>if there are no input parameters then display the syntax */
/* |>load and verify input parameters */
/* |>call RxNetEnumRIPLMachine API */
/* |>display the information returned from the API */
/* |>exit with resulting return code */
/* end rplrxenu */
/*****************************************************************************/
/* trace ?i */
if arg() = 0 then
do
say 'Enumerate RIPL Machines--Command Syntax:'
say 'RPLRXENU /L: /T: [/S:]'
say '/L: Level of detail from API(0-2)'
say '/T: Type of RIPL clients to enumerate(O | D | A)'
say ' O->OS/2'
say ' D->DOS'
say ' A->All'
say '/S: remote IPL Server name(<= 15)'
exit 0
end
Call RxFuncAdd 'SysLoadFuncs', 'RexxUtil', 'SysLoadFuncs'
Call SysLoadFuncs
call RxFuncAdd 'RxRegRIPLFuncs', 'RXRPLEXT', 'RXREGRIPLFUNCS'
call RxRegRIPLFuncs
/*****************************************************************************/
/* initialize variables */
/*****************************************************************************/
rc = 0
level = -1
type = ''
ripl_svr = ''
/*****************************************************************************/
/* load and verify parameters */
/*****************************************************************************/
arg p.0 p.1 p.2 p.3
if p.3 <> '' then
do
rc = 8
call error
end
do i = 0 to 2
if p.i <> '' then
do
sep_pos = pos(':', p.i)
if sep_pos = 0 then
do
rc = 19
call error
end
parm_sec = sep_pos - 1
parm = substr(p.i, 1, parm_sec)
parm_val_sec = length(p.i) - sep_pos
parm_val = substr(p.i, sep_pos+1, parm_val_sec)
if parm = '/L' then
do
if (parm_val <> 0) & (parm_val <> 1) & (parm_val <> 2) then
do
rc = 20
call error
end
level = parm_val
end
else if parm = '/T' then
do
if (parm_val <> 'O') & (parm_val <> 'D') & (parm_val <> 'A') then
do
rc = 21
call error
end
type = parm_val
end
else if parm = '/S' then
do
if length(parm_val) > 15 then
do
rc = 16
call error
end
ripl_svr = '\\' || parm_val
end
else
do
rc = 17
call error
end
end
end
if (level = -1) | (type = '') then
do
rc = 5
call error
end
say '▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓'
say '▓RIPL Client Enumeration Data▓'
say '▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓'
if (type = 'O') | (type = 'A') then
do
call RxNetEnumRIPLMachine ripl_svr, level, '1', stem
if RESULT <> 0 then
do
if RESULT < 2100 then
msg = SysGetMessage(RESULT)
else
msg = SysGetMessage(RESULT, 'NET.MSG')
say msg
exit RESULT
end
/*****************************************************************************/
/* display the enumerated information for all of the OS/2 RIPL */
/* client(s) specified */
/*****************************************************************************/
do i = 1 to stem.0
say ''
say '░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░OS' || ,
'/2░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░'
say 'machine ID: 'stem.i.name
if level <> 0 then
say 'description: 'stem.i.remark
if level = 2 then
do
say 'adapter address: 'stem.i.adapter
say 'OS/2 boot drive: 'stem.i.os2bootdrive
say 'server record ID: 'stem.i.os2recid
say 'OS/2 config. flags: 'stem.i.os2flags
end
end
end
if (type = 'D') | (type = 'A') then
do
call RxNetEnumRIPLMachine ripl_svr, level, '2', stem
if RESULT <> 0 then
do
if RESULT < 2100 then
msg = SysGetMessage(RESULT)
else
msg = SysGetMessage(RESULT, 'NET.MSG')
say msg
exit RESULT
end
/*****************************************************************************/
/* display the enumerated information for all of the DOS RIPL */
/* client(s) specified */
/*****************************************************************************/
do i = 1 to stem.0
say ''
say '░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░DO' || ,
'S░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░'
say 'machine ID: 'stem.i.name
if level <> 0 then
say 'description: 'stem.i.remark
if level = 2 then
do
say 'adapter address: 'stem.i.adapter
say 'DOS image ID: 'stem.i.dosimageid
say 'server record ID: 'stem.i.dosrecid
end
end
end
exit 0
/*****************************************************************************/
/* this routine displays the appropriate error message then exits */
/*****************************************************************************/
error:
if rc = 5 then
say 'at least one of the necessary parameters was not specified'
else if rc = 8 then
say 'an incorrect number of parameters was specified'
else if rc = 16 then
do
say 'the remote IPL server name specified is more than 15 characters in'
say 'length'
end
else if rc = 17 then
say 'an invalid parameter was specified'
else if rc = 19 then
say 'a parameter was specified with an invalid format'
else if rc = 20 then
say 'an incorrect value was specified for the level(/L:) parameter'
else if rc = 21 then
say 'an incorrect value was specified for the type(/T:) parameter'
exit rc