%( **************************************************************** Copyright (c) 1992, Carnegie Mellon University All Rights Reserved Permission is hereby granted to use, copy, modify, and distribute this software provided that the above copyright notice appears in all copies and that any distribution be for noncommercial purposes. Carnegie Mellon University disclaims all warranties with regard to this software. In no event shall Carnegie Mellon University be liable for any special, indirect, or consequential damages or any damages whatsoever resulting from loss of use, data, or profits arising out of or in connection with the use or performance of this software. **************************************************************** )% Module Netlog ( IDENT='001', ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, NONEXTERNAL=LONG_RELATIVE), LIST(NORequire,assembly,object,binary))= BEGIN !++ ! NETLOG.BLI Copyright (c) 1986 Carnegie Mellon University ! ! Description: ! ! A utility to enable/disable ACP debugging logging. ! ! Modifications: ! ! 01-DEC-1987 Dale Moore CMU-CS/RI ! Added keyword names for various debugging. ! Unfortunately, we should probably get the same bit values ! from a common require file with the sources. ! ! 01-JUL-1986 Dale Moore CMU-CS/RI ! Change device name from THC to IP. ! ! 30-JUN-1986 Dale Moore CMU-CS/RI ! Removed XPORT. Added Change log. Added Real error messages. ! Changed to use OTS to convert hex number. !-- LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'CMUIP_SRC:[central]NETCNTRL'; LIBRARY 'CMUIP_SRC:[central]NETCOMMON'; LIBRARY 'CMUIP_SRC:[central]NETWORK'; LIBRARY 'CMUIP_SRC:[central]NETERROR'; EXTERNAL LITERAL IPNCP$_Privs, IPNCP$_Find_Net, IPNCP$_Log_Dis, IPNCP$_Log_Ena; GLOBAL ROUTINE Do_NetLog (Log_State, Group) = Begin LOCAL curpriv : $BBLOCK [8], NetChan : WORD UNSIGNED, ! network I/O channel NET$IOSB: NetIO_Status_Block, RC; ! Do we have phy_io priv? ! get current priv's and check for phy_io. rc = $setprv (prvprv = curpriv); if not .RC then RETURN (.rc); if not (.curpriv[prv$v_phy_io]) THEN Signal (IPNCP$_Privs, 0, SS$_NOPHY_IO); ! assign network device for tcpacp communication RC = $ASSIGN (Devnam = %ASCID 'INET$DEVICE', Chan = NetChan); if not .RC then Signal (IPNCP$_Find_Net, 0, .RC); ! Request TCP to Enable/disable log file tracing. RC = Net$Debug ( Level = .log_state, Group = .Group, IOChan = .Netchan, IO$SB = NET$IOSB); if not .RC THEN RETURN (.RC); RC = .NET$IOSB [NSB$Status]; IF NOT .RC THEN BEGIN IF .RC EQLU SS$_ABORT THEN Signal (.NET$IOSB [NSB$XStatus], 0) ELSE Signal (.RC); END; ! Deassign the network device $Dassgn(chan=.NetChan); IF .log_State EQLU 0 THEN Signal (IPNCP$_LOG_DIS, 0) ELSE Signal (IPNCP$_Log_Ena, 1, .Log_State); SS$_NORMAL END; End Eludom