IBM OS/2 LAN Server REXX Utility DLL


Inf-HTML [About][Toc][Index] 0.9b (c) 1995 Peter Childs


NETCONNECTION Get Info


The function returns a list of connections made to a shared resource of a 
server, or a list of all connections established from a particular 
computer to a server. This function is identical identical to 
NetEnumerate(NETCONNECTION).   
Syntax 


MyRc = NetGetInfo(NETCONNECTION, 'connInfo', SrvName, Qualifier)

  
Parameters 
The parameters specified are: 
'connInfo'    The REXX variable receiving the result. The variable is 
              divided into: 
   o connInfo.num_entries 
     The number of connection information entries. Each entry is obtained 
     by the index i, which has a value from 1 to connInfo.num_entries 
   o connInfo.i.id 
     The connection id 
   o connInfo.i.type 
     The type of connection made from the local device name to the shared 
     resource 
   o connInfo.i.num_opens 
     The number of files that are currently open as a result of the 
     connection 
   o connInfo.i.num_users 
     The number of users on the connection 
   o connInfo.i.time 
     The number of seconds the connection has been established 
   o connInfo.i.username 
     The name of the user that made the connection 
   o connInfo.i.netname 
     A string indicating either the netname of the shared resource of the 
     server or the computer name of the requester, depending on which name 
     was specified as the Qualifier parameter 
SrvName       The server computer name 
Qualifier     A string specifying either the netname of the shared 
              resource whose connections will be listed or the client name 
              of the requester whose connections to the shared resource 
              will be listed 
  
Note 
The server computer name can be specified as '' for a local server.   
Example   


/* Get connection information */
call RxFuncAdd 'LoadLsRxutFuncs', 'LSRXUT', 'LoadLsRxutFuncs'
call LoadLsRxutFuncs

NETCONNECTION = 40
SrvName       = '\\DOMAIN_CONTRLR'
Qualifier     = '\\ITSCWK21'

myRc = NetGetInfo(NETCONNECTION, 'connInfo', SrvName, Qualifier)

if myRc <> '0' then do
 say 'Got error from NetGetInfo() ' myRc
 call DropLsRxutFuncs
 exit 9
end

if connInfo.0 = 0 then do
 say 'No connections established'
 call DropLsRxutFuncs
 exit 0
end

if connInfo.num_entries <> 0 then do
 say "Number of entries: " connInfo.num_entries

 do i=1 to connInfo.num_entries
  say
  say "Connection id:        " connInfo.i.id
  say "Connection type:      " connInfo.i.type
  say "Connection num opens: " connInfo.i.num_opens
  say "Connection num users: " connInfo.i.num_users
  say "Connection time:      " connInfo.i.time
  say "Connection user name: " connInfo.i.username
  say "Connection net name:  " connInfo.i.netname
 end

end

call DropLsRxutFuncs
call RxFuncDrop 'LoadLsRxutFuncs'

exit 0

  
Example Output   


Number of entries:  2

Connection id:         6145
Connection type:       Interprocess Communication Connection
Connection num opens:  0
Connection num users:  1
Connection time:       411
Connection user name:  ADMIN04
Connection net name:   IPC$

Connection id:         59393
Connection type:       Disk Connection
Connection num opens:  1
Connection num users:  1
Connection time:       367
Connection user name:  ADMIN04
Connection net name:   C$



Inf-HTML End Run - Successful