%( **************************************************************** 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 Netexit ( IDENT='001', ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, NONEXTERNAL=LONG_RELATIVE), LIST (NOEXPAND,ASSEMBLY,BINARY))= Begin !++ ! NETEXIT.BLI Copyright (c) 1986 Carnegie Mellon University ! ! Description: ! ! Tell the network to exit. ! ! Written By: Unknown Tektronix ! ! Modifications: ! ! 01-JUL-1986 Dale Moore CMU-CS/RI ! Changed network device from THC to IP. ! ! 30-JUN-1986 Dale Moore CMU-CS/RI ! Removed XPORT dependencies. Cleaned up terminal I/O. ! Removed fake error messages. Add change log. !-- LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'CMUIP_SRC:[central]NETWORK'; LIBRARY 'CMUIP_SRC:[central]NETCOMMON'; LIBRARY 'CMUIP_SRC:[central]NETCNTRL'; LIBRARY 'CMUIP_SRC:[central]NETERROR'; EXTERNAL LITERAL IPNCP$_Privs, IPNCP$_Find_Net, IPNCP$_IPACP_Exiting; GLOBAL ROUTINE NetExit = Begin LOCAL NetChan : WORD UNSIGNED, ! network I/O channel Net$IOSB: NetIO_Status_Block, CurPriv : $BBLOCK [8], RC; ! check process privileges to bring down acp. 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 so we can talk to the acp. RC = $ASSIGN (Devnam = %ASCID 'INET$DEVICE', Chan = NetChan); if not (.RC) then Signal (IPNCP$_Find_Net, 0, .RC); ! Request TCP to Exit gracefully RC = Net$EXIT (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 RC = .Net$IOSB [NSB$XStatus]; Signal (.RC); END; ! Deassign the network device $Dassgn(chan=.NetChan); Signal (IPNCP$_IPACP_EXITING, 0); SS$_NORMAL End; End Eludom