%( **************************************************************** 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 SNMP( VERSION = '6.5', ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, NONEXTERNAL=LONG_RELATIVE), OPTIMIZE, OPTLEVEL = 3, ZIP) = BEGIN !++ ! SNMP.BLI Copyright (c) 1990 Carnegie Mellon University ! ! Description: ! ! Provide SNMP access. ! ! 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); 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_SNMP_Get = ! ! Kill a TCP connection ! BEGIN LOCAL Chan, ! Holds the channel ID. In_Buff : BLOCK [256,BYTE], Out_Buff : VECTOR [256,Long], STATUS; BIND Buffsize = Out_Buff : LONG; ! Assign the network device IF NOT (STATUS = $ASSIGN(DEVNAM=%ASCID'INET$DEVICE',CHAN=Chan)) THEN BEGIN Signal(.status); RETURN .Status END; %( STATUS = NET$SNMP( IOchan = .Chan, IO$SB = NETIOSB, SubFUNC = SNMP$C_Get, WBUFADRS = In_Buff, WBUFSIZE = 4, RBUFADRS = Out_Buff, RBUFSIZE = 256 ); )% STATUS = SS$_NORMAL; 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]); ! Deassign the network device $DASSGN(CHAN = .Chan); .STATUS END; GLOBAL ROUTINE DO_SNMP_GetNext = ! ! Stub ! BEGIN SS$_NORMAL END; GLOBAL ROUTINE DO_SNMP_Store = ! ! Stub ! BEGIN SS$_NORMAL END; END ELUDOM