%( **************************************************************** 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 KILL( VERSION = '6.5', ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, NONEXTERNAL=LONG_RELATIVE), OPTIMIZE, OPTLEVEL = 3, ZIP) = BEGIN !++ ! KILL.BLI Copyright (c) 1990 Carnegie Mellon University ! ! Description: ! ! Delete a network connection. ! ! Written By: Bruce R. Miller ! ! Modifications: ! !-- LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'CMUIP_SRC:[central]NETWORK'; LIBRARY 'CMUIP_SRC:[central]NETCOMMON'; LIBRARY 'CMUIP_SRC:[central]NETCONFIG'; LIBRARY 'CMUIP_SRC:[central]NETCNTRL'; LIBRARY 'CMUIP_SRC:[central]NETERROR'; LIBRARY 'IPNCP'; OWN NETIOSB : NetIO_Status_Block; EXTERNAL ROUTINE STR$APPEND : BLISS ADDRESSING_MODE(GENERAL), STR$FREE1_DX : BLISS ADDRESSING_MODE(GENERAL); BIND PADD = UPLIT(%ASCII' '); MACRO TRUE = (1 EQL 1) %, FALSE = (NOT TRUE) %; %SBTTL 'Utility routines' ROUTINE NETERROR(IOSB : REF NetIO_Status_Block) : NOVALUE = BEGIN IF .IOSB[NSB$Status] NEQ SS$_ABORT THEN SIGNAL(.IOSB[NSB$Status]) ELSE SIGNAL(.IOSB[NSB$XStatus]); END; GLOBAL ROUTINE DO_KILL_TCP (Chan,IDX) = ! ! Kill a TCP connection ! BEGIN LOCAL In_Buff : VECTOR [4,byte], Out_Buff : VECTOR [256,Long], STATUS; BIND Buffsize = Out_Buff : LONG; In_Buff[0] = .IDX; STATUS = NET$SNMP( IOchan = .Chan, IO$SB = NETIOSB, SubFUNC = 4, WBUFADRS = In_Buff, WBUFSIZE = 4, RBUFADRS = Out_Buff, RBUFSIZE = 256 ); IF .STATUS THEN IF (STATUS = .NETIOSB[NSB$Status]) EQL SS$_ABORT THEN STATUS = .NETIOSB[NSB$XStatus]; IF NOT .STATUS THEN BEGIN Signal(.Status); RETURN .Status END; PrintTT('Length of returned buffer is !XL!/',.Buffsize); PrintTT('SNMP returned: [!AF]!/',.Buffsize,Out_Buff[1]); .STATUS END; GLOBAL ROUTINE DO_KILL_UDP (Chan,IDX) = ! ! Kill a UDP connection ! BEGIN LOCAL In_Buff : VECTOR [4,BYTE], Out_Buff : VECTOR [256,BYTE], STATUS; PrintTT('Not Implemented.!/'); SS$_NORMAL END; GLOBAL ROUTINE DO_KILL_ICMP (Chan,IDX) = ! ! Kill a ICMP connection ! BEGIN LOCAL In_Buff : VECTOR [4,BYTE], Out_Buff : VECTOR [256,BYTE], STATUS; PrintTT('Not Implemented.!/'); SS$_NORMAL END; END ELUDOM