%( **************************************************************** 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 CONFIG ( ! NamRes Control Program LANGUAGE (BLISS32), ADDRESSING_MODE(EXTERNAL=LONG_RELATIVE, NONEXTERNAL=LONG_RELATIVE), LIST (NOEXPAND,ASSEMBLY,BINARY), IDENT = 'V1.0' ) = BEGIN !-- ! CONFIG.BLI Copyright (c) 1989 Carnegie Mellon University ! ! Facility: ! ! IPNCP: CMU-OpenVMS/IP Network Control Program ! ! Abstract: ! ! Manages the IPNCP configuration database ! ! Author: Bruce R. Miller CMU Network Development ! Date: July 23, 1990 ! ! Modifications: ! !-- LIBRARY 'SYS$LIBRARY:STARLET'; LIBRARY 'IPNCP'; GLOBAL config : REF IPNCP_Config_Struct; ! One page. %SBTTL 'Config file handling routines' OWN CFFAB : $FAB(FNM = 'IPNCP$CONFIG', ALQ=4, FAC=PUT, FOP=(UFO,CIF,CBT), SHR=(PUT,UPI)); GLOBAL ROUTINE IPNCP_Init_Config = BEGIN MAP CFFAB : $BBLOCK[]; LOCAL gsect_va : VECTOR [2], retrange : VECTOR [2], Chan, Status; PrintTT('Init_Config!/'); Status = $CREATE(FAB=CFFAB); IF NOT .Status THEN BEGIN PrintTT('Trouble accessing IPNCP$CONFIG!/'); RETURN Signal(.Status); END; Chan = .CFFAB[FAB$L_STV]; ! Map file into next available P0 page. gsect_va[0] = %x'200'; gsect_va[1] = %x'200'; Status = $CRMPSC( INADR = gsect_va, RETADR = retrange, CHAN = .Chan, PAGCNT = 1, FLAGS = SEC$M_GBL OR SEC$M_EXPREG OR SEC$M_PERM OR SEC$M_WRT, GSDNAM = %ASCID'IPNCP_CONFIG'); IF NOT .Status THEN BEGIN PrintTT('Trouble creating IPNCP configuration global section!/'); RETURN Signal(.Status); END; config = .retrange[0]; config[CNF$Invocation_Count] = 0; SS$_NORMAL END; GLOBAL ROUTINE Map_Config = BEGIN LOCAL gsect_va : VECTOR [2], retrange : VECTOR [2], Chan, Status; PrintTT('Map_Config!/'); ! Map section into next available P0 page. gsect_va[0] = %x'200'; gsect_va[1] = %x'200'; Status = $MGBLSC( INADR = gsect_va, RETADR = retrange, FLAGS = SEC$M_GBL OR SEC$M_WRT OR SEC$M_EXPREG, GSDNAM = %ASCID'IPNCP_CONFIG'); IF NOT .Status THEN BEGIN Signal(.Status); PrintTT('Trouble mapping IPNCP configuration global section, RC=!XL!/', .Status); RETURN .Status; END; Config = .retrange[0]; RETURN 1 END; GLOBAL ROUTINE IPNCP_Show_Config = BEGIN IF .config NEQ 0 THEN PrintTT(' !UL invocations.!/',.config[CNF$Invocation_Count]); SS$_NORMAL END; END ELUDOM